Skip to content

Commit

Permalink
Updated to Swift 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AvdLee committed Aug 7, 2019
1 parent 34a9925 commit 8f7c7ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Mocker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
501E269C1F3DAE370048F39E = {
CreatedOnToolsVersion = 8.3.3;
DevelopmentTeam = GLJTT4T544;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -455,7 +455,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.wetransfer.MockerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -468,7 +468,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.wetransfer.MockerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
12 changes: 6 additions & 6 deletions Sources/MockingURLProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ public final class MockingURLProtocol: URLProtocol {
}
}

/// Overrides needed to define a valid inheritance of URLProtocol.
override public class func canInit(with request: URLRequest) -> Bool {
guard let url = request.url else { return false }
return Mocker.shouldHandle(url)
}

/// Implementation does nothing, but is needed for a valid inheritance of URLProtocol.
override public func stopLoading() {
// No implementation needed
Expand All @@ -56,6 +50,12 @@ public final class MockingURLProtocol: URLProtocol {
override public class func canonicalRequest(for request: URLRequest) -> URLRequest {
return request
}

/// Overrides needed to define a valid inheritance of URLProtocol.
override public class func canInit(with request: URLRequest) -> Bool {
guard let url = request.url else { return false }
return Mocker.shouldHandle(url)
}
}

private extension Data {
Expand Down

0 comments on commit 8f7c7ee

Please sign in to comment.