diff --git a/Apollo.podspec b/Apollo.podspec index 492cf81e1c..df34308d38 100644 --- a/Apollo.podspec +++ b/Apollo.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.requires_arc = true - s.swift_version = '4.2' + s.swift_version = '5.0' s.default_subspecs = 'Core' diff --git a/Configuration/Shared/Project-Version.xcconfig b/Configuration/Shared/Project-Version.xcconfig index 0f58ba6b52..4fbb33bd20 100644 --- a/Configuration/Shared/Project-Version.xcconfig +++ b/Configuration/Shared/Project-Version.xcconfig @@ -1 +1 @@ -CURRENT_PROJECT_VERSION = 0.10.1 +CURRENT_PROJECT_VERSION = 0.10.2 diff --git a/Sources/Apollo/Collections.swift b/Sources/Apollo/Collections.swift index 43b6459b0d..6ad5532b1a 100644 --- a/Sources/Apollo/Collections.swift +++ b/Sources/Apollo/Collections.swift @@ -1,12 +1,6 @@ public extension Dictionary { static func += (lhs: inout Dictionary, rhs: Dictionary) { - #if swift(>=3.2) lhs.merge(rhs) { (_, new) in new } - #else - for (key, value) in rhs { - lhs[key] = value - } - #endif } } diff --git a/Sources/ApolloWebSocket/SplitNetworkTransport.swift b/Sources/ApolloWebSocket/SplitNetworkTransport.swift index e235c2ed94..1df2768efb 100644 --- a/Sources/ApolloWebSocket/SplitNetworkTransport.swift +++ b/Sources/ApolloWebSocket/SplitNetworkTransport.swift @@ -1,4 +1,7 @@ +#if !COCOAPODS import Apollo +#endif + public class SplitNetworkTransport: NetworkTransport { private let httpNetworkTransport: NetworkTransport diff --git a/Sources/ApolloWebSocket/WebSocketTransport.swift b/Sources/ApolloWebSocket/WebSocketTransport.swift index c199326d86..53e475776a 100644 --- a/Sources/ApolloWebSocket/WebSocketTransport.swift +++ b/Sources/ApolloWebSocket/WebSocketTransport.swift @@ -1,4 +1,6 @@ +#if !COCOAPODS import Apollo +#endif import Starscream // To allow for alternative implementations supporting the same WebSocketClient protocol diff --git a/Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift b/Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift index c89518c6b1..b5990648fe 100644 --- a/Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift +++ b/Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift @@ -149,7 +149,7 @@ class StarWarsSubscriptionTests: XCTestCase { for i in 1...count { let review = ReviewInput(stars: i, commentary: "The greatest movie ever!") - let episode = episodes.sample() + let episode = episodes.randomElement() _ = client.perform(mutation: CreateReviewForEpisodeMutation(episode: episode!, review: review)) } @@ -160,16 +160,3 @@ class StarWarsSubscriptionTests: XCTestCase { subNewHope.cancel() } } - -// MARK: - Helpers - -extension Collection where Index == Int { - /** - Picks a random element of the collection. - - - returns: A random element of the collection. - */ - func sample() -> Iterator.Element? { - return isEmpty ? nil : self[Int(arc4random_uniform(UInt32(endIndex)))] - } -}