Skip to content

Commit

Permalink
Merge pull request #154 from contentful/improvement/usability-improve…
Browse files Browse the repository at this point in the history
…ments

Improvement/usability improvements
  • Loading branch information
loudmouth committed Nov 27, 2017
2 parents afdd9ab + 168c760 commit 5b9e4e3
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .env
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=1.0.0-beta2
CONTENTFUL_SDK_VERSION=1.0.0-beta3
2 changes: 1 addition & 1 deletion .envrc
@@ -1 +1 @@
export CONTENFUL_SDK_VERSION=1.0.0-beta2
export CONTENFUL_SDK_VERSION=1.0.0-beta3
10 changes: 9 additions & 1 deletion CHANGELOG.md
Expand Up @@ -10,7 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from
## Table of contents

#### 1.x Releases
- `1.0.0-betax` Releases - [1.0.0-beta1](#100-beta1) | [1.0.0-beta2](#100-beta2)
- `1.0.0-betax` Releases - [1.0.0-beta1](#100-beta1) | [1.0.0-beta2](#100-beta2) | [1.0.0-beta3](#100-beta3)

#### 0.x Releases
- `0.10.x` Releases - [0.11.0](#0110)
Expand All @@ -25,6 +25,14 @@ This project adheres to [Semantic Versioning](http://semver.org/) starting from

---

## [`1.0.0-beta3`](https://github.com/contentful/contentful.swift/releases/tag/1.0.0-beta3)
Released on 2017-11-27

#### Fixed
- Issue where `true` would be decoded to `Int` with value `1` when decoding JSON to `[String: Any]`. The SDK now attempts to decode `Bool` before `Int` to prevent this error.

---

## [`1.0.0-beta2`](https://github.com/contentful/contentful.swift/releases/tag/1.0.0-beta2)
Released on 2017-11-03

Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
@@ -1,3 +1,3 @@
github "Quick/Nimble" ~> 7.0.2
github "Quick/Nimble" ~> 7.0.3
github "venmo/DVR" ~> 1.1.0

2 changes: 1 addition & 1 deletion Cartfile.resolved
@@ -1,3 +1,3 @@
github "JensRavens/Interstellar" "2.1.0"
github "Quick/Nimble" "v7.0.2"
github "Quick/Nimble" "v7.0.3"
github "venmo/DVR" "v1.1.0"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/Nimble
Submodule Nimble updated 48 files
+9 −1 .gitignore
+1 −1 .swiftlint.yml
+8 −0 .travis.yml
+1 −0 Cartfile.private
+2 −0 Cartfile.resolved
+13 −0 Carthage/Checkouts/CwlCatchException/LICENSE.txt
+9 −0 Carthage/Checkouts/CwlCatchException/Package.swift
+46 −0 Carthage/Checkouts/CwlCatchException/README.md
+3 −3 Carthage/Checkouts/CwlCatchException/Sources/CwlCatchException/CwlCatchException.swift
+0 −0 Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/CwlCatchException.m
+0 −1 Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/include/CwlCatchException.h
+13 −0 Carthage/Checkouts/CwlPreconditionTesting/LICENSE.txt
+19 −0 Carthage/Checkouts/CwlPreconditionTesting/Package.swift
+73 −0 Carthage/Checkouts/CwlPreconditionTesting/README.md
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/CwlMachBadInstructionHandler.m
+1 −1 ...heckouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/mach_excServer.c
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/mach_excServer.h
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift
+18 −22 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstructionPosix.swift
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift
+0 −0 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/Mach/CwlPreconditionTesting.h
+2 −2 Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/Posix/CwlPreconditionTesting_POSIX.h
+17 −14 Nimble.podspec
+154 −144 Nimble.xcodeproj/project.pbxproj
+0 −41 Nimble.xcodeproj/project.xcworkspace/xcshareddata/Nimble.xccheckout
+0 −1 Package.swift
+22 −0 Package@swift-4.swift
+0 −80 Sources/Lib/CwlPreconditionTesting/README.md
+1 −1 Sources/Nimble/Matchers/BeLessThanOrEqual.swift
+13 −13 Sources/Nimble/Matchers/MatcherProtocols.swift
+30 −2 Sources/Nimble/Matchers/PostNotification.swift
+5 −1 Sources/Nimble/Nimble.h
+1 −1 Tests/NimbleTests/Helpers/utils.swift
+3 −3 Tests/NimbleTests/Matchers/BeAKindOfTest.swift
+3 −3 Tests/NimbleTests/Matchers/BeAnInstanceOfTest.swift
+4 −4 Tests/NimbleTests/Matchers/BeCloseToTest.swift
+2 −2 Tests/NimbleTests/Matchers/BeEmptyTest.swift
+5 −5 Tests/NimbleTests/Matchers/BeGreaterThanOrEqualToTest.swift
+6 −6 Tests/NimbleTests/Matchers/BeGreaterThanTest.swift
+5 −5 Tests/NimbleTests/Matchers/BeIdenticalToTest.swift
+4 −4 Tests/NimbleTests/Matchers/BeLessThanOrEqualToTest.swift
+10 −10 Tests/NimbleTests/Matchers/BeLessThanTest.swift
+1 −1 Tests/NimbleTests/Matchers/ContainTest.swift
+5 −5 Tests/NimbleTests/Matchers/EqualTest.swift
+1 −1 Tests/NimbleTests/Matchers/RaisesExceptionTest.swift
+2 −2 Tests/NimbleTests/Matchers/ThrowErrorTest.swift
2 changes: 1 addition & 1 deletion Config.xcconfig
@@ -1 +1 @@
CONTENTFUL_SDK_VERSION=1.0.0-beta2
CONTENTFUL_SDK_VERSION=1.0.0-beta3
16 changes: 8 additions & 8 deletions Contentful.xcodeproj/project.pbxproj
Expand Up @@ -32,9 +32,6 @@
ED10F3FA1F8BD82200A00180 /* QueryTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED10F3F81F8BD81F00A00180 /* QueryTests.json */; };
ED10F3FB1F8BD82300A00180 /* QueryTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED10F3F81F8BD81F00A00180 /* QueryTests.json */; };
ED10F3FC1F8BD82300A00180 /* QueryTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED10F3F81F8BD81F00A00180 /* QueryTests.json */; };
ED13135E1F9894DF00F69CB3 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED13135C1F9894DB00F69CB3 /* LinkResolverTests.json */; };
ED13135F1F9894DF00F69CB3 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED13135C1F9894DB00F69CB3 /* LinkResolverTests.json */; };
ED1313601F9894E000F69CB3 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = ED13135C1F9894DB00F69CB3 /* LinkResolverTests.json */; };
ED1638C51ED5CA6D009BAA9F /* ImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1638C41ED5CA6D009BAA9F /* ImageTests.swift */; };
ED1D789A1F2F96260048E169 /* DataCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1D78991F2F96260048E169 /* DataCache.swift */; };
ED1D789B1F2F96260048E169 /* DataCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1D78991F2F96260048E169 /* DataCache.swift */; };
Expand Down Expand Up @@ -201,6 +198,9 @@
EDA7D96D1F8E6D660020EE86 /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA7D96C1F8E6D660020EE86 /* ErrorTests.swift */; };
EDA7D96E1F8E6D660020EE86 /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA7D96C1F8E6D660020EE86 /* ErrorTests.swift */; };
EDA7D96F1F8E6D660020EE86 /* ErrorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA7D96C1F8E6D660020EE86 /* ErrorTests.swift */; };
EDB50F751FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = EDB50F731FCC15F0005FB1F9 /* LinkResolverTests.json */; };
EDB50F761FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = EDB50F731FCC15F0005FB1F9 /* LinkResolverTests.json */; };
EDB50F771FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */ = {isa = PBXBuildFile; fileRef = EDB50F731FCC15F0005FB1F9 /* LinkResolverTests.json */; };
EDBB1F4F1F3DF44A00D90FBE /* Client+AppKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDBB1F4D1F3DF44700D90FBE /* Client+AppKit.swift */; };
EDBEC94A1E3F51FE0040FC56 /* Contentful.h in Headers */ = {isa = PBXBuildFile; fileRef = EDBEC9491E3F51FE0040FC56 /* Contentful.h */; settings = {ATTRIBUTES = (Public, ); }; };
EDBEC9511E3F548F0040FC56 /* Contentful.h in Headers */ = {isa = PBXBuildFile; fileRef = EDBEC9491E3F51FE0040FC56 /* Contentful.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -263,7 +263,6 @@
ED02BC5F1E7047AE00BAB2CA /* QueryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryTests.swift; sourceTree = "<group>"; };
ED0876D91E1D07B3008E1A06 /* Date.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Date.swift; sourceTree = "<group>"; };
ED10F3F81F8BD81F00A00180 /* QueryTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = QueryTests.json; sourceTree = "<group>"; };
ED13135C1F9894DB00F69CB3 /* LinkResolverTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LinkResolverTests.json; sourceTree = "<group>"; };
ED1638C41ED5CA6D009BAA9F /* ImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageTests.swift; sourceTree = "<group>"; };
ED1D78991F2F96260048E169 /* DataCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DataCache.swift; sourceTree = "<group>"; };
ED1D789E1F3069FF0048E169 /* Client+Modellable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Client+Modellable.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -306,6 +305,7 @@
EDA690CC1F431A0C00581FC6 /* DVR.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVR.framework; path = Carthage/Build/tvOS/DVR.framework; sourceTree = "<group>"; };
EDA690CD1F431A0C00581FC6 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nimble.framework; path = Carthage/Build/tvOS/Nimble.framework; sourceTree = "<group>"; };
EDA7D96C1F8E6D660020EE86 /* ErrorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorTests.swift; sourceTree = "<group>"; };
EDB50F731FCC15F0005FB1F9 /* LinkResolverTests.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = LinkResolverTests.json; sourceTree = "<group>"; };
EDBB1F4D1F3DF44700D90FBE /* Client+AppKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Client+AppKit.swift"; sourceTree = "<group>"; };
EDBEC9371E3F4ADE0040FC56 /* Info_macOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info_macOS.plist; sourceTree = "<group>"; };
EDBEC9381E3F4ADE0040FC56 /* Info_tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info_tvOS.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -548,8 +548,8 @@
ED737C691EF0095200ECB3F1 /* AssetTests.json */,
ED5F8F991F94B8FD00C86411 /* EntryTests.json */,
ED84DBC71F951ED5006C6AA3 /* ContentTypeTests.json */,
EDB50F731FCC15F0005FB1F9 /* LinkResolverTests.json */,
ED737C721EF009A000ECB3F1 /* ImageTests.json */,
ED13135C1F9894DB00F69CB3 /* LinkResolverTests.json */,
ED737C871EF15CC600ECB3F1 /* PreviewSyncTests.json */,
ED737C7E1EF00A0600ECB3F1 /* RateLimitTests.json */,
EDCE15A21F960AAA00FF272F /* ErrorTests.json */,
Expand Down Expand Up @@ -827,7 +827,7 @@
EDCE15A61F960AAF00FF272F /* ErrorTests.json in Resources */,
ED737C7A1EF009DD00ECB3F1 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
ED737C921EF1748700ECB3F1 /* SyncTests.json in Resources */,
ED13135E1F9894DF00F69CB3 /* LinkResolverTests.json in Resources */,
EDB50F751FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */,
ED737C891EF15CCA00ECB3F1 /* PreviewSyncTests.json in Resources */,
ED5F8F9B1F94B90200C86411 /* EntryTests.json in Resources */,
);
Expand All @@ -848,7 +848,7 @@
EDCE15A51F960AAF00FF272F /* ErrorTests.json in Resources */,
EDA690B21F43188500581FC6 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
EDA690B11F43188500581FC6 /* testClientCanAccessPreviewAPI.json in Resources */,
ED1313601F9894E000F69CB3 /* LinkResolverTests.json in Resources */,
EDB50F761FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */,
EDA690A81F43188100581FC6 /* Data in Resources */,
ED5F8F9C1F94B90200C86411 /* EntryTests.json in Resources */,
);
Expand All @@ -869,7 +869,7 @@
EDCE15A41F960AAE00FF272F /* ErrorTests.json in Resources */,
EDA690BD1F43188500581FC6 /* testClientCantAccessPreviewAPIWithProductionToken.json in Resources */,
EDA690BC1F43188500581FC6 /* testClientCanAccessPreviewAPI.json in Resources */,
ED13135F1F9894DF00F69CB3 /* LinkResolverTests.json in Resources */,
EDB50F771FCC15F0005FB1F9 /* LinkResolverTests.json in Resources */,
EDA690A91F43188100581FC6 /* Data in Resources */,
ED5F8F9D1F94B90300C86411 /* EntryTests.json in Resources */,
);
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -133,7 +133,7 @@ pod 'Contentful'
You can specify a specific version of Contentful depending on your needs. To learn more about operators for dependency versioning within a Podfile, see the [CocoaPods doc on the Podfile][7].

```ruby
pod 'Contentful', '~> 1.0.0-beta1'
pod 'Contentful', '~> 1.0.0-beta3'
```

Note that for Swift 3 support (contentful.swift versions [`0.3.0` - `0.9.3`]) you will need to add a post-install script to your Podfile if installing with Cocoapods:
Expand All @@ -153,7 +153,7 @@ end
You can also use [Carthage][8] for integration by adding the following to your `Cartfile`:

```
github "contentful/contentful.swift" ~> 1.0.0-beta1
github "contentful/contentful.swift" ~> 1.0.0-beta3
```

## License
Expand Down
8 changes: 4 additions & 4 deletions Sources/Contentful/Decodable.swift
Expand Up @@ -245,12 +245,12 @@ internal extension KeyedDecodingContainer {
var dictionary = Dictionary<String, Any>()

for key in allKeys {
if let intValue = try? decode(Int.self, forKey: key) {
dictionary[key.stringValue] = intValue
if let boolValue = try? decode(Bool.self, forKey: key) {
dictionary[key.stringValue] = boolValue
} else if let stringValue = try? decode(String.self, forKey: key) {
dictionary[key.stringValue] = stringValue
} else if let boolValue = try? decode(Bool.self, forKey: key) {
dictionary[key.stringValue] = boolValue
} else if let intValue = try? decode(Int.self, forKey: key) {
dictionary[key.stringValue] = intValue
} else if let doubleValue = try? decode(Double.self, forKey: key) {
dictionary[key.stringValue] = doubleValue
}
Expand Down

0 comments on commit 5b9e4e3

Please sign in to comment.