Skip to content

Commit

Permalink
Swift 5 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusolino committed Mar 27, 2019
1 parent e9555ae commit 9e4ac16
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Configs/Wormholy.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<string>1.4.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Storage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open class Storage: NSObject {
return
}

if let index = requests.index(where: { (req) -> Bool in
if let index = requests.firstIndex(where: { (req) -> Bool in
return request?.id == req.id ? true : false
}){
requests[index] = request!
Expand Down
2 changes: 1 addition & 1 deletion Sources/Wormholy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Wormholy: NSObject
return
}

let index = urlProtocolClasses?.index(where: { (obj) -> Bool in
let index = urlProtocolClasses?.firstIndex(where: { (obj) -> Bool in
if obj == protoCls{
return true
}
Expand Down
2 changes: 1 addition & 1 deletion Wormholy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Wormholy"
s.version = "1.3.0"
s.version = "1.4.0"
s.summary = "Network debugging made easy"
s.description = <<-DESC
Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable.
Expand Down
22 changes: 12 additions & 10 deletions Wormholy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Wormholy;
TargetAttributes = {
45087188207E59FE00EE2D31 = {
Expand All @@ -455,7 +455,7 @@
};
buildConfigurationList = 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "Wormholy" */;
compatibilityVersion = "Xcode 6.3";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -618,7 +618,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -645,7 +645,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand All @@ -654,6 +654,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -702,7 +703,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand All @@ -713,6 +714,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -753,7 +755,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -794,7 +796,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(PROJECT_NAME)-Swift.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
USER_HEADER_SEARCH_PATHS = "";
USE_HEADERMAP = YES;
};
Expand Down Expand Up @@ -832,7 +834,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(PROJECT_NAME)-Swift.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
USER_HEADER_SEARCH_PATHS = "";
USE_HEADERMAP = YES;
};
Expand All @@ -847,7 +849,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.Wormholy.Wormholy-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -860,7 +862,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.Wormholy.Wormholy-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -57,7 +56,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion WormholyDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.0</string>
<string>1.4.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down
4 changes: 2 additions & 2 deletions WormholyDemo/Networking/DataFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DataFetcher: NSObject {
}

func getWrongURL(completion: @escaping () -> Void, failure:@escaping (Error) -> Void){
var urlRequest = Routing.WrongURL().urlRequest
var urlRequest = Routing.WrongURL(()).urlRequest
urlRequest.httpMethod = "GET"

let task = session?.dataTask(with: urlRequest) {
Expand All @@ -97,7 +97,7 @@ class DataFetcher: NSObject {
}

func getPhotosList(completion: @escaping () -> Void, failure:@escaping (Error) -> Void){
var urlRequest = Routing.Photos().urlRequest
var urlRequest = Routing.Photos(()).urlRequest
urlRequest.httpMethod = "GET"

let task = session?.dataTask(with: urlRequest) {
Expand Down
4 changes: 2 additions & 2 deletions WormholyDemo/Networking/Routing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ enum Routing{

case Post(Int)
case NewPost(userId: Int, title: String, body: String)
case WrongURL()
case Photos()
case WrongURL(())
case Photos(())

var urlRequest: URLRequest{
let touple : (path: String, parameters: [String: Any]?) = {
Expand Down

0 comments on commit 9e4ac16

Please sign in to comment.