Structs

The following structs are available globally.

  • Mechanica

    Configuration is a Property List reader. Extends this struct with StringKeyCodable, BoolKeyCodable, URLKeyCodable,NumberKeyCodable,DateKeyCodable,DataKeyCodable,ArrayKeyCodable,DictionaryKeyCodable` to avoid stringly typed APIs.

    extension Configuration: StringKeyCodable {
     public enum StringKey: String {
       case value1  = "path.to.value1"
       case value2  = "path.to.value2"
     }
    }
    
    extension Configuration: BoolKeyCodable {
     public enum StringKey: String {
       case value3  = "path.to.value3"
       case value4  = "path.to.value4"
     }
    }
    
    let cfg: Configuration = ...
    
    let stringValue1 = cfg.string(forKey: .value3)
    let boolValue3   = cfg.bool(forKey: .value3)
    
    See more

    Declaration

    Swift

    public struct Configuration: PropertyListConfiguration