Skip to content

Commit 5cfacf8

Browse files
authored
Merge pull request #55 from hyperoslo/swift4
Swift4 migration
2 parents 0d2c51d + 7c1d6d6 commit 5cfacf8

File tree

7 files changed

+55
-22
lines changed

7 files changed

+55
-22
lines changed

Compass.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Compass"
33
s.summary = "Compass helps you setup a central navigation system for your iOS application."
4-
s.version = "5.1.0"
4+
s.version = "6.0.0"
55
s.homepage = "https://github.com/hyperoslo/Compass"
66
s.license = 'MIT'
77
s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }

Compass.xcodeproj/project.pbxproj

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
D5B2E8A91C3A780C00C0327D /* Compass-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Compass-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
7474
D5C629401C3A7FAA007F7B7C /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7575
D5C629491C3A7FAA007F7B7C /* Compass-Mac-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Compass-Mac-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
76+
D5D70EA31F9DD13C0018736F /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = "<group>"; };
7677
FDD723411DCA20BC00D722E4 /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; };
77-
FDD723421DCA20BC00D722E4 /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-tvOS.plist"; path = "/Users/ferruggp/workspace/Compass/Project/Info-tvOS.plist"; sourceTree = "<absolute>"; };
7878
/* End PBXFileReference section */
7979

8080
/* Begin PBXFrameworksBuildPhase section */
@@ -140,9 +140,9 @@
140140
D53620121D6C743A003C3EE8 /* Project */ = {
141141
isa = PBXGroup;
142142
children = (
143+
D5D70EA31F9DD13C0018736F /* Info-tvOS.plist */,
143144
D53620131D6C743A003C3EE8 /* Info-iOS.plist */,
144145
D53620141D6C743A003C3EE8 /* Info-Mac.plist */,
145-
FDD723421DCA20BC00D722E4 /* Info-tvOS.plist */,
146146
D53620151D6C743A003C3EE8 /* Info-Tests-iOS.plist */,
147147
D53620161D6C743A003C3EE8 /* Info-Tests-Mac.plist */,
148148
);
@@ -308,22 +308,27 @@
308308
isa = PBXProject;
309309
attributes = {
310310
LastSwiftUpdateCheck = 0730;
311-
LastUpgradeCheck = 0810;
311+
LastUpgradeCheck = 0900;
312312
ORGANIZATIONNAME = "Hyper Interaktiv AS";
313313
TargetAttributes = {
314314
D5B2E89E1C3A780C00C0327D = {
315315
CreatedOnToolsVersion = 7.2;
316-
LastSwiftMigration = 0800;
316+
LastSwiftMigration = 0900;
317317
};
318318
D5B2E8A81C3A780C00C0327D = {
319319
CreatedOnToolsVersion = 7.2;
320-
LastSwiftMigration = 0800;
320+
LastSwiftMigration = 0900;
321321
};
322322
D5C6293F1C3A7FAA007F7B7C = {
323323
CreatedOnToolsVersion = 7.2;
324+
LastSwiftMigration = 0900;
324325
};
325326
D5C629481C3A7FAA007F7B7C = {
326327
CreatedOnToolsVersion = 7.2;
328+
LastSwiftMigration = 0900;
329+
};
330+
FDD723341DCA20BC00D722E4 = {
331+
LastSwiftMigration = 0900;
327332
};
328333
};
329334
};
@@ -472,14 +477,20 @@
472477
CLANG_CXX_LIBRARY = "libc++";
473478
CLANG_ENABLE_MODULES = YES;
474479
CLANG_ENABLE_OBJC_ARC = YES;
480+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
475481
CLANG_WARN_BOOL_CONVERSION = YES;
482+
CLANG_WARN_COMMA = YES;
476483
CLANG_WARN_CONSTANT_CONVERSION = YES;
477484
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
478485
CLANG_WARN_EMPTY_BODY = YES;
479486
CLANG_WARN_ENUM_CONVERSION = YES;
480487
CLANG_WARN_INFINITE_RECURSION = YES;
481488
CLANG_WARN_INT_CONVERSION = YES;
489+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
490+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
482491
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
492+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
493+
CLANG_WARN_STRICT_PROTOTYPES = YES;
483494
CLANG_WARN_SUSPICIOUS_MOVE = YES;
484495
CLANG_WARN_UNREACHABLE_CODE = YES;
485496
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -523,14 +534,20 @@
523534
CLANG_CXX_LIBRARY = "libc++";
524535
CLANG_ENABLE_MODULES = YES;
525536
CLANG_ENABLE_OBJC_ARC = YES;
537+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
526538
CLANG_WARN_BOOL_CONVERSION = YES;
539+
CLANG_WARN_COMMA = YES;
527540
CLANG_WARN_CONSTANT_CONVERSION = YES;
528541
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
529542
CLANG_WARN_EMPTY_BODY = YES;
530543
CLANG_WARN_ENUM_CONVERSION = YES;
531544
CLANG_WARN_INFINITE_RECURSION = YES;
532545
CLANG_WARN_INT_CONVERSION = YES;
546+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
547+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
533548
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
549+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
550+
CLANG_WARN_STRICT_PROTOTYPES = YES;
534551
CLANG_WARN_SUSPICIOUS_MOVE = YES;
535552
CLANG_WARN_UNREACHABLE_CODE = YES;
536553
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -578,7 +595,8 @@
578595
PRODUCT_NAME = Compass;
579596
SKIP_INSTALL = YES;
580597
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
581-
SWIFT_VERSION = 3.0;
598+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
599+
SWIFT_VERSION = 4.0;
582600
};
583601
name = Debug;
584602
};
@@ -599,7 +617,8 @@
599617
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-iOS";
600618
PRODUCT_NAME = Compass;
601619
SKIP_INSTALL = YES;
602-
SWIFT_VERSION = 3.0;
620+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
621+
SWIFT_VERSION = 4.0;
603622
};
604623
name = Release;
605624
};
@@ -613,7 +632,8 @@
613632
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CompassTests;
614633
PRODUCT_NAME = "$(TARGET_NAME)";
615634
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
616-
SWIFT_VERSION = 3.0;
635+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
636+
SWIFT_VERSION = 4.0;
617637
};
618638
name = Debug;
619639
};
@@ -626,7 +646,8 @@
626646
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
627647
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CompassTests;
628648
PRODUCT_NAME = "$(TARGET_NAME)";
629-
SWIFT_VERSION = 3.0;
649+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
650+
SWIFT_VERSION = 4.0;
630651
};
631652
name = Release;
632653
};
@@ -651,7 +672,8 @@
651672
SDKROOT = macosx;
652673
SKIP_INSTALL = YES;
653674
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
654-
SWIFT_VERSION = 3.0;
675+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
676+
SWIFT_VERSION = 4.0;
655677
};
656678
name = Debug;
657679
};
@@ -675,7 +697,8 @@
675697
PRODUCT_NAME = Compass;
676698
SDKROOT = macosx;
677699
SKIP_INSTALL = YES;
678-
SWIFT_VERSION = 3.0;
700+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
701+
SWIFT_VERSION = 4.0;
679702
};
680703
name = Release;
681704
};
@@ -691,7 +714,8 @@
691714
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-MacTests";
692715
PRODUCT_NAME = "$(TARGET_NAME)";
693716
SDKROOT = macosx;
694-
SWIFT_VERSION = 3.0;
717+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
718+
SWIFT_VERSION = 4.0;
695719
};
696720
name = Debug;
697721
};
@@ -707,7 +731,8 @@
707731
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-MacTests";
708732
PRODUCT_NAME = "$(TARGET_NAME)";
709733
SDKROOT = macosx;
710-
SWIFT_VERSION = 3.0;
734+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
735+
SWIFT_VERSION = 4.0;
711736
};
712737
name = Release;
713738
};
@@ -730,7 +755,8 @@
730755
SDKROOT = appletvos;
731756
SKIP_INSTALL = YES;
732757
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
733-
SWIFT_VERSION = 3.0;
758+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
759+
SWIFT_VERSION = 4.0;
734760
TARGETED_DEVICE_FAMILY = 3;
735761
};
736762
name = Debug;
@@ -753,7 +779,8 @@
753779
PRODUCT_NAME = Compass;
754780
SDKROOT = appletvos;
755781
SKIP_INSTALL = YES;
756-
SWIFT_VERSION = 3.0;
782+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
783+
SWIFT_VERSION = 4.0;
757784
TARGETED_DEVICE_FAMILY = 3;
758785
};
759786
name = Release;

Compass.xcodeproj/xcshareddata/xcschemes/Compass-Mac.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Compass.xcodeproj/xcshareddata/xcschemes/Compass-iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Debug"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Compass.xcodeproj/xcshareddata/xcschemes/Compass-tvOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

Sources/Navigator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public struct Navigator {
2626
/// - payload: The optional payload if you want to send in app objects
2727
/// - Returns: The Location that can be used
2828
public static func parse(url: URL, payload: Any? = nil) -> Location? {
29-
let path = url.absoluteString.substring(from: scheme.endIndex)
29+
let path = String(url.absoluteString.suffix(from: scheme.endIndex))
3030

3131
guard !(path.contains("?") || path.contains("#")) else {
3232
return parseComponents(url: url, payload: payload)

Sources/String+Extensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ extension String {
2121
self.components(separatedBy: separatorCharacters).forEach { (pair) in
2222

2323
if let equalSeparator = pair.range(of: "=") {
24-
let name = pair.substring(to: equalSeparator.lowerBound)
25-
let value = pair.substring(from: pair.index(equalSeparator.lowerBound, offsetBy: 1))
24+
let name = String(pair.prefix(upTo: equalSeparator.lowerBound))
25+
let value = String(pair.suffix(from: pair.index(equalSeparator.lowerBound, offsetBy: 1)))
2626
let cleaned = value.removingPercentEncoding ?? value
2727

2828
parameters[name] = cleaned

0 commit comments

Comments
 (0)