Add workaround for Xcode bug

This commit is contained in:
Sindre Sorhus 2020-04-18 14:31:06 +08:00
parent 5df16e0d2e
commit 39160d389f
3 changed files with 13 additions and 3 deletions

View File

@ -13,4 +13,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '10.0'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '3.0'
s.weak_framework = 'Combine'
end

View File

@ -646,6 +646,10 @@
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
);
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = singlefile;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -701,6 +705,10 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
"-weak_framework",
Combine,
);
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";

View File

@ -2,7 +2,7 @@
> Swifty and modern [UserDefaults](https://developer.apple.com/documentation/foundation/userdefaults)
#### Note: The readme reflects the master branch. [Click here](https://github.com/sindresorhus/Defaults/tree/55ffea9487fb9b559406d909ee31dcd955fe77aa#readme) for docs for the latest version. The code in the master branch cannot be released until Apple fixes [this bug](https://github.com/feedback-assistant/reports/issues/44).
Store key-value pairs persistently across launches of your app.
It uses `NSUserDefaults` underneath but exposes a type-safe facade with lots of nice conveniences.
@ -16,7 +16,6 @@ It's used in production by apps like [Gifski](https://github.com/sindresorhus/Gi
- **Debuggable:** The data is stored as JSON-serialized values.
- **Observation:** Observe changes to keys.
- **Publishers:** Combine publishers built-in.
- **Lightweight:** It's only some hundred lines of code.
## Compatibility
@ -27,12 +26,14 @@ It's used in production by apps like [Gifski](https://github.com/sindresorhus/Gi
## Install
#### SwiftPM
#### Swift Package Manager
```swift
.package(url: "https://github.com/sindresorhus/Defaults", from: "3.1.1")
```
You need to set the build setting “Other Linker Flags” to `-weak_framework Combine` to work around [this Xcode bug](https://github.com/feedback-assistant/reports/issues/44).
#### Carthage
```