Created
April 3, 2018 16:08
-
-
Save Jxrgxn/0f4649bf2122d84216ebdafc74d115b8 to your computer and use it in GitHub Desktop.
This file contains 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
import UIKit | |
class TestView: UIView { | |
@IBOutlet var contentView: UIView! | |
@IBOutlet weak var mainLabel: UILabel! | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
commonInit() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
commonInit() | |
} | |
private func commonInit() { | |
Bundle(for: TestView.self).loadNibNamed("TestView", owner: self, options: nil) | |
contentView.frame = self.bounds | |
contentView.autoresizingMask = [.flexibleHeight, .flexibleWidth] | |
addSubview(contentView) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment