File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,28 @@ Import the framework:
30
30
import Configurations
31
31
```
32
32
33
- And get the default configuration:
33
+ And get the current configuration:
34
34
35
35
``` swift
36
- let configuration = Configuration.defaultConfiguration ()
36
+ let configuration = Configuration.current
37
37
if let someValue = configuration[" someKey" ] as? String {
38
38
print (" someKey: \( someValue ) " )
39
39
}
40
40
```
41
41
42
+ By making use of generics the return type of a value can be inferred from the
43
+ receiver.
44
+
45
+ For example; the ` text ` property of a ` UILabel ` expects a ` String ` ;
46
+
47
+ ``` swift
48
+ let configuration = Configuration.current
49
+ let label = UILabel ()
50
+ label.text = configuration[" someKey" ]!
51
+ ```
52
+
53
+ But do make sure that the value in the plist is of a matching type.
54
+
42
55
## Contributing
43
56
44
57
1 . Fork it
You can’t perform that action at this time.
0 commit comments