Skip to content

Commit

Permalink
fix: release pre-built XCFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocstn committed Feb 22, 2022
1 parent 44b62f0 commit 15dd02b
Show file tree
Hide file tree
Showing 55 changed files with 2,508 additions and 3,425 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ xcuserdata
*/appsync_test_credentials.json
Carthage
.build/
build/
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ osx_image: xcode13.2
env:
global:
- FRAMEWORK_NAME=AWSAppSync
- BUILD_FOLDER=./build
xcode_workspace: AWSAppSyncClient.xcworkspace
xcode_scheme: AWSAppSync
before_install:
Expand All @@ -16,13 +17,16 @@ before_install:
before_deploy:
- bash ./build-support/carthage-build.sh build --no-skip-current
- bash ./build-support/carthage-build.sh archive $FRAMEWORK_NAME
- bash ./build-support/build-xcframeworks.sh $FRAMEWORK_NAME
script:
- xcodebuild -quiet -workspace AWSAppSyncClient.xcworkspace -scheme AWSAppSync build test -destination 'platform=iOS Simulator,name=iPhone 11,OS=latest'
deploy:
- provider: releases
api_key:
secure: "sdazI+kG88gwh3ssS66BB71if2x2jgS+jfGW+vhSl4/kDiBiT7Xg8b98LNBp/U1sihLm4Jk3NVRdtcdXmBdHw+IXlfuINrSmjTPEibgW0aG6mRhjIZKHrNdkqOe92R2gQYzN8RXUXgaevd6QDymcfi8tN1O2aFAm10hC25bDil+9AlQW4WiBWmEOmJCW4ZI1cIEDQDTZmBw6k/vTId2uMYNE0wpKnzO4jZx4owXawseHDf3OE/7gXUdNBsRH0MsKfMEOxluOj1NEvrfQVTqzJei1amjqBegiRPJr/tULjFgjNgi1iApG55n0a8x84GNcAMC3e71/srY2Wp2rlYeWzFdKcr8yV+YH/D4W/yjeUWX5IQMnrmXt7DL70dTg5fMpFUiWQr10jjXlO0nzWFTkFmN9JHkjdbLSv5CWqstt1JkS1odviNam1GbrW41U2OVrkmS3Hk7/4N1w+VBEv7LU/hYa2gREEU7mOyz2u8X/Q3sShOC4saSfv8a1+pWVSKJlBggQ8kBKRyy/xjCwpJm149uwaVZ8vV/rMDiAXigVRYqEmbyEeNbOILygq/mAhm04RF8StEeKxIFxpl+J+aHodqeUa5mPxojLcdmgETGvL8eMPTJFRqTNqHTsYMC5YPdiwu3PezOZugvzDbI+9q8PpOzIJ2q5KoH2DJMsqgjG0XM="
file: "$FRAMEWORK_NAME.framework.zip"
file:
- "$FRAMEWORK_NAME.framework.zip"
- "$BUILD_FOLDER/$FRAMEWORK_NAME.xcframework.zip"
skip_cleanup: true
on:
repo: awslabs/aws-mobile-appsync-sdk-ios
Expand Down
18 changes: 6 additions & 12 deletions AWSAppSyncClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
763C857726B08D74005164B2 /* AWSAppSyncLambdaAuthTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 763C857626B08D74005164B2 /* AWSAppSyncLambdaAuthTests.swift */; };
763C857926B1C262005164B2 /* LambdaAuthInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 763C857826B1C262005164B2 /* LambdaAuthInterceptor.swift */; };
763C857B26B1CB18005164B2 /* LambdaBasedConnectionPoolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 763C857A26B1CB18005164B2 /* LambdaBasedConnectionPoolTests.swift */; };
7678AF3B27C08D9C003CE437 /* AWSAppSyncReachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7678AF3A27C08D9C003CE437 /* AWSAppSyncReachability.swift */; };
8032C5415EF414C038394D69 /* Pods_AWSAppSyncTestCommon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 74071C397A83DEA980BB2F4C /* Pods_AWSAppSyncTestCommon.framework */; };
90DE0C49240A304D000E875B /* AWSAppSyncAuthTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90DE0C48240A304D000E875B /* AWSAppSyncAuthTypeTests.swift */; };
A70604C0C722923A70C937A1 /* Pods_AWSAppSyncTestApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57F5A94352E1ABE35159489D /* Pods_AWSAppSyncTestApp.framework */; };
Expand Down Expand Up @@ -520,6 +521,7 @@
763C857626B08D74005164B2 /* AWSAppSyncLambdaAuthTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AWSAppSyncLambdaAuthTests.swift; sourceTree = "<group>"; };
763C857826B1C262005164B2 /* LambdaAuthInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LambdaAuthInterceptor.swift; sourceTree = "<group>"; };
763C857A26B1CB18005164B2 /* LambdaBasedConnectionPoolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LambdaBasedConnectionPoolTests.swift; sourceTree = "<group>"; };
7678AF3A27C08D9C003CE437 /* AWSAppSyncReachability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AWSAppSyncReachability.swift; sourceTree = "<group>"; };
82E714A3E9BFB80BD9E5EF90 /* Pods-ApolloTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ApolloTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ApolloTests/Pods-ApolloTests.debug.xcconfig"; sourceTree = "<group>"; };
8623D545D4837963CF2FFF02 /* Pods-AWSAppSyncUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AWSAppSyncUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AWSAppSyncUnitTests/Pods-AWSAppSyncUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
8C707001F57B091A8A001CAB /* Pods_AWSAppSyncTestHostApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AWSAppSyncTestHostApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -884,9 +886,8 @@
17DECF601F59F5FF004B0512 /* AWSAppSyncClient */ = {
isa = PBXGroup;
children = (
B4CF479826080AAB005F5CDA /* AWSAppSync.h */,
17E009981FCAB214005031DB /* Apollo */,
1756980121349F9900319ABC /* Internal */,
B4CF479826080AAB005F5CDA /* AWSAppSync.h */,
21D38B8F240B63FF00EC2A8D /* AWSAppSyncAuthProvider.swift */,
FA0C12BE21CD360B00B438CB /* AWSAppSyncAuthType.swift */,
FABD70682203C17900C99B47 /* AWSAppSyncCache.swift */,
Expand All @@ -903,6 +904,7 @@
FA88834421E3C2D300DEBCB3 /* AWSAppSyncConnection.swift */,
17915B041F5F106600C4B73C /* AWSAppSyncHTTPNetworkTransport.swift */,
FAAACC2521DD7BC300D24B37 /* AWSAppSyncMutations.swift */,
7678AF3A27C08D9C003CE437 /* AWSAppSyncReachability.swift */,
17FD3F57225BAE9A00BD12F8 /* AWSAppSyncRetryStrategy.swift */,
FAF5D78C21D3F04E00FC04D2 /* AWSAppSyncServiceConfig.swift */,
FA3E128421D5297500F2D19A /* AWSAppSyncServiceConfigError.swift */,
Expand All @@ -912,6 +914,7 @@
DF9468DA20E1CA4A00E40482 /* AWSNetworkTransport.swift */,
17A7F8C91FB8BCBC008D1393 /* AWSS3ObjectProtocol.swift */,
17DECF621F59F5FF004B0512 /* Info.plist */,
1756980121349F9900319ABC /* Internal */,
3D9BF114227836800079F52F /* NetworkReachability.swift */,
);
path = AWSAppSyncClient;
Expand Down Expand Up @@ -1579,15 +1582,13 @@
"${PODS_ROOT}/Target Support Files/Pods-ApolloTests/Pods-ApolloTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AWSCore/AWSCore.framework",
"${BUILT_PRODUCTS_DIR}/AppSyncRealTimeClient/AppSyncRealTimeClient.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSyncRealTimeClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
);
Expand All @@ -1605,7 +1606,6 @@
"${PODS_ROOT}/Target Support Files/Pods-AWSAppSyncUnitTests/Pods-AWSAppSyncUnitTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AWSCore/AWSCore.framework",
"${BUILT_PRODUCTS_DIR}/AppSyncRealTimeClient/AppSyncRealTimeClient.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/AWSS3/AWSS3.framework",
Expand All @@ -1614,7 +1614,6 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSyncRealTimeClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSS3.framework",
Expand Down Expand Up @@ -1673,7 +1672,6 @@
"${PODS_ROOT}/Target Support Files/Pods-AWSAppSyncTestHostApp/Pods-AWSAppSyncTestHostApp-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AWSCore/AWSCore.framework",
"${BUILT_PRODUCTS_DIR}/AppSyncRealTimeClient/AppSyncRealTimeClient.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/AWSS3/AWSS3.framework",
Expand All @@ -1682,7 +1680,6 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSyncRealTimeClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSS3.framework",
Expand Down Expand Up @@ -1745,7 +1742,6 @@
"${PODS_ROOT}/Target Support Files/Pods-AWSAppSyncIntegrationTests/Pods-AWSAppSyncIntegrationTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AWSCore/AWSCore.framework",
"${BUILT_PRODUCTS_DIR}/AppSyncRealTimeClient/AppSyncRealTimeClient.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/AWSS3/AWSS3.framework",
Expand All @@ -1754,7 +1750,6 @@
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSyncRealTimeClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSS3.framework",
Expand Down Expand Up @@ -1844,7 +1839,6 @@
"${BUILT_PRODUCTS_DIR}/AWSCognitoIdentityProviderASF/AWSCognitoIdentityProviderASF.framework",
"${BUILT_PRODUCTS_DIR}/AWSMobileClient/AWSMobileClient.framework",
"${BUILT_PRODUCTS_DIR}/AppSyncRealTimeClient/AppSyncRealTimeClient.framework",
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/SQLite.swift/SQLite.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
);
Expand All @@ -1857,7 +1851,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCognitoIdentityProviderASF.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSMobileClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AppSyncRealTimeClient.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SQLite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
);
Expand Down Expand Up @@ -2041,6 +2034,7 @@
17E009DA1FCAB234005031DB /* Result.swift in Sources */,
FA0C12BF21CD360B00B438CB /* AWSAppSyncAuthType.swift in Sources */,
179577992149CD1B00C834E1 /* AWSAppSyncRetryHandler.swift in Sources */,
7678AF3B27C08D9C003CE437 /* AWSAppSyncReachability.swift in Sources */,
172C2C8C22641994007A3552 /* AWSMutationState.swift in Sources */,
17E009D21FCAB234005031DB /* RecordSet.swift in Sources */,
FAE1E0ED21D3D61B005767C7 /* Foundation+Utils.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE.
import SystemConfiguration
import Foundation

public enum ReachabilityError: Error {
public enum AWSAppSyncReachabilityError: Error {
case failedToCreateWithAddress(sockaddr, Int32)
case failedToCreateWithHostname(String, Int32)
case unableToSetCallback(Int32)
Expand All @@ -43,10 +43,10 @@ public extension Notification.Name {
static let reachabilityChanged = Notification.Name("reachabilityChanged")
}

public class Reachability {
public class AWSAppSyncReachability {

public typealias NetworkReachable = (Reachability) -> ()
public typealias NetworkUnreachable = (Reachability) -> ()
public typealias NetworkReachable = (AWSAppSyncReachability) -> ()
public typealias NetworkUnreachable = (AWSAppSyncReachability) -> ()

@available(*, unavailable, renamed: "Connection")
public enum NetworkStatus: CustomStringConvertible {
Expand Down Expand Up @@ -143,7 +143,7 @@ public class Reachability {
targetQueue: DispatchQueue? = nil,
notificationQueue: DispatchQueue? = .main) throws {
guard let ref = SCNetworkReachabilityCreateWithName(nil, hostname) else {
throw ReachabilityError.failedToCreateWithHostname(hostname, SCError())
throw AWSAppSyncReachabilityError.failedToCreateWithHostname(hostname, SCError())
}
self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
}
Expand All @@ -156,7 +156,7 @@ public class Reachability {
zeroAddress.sa_family = sa_family_t(AF_INET)

guard let ref = SCNetworkReachabilityCreateWithAddress(nil, &zeroAddress) else {
throw ReachabilityError.failedToCreateWithAddress(zeroAddress, SCError())
throw AWSAppSyncReachabilityError.failedToCreateWithAddress(zeroAddress, SCError())
}

self.init(reachabilityRef: ref, queueQoS: queueQoS, targetQueue: targetQueue, notificationQueue: notificationQueue)
Expand All @@ -167,7 +167,7 @@ public class Reachability {
}
}

public extension Reachability {
public extension AWSAppSyncReachability {

// MARK: - *** Notifier methods ***
func startNotifier() throws {
Expand All @@ -178,30 +178,30 @@ public extension Reachability {

// `weakifiedReachability` is guaranteed to exist by virtue of our
// retain/release callbacks which we provided to the `SCNetworkReachabilityContext`.
let weakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info).takeUnretainedValue()
let weakifiedReachability = Unmanaged<AWSAppSyncReachabilityWeakifier>.fromOpaque(info).takeUnretainedValue()

// The weak `reachability` _may_ no longer exist if the `Reachability`
// object has since been deallocated but a callback was already in flight.
weakifiedReachability.reachability?.flags = flags
}

let weakifiedReachability = ReachabilityWeakifier(reachability: self)
let opaqueWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.passUnretained(weakifiedReachability).toOpaque()
let weakifiedReachability = AWSAppSyncReachabilityWeakifier(reachability: self)
let opaqueWeakifiedReachability = Unmanaged<AWSAppSyncReachabilityWeakifier>.passUnretained(weakifiedReachability).toOpaque()

var context = SCNetworkReachabilityContext(
version: 0,
info: UnsafeMutableRawPointer(opaqueWeakifiedReachability),
retain: { (info: UnsafeRawPointer) -> UnsafeRawPointer in
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
let unmanagedWeakifiedReachability = Unmanaged<AWSAppSyncReachabilityWeakifier>.fromOpaque(info)
_ = unmanagedWeakifiedReachability.retain()
return UnsafeRawPointer(unmanagedWeakifiedReachability.toOpaque())
},
release: { (info: UnsafeRawPointer) -> Void in
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
let unmanagedWeakifiedReachability = Unmanaged<AWSAppSyncReachabilityWeakifier>.fromOpaque(info)
unmanagedWeakifiedReachability.release()
},
copyDescription: { (info: UnsafeRawPointer) -> Unmanaged<CFString> in
let unmanagedWeakifiedReachability = Unmanaged<ReachabilityWeakifier>.fromOpaque(info)
let unmanagedWeakifiedReachability = Unmanaged<AWSAppSyncReachabilityWeakifier>.fromOpaque(info)
let weakifiedReachability = unmanagedWeakifiedReachability.takeUnretainedValue()
let description = weakifiedReachability.reachability?.description ?? "nil"
return Unmanaged.passRetained(description as CFString)
Expand All @@ -210,12 +210,12 @@ public extension Reachability {

if !SCNetworkReachabilitySetCallback(reachabilityRef, callback, &context) {
stopNotifier()
throw ReachabilityError.unableToSetCallback(SCError())
throw AWSAppSyncReachabilityError.unableToSetCallback(SCError())
}

if !SCNetworkReachabilitySetDispatchQueue(reachabilityRef, reachabilitySerialQueue) {
stopNotifier()
throw ReachabilityError.unableToSetDispatchQueue(SCError())
throw AWSAppSyncReachabilityError.unableToSetDispatchQueue(SCError())
}

// Perform an initial check
Expand Down Expand Up @@ -253,14 +253,14 @@ public extension Reachability {
}
}

fileprivate extension Reachability {
fileprivate extension AWSAppSyncReachability {

func setReachabilityFlags() throws {
try reachabilitySerialQueue.sync { [unowned self] in
var flags = SCNetworkReachabilityFlags()
if !SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags) {
self.stopNotifier()
throw ReachabilityError.unableToGetFlags(SCError())
throw AWSAppSyncReachabilityError.unableToGetFlags(SCError())
}

self.flags = flags
Expand All @@ -282,7 +282,7 @@ fileprivate extension Reachability {

extension SCNetworkReachabilityFlags {

typealias Connection = Reachability.Connection
typealias Connection = AWSAppSyncReachability.Connection

var connection: Connection {
guard isReachableFlagSet else { return .unavailable }
Expand Down Expand Up @@ -398,9 +398,9 @@ extension SCNetworkReachabilityFlags {
- don't alter the public API of `Reachability.swift` in any way
- still allow for automatic stopping of the notifier on `deinit`.
*/
private class ReachabilityWeakifier {
weak var reachability: Reachability?
init(reachability: Reachability) {
private class AWSAppSyncReachabilityWeakifier {
weak var reachability: AWSAppSyncReachability?
init(reachability: AWSAppSyncReachability) {
self.reachability = reachability
}
}
9 changes: 4 additions & 5 deletions AWSAppSyncClient/Internal/NetworkReachabilityNotifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//

import Foundation
import Reachability
import AWSCore

internal extension Notification.Name {
Expand Down Expand Up @@ -41,7 +40,7 @@ class NetworkReachabilityNotifier {
return
}

let factory = reachabilityFactory ?? Reachability.self
let factory = reachabilityFactory ?? AWSAppSyncReachability.self
shared = NetworkReachabilityNotifier(
host: host,
allowsCellularAccess: allowsCellularAccess,
Expand Down Expand Up @@ -155,10 +154,10 @@ class NetworkReachabilityNotifier {

// MARK: - Reachability

extension Reachability: NetworkReachabilityProvidingFactory {
extension AWSAppSyncReachability: NetworkReachabilityProvidingFactory {
public static func make(for hostname: String) -> NetworkReachabilityProviding? {
return try? Reachability(hostname: hostname)
return try? AWSAppSyncReachability(hostname: hostname)
}
}

extension Reachability: NetworkReachabilityProviding { }
extension AWSAppSyncReachability: NetworkReachabilityProviding { }
3 changes: 1 addition & 2 deletions AWSAppSyncClient/NetworkReachability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//

import Foundation
import Reachability

/// Defines a factory to return a NetworkReachabilityProviding instance
public protocol NetworkReachabilityProvidingFactory {
Expand All @@ -20,7 +19,7 @@ public protocol NetworkReachabilityProviding: class {
/// reachable if it can be accessed via WiFi
var allowsCellularConnection: Bool { get set }

var connection: Reachability.Connection { get }
var connection: AWSAppSyncReachability.Connection { get }

/// The notification center on which "reachability changed" events are being posted
var notificationCenter: NotificationCenter { get set }
Expand Down
Loading

0 comments on commit 15dd02b

Please sign in to comment.