Skip to content

Instantly share code, notes, and snippets.

@jonathanduty
Created June 29, 2018 12:26
Show Gist options
  • Save jonathanduty/b10ee8b20aab686bb7ea8913068babb8 to your computer and use it in GitHub Desktop.
Save jonathanduty/b10ee8b20aab686bb7ea8913068babb8 to your computer and use it in GitHub Desktop.
UIStoryboard+Extensions.swift
import UIKit
extension UIStoryboard {
static func fromStoryboard(named: String) -> UIViewController? {
return UIStoryboard(name: named, bundle: nil).instantiateInitialViewController()
}
static func fromStoryboard(named: String, get: String) -> UIViewController? {
return UIStoryboard(name: named, bundle: nil).instantiateViewController(withIdentifier: get)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment