暫無描述

UIStoryboardExt.swift 365B

12345678910111213141516
  1. //
  2. // UIStoryboardExt.swift
  3. // ExtensionKit
  4. //
  5. // Created by FFIB on 2017/9/14.
  6. // Copyright © 2017年 FFIB. All rights reserved.
  7. //
  8. import UIKit
  9. extension UIStoryboard {
  10. public func instantiateController<T: UIViewController> (_ type: T.Type) -> T {
  11. return instantiateViewController(withIdentifier: String(describing: type)) as? T ?? T()
  12. }
  13. }