Structs
The following structs are available globally.
-
Mechanica
Configuration
is a Property List reader. Extends this struct withStringKeyCodable
,BoolKeyCodable
,URLKeyCodable,
NumberKeyCodable,
DateKeyCodable,
DataKeyCodable,
ArrayKeyCodable,
DictionaryKeyCodable` to avoid stringly typed APIs.
See moreextension 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)
Declaration
Swift
public struct Configuration: PropertyListConfiguration