Make it possible to import the package once for a whole project (#125)
This commit is contained in:
parent
7a22d37874
commit
5cf1178d34
|
@ -35,6 +35,9 @@ public enum Defaults {
|
|||
}
|
||||
}
|
||||
|
||||
public typealias _Defaults = Defaults
|
||||
public typealias _Default = Default
|
||||
|
||||
extension Defaults {
|
||||
// We cannot use `Key` as the container for keys because of "Static stored properties not supported in generic types".
|
||||
/**
|
||||
|
|
|
@ -30,6 +30,17 @@ Defaults[.quality] = 0.5
|
|||
|
||||
[Learn More](https://github.com/sindresorhus/Defaults#usage)
|
||||
|
||||
### Tip
|
||||
|
||||
If you don't want to import this package in every file you use it, add the below to a file in your app. You can then use `Defaults` and `@Default` from anywhere without an import.
|
||||
|
||||
```swift
|
||||
import Defaults
|
||||
|
||||
typealias Defaults = _Defaults
|
||||
typealias Default = _Default
|
||||
```
|
||||
|
||||
## Topics
|
||||
|
||||
### Essentials
|
||||
|
|
Loading…
Reference in New Issue