Skip to content

Instantly share code, notes, and snippets.

Avatar

asim.najam asimnajam

View GitHub Profile
@asimnajam
asimnajam / gist:0c43a9c51c07080d34c950ca4d6e1dad
Created Sep 15, 2021
Instantiating Storyboard Using Protocol Extension
View gist:0c43a9c51c07080d34c950ca4d6e1dad
protocol Storyboarded {
static var name: String { get }
static func instantiate() -> UIViewController
}
extension Storyboarded where Self: UIViewController {
static var name: String { return "Main" }
static func instantiate() -> UIViewController {
let storyboard = UIStoryboard(name: name, bundle: .main)