diff --git a/.swift-version b/.swift-version new file mode 100644 index 00000000..bb576dbd --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +2.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 88d66526..d8439b41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log +## [0.6.0] 2016-11-22 -## [0.5.3] +### Added +Added Swift 2.3 support + +## [0.5.3] 2016-11-18 This will be the final release using Swift 2.2 diff --git a/Cartfile.private b/Cartfile.private index 25a214a2..e45f0ca0 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1 +1 @@ -github "https://github.com/AliSoftware/OHHTTPStubs.git" ~> 5.0 +github "https://github.com/AliSoftware/OHHTTPStubs.git" ~> 5.2 diff --git a/README.md b/README.md index 4ebd5117..57e4ccaf 100755 --- a/README.md +++ b/README.md @@ -9,7 +9,11 @@ Please keep in mind that this SDK is in a Pre-1.0 release state and is still act ## Requirements - iOS 8.0+ -- Xcode 7.3+ +- Xcode 8.0+ +- Swift 2.3 + +**Looking for Swift 2.2?** For Swift 2.2 support, please use version [0.5.3](https://github.com/uber/rides-ios-sdk/releases/tag/v0.5.3) + ## Getting Started diff --git a/UberRides.podspec b/UberRides.podspec index 0bb2d80a..02802269 100644 --- a/UberRides.podspec +++ b/UberRides.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "UberRides" - s.version = "0.5.3" + s.version = "0.6.0" s.summary = "The Official Uber Rides iOS SDK." s.description = <<-DESC This Swift library allows you to integrate Uber into your iOS app. It is designed to make it quick and easy to add a 'Request a Ride' button in your application, seamlessly connecting your users with Uber. diff --git a/examples/Swift SDK/Swift SDK.xcodeproj/project.pbxproj b/examples/Swift SDK/Swift SDK.xcodeproj/project.pbxproj index fb7de37b..9606f253 100644 --- a/examples/Swift SDK/Swift SDK.xcodeproj/project.pbxproj +++ b/examples/Swift SDK/Swift SDK.xcodeproj/project.pbxproj @@ -267,15 +267,18 @@ TargetAttributes = { AC0404A31BFAD0C800AC1501 = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; }; AC0404B71BFAD0C800AC1501 = { CreatedOnToolsVersion = 7.1; DevelopmentTeam = 36UPBWHAQE; + LastSwiftMigration = 0800; TestTargetID = AC0404A31BFAD0C800AC1501; }; AC0404C21BFAD0C800AC1501 = { CreatedOnToolsVersion = 7.1; DevelopmentTeam = 36UPBWHAQE; + LastSwiftMigration = 0800; TestTargetID = AC0404A31BFAD0C800AC1501; }; }; @@ -515,6 +518,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDK"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -532,6 +536,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDK"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -543,6 +548,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDKTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Swift SDK.app/Swift SDK"; }; name = Debug; @@ -555,6 +561,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDKTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Swift SDK.app/Swift SDK"; }; name = Release; @@ -566,6 +573,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDKUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = "Swift SDK"; USES_XCTRUNNER = YES; }; @@ -578,6 +586,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.uber.sdk.Swift-SDKUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_TARGET_NAME = "Swift SDK"; USES_XCTRUNNER = YES; }; diff --git a/source/TestAppShim/AppDelegate.swift b/source/TestAppShim/AppDelegate.swift new file mode 100644 index 00000000..8e118e92 --- /dev/null +++ b/source/TestAppShim/AppDelegate.swift @@ -0,0 +1,29 @@ +// +// AppDelegate.swift +// TestAppShim +// +// Copyright © 2016 Uber Technologies, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate {} + diff --git a/source/TestAppShim/Assets.xcassets/AppIcon.appiconset/Contents.json b/source/TestAppShim/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..b8236c65 --- /dev/null +++ b/source/TestAppShim/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,48 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/source/TestAppShim/Base.lproj/LaunchScreen.storyboard b/source/TestAppShim/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..fdf3f97d --- /dev/null +++ b/source/TestAppShim/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/TestAppShim/Base.lproj/Main.storyboard b/source/TestAppShim/Base.lproj/Main.storyboard new file mode 100644 index 00000000..273375fc --- /dev/null +++ b/source/TestAppShim/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/TestAppShim/Info.plist b/source/TestAppShim/Info.plist new file mode 100644 index 00000000..38e98af2 --- /dev/null +++ b/source/TestAppShim/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/source/TestAppShim/TestAppShim.entitlements b/source/TestAppShim/TestAppShim.entitlements new file mode 100644 index 00000000..62f8062f --- /dev/null +++ b/source/TestAppShim/TestAppShim.entitlements @@ -0,0 +1,10 @@ + + + + + keychain-access-groups + + $(AppIdentifierPrefix)com.uber.sdk.UberRides.TestAppShim + + + diff --git a/source/TestAppShim/ViewController.swift b/source/TestAppShim/ViewController.swift new file mode 100644 index 00000000..0336d45f --- /dev/null +++ b/source/TestAppShim/ViewController.swift @@ -0,0 +1,27 @@ +// +// ViewController.swift +// TestAppShim +// +// Copyright © 2016 Uber Technologies, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +class ViewController: UIViewController {} diff --git a/source/UberRides.xcodeproj/project.pbxproj b/source/UberRides.xcodeproj/project.pbxproj index 75029520..c02573f2 100644 --- a/source/UberRides.xcodeproj/project.pbxproj +++ b/source/UberRides.xcodeproj/project.pbxproj @@ -127,6 +127,11 @@ DCB0D3901CADAA6300194DD5 /* RideRequestViewRequestingBehaviorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCB0D38F1CADAA6300194DD5 /* RideRequestViewRequestingBehaviorTests.swift */; }; DCD8060C1CFE50F300EF6EB1 /* requestEstimateNoCars.json in Resources */ = {isa = PBXBuildFile; fileRef = DCD8060B1CFE50F300EF6EB1 /* requestEstimateNoCars.json */; }; DCD8060E1CFE533F00EF6EB1 /* rideReceiptNullSurgeTotalOwed.json in Resources */ = {isa = PBXBuildFile; fileRef = DCD8060D1CFE533F00EF6EB1 /* rideReceiptNullSurgeTotalOwed.json */; }; + DCDD153E1D99A7F20053BC8F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDD153D1D99A7F20053BC8F /* AppDelegate.swift */; }; + DCDD15401D99A7F20053BC8F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDD153F1D99A7F20053BC8F /* ViewController.swift */; }; + DCDD15431D99A7F20053BC8F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DCDD15411D99A7F20053BC8F /* Main.storyboard */; }; + DCDD15451D99A7F20053BC8F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DCDD15441D99A7F20053BC8F /* Assets.xcassets */; }; + DCDD15481D99A7F20053BC8F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DCDD15461D99A7F20053BC8F /* LaunchScreen.storyboard */; }; DCE7A0011CF5238A003AC3BD /* BaseDeeplinkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCE7A0001CF5238A003AC3BD /* BaseDeeplinkTests.swift */; }; DCED60F21C9724D4001A65E0 /* AccessTokenFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCED60F11C9724D4001A65E0 /* AccessTokenFactory.swift */; }; DCED60F61C9770D9001A65E0 /* AccessTokenFactoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCED60F51C9770D9001A65E0 /* AccessTokenFactoryTests.swift */; }; @@ -144,6 +149,13 @@ remoteGlobalIDString = AC0404741BFACD1D00AC1501; remoteInfo = UberRides; }; + DCDD154E1D99A8410053BC8F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = AC04046C1BFACD1D00AC1501 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DCDD153A1D99A7F20053BC8F; + remoteInfo = TestAppShim; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -278,6 +290,14 @@ DCB0D38F1CADAA6300194DD5 /* RideRequestViewRequestingBehaviorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RideRequestViewRequestingBehaviorTests.swift; sourceTree = ""; }; DCD8060B1CFE50F300EF6EB1 /* requestEstimateNoCars.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = requestEstimateNoCars.json; sourceTree = ""; }; DCD8060D1CFE533F00EF6EB1 /* rideReceiptNullSurgeTotalOwed.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = rideReceiptNullSurgeTotalOwed.json; sourceTree = ""; }; + DCDD153B1D99A7F20053BC8F /* TestAppShim.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestAppShim.app; sourceTree = BUILT_PRODUCTS_DIR; }; + DCDD153D1D99A7F20053BC8F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + DCDD153F1D99A7F20053BC8F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + DCDD15421D99A7F20053BC8F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + DCDD15441D99A7F20053BC8F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + DCDD15471D99A7F20053BC8F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + DCDD15491D99A7F20053BC8F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DCDD154D1D99A82D0053BC8F /* TestAppShim.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TestAppShim.entitlements; sourceTree = ""; }; DCE7A0001CF5238A003AC3BD /* BaseDeeplinkTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseDeeplinkTests.swift; sourceTree = ""; }; DCED60F11C9724D4001A65E0 /* AccessTokenFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AccessTokenFactory.swift; path = OAuth/AccessTokenFactory.swift; sourceTree = ""; }; DCED60F51C9770D9001A65E0 /* AccessTokenFactoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccessTokenFactoryTests.swift; sourceTree = ""; }; @@ -307,6 +327,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DCDD15381D99A7F20053BC8F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -315,6 +342,7 @@ children = ( AC0404771BFACD1D00AC1501 /* UberRides */, AC0404831BFACD1D00AC1501 /* UberRidesTests */, + DCDD153C1D99A7F20053BC8F /* TestAppShim */, AC0404761BFACD1D00AC1501 /* Products */, E0C87DA8C44B500B36E07963 /* Pods */, F036511333B3B5067F8B6DC8 /* Frameworks */, @@ -326,6 +354,7 @@ children = ( AC0404751BFACD1D00AC1501 /* UberRides.framework */, AC04047F1BFACD1D00AC1501 /* UberRidesTests.xctest */, + DCDD153B1D99A7F20053BC8F /* TestAppShim.app */, ); name = Products; sourceTree = ""; @@ -511,6 +540,20 @@ name = Utilities; sourceTree = ""; }; + DCDD153C1D99A7F20053BC8F /* TestAppShim */ = { + isa = PBXGroup; + children = ( + DCDD154D1D99A82D0053BC8F /* TestAppShim.entitlements */, + DCDD153D1D99A7F20053BC8F /* AppDelegate.swift */, + DCDD153F1D99A7F20053BC8F /* ViewController.swift */, + DCDD15411D99A7F20053BC8F /* Main.storyboard */, + DCDD15441D99A7F20053BC8F /* Assets.xcassets */, + DCDD15461D99A7F20053BC8F /* LaunchScreen.storyboard */, + DCDD15491D99A7F20053BC8F /* Info.plist */, + ); + path = TestAppShim; + sourceTree = ""; + }; E0C87DA8C44B500B36E07963 /* Pods */ = { isa = PBXGroup; children = ( @@ -578,28 +621,57 @@ ); dependencies = ( AC0404821BFACD1D00AC1501 /* PBXTargetDependency */, + DCDD154F1D99A8410053BC8F /* PBXTargetDependency */, ); name = UberRidesTests; productName = UberRidesTests; productReference = AC04047F1BFACD1D00AC1501 /* UberRidesTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + DCDD153A1D99A7F20053BC8F /* TestAppShim */ = { + isa = PBXNativeTarget; + buildConfigurationList = DCDD154C1D99A7F20053BC8F /* Build configuration list for PBXNativeTarget "TestAppShim" */; + buildPhases = ( + DCDD15371D99A7F20053BC8F /* Sources */, + DCDD15381D99A7F20053BC8F /* Frameworks */, + DCDD15391D99A7F20053BC8F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestAppShim; + productName = TestAppShim; + productReference = DCDD153B1D99A7F20053BC8F /* TestAppShim.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ AC04046C1BFACD1D00AC1501 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; + LastSwiftUpdateCheck = 0800; LastUpgradeCheck = 0710; ORGANIZATIONNAME = Uber; TargetAttributes = { AC0404741BFACD1D00AC1501 = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; }; AC04047E1BFACD1D00AC1501 = { CreatedOnToolsVersion = 7.1; - DevelopmentTeam = 36UPBWHAQE; + LastSwiftMigration = 0800; + TestTargetID = DCDD153A1D99A7F20053BC8F; + }; + DCDD153A1D99A7F20053BC8F = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Keychain = { + enabled = 1; + }; + }; }; }; }; @@ -612,12 +684,14 @@ "hi-IN", "zh-Hans", "zh-Hant", + Base, ); mainGroup = AC04046B1BFACD1D00AC1501; productRefGroup = AC0404761BFACD1D00AC1501 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( + DCDD153A1D99A7F20053BC8F /* TestAppShim */, AC0404741BFACD1D00AC1501 /* UberRides */, AC04047E1BFACD1D00AC1501 /* UberRidesTests */, ); @@ -663,6 +737,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DCDD15391D99A7F20053BC8F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DCDD15481D99A7F20053BC8F /* LaunchScreen.storyboard in Resources */, + DCDD15451D99A7F20053BC8F /* Assets.xcassets in Resources */, + DCDD15431D99A7F20053BC8F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -797,6 +881,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DCDD15371D99A7F20053BC8F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DCDD15401D99A7F20053BC8F /* ViewController.swift in Sources */, + DCDD153E1D99A7F20053BC8F /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -805,6 +898,11 @@ target = AC0404741BFACD1D00AC1501 /* UberRides */; targetProxy = AC0404811BFACD1D00AC1501 /* PBXContainerItemProxy */; }; + DCDD154F1D99A8410053BC8F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = DCDD153A1D99A7F20053BC8F /* TestAppShim */; + targetProxy = DCDD154E1D99A8410053BC8F /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -819,6 +917,22 @@ name = Localizable.strings; sourceTree = ""; }; + DCDD15411D99A7F20053BC8F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + DCDD15421D99A7F20053BC8F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + DCDD15461D99A7F20053BC8F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + DCDD15471D99A7F20053BC8F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -928,6 +1042,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -947,28 +1062,73 @@ PRODUCT_BUNDLE_IDENTIFIER = com.uber.sdk.UberRides; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; AC04048D1BFACD1D00AC1501 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Carthage/Build/iOS/**"; INFOPLIST_FILE = UberRidesTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.uber.sdk.UberRidesTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestAppShim.app/TestAppShim"; }; name = Debug; }; AC04048E1BFACD1D00AC1501 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../Carthage/Build/iOS/**"; INFOPLIST_FILE = UberRidesTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.uber.sdk.UberRidesTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestAppShim.app/TestAppShim"; + }; + name = Release; + }; + DCDD154A1D99A7F20053BC8F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = TestAppShim/TestAppShim.entitlements; + INFOPLIST_FILE = TestAppShim/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.uber.sdk.UberRides.TestAppShim; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 2.3; + }; + name = Debug; + }; + DCDD154B1D99A7F20053BC8F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CODE_SIGN_ENTITLEMENTS = TestAppShim/TestAppShim.entitlements; + INFOPLIST_FILE = TestAppShim/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.uber.sdk.UberRides.TestAppShim; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -1002,6 +1162,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + DCDD154C1D99A7F20053BC8F /* Build configuration list for PBXNativeTarget "TestAppShim" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DCDD154A1D99A7F20053BC8F /* Debug */, + DCDD154B1D99A7F20053BC8F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = AC04046C1BFACD1D00AC1501 /* Project object */; diff --git a/source/UberRides/Info.plist b/source/UberRides/Info.plist index c89d5f29..63c3e67d 100644 --- a/source/UberRides/Info.plist +++ b/source/UberRides/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.3 + 0.6.0 CFBundleSignature ???? CFBundleVersion diff --git a/source/UberRides/RideRequestView.swift b/source/UberRides/RideRequestView.swift index e97f7c39..8582bf88 100644 --- a/source/UberRides/RideRequestView.swift +++ b/source/UberRides/RideRequestView.swift @@ -216,7 +216,7 @@ import CoreLocation extension RideRequestView: WKNavigationDelegate { public func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) { if let url = navigationAction.request.URL { - if url.absoluteString.lowercaseString.hasPrefix(redirectURL.lowercaseString) { + if url.absoluteString?.lowercaseString.hasPrefix(redirectURL.lowercaseString) ?? false { let error = OAuthUtil.parseRideWidgetErrorFromURL(url) delegate?.rideRequestView(self, didReceiveError: error) decisionHandler(.Cancel) diff --git a/source/UberRides/Utilities/RidesUtil.swift b/source/UberRides/Utilities/RidesUtil.swift index 4416e20f..3cb62052 100644 --- a/source/UberRides/Utilities/RidesUtil.swift +++ b/source/UberRides/Utilities/RidesUtil.swift @@ -70,10 +70,10 @@ class FontUtil { var error: Unmanaged? let cfdata = CFDataCreate(nil, UnsafePointer(inData.bytes), inData.length) if let provider = CGDataProviderCreateWithCFData(cfdata) { - if let font = CGFontCreateWithDataProvider(provider) { - if (CTFontManagerRegisterGraphicsFont(font, &error)) { - return true - } + let font = CGFontCreateWithDataProvider(provider) + if (CTFontManagerRegisterGraphicsFont(font, &error)) { + return true + } else { print("Failed to load font with error: \(error)") } } diff --git a/source/UberRidesTests/AuthenticationDeeplinkTests.swift b/source/UberRidesTests/AuthenticationDeeplinkTests.swift index b3b9cf75..237aaed1 100644 --- a/source/UberRidesTests/AuthenticationDeeplinkTests.swift +++ b/source/UberRidesTests/AuthenticationDeeplinkTests.swift @@ -61,7 +61,7 @@ class AuthenticationDeeplinkTests: XCTestCase { let authenticationDeeplink = AuthenticationDeeplink(scopes:scopes) let expectedURLPrefix = "uberauth://connect?" - XCTAssertTrue(authenticationDeeplink.deeplinkURL.absoluteString.hasPrefix(expectedURLPrefix)) + XCTAssertTrue(authenticationDeeplink.deeplinkURL.absoluteString!.hasPrefix(expectedURLPrefix)) } } diff --git a/source/UberRidesTests/OAuthTests.swift b/source/UberRidesTests/OAuthTests.swift index 14a205bf..4948691e 100644 --- a/source/UberRidesTests/OAuthTests.swift +++ b/source/UberRidesTests/OAuthTests.swift @@ -279,7 +279,7 @@ class OAuthTests: XCTestCase { Test saving a duplicate key with different value and verify that value is updated. */ func testSaveDuplicateObjectInKeychain() { - guard let token = tokenFixture(), newToken = tokenFixture("newTokenString") else { + guard let token = tokenFixture(), let newToken = tokenFixture("newTokenString") else { XCTAssert(false) return } diff --git a/source/UberRidesTests/RequestDeeplinkTests.swift b/source/UberRidesTests/RequestDeeplinkTests.swift index 95ff5e51..eaf7780d 100644 --- a/source/UberRidesTests/RequestDeeplinkTests.swift +++ b/source/UberRidesTests/RequestDeeplinkTests.swift @@ -86,7 +86,7 @@ class UberRidesDeeplinkTests: XCTestCase { */ func testBuildDeeplinkWithClientIDHasDefaultParameters() { let deeplink = RequestDeeplink() - let uri = deeplink.deeplinkURL.absoluteString + let uri = deeplink.deeplinkURL.absoluteString! XCTAssertTrue(uri.containsString(ExpectedDeeplink.uberScheme)) diff --git a/source/UberRidesTests/RideRequestViewTests.swift b/source/UberRidesTests/RideRequestViewTests.swift index 58a34557..55ef1f49 100644 --- a/source/UberRidesTests/RideRequestViewTests.swift +++ b/source/UberRidesTests/RideRequestViewTests.swift @@ -184,35 +184,6 @@ class RideRequestViewTests: XCTestCase { }) } - func testNotSupportedDelegateCalled_whenSMS() { - expectation = expectationWithDescription("Delegate called") - let cancelRequestExpectation = expectationWithDescription("Request was cancelled") - - let rideRequestView = RideRequestView(rideParameters: RideParametersBuilder().build(), accessToken:nil, frame:CGRectZero) - rideRequestView.delegate = self - let smsURLString = "sms:5555555555" - guard let smsURL = NSURL(string: smsURLString) else { - XCTAssert(false) - return - } - let smsURLRequest = NSURLRequest(URL: smsURL) - let navigationActionMock = WKNavigationActionMock(urlRequest: smsURLRequest) - - if let delegate = rideRequestView.webView.navigationDelegate { - delegate.webView!(rideRequestView.webView, decidePolicyForNavigationAction: navigationActionMock, decisionHandler: { (policy: WKNavigationActionPolicy) -> Void in - XCTAssertEqual(policy, WKNavigationActionPolicy.Cancel) - cancelRequestExpectation.fulfill() - }) - - waitForExpectationsWithTimeout(timeout, handler: { error in - XCTAssertNotNil(self.error) - XCTAssertEqual(self.error?.code, RideRequestViewErrorType.NotSupported.rawValue) - }) - } else { - XCTAssert(false) - } - } - func testNotSupportedDelegateCalled_whenTel() { expectation = expectationWithDescription("Delegate called") let cancelRequestExpectation = expectationWithDescription("Request was cancelled") diff --git a/source/UberRidesTests/RidesMocks.swift b/source/UberRidesTests/RidesMocks.swift index 367162d0..c75c1729 100644 --- a/source/UberRidesTests/RidesMocks.swift +++ b/source/UberRidesTests/RidesMocks.swift @@ -161,6 +161,10 @@ class WebViewMock : WKWebView { super.init(frame: frame, configuration: configuration) } + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + override func loadRequest(request: NSURLRequest) -> WKNavigation? { testClosure?(request) return nil