From 39160d389f70fe2219c20e411099cb07d6fedb29 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 18 Apr 2020 14:31:06 +0800 Subject: [PATCH] Add workaround for Xcode bug --- Defaults.podspec | 1 + Defaults.xcodeproj/project.pbxproj | 8 ++++++++ readme.md | 7 ++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Defaults.podspec b/Defaults.podspec index f4c52ea..c5f1c52 100644 --- a/Defaults.podspec +++ b/Defaults.podspec @@ -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 diff --git a/Defaults.xcodeproj/project.pbxproj b/Defaults.xcodeproj/project.pbxproj index a6e8e0c..5ff9ffb 100644 --- a/Defaults.xcodeproj/project.pbxproj +++ b/Defaults.xcodeproj/project.pbxproj @@ -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"; diff --git a/readme.md b/readme.md index be1a6e2..54ee7b8 100644 --- a/readme.md +++ b/readme.md @@ -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 ```