NibEnumerable

public protocol NibEnumerable

Mechanica

Types adopting the NibEnumerable protocol can be used to define Nib names.

  • nib(forKey:bundle:) Extension method

    Mechanica

    Creates and returns a Nib object for a specified nib enum case.

    Example:

     extension Nib: NibEnumerable {
       enum NibName : String {
         case first   = "first"
         case second  = "second"
       }
     }
    
     let firstNib = Nib.nib(forKey: .first)
    

    Note

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

    Declaration

    Swift

    public static func nib(forKey key: NibName, bundle: Bundle? = nil) -> Nib