StoryboardKeyCodable

public protocol StoryboardKeyCodable

Mechanica

Types adopting the StoryboardKeyCodable 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.

    i.e. “` extension Storyboard: StoryboardKeyCodable { 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