Skip to content

Commit 0f881d5

Browse files
Swift 5.1
1 parent 81af4aa commit 0f881d5

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

AwsDynamoDBsdk.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Pod::Spec.new do |s|
99
s.source = { :git => "https://github.com/nikola-mladenovic/AwsSwiftDynamoDBsdk.git", :tag => s.version.to_s }
1010
s.source_files = 'Sources/AwsDynamoDB/*.swift'
1111
s.swift_version = "4.2"
12-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }
12+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.1' }
1313

1414
s.ios.deployment_target = '10.0'
1515
s.osx.deployment_target = '10.10'
1616
s.tvos.deployment_target = '9.0'
1717
s.watchos.deployment_target = '2.2'
1818

19-
s.dependency 'AwsSign', '~> 0.2'
19+
s.dependency 'AwsSign', '~> 0.3'
2020

2121
end

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.1
22

33
import PackageDescription
44

55
let package = Package(
66
name: "AwsDynamoDB",
77
products: [.library(name: "AwsDynamoDB", targets: ["AwsDynamoDB"])],
8-
dependencies: [.package(url: "https://github.com/nikola-mladenovic/AwsSwiftSign.git", from: "0.2.0")],
8+
dependencies: [.package(url: "https://github.com/nikola-mladenovic/AwsSwiftSign.git", from: "0.3.0")],
99
targets: [.target(name: "AwsDynamoDB", dependencies: ["AwsSign"]),
1010
.testTarget(name: "AwsDynamoDBTests", dependencies: ["AwsDynamoDB"])],
11-
swiftLanguageVersions: [.v4_2]
11+
swiftLanguageVersions: [.v5]
1212
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ AwsDynamoDB is a Swift library that enables you to use Amazon DynamoDB with Swi
77
<img src="https://travis-ci.org/nikola-mladenovic/AwsSwiftDynamoDBsdk.svg?branch=master">
88
</a>
99
<a href="https://developer.apple.com/swift/" target="_blank">
10-
<img src="https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat" alt="Swift 4.2">
10+
<img src="https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat" alt="Swift 5.1">
1111
</a>
1212
<a href="https://developer.apple.com/swift/" target="_blank">
1313
<img src="https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-4E4E4E.svg?colorA=EF5138" alt="Platforms iOS | macOS | watchOS | tvOS | Linux">
@@ -24,7 +24,7 @@ This package builds with Swift Package Manager. Ensure you have installed and ac
2424
To use AwsSns, modify the Package.swift file and add following dependency:
2525

2626
``` swift
27-
.package(url: "https://github.com/nikola-mladenovic/AwsSwiftDynamoDBsdk", from: "0.2.0")
27+
.package(url: "https://github.com/nikola-mladenovic/AwsSwiftDynamoDBsdk", from: "0.3.0")
2828
```
2929

3030
Then import the `AwsDynamoDB` library into the swift source code:

Sources/AwsDynamoDB/AwsDynamoDB.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import Foundation
2+
#if canImport(FoundationNetworking)
3+
import FoundationNetworking
4+
#endif
25
import Dispatch
36
import AwsSign
47

@@ -100,7 +103,7 @@ public struct AwsDynamoDBTable {
100103
if error == nil,
101104
let data = data,
102105
let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String : Any],
103-
let awsJson = jsonObject?["Item"] as? [String : Any] {
106+
let awsJson = jsonObject["Item"] as? [String : Any] {
104107
do {
105108
let item: T = try self.deserialize(from: awsJson)
106109
completion(true, item, error)
@@ -256,7 +259,7 @@ public struct AwsDynamoDBTable {
256259
if error == nil,
257260
let data = data,
258261
let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String : Any],
259-
let jsonItems = jsonObject?["Items"] as? [[String : Any]] {
262+
let jsonItems = jsonObject["Items"] as? [[String : Any]] {
260263
do {
261264
let items: [T] = try jsonItems.map { return try self.deserialize(from: $0) }
262265
completion(true, items, error)
@@ -323,7 +326,7 @@ public struct AwsDynamoDBTable {
323326
if error == nil,
324327
let data = data,
325328
let jsonObject = try? JSONSerialization.jsonObject(with: data, options: []) as? [String : Any],
326-
let jsonItems = jsonObject?["Items"] as? [[String : Any]] {
329+
let jsonItems = jsonObject["Items"] as? [[String : Any]] {
327330
do {
328331
let items: [T] = try jsonItems.map { return try self.deserialize(from: $0) }
329332
completion(true, items, error)

0 commit comments

Comments
 (0)