StoryboardEnumerable

public protocol StoryboardEnumerable

Mechanica

Types adopting the StoryboardEnumerable protocol can be used to define Storyboard names.

  • storyboard(forKey:bundle:) Extension method

    Mechanica Creates and returns a storyboard object for a specified storyboard enum case.

    Example:

    extension Storyboard: StoryboardEnumerable {
      enum StoryboardName : String {
        case main    = "MainStoryboard"
        case detail  = "DetailStoryboard"
       }
     }
    let mainStoryboard = Storyboard.storyboard(forKey: .main)
    

    Note

    If the bundle parameter is nil, the main bundle is used.

    Declaration

    Swift

    public static func storyboard(forKey key: StoryboardName, bundle: Bundle? = nil) -> Storyboard