-
-
Save orakaro/2e8968d48ffab5071ca21da4b87398c4 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
protocol XibViewController { | |
static var className: String { get } | |
static func make() -> Self | |
} | |
extension XibViewController where Self: UIViewController { | |
static var className: String { | |
return String(describing: self).components(separatedBy: ".").last! | |
} | |
static func make() -> Self { | |
return self.init(nibName: Self.className, bundle: nil) | |
} | |
} | |
extension UIViewController: XibViewController {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment