Config Bridges
-
A bridge class that connects Lobster and ConfigKey.
Getting a value and setting a value are executed in a class that inherit this class. That is, There are bridge classes that inherit
ConfigBridge<T>
for each value type likeString
,Int
, etc… Lobster provides these bridge classes:- String:
ConfigStringBridge
- Int:
ConfigIntBridge
- Double:
ConfigDoubleBridge
- Float:
ConfigFloatBridge
- Bool:
ConfigBoolBridge
- Data:
ConfigDataBridge
- URL:
ConfigURLBridge
- UIColor:
ConfigColorBridge
- RawRepresentable(Enum):
ConfigRawRepresentableBridge
- Decodable:
ConfigDecodableBridge
- Encodable:
ConfigCodableBridge
- Array:
ConfigArrayBridge
Array for Enum:
ConfigRawRepresentableArrayBridge
Note
It’s an abstract class. If you want to adapt it to some value type, please override it.
Declaration
Swift
open class ConfigBridge<T>
- String:
-
ConfigBridge for
See moreString
Declaration
Swift
public final class ConfigStringBridge : ConfigBridge<String>
-
ConfigBridge for
See moreInt
Declaration
Swift
public final class ConfigIntBridge : ConfigBridge<Int>
-
ConfigBridge for
See moreDouble
Declaration
Swift
public final class ConfigDoubleBridge : ConfigBridge<Double>
-
ConfigBridge for
See moreFloat
Declaration
Swift
public final class ConfigFloatBridge : ConfigBridge<Float>
-
ConfigBridge for
See moreBool
Declaration
Swift
public final class ConfigBoolBridge : ConfigBridge<Bool>
-
ConfigBridge for
See moreData
Declaration
Swift
public final class ConfigDataBridge : ConfigBridge<Data>
-
ConfigBridge for
See moreURL
Declaration
Swift
public final class ConfigURLBridge : ConfigBridge<URL>
-
ConfigBridge for
See moreUIColor
Declaration
Swift
public final class ConfigColorBridge : ConfigBridge<UIColor>
-
ConfigBridge for
See moreRawRepresentable
(Enum)Declaration
Swift
public final class ConfigRawRepresentableBridge<T> : ConfigBridge<T> where T : RawRepresentable
-
ConfigBridge for
Decodable
Note
You can’t set default value if a value isDecodasble
object, notEncodable
object. If you can set default value, Please make object conform toEncodable
and useConfigCodableBridge
.Declaration
Swift
public final class ConfigDecodableBridge<T> : ConfigBridge<T> where T : Decodable
-
ConfigBridge for
See moreCodable
Declaration
Swift
public final class ConfigCodableBridge<T> : ConfigBridge<T> where T : Decodable, T : Encodable
-
ConfigBridge for
See moreArray
Declaration
Swift
public final class ConfigArrayBridge<T> : ConfigBridge<T> where T : Collection
-
ConfigBridge for
See moreArray
ifCollection.Element
isRawRepresentable
(for Enum element).Declaration
Swift
public final class ConfigRawRepresentableArrayBridge<T> : ConfigBridge<T> where T : Collection, T.Element : RawRepresentable