Created
November 13, 2015 22:38
-
-
Save terrybu/a25801bf04325acec562 to your computer and use it in GitHub Desktop.
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
class TasteMatchesView: UIView { | |
var view: UIView! | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
setUp() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
setUp() | |
} | |
func setUp() { | |
view = loadViewFromNib() | |
view.frame = bounds | |
view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] | |
addSubview(view) | |
} | |
func loadViewFromNib() -> UIView { | |
let bundle = NSBundle(forClass: self.dynamicType) | |
let nib = UINib(nibName: "TasteMatchesView", bundle: bundle) | |
return nib.instantiateWithOwner(self, options: nil)[0] as! UIView | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment