Created
November 13, 2017 01:02
-
-
Save bwhiteley/28359596934b62f19e3711d434560a8d 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
class DetailViewController: UIViewController { | |
@IBOutlet var label: UILabel! { | |
didSet { | |
label?.text = episode.title | |
} | |
} | |
let episode: Episode | |
init(episode: Episode) { | |
self.episode = episode | |
// `nil` nibName means it will look for a nib with the same name as this class. | |
// Or, provide an explicit name if you prefer. | |
// `Bundle(for: type(of: self))` makes this VC safe to put in a framework. | |
super.init(nibName: nil, bundle: Bundle(for: type(of: self))) | |
} | |
@available(*, unavailable) // remove it from autocomplete suggestions | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment