Created
February 3, 2019 05:59
-
-
Save barefeettom/046d1b28ac5cd3f14453155f6aa36803 to your computer and use it in GitHub Desktop.
A dodgy though common way to embed a xib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard let contentView = Bundle(for: self) | |
.loadNibNamed(String(describing: self), owner: self, options: nil) | |
.first as? UIView | |
else { return } | |
self.addSubview(contentView) | |
addConstraintsToPinToTheSuperview(contentView) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment