Skip to content

Instantly share code, notes, and snippets.

@eugeniobaglieri
Created November 10, 2015 18:06
Show Gist options
  • Save eugeniobaglieri/dec497468235a571c2cf to your computer and use it in GitHub Desktop.
Save eugeniobaglieri/dec497468235a571c2cf to your computer and use it in GitHub Desktop.
//
// UIStoryboaard+Conveniences.swift
// Temi Svolti
//
// Created by Eugenio Baglieri on 09/11/15.
// Copyright © 2015 Eugenio Baglieri. All rights reserved.
//
import UIKit
extension UIStoryboard {
class func mainStoryboard() -> UIStoryboard! {
guard let mainStoryboardName = NSBundle.mainBundle().infoDictionary?["UIMainStoryboardFile"] as? String else {
assertionFailure("No UIMainStoryboardFile found in main bundle")
return nil
}
return UIStoryboard(name: mainStoryboardName, bundle: NSBundle.mainBundle())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment