diff --git a/DictionaryCoder.podspec b/DictionaryCoder.podspec index 7f123b8..638a3bd 100644 --- a/DictionaryCoder.podspec +++ b/DictionaryCoder.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "DictionaryCoder" - spec.version = "1.3.0" + spec.version = "1.4.0" spec.summary = "Swift Encoder and Decoder for dictionaries" spec.homepage = "https://github.com/almazrafi/DictionaryCoder" diff --git a/DictionaryCoder.xcodeproj/project.pbxproj b/DictionaryCoder.xcodeproj/project.pbxproj index e900ea9..92d5482 100644 --- a/DictionaryCoder.xcodeproj/project.pbxproj +++ b/DictionaryCoder.xcodeproj/project.pbxproj @@ -991,7 +991,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1020,7 +1020,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1186,7 +1186,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1215,7 +1215,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1281,7 +1281,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.5; - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1311,7 +1311,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.5; - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1377,7 +1377,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; @@ -1407,7 +1407,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 1.3.0; + MARKETING_VERSION = 1.4.0; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; PRODUCT_BUNDLE_IDENTIFIER = com.almazrafi.DictionaryCoder; PRODUCT_NAME = DictionaryCoder; diff --git a/README.md b/README.md index a6ec1db..f87478b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for ma To integrate DictionaryCoder into your Xcode project using Swift Package Manager, add the following as a dependency to your `Package.swift`: ``` swift -.package(url: "https://github.com/almazrafi/DictionaryCoder.git", from: "1.3.0") +.package(url: "https://github.com/almazrafi/DictionaryCoder.git", from: "1.4.0") ``` and then specify `"DictionaryCoder"` as a dependency of the Target in which you wish to use DictionaryCoder. @@ -52,7 +52,7 @@ let package = Package( .library(name: "MyPackage", targets: ["MyPackage"]) ], dependencies: [ - .package(url: "https://github.com/almazrafi/DictionaryCoder.git", from: "1.3.0") + .package(url: "https://github.com/almazrafi/DictionaryCoder.git", from: "1.4.0") ], targets: [ .target(name: "MyPackage", dependencies: ["DictionaryCoder"]) @@ -69,7 +69,7 @@ $ brew install carthage To integrate DictionaryCoder into your Xcode project using Carthage, specify it in your `Cartfile`: ``` ogdl -github "almazrafi/DictionaryCoder" ~> 1.3.0 +github "almazrafi/DictionaryCoder" ~> 1.4.0 ``` Finally run `carthage update` to build the framework and drag the built `DictionaryCoder.framework` into your Xcode project. diff --git a/Sources/Decoder/DictionaryDecoder.swift b/Sources/Decoder/DictionaryDecoder.swift index dc067a6..f7e4173 100644 --- a/Sources/Decoder/DictionaryDecoder.swift +++ b/Sources/Decoder/DictionaryDecoder.swift @@ -54,7 +54,10 @@ public final class DictionaryDecoder: Sendable { // MARK: - Instance Methods - public func decode(_ type: T.Type, from dictionary: [String: Any]) throws -> T { + public func decode( + _ type: T.Type = T.self, + from dictionary: [String: Any] + ) throws -> T { let options = optionsMutex.withLock { $0 } let decoder = DictionarySingleValueDecodingContainer( @@ -72,8 +75,12 @@ public final class DictionaryDecoder: Sendable { } @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) - public func decode(_ type: T.Type = T.self, from dictionary: [String: Any], configuration: T.DecodingConfiguration) throws -> T { - let options = optionsMutex.withLock(\.self) + public func decode( + _ type: T.Type = T.self, + from dictionary: [String: Any], + configuration: T.DecodingConfiguration + ) throws -> T { + let options = optionsMutex.withLock { $0 } let decoder = DictionarySingleValueDecodingContainer( component: dictionary, diff --git a/Sources/Encoder/DictionaryEncoder.swift b/Sources/Encoder/DictionaryEncoder.swift index 37d945f..d424b99 100644 --- a/Sources/Encoder/DictionaryEncoder.swift +++ b/Sources/Encoder/DictionaryEncoder.swift @@ -85,8 +85,11 @@ public final class DictionaryEncoder: Sendable { } @available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) - public func encode(_ value: T, configuration: T.EncodingConfiguration) throws -> [String: Sendable] { - let options = optionsMutex.withLock(\.self) + public func encode( + _ value: T, + configuration: T.EncodingConfiguration + ) throws -> [String: Sendable] { + let options = optionsMutex.withLock { $0 } let encoder = DictionarySingleValueEncodingContainer( options: options,