2019-04-15 15:03:05 -05:00
|
|
|
//
|
2019-04-19 07:49:35 -05:00
|
|
|
// UIStoryboard-Extensions.swift
|
2019-04-15 15:03:05 -05:00
|
|
|
// NetNewsWire
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 4/8/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
extension UIStoryboard {
|
|
|
|
|
2019-10-21 11:51:33 -05:00
|
|
|
static let preferredContentSizeForFormSheetDisplay = CGSize(width: 460.0, height: 400.0)
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
static var main: UIStoryboard {
|
|
|
|
return UIStoryboard(name: "Main", bundle: nil)
|
|
|
|
}
|
|
|
|
|
2019-04-16 13:38:07 -05:00
|
|
|
static var add: UIStoryboard {
|
|
|
|
return UIStoryboard(name: "Add", bundle: nil)
|
|
|
|
}
|
|
|
|
|
2019-04-25 06:05:49 -05:00
|
|
|
static var settings: UIStoryboard {
|
|
|
|
return UIStoryboard(name: "Settings", bundle: nil)
|
|
|
|
}
|
|
|
|
|
2019-10-23 19:58:18 -05:00
|
|
|
static var inspector: UIStoryboard {
|
|
|
|
return UIStoryboard(name: "Inspector", bundle: nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
static var account: UIStoryboard {
|
|
|
|
return UIStoryboard(name: "Account", bundle: nil)
|
|
|
|
}
|
|
|
|
|
2019-04-15 15:03:05 -05:00
|
|
|
func instantiateController<T>(ofType type: T.Type = T.self) -> T where T: UIViewController {
|
|
|
|
|
|
|
|
let storyboardId = String(describing: type)
|
|
|
|
guard let viewController = instantiateViewController(withIdentifier: storyboardId) as? T else {
|
|
|
|
print("Unable to load view with Scene Identifier: \(storyboardId)")
|
|
|
|
fatalError()
|
|
|
|
}
|
|
|
|
|
|
|
|
return viewController
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|