diff --git a/Sources/ArchiveValueTransformer.swift b/Sources/ArchiveValueTransformer.swift index 8cea02c..587c6f4 100644 --- a/Sources/ArchiveValueTransformer.swift +++ b/Sources/ArchiveValueTransformer.swift @@ -21,7 +21,12 @@ public final class ArchiveValueTransformer: ValueTransformer, ValueTransformerRe guard let value = value else { return nil } - return NSKeyedArchiver.archivedData(withRootObject: value) + do { + return try NSKeyedArchiver.archivedData(withRootObject: value, requiringSecureCoding: false) + } catch { + // XXX add log + return nil + } } public override func reverseTransformedValue(_ value: Any?) -> Any? { @@ -62,7 +67,12 @@ public final class UnarchiveValueTransformer: ValueTransformer, ValueTransformer guard let value = value else { return nil } - return NSKeyedArchiver.archivedData(withRootObject: value) + do { + return try NSKeyedArchiver.archivedData(withRootObject: value, requiringSecureCoding: false) + } catch { + // XXX add log + return nil + } } } diff --git a/Sources/ValueTransformerRegisterable.swift b/Sources/ValueTransformerRegisterable.swift index a01db1f..a1c53b9 100644 --- a/Sources/ValueTransformerRegisterable.swift +++ b/Sources/ValueTransformerRegisterable.swift @@ -35,13 +35,13 @@ extension ValueTransformerRegisterable where Self: ValueTransformer { extension ValueTransformer { /// Registers this value transformer with a given identifier. - open func setValueTransformer(forName name: NSValueTransformerName) { + public func setValueTransformer(forName name: NSValueTransformerName) { assert(ValueTransformer(forName: name) == nil) ValueTransformer.setValueTransformer(self, forName: name) } /// Registers this value transformer with a given identifier. - open func setValueTransformer(for string: String) { + public func setValueTransformer(for string: String) { self.setValueTransformer(forName: NSValueTransformerName(string)) } diff --git a/ValueTransformerKit.xcodeproj/project.pbxproj b/ValueTransformerKit.xcodeproj/project.pbxproj index e2ecffb..c1bfc63 100644 --- a/ValueTransformerKit.xcodeproj/project.pbxproj +++ b/ValueTransformerKit.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -348,7 +348,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1420; ORGANIZATIONNAME = "Eric Marchand"; TargetAttributes = { 480BE9161E953CE3002295D1 = { @@ -415,6 +415,7 @@ /* Begin PBXShellScriptBuildPhase section */ 486545D81EB0C92100D3ECCC /* swiftlint */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -425,7 +426,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi"; + shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -543,6 +544,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -568,7 +570,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -607,6 +609,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -626,10 +629,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -649,7 +653,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Xcode/iOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.ValueTransformerKit; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -669,7 +677,11 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Xcode/iOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.ValueTransformerKit; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -682,6 +694,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -689,8 +702,12 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = Xcode/macOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.ValueTransformerKit; PRODUCT_NAME = ValueTransfomerKit; SDKROOT = macosx; @@ -704,6 +721,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -711,8 +729,12 @@ FRAMEWORK_VERSION = A; INFOPLIST_FILE = Xcode/macOS/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.ValueTransformerKit; PRODUCT_NAME = ValueTransfomerKit; SDKROOT = macosx; @@ -725,7 +747,11 @@ isa = XCBuildConfiguration; buildSettings = { INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -738,7 +764,11 @@ isa = XCBuildConfiguration; buildSettings = { INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = fr.phimage.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/ValueTransformerKit.xcodeproj/xcshareddata/xcschemes/ValueTransformerKit.xcscheme b/ValueTransformerKit.xcodeproj/xcshareddata/xcschemes/ValueTransformerKit.xcscheme index f006dea..1df9504 100644 --- a/ValueTransformerKit.xcodeproj/xcshareddata/xcschemes/ValueTransformerKit.xcscheme +++ b/ValueTransformerKit.xcodeproj/xcshareddata/xcschemes/ValueTransformerKit.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - - - - -