Skip to content

Commit a40fb4f

Browse files
committed
update README
1 parent 421ea52 commit a40fb4f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,28 @@ Import the framework:
3030
import Configurations
3131
```
3232

33-
And get the default configuration:
33+
And get the current configuration:
3434

3535
```swift
36-
let configuration = Configuration.defaultConfiguration()
36+
let configuration = Configuration.current
3737
if let someValue = configuration["someKey"] as? String {
3838
print("someKey: \(someValue)")
3939
}
4040
```
4141

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+
4255
## Contributing
4356

4457
1. Fork it

0 commit comments

Comments
 (0)