diff --git a/Compass.podspec b/Compass.podspec index c1373e3..76b05fa 100644 --- a/Compass.podspec +++ b/Compass.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Compass" s.summary = "Compass helps you setup a central navigation system for your iOS application." - s.version = "5.1.0" + s.version = "6.0.0" s.homepage = "https://github.com/hyperoslo/Compass" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" } diff --git a/Compass.xcodeproj/project.pbxproj b/Compass.xcodeproj/project.pbxproj index eda1a68..066055c 100644 --- a/Compass.xcodeproj/project.pbxproj +++ b/Compass.xcodeproj/project.pbxproj @@ -73,8 +73,8 @@ D5B2E8A91C3A780C00C0327D /* Compass-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Compass-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D5C629401C3A7FAA007F7B7C /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D5C629491C3A7FAA007F7B7C /* Compass-Mac-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Compass-Mac-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + D5D70EA31F9DD13C0018736F /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; FDD723411DCA20BC00D722E4 /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FDD723421DCA20BC00D722E4 /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-tvOS.plist"; path = "/Users/ferruggp/workspace/Compass/Project/Info-tvOS.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -140,9 +140,9 @@ D53620121D6C743A003C3EE8 /* Project */ = { isa = PBXGroup; children = ( + D5D70EA31F9DD13C0018736F /* Info-tvOS.plist */, D53620131D6C743A003C3EE8 /* Info-iOS.plist */, D53620141D6C743A003C3EE8 /* Info-Mac.plist */, - FDD723421DCA20BC00D722E4 /* Info-tvOS.plist */, D53620151D6C743A003C3EE8 /* Info-Tests-iOS.plist */, D53620161D6C743A003C3EE8 /* Info-Tests-Mac.plist */, ); @@ -308,22 +308,27 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Hyper Interaktiv AS"; TargetAttributes = { D5B2E89E1C3A780C00C0327D = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; D5B2E8A81C3A780C00C0327D = { CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; D5C6293F1C3A7FAA007F7B7C = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0900; }; D5C629481C3A7FAA007F7B7C = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0900; + }; + FDD723341DCA20BC00D722E4 = { + LastSwiftMigration = 0900; }; }; }; @@ -472,14 +477,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -523,14 +534,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -578,7 +595,8 @@ PRODUCT_NAME = Compass; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -599,7 +617,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-iOS"; PRODUCT_NAME = Compass; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -613,7 +632,8 @@ PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CompassTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -626,7 +646,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = no.hyper.CompassTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -651,7 +672,8 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -675,7 +697,8 @@ PRODUCT_NAME = Compass; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -691,7 +714,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-MacTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -707,7 +731,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Compass-MacTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -730,7 +755,8 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; }; name = Debug; @@ -753,7 +779,8 @@ PRODUCT_NAME = Compass; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; }; name = Release; diff --git a/Compass.xcodeproj/xcshareddata/xcschemes/Compass-Mac.xcscheme b/Compass.xcodeproj/xcshareddata/xcschemes/Compass-Mac.xcscheme index fa7292e..4defbe7 100644 --- a/Compass.xcodeproj/xcshareddata/xcschemes/Compass-Mac.xcscheme +++ b/Compass.xcodeproj/xcshareddata/xcschemes/Compass-Mac.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Sources/Navigator.swift b/Sources/Navigator.swift index e762c9f..3cbb289 100644 --- a/Sources/Navigator.swift +++ b/Sources/Navigator.swift @@ -26,7 +26,7 @@ public struct Navigator { /// - payload: The optional payload if you want to send in app objects /// - Returns: The Location that can be used public static func parse(url: URL, payload: Any? = nil) -> Location? { - let path = url.absoluteString.substring(from: scheme.endIndex) + let path = String(url.absoluteString.suffix(from: scheme.endIndex)) guard !(path.contains("?") || path.contains("#")) else { return parseComponents(url: url, payload: payload) diff --git a/Sources/String+Extensions.swift b/Sources/String+Extensions.swift index d144cbf..4583363 100644 --- a/Sources/String+Extensions.swift +++ b/Sources/String+Extensions.swift @@ -21,8 +21,8 @@ extension String { self.components(separatedBy: separatorCharacters).forEach { (pair) in if let equalSeparator = pair.range(of: "=") { - let name = pair.substring(to: equalSeparator.lowerBound) - let value = pair.substring(from: pair.index(equalSeparator.lowerBound, offsetBy: 1)) + let name = String(pair.prefix(upTo: equalSeparator.lowerBound)) + let value = String(pair.suffix(from: pair.index(equalSeparator.lowerBound, offsetBy: 1))) let cleaned = value.removingPercentEncoding ?? value parameters[name] = cleaned