Bundle

public extension Bundle
  • Loads a nib from the bundle.

    Seealso

    loadNibNamed()

    Warning

    This may through an ObjC NSException if there is no nib with that name in that bundle.

    Declaration

    Swift

    func loadNib<NibType, T>(named nibName: T) -> NibType? where T : RawRepresentable, T.RawValue == String

    Parameters

    nibName

    Contains a StringRepresentable nib.

    Return Value

    The loaded NibType or .none if it don’t exists.

  • Returns the value associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:) and String(describing:)

    Declaration

    Swift

    subscript(key: String) -> Any? { get }

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The value associated with key in the receiver’s property list (Info.plist) as Any or .none if the key doesn’t exist.

  • Returns the string associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getString(from key: String) -> String?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The string associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not a string or if it’s an empty string.

  • Returns the integer associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getInt(from key: String) -> Int?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The integer associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not an integer.

  • Returns the float number associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getFloat(from key: String) -> Float?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The float associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not not a real number.

  • Returns the date associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getDate(from key: String) -> Date?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The date associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not a date.

  • Returns the data associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getData(from key: String) -> Data?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The data associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not data.

  • Returns the array associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getArray<T>(from key: String) -> [T]?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The array associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not an array of elements of type T.

  • Returns the dictionary associated with the specified key in the receiver’s information property list (Info.plist).

    Seealso

    object(forInfoDictionaryKey:)

    Declaration

    Swift

    func getDictionary<V>(from key: String) -> [String : V]?

    Parameters

    key

    A key in the bundle’s property list.

    Return Value

    The dictionary associated with key in the receiver’s property list (Info.plist) or .none if the key doesn’t exist or if the value is not a dictionary of keys of type K and values of type V.