diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 5186d0706..000000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.0 diff --git a/.travis.yml b/.travis.yml index 5002a41e4..159cdb469 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode9.3 +osx_image: xcode11.2 cache: directories: - Carthage @@ -9,18 +9,18 @@ env: - LC_CTYPE=en_US.UTF-8 - LANG=en_US.UTF-8 - IOS_FRAMEWORK_SCHEME="TripKit-iOS" - - IOS_SDK=iphonesimulator11.3 + - IOS_SDK=iphoneos13.2 - secure: "whkK++h4Y+ciX+W/9o96SQoSvkfi2+dtlkeWeCj5emMe2Uk67FTjNK0REaueEkvBvEpGxPnbbLLiEWJAS561Gh2XSKtKgABGVWtrvjk6j2/44ezt689D1/mAf6bDOaHK6N3kwA2qdFAec4JmknCikpLg6WiC7GT1/2oYXgoBz6wA1ai35MnnlLWvopAQq98T0a2B5P3foB4AW7oKtNGNKvvWGXj0+c8ZPcsk6LJNmjrVReAdplg3NFagDWEK2VNd8D79//cvvt5sdmE5a6Dkh83zAgpHewzqe7vtIfLqTUUChgIlOaDGZpWn8boMn0lku6QCH4Rs1szsSII4FuCwEeZWrthUtQiqw8If8cwIrLCKqaItFSJ+MNL2sNe/jDdTmbhnwWjxx8yAqivrwOC86xG/iCGbCX16zpjfwG5CxPWDFjiuJ1mvlFQmRbz02IVYmWyms58zL2RaHXTjewCRrwzxiWZhpoLfLt/zbX6ISDKiuY+TXtc+5DLS1Qgs7gsKxLolCteVqDE++3hsmImMtP/Gf/ojeTaVoHin+WNJV/WQn29xcCFN6erCDp5lQwyY68ygqVpqUwNdTugjw/1iNbd3Oo3/klrXXcOya6ErFlPUQHx5An2VlcpEI/CqcjRAoNQSKRgrFdv0NsQIPAjPGX4PdKWEFpcZ/kLggIUbAiU=" - secure: "r4alEXz4O0nJeiEqxF7dM1OHqDILk/cq1VlBe6kOOEr/hj9boC6bkQdJK9+rsKJnWg7Q5WFo6EigI7orKDrN1rLPePtwwCDlK4vfoWQHNfx3ch5cHK2nDYnTFDYAGT+KAndw3b21NJGGb08XHlKgFuDCR6HLCq6iSYDsMmaCZkFenbeq1E6BqYJAMMMSb6ohx95kJ1nGRms7LGdezqqzPGVG3MwI3Ro6CkXoisqkOUpjMRte4FtKOGwJEXjzEuk/TZjhUBhTOB+2kR2EDsN3VKncJPwdN/l3V//Rh0jF+g93glENPJK9VSGIEnmA24HdVvTaDdOb2ovL5gD3HIY8tsBI4gELkblGaOHcICw1AyN/MdEX/6LizQek5R2KN3QRU7elw/CB2JTTHWAS9teZf1f8seFfSkHuAH5z9oQDyXvZhCsb1g1IXBkHahfqvTXkYdZo7Fz6Y1nmneErfD8fmMPYYOovm0gPqVfDZTQLYW+cEhSTfx5Hn8y9o1sYL0IAibIOFityQ4s8phm99pEES3Qa+XFasSceETyyMpW23dUHyPuExJ7hpggrZb9IEYmgD3SOfGPks9F40CKOVYG2CKiXntAjMiIIH8fGro/OCb26XXFdgK6vRqqm2Yyk7DZpst3B89EcfGVg5e5DODVlC/WDS+T1eaUb55U86xTHbiI=" - secure: "cjEEjCaVS6ZiEkLdGzQ22yZ0yRPSNDpIlZhKmHMVnJc8x9QB+EZALZ7hPLEmSJL+rqQ6DVK23zkXDlLwFHsDrrQHavXsO5NIsPhPpUTPyrVTGuBsR18Pk1TbClyh/vCJ1N6FzskCIIQd7ZbQ/J5PjQ6OC7W7KHyXnozYuS7ruSTmNjX9C3052yY7RpKJsMjDR570f/TPRjFRegrnOpvJ1Q/t0mfFSESGB000/gxPW1O61A5zJXuX9H30kK97bz2fPO8LJhQ+NFkQqAbs3BirNf3iHOYCk+pO5Uv8Mtupg6FfPi2+1fhghpM1eVXqstkf86r/0em8fqqCHK+vUlscy54Ow44gs8oGmE/3zGWCkvFZ76NUQ87wisHDFwA3iJo5EygZU6uocVcBKo9TqN3tg5dU7McFcdczqRlOSpcIP8nMpz/fo4PMqeMwjP8DKcrRqk8XnBPVCthQ9D9oiVOxoicK/kf6JlPAK9OEcuZDXFV0/qP7pKjVqf6J/mbkv6ORe6CcDdq7QgUmu7lavplwyfEY7pTJzqGlVo2p8ZBblILnXXFoqi13dmDtcngvDg3zA/d3Cyp+4HYouFXmyh2z9mEvdgs3gNPGrWVOi5IMfuLd3VyyAKcGPoM1PDl9ib394QljAfrBcQtampw48UdmPVZySnQVYlNxCwo/XPx6KFw=" - secure: "Cm2f7+Z2Gdj2ZroiaH3i28WknaBlr7BGEpTSL/240ahLiE/MiUinPHd8tBT3+J0V5HiHor5+TMC9AfrDuXbaGLb9b3SaK83QowEj+ukQtEj1Z1CIqjv40a5z0shaUgqsDLUui4GMW2SX7yCHHu/NAx8ijwR/JTzdA5oSBeYuYcAURkYWDC+NxuBpqBxLMpZ44r0Gt+TvWSSKtKOsf0i+F+HJLLOLJWPodiHiQZdjS/cSgfeDRjN0zoHVoYwKMXdpJ5WaqVWcJJNFLz8aL5HsSQTgRYtENovo3z+oZfSwcEoUllURZ3UjLxi1mVhg2+AZCAF+G1AJUqwUuD6NFcyphBBQWDU9dGAcv8K5u9G8Qqd3BOGYzVkfGCDxjHcNjU2FvB9LF0gnQ6IFX9CeA+W01sYQ9IzztpQXiPHrEPkJeA0FrE48RfKigAz2UQ4aN9/taRnThnuLqxp3YdadJHHnOzQ+YIvkGbcxfqp/JmNWz48ZvxJwtKYNF0t12eONr4Rugt02UfjYLBQBdHk2BYwfgXrhiM6ylc3rihjp0UPawQ2D5ctdkLFDlVFb2QtJPn1Zyc4eeRfT3GU0cwatd+OAEGpU/ZW+l+PGGBZyh8ElfrmBKE8uEqx4zmEOOVosuQum2HQTUPgjgTL8EwFZaJpKoynbvGfwcWa637WKPNJfQNY=" - secure: "F2K/ptSGM2jwMDP8lFPGdH4TTv1hB1+DSc3q1QmZclg3YrNh4g1VGy8bvpaCCfudYm+bXOXMCkUEpz11MA05eLBCByKaVCACRV/G+5gr/jSHVplJ1BpaKu4Ax1J8hveValdr1uAtk8NkwIFxY08pbwqZKfBYGeYi45Uckwnrg2uWybsoo2rM1/P2Op1+3U/PJYR2/D4RxM7f938AT+48v88IP2ORDv7jow0O/KD2ENheLp7iddJ+TJmRpHF0UBESP/3E1ZabBjf9ptqpu3aPvvh2yjli4qdMGikC+i0wi+qI5cMRWx+5e5DK0HjNXx0TqPXhpmBTYdNGaast+dcrzl4HNRhYvWSRrU4hiPffnH8E166lVwVftRCLRWQDj9Vq8od+bKlp0Fg9R5oYObKGCv54Ej24rMqI97/NRAV3tamww/vJ7kD6EgSoYYjM1tLRqvchganDZ3u/63gORf77PwUum7bRpUPCTiCftEfmOiG3lhBEFyzBlLpDDW7B9HFSK0jfi7aS9e65RedwyF0DcthskaGMWCM+9Sh8HNcU8LiOok0oVnJM4VkQCpHSkxA0HqLRU7b3ItTzCR5ZBbNexgbkhl0QtJZfJl52v2+CKpfW2CaWz3YLK7yz3px3f1xB/sMj5ACMPejE+g8i2jPKz1SbgJ9eDH4M2Y3nppIp/Hs=" matrix: - - DESTINATION="OS=11.3,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" + - DESTINATION="OS=13.2.2,name=iPhone 8" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" before_install: - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc -- gem install xcpretty --no-rdoc --no-ri --no-document --quiet +- gem install xcpretty --no-document --quiet - carthage bootstrap --cache-builds --platform iOS # We use xcodebuild rather than xctool as xctool doesn't play nicely with network requests diff --git a/Cartfile b/Cartfile index 962a56d75..a16f2f473 100644 --- a/Cartfile +++ b/Cartfile @@ -1,14 +1,14 @@ # TripKit -github "ReactiveX/RxSwift" ~> 4.0 +github "ReactiveX/RxSwift" ~> 5.0 github "nighthawk/ASPolygonKit" # TripKitUI -github "onevcat/Kingfisher" ~> 4.0 +github "onevcat/Kingfisher" ~> 5.12 github "nighthawk/ASPolylineView" -github "RxSwiftCommunity/RxDataSources" ~> 3.0 +github "RxSwiftCommunity/RxDataSources" ~> 4.0 # TripKitBookings github "kishikawakatsumi/KeychainAccess" -github "OAuthSwift/OAuthSwift" ~> 1.2.0 +github "OAuthSwift/OAuthSwift" ~> 2.1 github "SwiftyJSON/SwiftyJSON" github "skedgo/KVNProgress" diff --git a/Cartfile.resolved b/Cartfile.resolved index 82e24f390..ed2a5fbe4 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,9 +1,9 @@ -github "OAuthSwift/OAuthSwift" "1.2.1" -github "ReactiveX/RxSwift" "4.1.2" -github "RxSwiftCommunity/RxDataSources" "3.0.2" -github "SwiftyJSON/SwiftyJSON" "4.0.0" -github "kishikawakatsumi/KeychainAccess" "v3.1.1" -github "nighthawk/ASPolygonKit" "0.1.7" +github "OAuthSwift/OAuthSwift" "2.1.0" +github "ReactiveX/RxSwift" "5.0.1" +github "RxSwiftCommunity/RxDataSources" "4.0.1" +github "SwiftyJSON/SwiftyJSON" "5.0.0" +github "kishikawakatsumi/KeychainAccess" "v4.1.0" +github "nighthawk/ASPolygonKit" "0.2.1" github "nighthawk/ASPolylineView" "v1.0.3" -github "onevcat/Kingfisher" "4.7.0" +github "onevcat/Kingfisher" "5.12.0" github "skedgo/KVNProgress" "2.3.2" diff --git a/Tests/UI/TKSectionedAlertsTest.swift b/Tests/UI/TKSectionedAlertsTest.swift index db2100253..dc8cdab61 100644 --- a/Tests/UI/TKSectionedAlertsTest.swift +++ b/Tests/UI/TKSectionedAlertsTest.swift @@ -11,7 +11,6 @@ import XCTest @testable import TripKit @testable import TripKitUI -@available(iOS 10.0, *) class TKSectionedAlertsTest: XCTestCase { var response: TKBuzzInfoProvider.AlertsTransitResponse! @@ -25,9 +24,13 @@ class TKSectionedAlertsTest: XCTestCase { func testParsingAlerts() throws { XCTAssertNotNil(response) + + let routeIDs = response.alerts.reduce(into: Set()) { acc, mapping in + mapping.routes?.forEach { acc.insert($0.id) } + } + XCTAssertEqual(routeIDs.count, 158) } - @available(iOS 10.0, *) func testGroupingAlerts() throws { XCTAssertNotNil(response) diff --git a/Tests/restoration/TKLocationRestorationTest.swift b/Tests/restoration/TKLocationRestorationTest.swift index a75d81a30..bdb874b2a 100644 --- a/Tests/restoration/TKLocationRestorationTest.swift +++ b/Tests/restoration/TKLocationRestorationTest.swift @@ -12,8 +12,6 @@ import CoreLocation @testable import TripKit - -@available(iOS 10.0, *) class TKLocationRestorationTest: XCTestCase { func testRestoringNamedCoordinate() { diff --git a/TripKit.podspec b/TripKit.podspec index a5a5ee3b2..9d516b88a 100644 --- a/TripKit.podspec +++ b/TripKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TripKit" - s.version = "3.1.1" + s.version = "3.2.0" s.summary = "SkedGo's TripKit" s.homepage = "https://github.com/skedgo/tripkit-ios" s.license = 'Apache License, Version 2.0' @@ -11,16 +11,16 @@ Pod::Spec.new do |s| # s.source = { path: "." } # s.source = { git: "." } s.source = { git: "https://github.com/skedgo/tripkit-ios.git", tag: "v#{s.version}" } - s.swift_version = '4.0' - s.ios.deployment_target = '8.0' + s.swift_version = '5.0' + s.ios.deployment_target = '10.3' s.osx.deployment_target = '10.12' s.requires_arc = true s.prefix_header_file = "prefix.pch" s.dependency 'ASPolygonKit' - s.dependency 'RxSwift', '~> 4.0.0' - s.dependency 'RxCocoa', '~> 4.0.0' + s.dependency 'RxSwift', '~> 5.0.0' + s.dependency 'RxCocoa', '~> 5.0.0' s.source_files = [ "TripKit/TripKit.h", diff --git a/TripKit.xcodeproj/project.pbxproj b/TripKit.xcodeproj/project.pbxproj index 867664545..e025ba0ef 100644 --- a/TripKit.xcodeproj/project.pbxproj +++ b/TripKit.xcodeproj/project.pbxproj @@ -341,29 +341,6 @@ 3AA03E781F0BC9DB00C6B337 /* SGSearchDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AA03E561F0BC9DB00C6B337 /* SGSearchDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3AA39AC51F7A35B60066CC94 /* Codable+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA39AC41F7A35B60066CC94 /* Codable+Helpers.swift */; }; 3AA39ACF1F7A63BB0066CC94 /* MapKit+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA39ACE1F7A63BA0066CC94 /* MapKit+Extensions.swift */; }; - 3AA3CE60202CD22F00E54859 /* ASPolygonKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */; }; - 3AA3CE61202CD22F00E54859 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */; }; - 3AA3CE62202CD22F00E54859 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */; }; - 3AA3CE66202CD24100E54859 /* ASPolygonKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE63202CD24100E54859 /* ASPolygonKit.framework */; }; - 3AA3CE67202CD24100E54859 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE64202CD24100E54859 /* RxSwift.framework */; }; - 3AA3CE68202CD24100E54859 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE65202CD24100E54859 /* RxCocoa.framework */; }; - 3AA3CE69202CD25700E54859 /* ASPolygonKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */; }; - 3AA3CE6A202CD25700E54859 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */; }; - 3AA3CE6B202CD25700E54859 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */; }; - 3AA3CE6E202CD25700E54859 /* ASPolylineView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE6C202CD25700E54859 /* ASPolylineView.framework */; }; - 3AA3CE6F202CD25700E54859 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE6D202CD25700E54859 /* Kingfisher.framework */; }; - 3AA3CE70202CD26800E54859 /* ASPolygonKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */; }; - 3AA3CE71202CD26800E54859 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */; }; - 3AA3CE72202CD26800E54859 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */; }; - 3AA3CE73202CD28500E54859 /* ASPolygonKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */; }; - 3AA3CE74202CD28500E54859 /* ASPolylineView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE6C202CD25700E54859 /* ASPolylineView.framework */; }; - 3AA3CE75202CD28500E54859 /* Kingfisher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE6D202CD25700E54859 /* Kingfisher.framework */; }; - 3AA3CE76202CD28500E54859 /* RxCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */; }; - 3AA3CE77202CD28500E54859 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */; }; - 3AA3CE7C202CD28600E54859 /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE78202CD28600E54859 /* SwiftyJSON.framework */; }; - 3AA3CE7D202CD28600E54859 /* KVNProgress.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE79202CD28600E54859 /* KVNProgress.framework */; }; - 3AA3CE7E202CD28600E54859 /* KeychainAccess.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE7A202CD28600E54859 /* KeychainAccess.framework */; }; - 3AA3CE7F202CD28600E54859 /* OAuthSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AA3CE7B202CD28600E54859 /* OAuthSwift.framework */; }; 3AA3CEB0202CD4D100E54859 /* TKShareHelperTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA3CE86202CD4D100E54859 /* TKShareHelperTest.swift */; }; 3AA3CEB1202CD4D100E54859 /* TKLocationRestorationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA3CE88202CD4D100E54859 /* TKLocationRestorationTest.swift */; }; 3AA3CEB2202CD4D100E54859 /* TKGeoJSONTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AA3CE8A202CD4D100E54859 /* TKGeoJSONTest.swift */; }; @@ -833,12 +810,8 @@ 3AFFAE081F06BA1500147990 /* Trip+Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFFAE071F06BA1500147990 /* Trip+Shareable.swift */; }; 3AFFAE0A1F06BA3700147990 /* TripRequest+Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFFAE091F06BA3700147990 /* TripRequest+Shareable.swift */; }; 3AFFAE0C1F06BCF200147990 /* Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFFAE0B1F06BCF200147990 /* Service.swift */; }; - D31F511B2068BE4F00FB4CE1 /* RxDataSources.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D31F511A2068BE4F00FB4CE1 /* RxDataSources.framework */; }; - D31F51252068C27200FB4CE1 /* Differentiator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D31F51242068C27200FB4CE1 /* Differentiator.framework */; }; D3211335206BBAF300E5D929 /* TKLoadingAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3211334206BBAF300E5D929 /* TKLoadingAlertView.swift */; }; D3211337206BBB0600E5D929 /* TKLoadingAlertView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3211336206BBB0600E5D929 /* TKLoadingAlertView.xib */; }; - D3348267205BE2B000CA5917 /* RxDataSources.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3348266205BE2B000CA5917 /* RxDataSources.framework */; }; - D3348268205C4C4B00CA5917 /* RxDataSources.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3348266205BE2B000CA5917 /* RxDataSources.framework */; }; D337467E208D5D980045B0C3 /* UserAPIModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D337467D208D5D980045B0C3 /* UserAPIModel.swift */; }; D337467F208D5DA90045B0C3 /* UserAPIModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D337467D208D5D980045B0C3 /* UserAPIModel.swift */; }; D38F2D341E5046DD003D1CE2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D38F2D361E5046DD003D1CE2 /* InfoPlist.strings */; }; @@ -982,22 +955,14 @@ 3A6DAED4204040B2009282FE /* Loc+TripKitUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Loc+TripKitUI.swift"; sourceTree = ""; }; 3A6DAED72040985A009282FE /* regionInfo-Nuremberg.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "regionInfo-Nuremberg.json"; sourceTree = ""; }; 3A6DAED82040985B009282FE /* regionInfo-Vancouver.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "regionInfo-Vancouver.json"; sourceTree = ""; }; - 3A6DF05E202C88E90084CB2C /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; }; - 3A6DF05F202C88E90084CB2C /* ASPolygonKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolygonKit.framework; path = Carthage/Build/iOS/ASPolygonKit.framework; sourceTree = ""; }; - 3A6DF062202C89180084CB2C /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; }; 3A6DF067202C8C340084CB2C /* TripKitBookings.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = TripKitBookings.podspec; sourceTree = ""; }; 3A6DF068202C8C340084CB2C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 3A6DF069202C8C340084CB2C /* TripKitUI.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = TripKitUI.podspec; sourceTree = ""; }; 3A6DF06A202C8C340084CB2C /* TripKit.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = TripKit.podspec; sourceTree = ""; }; 3A6DF070202C8C6E0084CB2C /* TripKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TripKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3A6DF078202C8C990084CB2C /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/Mac/RxCocoa.framework; sourceTree = ""; }; - 3A6DF079202C8C990084CB2C /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/Mac/RxSwift.framework; sourceTree = ""; }; - 3A6DF07A202C8C990084CB2C /* ASPolygonKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolygonKit.framework; path = Carthage/Build/Mac/ASPolygonKit.framework; sourceTree = ""; }; 3A6DF084202C8DA30084CB2C /* TripKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TripKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3A6DF086202C8DA30084CB2C /* TripKitUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TripKitUI.h; sourceTree = ""; }; 3A6DF087202C8DA30084CB2C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3A6DF090202C8E280084CB2C /* ASPolylineView.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolylineView.framework; path = Carthage/Build/iOS/ASPolylineView.framework; sourceTree = ""; }; - 3A6DF091202C8E280084CB2C /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = ""; }; 3A6DF097202C8EB80084CB2C /* SGTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGTableCell.h; sourceTree = ""; }; 3A6DF098202C8EB80084CB2C /* SGTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SGTableViewCell.m; sourceTree = ""; }; 3A6DF099202C8EB80084CB2C /* SGCountdownCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SGCountdownCell.h; sourceTree = ""; }; @@ -1230,10 +1195,6 @@ 3A6DF23E202C9AA00084CB2C /* UIViewController+modalController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+modalController.h"; sourceTree = ""; }; 3A6DF23F202C9AA00084CB2C /* UIView+Keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Keyboard.h"; sourceTree = ""; }; 3A6DF240202C9AA00084CB2C /* UIView+FindFirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+FindFirstResponder.h"; sourceTree = ""; }; - 3A6DF2E9202C9B210084CB2C /* OAuthSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OAuthSwift.framework; path = Carthage/Build/iOS/OAuthSwift.framework; sourceTree = ""; }; - 3A6DF2EA202C9B210084CB2C /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = Carthage/Build/iOS/SwiftyJSON.framework; sourceTree = ""; }; - 3A6DF2EB202C9B210084CB2C /* KeychainAccess.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeychainAccess.framework; path = Carthage/Build/iOS/KeychainAccess.framework; sourceTree = ""; }; - 3A6DF2F2202C9EA90084CB2C /* KVNProgress.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KVNProgress.framework; path = Carthage/Build/iOS/KVNProgress.framework; sourceTree = ""; }; 3A787EC31D38F646009F9A18 /* TKJSONCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TKJSONCache.swift; sourceTree = ""; }; 3A7E61362089E5AD0008AAE4 /* locationInfo-carRental-days.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "locationInfo-carRental-days.json"; sourceTree = ""; }; 3A7E6138208A08BB0008AAE4 /* SGCalendarManager+Autocompleting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SGCalendarManager+Autocompleting.swift"; sourceTree = ""; }; @@ -1287,18 +1248,6 @@ 3AA39AC41F7A35B60066CC94 /* Codable+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Codable+Helpers.swift"; sourceTree = ""; }; 3AA39ACE1F7A63BA0066CC94 /* MapKit+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MapKit+Extensions.swift"; sourceTree = ""; }; 3AA3CC8B202CABE900E54859 /* TripKitInterApp.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = TripKitInterApp.podspec; sourceTree = ""; }; - 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolygonKit.framework; path = Carthage/Build/iOS/ASPolygonKit.framework; sourceTree = ""; }; - 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/iOS/RxCocoa.framework; sourceTree = ""; }; - 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/iOS/RxSwift.framework; sourceTree = ""; }; - 3AA3CE63202CD24100E54859 /* ASPolygonKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolygonKit.framework; path = Carthage/Build/Mac/ASPolygonKit.framework; sourceTree = ""; }; - 3AA3CE64202CD24100E54859 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxSwift.framework; path = Carthage/Build/Mac/RxSwift.framework; sourceTree = ""; }; - 3AA3CE65202CD24100E54859 /* RxCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxCocoa.framework; path = Carthage/Build/Mac/RxCocoa.framework; sourceTree = ""; }; - 3AA3CE6C202CD25700E54859 /* ASPolylineView.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ASPolylineView.framework; path = Carthage/Build/iOS/ASPolylineView.framework; sourceTree = ""; }; - 3AA3CE6D202CD25700E54859 /* Kingfisher.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kingfisher.framework; path = Carthage/Build/iOS/Kingfisher.framework; sourceTree = ""; }; - 3AA3CE78202CD28600E54859 /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = Carthage/Build/iOS/SwiftyJSON.framework; sourceTree = ""; }; - 3AA3CE79202CD28600E54859 /* KVNProgress.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KVNProgress.framework; path = Carthage/Build/iOS/KVNProgress.framework; sourceTree = ""; }; - 3AA3CE7A202CD28600E54859 /* KeychainAccess.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeychainAccess.framework; path = Carthage/Build/iOS/KeychainAccess.framework; sourceTree = ""; }; - 3AA3CE7B202CD28600E54859 /* OAuthSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OAuthSwift.framework; path = Carthage/Build/iOS/OAuthSwift.framework; sourceTree = ""; }; 3AA3CE80202CD2A700E54859 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; }; 3AA3CE84202CD4D100E54859 /* TKTTPifierTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TKTTPifierTest.swift; sourceTree = ""; }; 3AA3CE86202CD4D100E54859 /* TKShareHelperTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TKShareHelperTest.swift; sourceTree = ""; }; @@ -1554,11 +1503,8 @@ 3AFFAE071F06BA1500147990 /* Trip+Shareable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Trip+Shareable.swift"; sourceTree = ""; }; 3AFFAE091F06BA3700147990 /* TripRequest+Shareable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TripRequest+Shareable.swift"; sourceTree = ""; }; 3AFFAE0B1F06BCF200147990 /* Service.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Service.swift; sourceTree = ""; }; - D31F511A2068BE4F00FB4CE1 /* RxDataSources.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxDataSources.framework; path = Carthage/Build/iOS/RxDataSources.framework; sourceTree = ""; }; - D31F51242068C27200FB4CE1 /* Differentiator.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Differentiator.framework; path = Carthage/Build/iOS/Differentiator.framework; sourceTree = ""; }; D3211334206BBAF300E5D929 /* TKLoadingAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TKLoadingAlertView.swift; sourceTree = ""; }; D3211336206BBB0600E5D929 /* TKLoadingAlertView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TKLoadingAlertView.xib; sourceTree = ""; }; - D3348266205BE2B000CA5917 /* RxDataSources.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RxDataSources.framework; path = ../../Carthage/Build/iOS/RxDataSources.framework; sourceTree = ""; }; D337467D208D5D980045B0C3 /* UserAPIModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPIModel.swift; sourceTree = ""; }; D38F2D351E5046DD003D1CE2 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; }; D39B7BAE20622C2C00988D8A /* TKRouteCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TKRouteCell.swift; sourceTree = ""; }; @@ -1581,9 +1527,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3AA3CE66202CD24100E54859 /* ASPolygonKit.framework in Frameworks */, - 3AA3CE67202CD24100E54859 /* RxSwift.framework in Frameworks */, - 3AA3CE68202CD24100E54859 /* RxCocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1591,12 +1534,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D3348267205BE2B000CA5917 /* RxDataSources.framework in Frameworks */, - 3AA3CE69202CD25700E54859 /* ASPolygonKit.framework in Frameworks */, - 3AA3CE6E202CD25700E54859 /* ASPolylineView.framework in Frameworks */, - 3AA3CE6F202CD25700E54859 /* Kingfisher.framework in Frameworks */, - 3AA3CE6B202CD25700E54859 /* RxSwift.framework in Frameworks */, - 3AA3CE6A202CD25700E54859 /* RxCocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1604,9 +1541,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3AA3CE70202CD26800E54859 /* ASPolygonKit.framework in Frameworks */, - 3AA3CE72202CD26800E54859 /* RxSwift.framework in Frameworks */, - 3AA3CE71202CD26800E54859 /* RxCocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1614,16 +1548,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3AA3CE73202CD28500E54859 /* ASPolygonKit.framework in Frameworks */, - 3AA3CE74202CD28500E54859 /* ASPolylineView.framework in Frameworks */, - 3AA3CE7E202CD28600E54859 /* KeychainAccess.framework in Frameworks */, - 3AA3CE75202CD28500E54859 /* Kingfisher.framework in Frameworks */, - 3AA3CE7D202CD28600E54859 /* KVNProgress.framework in Frameworks */, - 3AA3CE7F202CD28600E54859 /* OAuthSwift.framework in Frameworks */, - 3AA3CE77202CD28500E54859 /* RxSwift.framework in Frameworks */, - 3AA3CE76202CD28500E54859 /* RxCocoa.framework in Frameworks */, - D3348268205C4C4B00CA5917 /* RxDataSources.framework in Frameworks */, - 3AA3CE7C202CD28600E54859 /* SwiftyJSON.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1631,9 +1555,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3AA3CE60202CD22F00E54859 /* ASPolygonKit.framework in Frameworks */, - 3AA3CE62202CD22F00E54859 /* RxSwift.framework in Frameworks */, - 3AA3CE61202CD22F00E54859 /* RxCocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1645,8 +1566,6 @@ 3AB6C62B1D1CD0060089F687 /* TripKit.framework in Frameworks */, 3AE194E5202DE32E0007B49B /* RxBlocking.framework in Frameworks */, 3AE194E6202DE32E0007B49B /* RxTest.framework in Frameworks */, - D31F51252068C27200FB4CE1 /* Differentiator.framework in Frameworks */, - D31F511B2068BE4F00FB4CE1 /* RxDataSources.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2833,35 +2752,8 @@ BF0D12F3CE39D82551585DB6 /* Frameworks */ = { isa = PBXGroup; children = ( - D31F51242068C27200FB4CE1 /* Differentiator.framework */, - D3348266205BE2B000CA5917 /* RxDataSources.framework */, - D31F511A2068BE4F00FB4CE1 /* RxDataSources.framework */, 3AE194E3202DE32D0007B49B /* RxBlocking.framework */, 3AE194E4202DE32E0007B49B /* RxTest.framework */, - 3AA3CE7A202CD28600E54859 /* KeychainAccess.framework */, - 3AA3CE79202CD28600E54859 /* KVNProgress.framework */, - 3AA3CE7B202CD28600E54859 /* OAuthSwift.framework */, - 3AA3CE78202CD28600E54859 /* SwiftyJSON.framework */, - 3AA3CE6C202CD25700E54859 /* ASPolylineView.framework */, - 3AA3CE6D202CD25700E54859 /* Kingfisher.framework */, - 3AA3CE5D202CD22F00E54859 /* ASPolygonKit.framework */, - 3AA3CE5E202CD22F00E54859 /* RxCocoa.framework */, - 3AA3CE65202CD24100E54859 /* RxCocoa.framework */, - 3AA3CE5F202CD22F00E54859 /* RxSwift.framework */, - 3AA3CE63202CD24100E54859 /* ASPolygonKit.framework */, - 3AA3CE64202CD24100E54859 /* RxSwift.framework */, - 3A6DF2F2202C9EA90084CB2C /* KVNProgress.framework */, - 3A6DF2EB202C9B210084CB2C /* KeychainAccess.framework */, - 3A6DF2E9202C9B210084CB2C /* OAuthSwift.framework */, - 3A6DF2EA202C9B210084CB2C /* SwiftyJSON.framework */, - 3A6DF090202C8E280084CB2C /* ASPolylineView.framework */, - 3A6DF091202C8E280084CB2C /* Kingfisher.framework */, - 3A6DF07A202C8C990084CB2C /* ASPolygonKit.framework */, - 3A6DF062202C89180084CB2C /* RxCocoa.framework */, - 3A6DF05F202C88E90084CB2C /* ASPolygonKit.framework */, - 3A6DF05E202C88E90084CB2C /* RxSwift.framework */, - 3A6DF078202C8C990084CB2C /* RxCocoa.framework */, - 3A6DF079202C8C990084CB2C /* RxSwift.framework */, ); name = Frameworks; sourceTree = ""; @@ -3280,24 +3172,27 @@ }; 3A6DF083202C8DA30084CB2C = { CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1130; ProvisioningStyle = Manual; }; 3A6DF166202C97F60084CB2C = { CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1130; ProvisioningStyle = Manual; }; 3A6DF185202C99D40084CB2C = { CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1130; ProvisioningStyle = Automatic; }; 3AB6C61F1D1CD0060089F687 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1130; }; 3AB6C6291D1CD0060089F687 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = JFT62W5LA3; - LastSwiftMigration = 0900; + LastSwiftMigration = 1130; ProvisioningStyle = Manual; }; }; @@ -3307,6 +3202,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, de, @@ -3459,6 +3355,7 @@ "$(SRCROOT)/Carthage/Build/iOS/SwiftyJSON.framework", "$(SRCROOT)/Carthage/Build/iOS/RxDataSources.framework", "$(SRCROOT)/Carthage/Build/iOS/Differentiator.framework", + "$(SRCROOT)/Carthage/Build/iOS/RxRelay.framework", ); name = "Copy Carthage Frameworks"; outputPaths = ( @@ -3475,10 +3372,11 @@ "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftyJSON.framework", "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxDataSources.framework", "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Differentiator.framework", + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/RxRelay.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/usr/local/bin/carthage copy-frameworks"; + shellScript = "/usr/local/bin/carthage copy-frameworks\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -4289,7 +4187,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitUI-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4298,7 +4195,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.buzzhives.TripKitUI-iOS"; PRODUCT_NAME = TripKitUI; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -4324,7 +4221,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitUI-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4335,7 +4231,7 @@ SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -4359,7 +4255,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitInterApp-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4368,7 +4263,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.buzzhives.TripKitInterApp-iOS"; PRODUCT_NAME = TripKitInterApp; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -4392,7 +4287,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitInterApp-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4403,7 +4297,7 @@ SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -4427,7 +4321,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitBookings-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4436,7 +4329,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.buzzhives.TripKitBookings-iOS"; PRODUCT_NAME = TripKitBookings; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -4460,7 +4353,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = "TripKitBookings-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4471,7 +4363,7 @@ SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -4525,7 +4417,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = TripKit; @@ -4582,7 +4474,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_NAME = TripKit; SDKROOT = iphoneos; @@ -4611,7 +4503,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = TripKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4619,7 +4510,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = "com.buzzhives.TripKit-iOS"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -4640,7 +4531,6 @@ GCC_PREFIX_HEADER = "TripKit/TripKit-Prefix.pch"; INFOPLIST_FILE = TripKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4650,7 +4540,7 @@ SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -4678,7 +4568,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -4707,7 +4597,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/TripKit/AddOns/Bookings/AccountKit/Controller/AKAccountViewController.swift b/TripKit/AddOns/Bookings/AccountKit/Controller/AKAccountViewController.swift index 31008f859..988bfb08a 100644 --- a/TripKit/AddOns/Bookings/AccountKit/Controller/AKAccountViewController.swift +++ b/TripKit/AddOns/Bookings/AccountKit/Controller/AKAccountViewController.swift @@ -11,7 +11,7 @@ import Foundation public extension AKAccountViewController { @objc - override public func configureLabelCell(_ labelCell: AKLabelCell, withItem item: AMKItem) { + override func configureLabelCell(_ labelCell: AKLabelCell, withItem item: AMKItem) { super.configureLabelCell(labelCell, withItem: item) if item.actionType == .destructive { diff --git a/TripKit/AddOns/Bookings/BookingKit/Model/OAuth/OAuthClient.swift b/TripKit/AddOns/Bookings/BookingKit/Model/OAuth/OAuthClient.swift index 8c2181904..d165cc070 100644 --- a/TripKit/AddOns/Bookings/BookingKit/Model/OAuth/OAuthClient.swift +++ b/TripKit/AddOns/Bookings/BookingKit/Model/OAuth/OAuthClient.swift @@ -344,16 +344,17 @@ extension Reactive where Base : OAuth2Swift { self.base.authorize( withCallbackURL: input.callbackURL, scope: input.scope, - state: input.state, - success: { _, _, parameters in - let data = RawOAuthData(parameters) - observer.onNext( OAuthResult.with(form: input.form, oauth: data) ) - observer.onCompleted() - }, - failure: { error in - observer.onNext( .error(error) ) - observer.onCompleted() - }) + state: input.state) { result in + switch result { + case .success(let success): + let data = RawOAuthData(success.parameters) + observer.onNext( OAuthResult.with(form: input.form, oauth: data) ) + observer.onCompleted() + case .failure(let error): + observer.onNext( .error(error) ) + observer.onCompleted() + } + } if let url = handling { OAuthSwift.handle(url: url) diff --git a/TripKit/AddOns/Bookings/SSO/TKUberSSO.swift b/TripKit/AddOns/Bookings/SSO/TKUberSSO.swift index c75e23b96..1e78a5310 100644 --- a/TripKit/AddOns/Bookings/SSO/TKUberSSO.swift +++ b/TripKit/AddOns/Bookings/SSO/TKUberSSO.swift @@ -73,11 +73,7 @@ public enum TKUberSSO : SSOCompatible { preconditionFailure("You shouldn't call `start` if `canHandle(mode:)` returns false") } - if #available(iOS 10.0, *) { - UIApplication.shared.open(url, options: [:], completionHandler: nil) - } else { - UIApplication.shared.openURL(url) - } + UIApplication.shared.open(url) } public static func handle(_ url: URL) throws -> OAuthData? { @@ -129,3 +125,8 @@ public enum TKUberSSO : SSOCompatible { } } + +// Helper function inserted by Swift 4.2 migrator. +fileprivate func convertToUIApplicationOpenExternalURLOptionsKeyDictionary(_ input: [String: Any]) -> [UIApplication.OpenExternalURLOptionsKey: Any] { + return Dictionary(uniqueKeysWithValues: input.map { key, value in (UIApplication.OpenExternalURLOptionsKey(rawValue: key), value)}) +} diff --git a/TripKit/AddOns/Bookings/TKTripBookingCoordinator.swift b/TripKit/AddOns/Bookings/TKTripBookingCoordinator.swift index bf593831d..e8571c7ad 100644 --- a/TripKit/AddOns/Bookings/TKTripBookingCoordinator.swift +++ b/TripKit/AddOns/Bookings/TKTripBookingCoordinator.swift @@ -122,7 +122,7 @@ public class TripBookingCoordinator { fileprivate var disposeBag = DisposeBag() fileprivate func machine(for segment: TKSegment) -> Variable? { - guard let index = trip?.segments().index(of: segment) else { return nil } + guard let index = trip?.segments().firstIndex(of: segment) else { return nil } return stateMachines?[index] } diff --git a/TripKit/AddOns/InterApp/TKInterAppCommunicator.m b/TripKit/AddOns/InterApp/TKInterAppCommunicator.m index 3186bbf4a..c68ecdc7f 100644 --- a/TripKit/AddOns/InterApp/TKInterAppCommunicator.m +++ b/TripKit/AddOns/InterApp/TKInterAppCommunicator.m @@ -170,7 +170,7 @@ + (void)performExternalAction:(NSString *)action } else if ([action hasPrefix:@"tel:"]) { if ([self canCall]) { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[action stringByReplacingOccurrencesOfString:@" " withString:@"-"]]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[action stringByReplacingOccurrencesOfString:@" " withString:@"-"]] options:@{} completionHandler:nil]; } } else if ([action hasPrefix:@"sms:"]) { @@ -183,7 +183,7 @@ + (void)performExternalAction:(NSString *)action if (openURLHandler) { openURLHandler(url, title); } else { - [[UIApplication sharedApplication] openURL:url]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } } else { @@ -294,10 +294,10 @@ + (void)launchGoCatchForSegment:(TKSegment *)segment if ([self deviceHasGoCatch]) { // open app directly - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else { // copy URL to paste board - UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:UIPasteboardNameFind + UIPasteboard *pasteboard = [UIPasteboard pasteboardWithName:UIPasteboardNameGeneral create:NO]; [pasteboard setURL:[NSURL URLWithString:urlString]]; @@ -306,7 +306,7 @@ + (void)launchGoCatchForSegment:(TKSegment *)segment openStoreHandler(@(TKInterAppCommunicatorITunesAppIDGoCatch)); } else { NSString *URLString = [NSString stringWithFormat:@"https://itunes.apple.com/au/app/gocatch/id%d?mt=8", TKInterAppCommunicatorITunesAppIDGoCatch]; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString] options:@{} completionHandler:nil]; } } @@ -321,13 +321,13 @@ + (void)launchIngogoForSegment:(TKSegment *)segment if ([self deviceHasIngogo]) { // just launch it NSString *urlString = @"ingogo://"; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else { if (openStoreHandler) { openStoreHandler(@(TKInterAppCommunicatorITunesAppIDIngogo)); } else { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.ingogo.mobi"]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.ingogo.mobi"] options:@{} completionHandler:nil]; } } } @@ -369,7 +369,7 @@ + (void)launchUberForSegment:(TKSegment *)segment } } - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else { // https://developer.uber.com/v1/deep-linking/#mobile-web @@ -405,7 +405,7 @@ + (void)launchUberForSegment:(TKSegment *)segment if (openURLHandler) { openURLHandler(url, title); } else { - [[UIApplication sharedApplication] openURL:url]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } } } @@ -429,14 +429,14 @@ + (void)launchOlaForSegment:(TKSegment *)segment [urlString appendFormat:@"&utm_source=%@", token]; } - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else if (openStoreHandler) { openStoreHandler(@(TKInterAppCommunicatorITunesAppIDOla)); } else { NSString *URLString = [NSString stringWithFormat:@"https://itunes.apple.com/in/app/olacabs/id%d?mt=8", TKInterAppCommunicatorITunesAppIDOla]; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString] options:@{} completionHandler:nil]; } } @@ -474,14 +474,14 @@ + (void)launchLyftForSegment:(TKSegment *)segment [urlString appendFormat:@"&partner=%@", partner]; } - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString] options:@{} completionHandler:nil]; } else if (openStoreHandler) { openStoreHandler(@(TKInterAppCommunicatorITunesAppIDLyft)); } else { NSString *URLString = [NSString stringWithFormat:@"https://itunes.apple.com/us/app/lyft/id%d?mt=8", TKInterAppCommunicatorITunesAppIDLyft]; - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URLString] options:@{} completionHandler:nil]; } } @@ -537,7 +537,7 @@ + (void)launchFlitWaysForSegment:(TKSegment *)segment if (openURLHandler) { openURLHandler(url, title); } else { - [[UIApplication sharedApplication] openURL:url]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } }]; }]; @@ -546,7 +546,7 @@ + (void)launchFlitWaysForSegment:(TKSegment *)segment if (openURLHandler) { openURLHandler(url, title); } else { - [[UIApplication sharedApplication] openURL:url]; + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; } } } diff --git a/TripKit/AddOns/InterApp/TKInterAppCommunicator.swift b/TripKit/AddOns/InterApp/TKInterAppCommunicator.swift index 0f2d653cc..2773733b1 100644 --- a/TripKit/AddOns/InterApp/TKInterAppCommunicator.swift +++ b/TripKit/AddOns/InterApp/TKInterAppCommunicator.swift @@ -232,7 +232,7 @@ extension TKInterAppCommunicator { } if let requestURL = URL(string: request) { - UIApplication.shared.openURL(requestURL) + UIApplication.shared.open(requestURL) } } @@ -240,7 +240,7 @@ extension TKInterAppCommunicator { // https://www.waze.com/about/dev let request = String(format: "waze://?ll=%f,%f&navigate=yes", destination.coordinate.latitude, destination.coordinate.longitude) if let url = URL(string: request) { - UIApplication.shared.openURL(url) + UIApplication.shared.open(url) } } diff --git a/TripKit/AddOns/Share/TKShareHelper+Parsing.swift b/TripKit/AddOns/Share/TKShareHelper+Parsing.swift index b484793fe..408543830 100644 --- a/TripKit/AddOns/Share/TKShareHelper+Parsing.swift +++ b/TripKit/AddOns/Share/TKShareHelper+Parsing.swift @@ -14,13 +14,13 @@ import RxSwift public extension TKShareHelper { - public enum ExtractionError: String, Error { + enum ExtractionError: String, Error { case invalidURL case invalidCoordinate case missingNecessaryInformation } - public struct QueryDetails { + struct QueryDetails { public enum Time { case leaveASAP case leaveAfter(Date) @@ -36,7 +36,7 @@ public extension TKShareHelper { /// Extracts the query details from a TripGo API-compatible deep link /// - parameter url: TripGo API-compatible deep link /// - parameter geocoder: Geocoder used for filling in missing information - public static func queryDetails(for url: URL, using geocoder: SGGeocoder) -> Observable { + static func queryDetails(for url: URL, using geocoder: SGGeocoder) -> Observable { guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: false), @@ -152,7 +152,7 @@ extension TKShareHelper.QueryDetails { public extension TKShareHelper { - public static func meetingDetails(for url: URL, using geocoder: SGGeocoder) -> Observable { + static func meetingDetails(for url: URL, using geocoder: SGGeocoder) -> Observable { guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: false), let items = components.queryItems @@ -185,13 +185,13 @@ public extension TKShareHelper { public extension TKShareHelper { - public struct StopDetails { + struct StopDetails { public let region: String public let code: String public let filter: String? } - public static func stopDetails(for url: URL) -> Observable { + static func stopDetails(for url: URL) -> Observable { let pathComponents = url.path.components(separatedBy: "/") guard pathComponents.count >= 4 else { return Observable.empty() } @@ -219,13 +219,13 @@ extension TKShareHelper.StopDetails { public extension TKShareHelper { - public struct ServiceDetails { + struct ServiceDetails { public let region: String public let stopCode: String public let serviceID: String } - public static func serviceDetails(for url: URL) -> Observable { + static func serviceDetails(for url: URL) -> Observable { let pathComponents = url.path.components(separatedBy: "/") if pathComponents.count >= 5 { let region = pathComponents[2] @@ -277,7 +277,7 @@ extension MKAnnotation { } return Observable.create() { observer in - SGBaseGeocoder.geocode(geocodable, using: geocoder, near: MKMapRectWorld) { (result: SGBaseGeocoder.Result) -> Void in + SGBaseGeocoder.geocode(geocodable, using: geocoder, near: .world) { (result: SGBaseGeocoder.Result) -> Void in switch result { case .success: observer.onNext(self) diff --git a/TripKit/Classes/SGKImage+TripKit.swift b/TripKit/Classes/SGKImage+TripKit.swift index ac4b74f17..14e718005 100644 --- a/TripKit/Classes/SGKImage+TripKit.swift +++ b/TripKit/Classes/SGKImage+TripKit.swift @@ -22,7 +22,7 @@ extension SGKImage { #if os(iOS) || os(tvOS) return SGKImage(named: name, in: TKTripKit.bundle(), compatibleWith: nil)! #elseif os(OSX) - return bundle.image(forResource: NSImage.Name(rawValue: name))! + return bundle.image(forResource: name)! #endif } } diff --git a/TripKit/Classes/core/CoreKit+Rx/SGLocationManager+rx.swift b/TripKit/Classes/core/CoreKit+Rx/SGLocationManager+rx.swift index e7d929708..62dcc5400 100644 --- a/TripKit/Classes/core/CoreKit+Rx/SGLocationManager+rx.swift +++ b/TripKit/Classes/core/CoreKit+Rx/SGLocationManager+rx.swift @@ -21,7 +21,7 @@ public extension Reactive where Base : SGLocationManager { /// /// - Parameter seconds: Maximum time to give GPS /// - Returns: Observable of user's current location; can error out - public func fetchCurrentLocation(within seconds: TimeInterval) -> Observable { + func fetchCurrentLocation(within seconds: TimeInterval) -> Observable { guard base.isAuthorized() else { return tryAuthorization().flatMap { authorized -> Observable in if authorized { @@ -52,7 +52,7 @@ public extension Reactive where Base : SGLocationManager { /// not granted to the device's location services. /// /// - Returns: Observable of user's current location; can error out - public var currentLocation: Observable { + var currentLocation: Observable { return Observable.create { subscriber in let date = Date() @@ -85,7 +85,7 @@ public extension Reactive where Base : SGLocationManager { /// - Note: Internally, each subscription creates a new /// observable, and a new location manager, so you're /// encouraged to share a single subscription. - public var deviceHeading: Observable { + var deviceHeading: Observable { return Observable.create { subscriber in @@ -109,7 +109,7 @@ public extension Reactive where Base : SGLocationManager { #endif - public func tryAuthorization() -> Observable { + func tryAuthorization() -> Observable { if !base.featureIsAvailable() { return Observable.error(SGLocationManager.LocalizationError.featureNotAvailable) @@ -131,6 +131,9 @@ public extension Reactive where Base : SGLocationManager { return Disposables.create() } + @unknown default: + assertionFailure("Unexpected new case. Treating as not authorized.") + return .just(false) } } diff --git a/TripKit/Classes/core/Permissions/SGAddressBookManager.h b/TripKit/Classes/core/Permissions/SGAddressBookManager.h index cd685d5b5..1542c3faa 100644 --- a/TripKit/Classes/core/Permissions/SGAddressBookManager.h +++ b/TripKit/Classes/core/Permissions/SGAddressBookManager.h @@ -29,7 +29,7 @@ typedef enum { typedef void (^SGAddressBookManagerCompletionBlock)(NSString *string, NSArray *results); -//NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "Use SGContactsManager instead") +NS_CLASS_DEPRECATED_IOS(2_0, 9_0, "Use SGContactsManager from TripKit 4 instead") @interface SGAddressBookManager : SGPermissionManager @property (nonatomic, strong) id helperGeocoder; diff --git a/TripKit/Classes/core/Permissions/SGAddressBookManager.m b/TripKit/Classes/core/Permissions/SGAddressBookManager.m index 5ee605e48..45b0e3e1a 100644 --- a/TripKit/Classes/core/Permissions/SGAddressBookManager.m +++ b/TripKit/Classes/core/Permissions/SGAddressBookManager.m @@ -141,7 +141,7 @@ - (BOOL)authorizationRestrictionsApply - (SGAuthorizationStatus)authorizationStatus { if ([self authorizationRestrictionsApply]) { - int status = ABAddressBookGetAuthorizationStatus(); + ABAuthorizationStatus status = ABAddressBookGetAuthorizationStatus(); switch (status) { case kABAuthorizationStatusAuthorized: return SGAuthorizationStatusAuthorized; diff --git a/TripKit/Classes/core/Permissions/SGCalendarManager+Autocompleting.swift b/TripKit/Classes/core/Permissions/SGCalendarManager+Autocompleting.swift index e27ff2ab4..09b28eea1 100644 --- a/TripKit/Classes/core/Permissions/SGCalendarManager+Autocompleting.swift +++ b/TripKit/Classes/core/Permissions/SGCalendarManager+Autocompleting.swift @@ -58,7 +58,7 @@ extension SGKNamedCoordinate { /// - Parameter event: Event @objc(initWithEvent:) public convenience init?(_ event: EKEvent) { - guard #available(iOS 9.0, *), let structured = event.structuredLocation, let location = structured.geoLocation else { return nil } + guard let structured = event.structuredLocation, let location = structured.geoLocation else { return nil } let address: String? if let fromStructure = structured.value(forKey: "address") as? String { diff --git a/TripKit/Classes/core/Permissions/SGLocationManager.swift b/TripKit/Classes/core/Permissions/SGLocationManager.swift index c3551952e..1fba209a5 100644 --- a/TripKit/Classes/core/Permissions/SGLocationManager.swift +++ b/TripKit/Classes/core/Permissions/SGLocationManager.swift @@ -10,16 +10,16 @@ import Foundation public extension SGLocationManager { - public enum LocalizationError: Error { + enum LocalizationError: Error { case featureNotAvailable case authorizationDenied } - public static let shared = SGLocationManager.__sharedInstance() + static let shared = SGLocationManager.__sharedInstance() - public var currentLocation: MKAnnotation { + var currentLocation: MKAnnotation { return __currentLocationPlaceholder() } @@ -52,6 +52,9 @@ extension SGLocationManager { case .denied: return .denied case .restricted: return .restricted case .notDetermined: return .notDetermined + @unknown default: + assertionFailure("Unexpected case, treating as not determined.") + return .notDetermined } } diff --git a/TripKit/Classes/core/RootKit/Categories/MapKit+Extensions.swift b/TripKit/Classes/core/RootKit/Categories/MapKit+Extensions.swift index 5a7aa86c8..7924fae48 100644 --- a/TripKit/Classes/core/RootKit/Categories/MapKit+Extensions.swift +++ b/TripKit/Classes/core/RootKit/Categories/MapKit+Extensions.swift @@ -50,20 +50,20 @@ extension MKCoordinateRegion { extension MKMapRect { public static func forCoordinateRegion(_ region: MKCoordinateRegion) -> MKMapRect { - let a = MKMapPointForCoordinate(region.topLeft) - let b = MKMapPointForCoordinate(region.bottomRight) + let a = MKMapPoint(region.topLeft) + let b = MKMapPoint(region.bottomRight) - return MKMapRectMake(min(a.x,b.x), min(a.y,b.y), abs(a.x-b.x), abs(a.y-b.y)) + return MKMapRect(x: min(a.x,b.x), y: min(a.y,b.y), width: abs(a.x-b.x), height: abs(a.y-b.y)) } } extension Array where Element: MKAnnotation { public var mapRect: MKMapRect { - return reduce(MKMapRectNull) { prior, annotation in - let point = MKMapPointForCoordinate(annotation.coordinate) + return reduce(.null) { prior, annotation in + let point = MKMapPoint(annotation.coordinate) let miniRect = MKMapRect(origin: point, size: MKMapSize(width: 1, height: 1)) - return MKMapRectUnion(prior, miniRect) + return prior.union(miniRect) } } diff --git a/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.h b/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.h index 59a3e507b..20e4b79a3 100644 --- a/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.h +++ b/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.h @@ -14,11 +14,11 @@ NS_ASSUME_NONNULL_BEGIN @interface SGKImage (Variations) -- (SGKImage *)imageWithTintColor:(SGKColor *)tintColor; +- (SGKImage *)tk_imageWithTintColor:(SGKColor *)tintColor; -- (SGKImage *)imageOnBackgroundImage:(SGKImage *)background; +- (SGKImage *)tk_imageOnBackgroundImage:(SGKImage *)background; -- (SGKImage *)monochromeImage; +- (SGKImage *)tk_monochromeImage; @end diff --git a/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.m b/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.m index 466be15fc..e13fcdd89 100644 --- a/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.m +++ b/TripKit/Classes/core/RootKit/Categories/UIImage+Variations.m @@ -15,7 +15,7 @@ @implementation UIImage (Variations) -- (UIImage *)imageWithTintColor:(UIColor *)tintColor +- (UIImage *)tk_imageWithTintColor:(UIColor *)tintColor { CGRect drawRect = CGRectMake(0, 0, self.size.width, self.size.height); @@ -40,7 +40,7 @@ - (UIImage *)imageWithTintColor:(UIColor *)tintColor return tintedImage; } -- (UIImage *)imageOnBackgroundImage:(UIImage *)background +- (UIImage *)tk_imageOnBackgroundImage:(UIImage *)background { CGRect drawRect = CGRectMake(0, 0, background.size.width, background.size.height); @@ -68,7 +68,7 @@ - (UIImage *)imageOnBackgroundImage:(UIImage *)background return combinedImage; } -- (UIImage *)monochromeImage +- (UIImage *)tk_monochromeImage { CIImage *inputImage = [[CIImage alloc] initWithImage:self]; CIFilter *monochrome = [CIFilter filterWithName:@"CIColorMonochrome"]; diff --git a/TripKit/Classes/core/RootKit/Model/SGLocationHelper.swift b/TripKit/Classes/core/RootKit/Model/SGLocationHelper.swift index e2b3405c8..8f0044538 100644 --- a/TripKit/Classes/core/RootKit/Model/SGLocationHelper.swift +++ b/TripKit/Classes/core/RootKit/Model/SGLocationHelper.swift @@ -22,23 +22,11 @@ extension SGLocationHelper { guard let dict = placemark.addressDictionary else { return nil } // TODO: iOS 11 does this better - let address: String - - if #available(iOS 9.0, macOS 10.11, *) { - address = postalAddress(forAddressDictionary: dict) - } else { - #if os(iOS) - address = ABCreateStringWithAddressDictionary(dict, true) - #else - return nil - #endif - } - + let address = postalAddress(forAddressDictionary: dict) let oneLine = address.replacingOccurrences(of: "\n", with: ", ") return oneLine } - @available(iOS 9.0, macOS 10.11, *) @objc(postalAddressForAddressDictionary:) public static func postalAddress(forAddressDictionary dict: [AnyHashable: Any]) -> String { diff --git a/TripKit/Classes/core/RootKit/SGKEnums.h b/TripKit/Classes/core/RootKit/SGKEnums.h index dc4deef64..1c9e30aba 100644 --- a/TripKit/Classes/core/RootKit/SGKEnums.h +++ b/TripKit/Classes/core/RootKit/SGKEnums.h @@ -16,7 +16,7 @@ typedef NS_ENUM(NSInteger, SGAppIds) { SGAppIdUnknown }; -typedef NS_ENUM(NSInteger, SGTimeType) { +typedef NS_CLOSED_ENUM(NSInteger, SGTimeType) { SGTimeTypeLeaveASAP = 0, SGTimeTypeLeaveAfter = 1, SGTimeTypeArriveBefore = 2, diff --git a/TripKit/Classes/core/RootKit/SGStyleManager.swift b/TripKit/Classes/core/RootKit/SGStyleManager.swift index ddbcfac8e..dc0845570 100644 --- a/TripKit/Classes/core/RootKit/SGStyleManager.swift +++ b/TripKit/Classes/core/RootKit/SGStyleManager.swift @@ -46,6 +46,8 @@ extension SGStyleManager { fullName = "icon-map-info-\(partName)" case .alert: fullName = "icon-alert-yellow-map" + @unknown default: + return nil } if let image = optionalImageNamed(fullName) { imageCache.setObject(image, forKey: key) diff --git a/TripKit/Classes/core/Search/SGAutocompletionDataSource.h b/TripKit/Classes/core/Search/SGAutocompletionDataSource.h index ac42eb725..534a3ad92 100644 --- a/TripKit/Classes/core/Search/SGAutocompletionDataSource.h +++ b/TripKit/Classes/core/Search/SGAutocompletionDataSource.h @@ -14,20 +14,20 @@ @class SGAutocompletionResult; @class SGAutocompletionDataSourceSwiftStorage; -typedef NS_ENUM(NSInteger, SGSearchSection) { +typedef NS_CLOSED_ENUM(NSInteger, SGSearchSection) { SGSearchSectionSticky, SGSearchSectionAutocompletion, SGSearchSectionMore, }; -typedef NS_ENUM(NSInteger, SGSearchSticky) { +typedef NS_CLOSED_ENUM(NSInteger, SGSearchSticky) { SGSearchStickyUnknown = 0, SGSearchStickyCurrentLocation, SGSearchStickyDroppedPin, SGSearchStickyNextEvent, }; -typedef NS_ENUM(NSInteger, SGSearchExtraRow) { +typedef NS_CLOSED_ENUM(NSInteger, SGSearchExtraRow) { SGSearchExtraRowSearchForMore = 0, SGSearchExtraRowProvider, }; diff --git a/TripKit/Classes/core/Search/SGAutocompletionDataSource.swift b/TripKit/Classes/core/Search/SGAutocompletionDataSource.swift index 974e716b0..ae9a7970a 100644 --- a/TripKit/Classes/core/Search/SGAutocompletionDataSource.swift +++ b/TripKit/Classes/core/Search/SGAutocompletionDataSource.swift @@ -21,7 +21,7 @@ extension SGAutocompletionDataSource { } @objc - @available(*, deprecated: 9.3, message: "Use `init(autocompleters:)` instead") + @available(*, deprecated, message: "Use `init(autocompleters:)` instead") public convenience init(dataProviders: [Any]) { let autocompleters = dataProviders.compactMap { provider -> TKAutocompleting? in if let autocompleter = provider as? TKAutocompleting { @@ -200,7 +200,7 @@ class SGAutocompletionDataSourceSwiftStorage: NSObject { fileprivate let inputText = Variable("") - fileprivate var mapRect = MKMapRectNull + fileprivate var mapRect = MKMapRect.null // Outputs diff --git a/TripKit/Classes/core/Search/SGImageCacher.m b/TripKit/Classes/core/Search/SGImageCacher.m index 74c2972cc..81d370082 100644 --- a/TripKit/Classes/core/Search/SGImageCacher.m +++ b/TripKit/Classes/core/Search/SGImageCacher.m @@ -50,7 +50,7 @@ - (UIImage *)monochromeImageForName:(NSString *)imageName } if (image) { - image = [image monochromeImage]; + image = [image tk_monochromeImage]; [self.monochromeImageCache setObject:image forKey:imageName]; } else { DLog(@"Missing image: %@", imageName); diff --git a/TripKit/Classes/core/Search/SGKNamedCoordinate+Attribution.swift b/TripKit/Classes/core/Search/SGKNamedCoordinate+Attribution.swift index 0b83ade6e..5e89bcbda 100644 --- a/TripKit/Classes/core/Search/SGKNamedCoordinate+Attribution.swift +++ b/TripKit/Classes/core/Search/SGKNamedCoordinate+Attribution.swift @@ -19,7 +19,7 @@ public extension SGKNamedCoordinate { } } - public var dataSources: [API.DataAttribution] { + var dataSources: [API.DataAttribution] { get { guard let json = data["dataSources"] as Any?, let sanitized = TKJSONSanitizer.sanitize(json) else { return [] } return (try? JSONDecoder().decode([API.DataAttribution].self, withJSONObject: sanitized)) ?? [] diff --git a/TripKit/Classes/core/Search/TKAppleGeocoder.swift b/TripKit/Classes/core/Search/TKAppleGeocoder.swift index 6df8ab2e0..9a04c04fa 100644 --- a/TripKit/Classes/core/Search/TKAppleGeocoder.swift +++ b/TripKit/Classes/core/Search/TKAppleGeocoder.swift @@ -13,7 +13,6 @@ import RxSwift @available(iOS, introduced: 9.3, unavailable, renamed: "TKAppleGeocoder") typealias SGAppleGeocoder = TKAppleGeocoder -@available(iOS 9.3, *) public class TKAppleGeocoder: NSObject { enum GeocoderError: Error { @@ -39,16 +38,15 @@ public class TKAppleGeocoder: NSObject { // MARK: Geocoding -@available(iOS 9.3, *) extension TKAppleGeocoder: TKGeocoding { public func geocode(_ input: String, near mapRect: MKMapRect) -> Single<[SGKNamedCoordinate]> { let fullString = SGLocationHelper.expandAbbreviation(inAddressString: input) - let request = MKLocalSearchRequest() + let request = MKLocalSearch.Request() request.naturalLanguageQuery = fullString - request.region = MKCoordinateRegionForMapRect(mapRect) + request.region = MKCoordinateRegion.init(mapRect) return MKLocalSearch(request: request).rx .start() .map { $0.map { SGKNamedCoordinate($0, forInput: input, near: request.region) } } @@ -56,7 +54,6 @@ extension TKAppleGeocoder: TKGeocoding { } -@available(iOS 9.3, *) extension TKAppleGeocoder: SGGeocoder { public func geocodeString(_ inputString: String, nearRegion mapRect: MKMapRect, success: @escaping SGGeocoderSuccessBlock, failure: SGGeocoderFailureBlock? = nil) { @@ -74,11 +71,10 @@ extension TKAppleGeocoder: SGGeocoder { // MARK: - Autocompletion -@available(iOS 9.3, *) extension TKAppleGeocoder: TKAutocompleting { public func autocomplete(_ input: String, near mapRect: MKMapRect) -> Observable<[SGAutocompletionResult]> { - completer.region = MKCoordinateRegionForMapRect(mapRect) + completer.region = MKCoordinateRegion(mapRect) completer.queryFragment = input return completerDelegate.results .map { $0.enumerated().map { SGAutocompletionResult($1, forInput: input, index: $0) } } @@ -88,7 +84,7 @@ extension TKAppleGeocoder: TKAutocompleting { guard let completion = result.object as? MKLocalSearchCompletion else { return Single.error(GeocoderError.unexpectedResult) } - let request = MKLocalSearchRequest(completion: completion) + let request = MKLocalSearch.Request(completion: completion) return MKLocalSearch(request: request).rx .start() .map { @@ -104,7 +100,6 @@ extension TKAppleGeocoder: TKAutocompleting { // MARK: - Helpers -@available(iOS 9.3, *) fileprivate class LocalSearchCompleterDelegate: NSObject, MKLocalSearchCompleterDelegate { let results = PublishSubject<[MKLocalSearchCompletion]>() @@ -119,7 +114,6 @@ fileprivate class LocalSearchCompleterDelegate: NSObject, MKLocalSearchCompleter } -@available(iOS 9.3, *) extension SGAutocompletionResult { convenience init(_ completion: MKLocalSearchCompletion, forInput input: String, index: Int) { diff --git a/TripKit/Classes/core/Search/TKPeliasGeocoder.swift b/TripKit/Classes/core/Search/TKPeliasGeocoder.swift index 6323f0d6d..1e8556307 100644 --- a/TripKit/Classes/core/Search/TKPeliasGeocoder.swift +++ b/TripKit/Classes/core/Search/TKPeliasGeocoder.swift @@ -65,7 +65,7 @@ extension TKPeliasGeocoder: SGGeocoder { return } - let region = MKCoordinateRegionForMapRect(mapRect) + let region = MKCoordinateRegion(mapRect) var components = URLComponents(string: "https://pelias.tripgo.com/v1/search") components?.queryItems = [ URLQueryItem(name: "text", value: inputString), @@ -96,7 +96,7 @@ extension TKPeliasGeocoder: SGAutocompletionDataProvider { return } - let region = MKCoordinateRegionForMapRect(mapRect) + let region = MKCoordinateRegion(mapRect) var components = URLComponents(string: "https://pelias.tripgo.com/v1/autocomplete") components?.queryItems = [ URLQueryItem(name: "text", value: string), diff --git a/TripKit/Classes/core/ServerKit/SVKRegion.swift b/TripKit/Classes/core/ServerKit/SVKRegion.swift index 080303d31..34965ef65 100644 --- a/TripKit/Classes/core/ServerKit/SVKRegion.swift +++ b/TripKit/Classes/core/ServerKit/SVKRegion.swift @@ -38,7 +38,7 @@ public class SVKRegion : NSObject, Codable { @objc public var centerBiasedMapRect: MKMapRect { // centre it on the region's coordinate let size = MKMapSize(width: 300_000, height: 400_00) - var center = MKMapPointForCoordinate(coordinate) + var center = MKMapPoint(coordinate) center.x -= size.width / 2 center.y -= size.height / 2 return MKMapRect(origin: center, size: size) diff --git a/TripKit/Classes/core/ServerKit/TKRegionManager.swift b/TripKit/Classes/core/ServerKit/TKRegionManager.swift index b141fbe4b..76fff3908 100644 --- a/TripKit/Classes/core/ServerKit/TKRegionManager.swift +++ b/TripKit/Classes/core/ServerKit/TKRegionManager.swift @@ -10,7 +10,7 @@ import Foundation import CoreLocation public extension NSNotification.Name { - public static let TKRegionManagerUpdatedRegions = NSNotification.Name(rawValue: "SVKRegionManagerRegionsUpdatedNotification") + static let TKRegionManagerUpdatedRegions = NSNotification.Name(rawValue: "SVKRegionManagerRegionsUpdatedNotification") } public class TKRegionManager: NSObject { @@ -212,7 +212,9 @@ extension TKRegionManager { case .vehicle: part = details.vehicleIcon case .alert: - part = nil // not supported for modes + return nil // not supported + @unknown default: + return nil } guard let fileNamePart = part else { return nil } return SVKServer.imageURL(forIconFileNamePart: fileNamePart, of: iconType) diff --git a/TripKit/Classes/core/Track/SGTrack.swift b/TripKit/Classes/core/Track/SGTrack.swift index e50ee0649..3d94d0c0f 100644 --- a/TripKit/Classes/core/Track/SGTrack.swift +++ b/TripKit/Classes/core/Track/SGTrack.swift @@ -205,7 +205,7 @@ public protocol SGTrackItemUserCustomizable: SGTrackItem { /** The editing style for how to display this track item in the list. */ - var editingStyle: UITableViewCellEditingStyle { get } + var editingStyle: UITableViewCell.EditingStyle { get } #endif /** diff --git a/TripKit/Classes/core/TransportKit/ModeInfo.swift b/TripKit/Classes/core/TransportKit/ModeInfo.swift index 0885c3a15..04def384e 100644 --- a/TripKit/Classes/core/TransportKit/ModeInfo.swift +++ b/TripKit/Classes/core/TransportKit/ModeInfo.swift @@ -56,6 +56,18 @@ public class ModeInfo: NSObject, Codable, NSSecureCoding { && rgbColor == other.rgbColor } + public override var hash: Int { + var hasher = Hasher() + hasher.combine(identifier) + hasher.combine(alt) + hasher.combine(localImageName) + hasher.combine(remoteImageName) + hasher.combine(remoteIconIsTemplate) + hasher.combine(descriptor) + hasher.combine(rgbColor) + return hasher.finalize() + } + // MARK: Codable private enum CodingKeys: String, CodingKey { diff --git a/TripKit/Classes/helpers/TKUserProfileHelper.swift b/TripKit/Classes/helpers/TKUserProfileHelper.swift index c23672a94..024f556e0 100644 --- a/TripKit/Classes/helpers/TKUserProfileHelper.swift +++ b/TripKit/Classes/helpers/TKUserProfileHelper.swift @@ -140,7 +140,7 @@ public class TKUserProfileHelper: NSObject { @objc public class func setTransitMode(_ identifier: Identifier, asPreferred preferred: Bool) { var modes = dislikedTransitModes if preferred { - if let index = modes.index(of: identifier) { + if let index = modes.firstIndex(of: identifier) { modes.remove(at: index) } } else { diff --git a/TripKit/Classes/model/API/AlertAPIModels.swift b/TripKit/Classes/model/API/AlertAPIModels.swift index cc461a1c0..a83b8d7f8 100644 --- a/TripKit/Classes/model/API/AlertAPIModels.swift +++ b/TripKit/Classes/model/API/AlertAPIModels.swift @@ -10,15 +10,15 @@ import Foundation extension API { - public struct Alert: Codable, Equatable { + public struct Alert: Codable, Hashable { public enum Severity: String, Codable { case info = "info" case warning = "warning" case alert = "alert" } - public struct Action: Equatable { - enum ActionType: Equatable { + public struct Action: Hashable { + enum ActionType: Hashable { case reroute([String]) } @@ -57,7 +57,7 @@ extension API { } /// Replaces the previous `TKAlertWrapper` - public struct AlertMapping: Codable, Equatable { + public struct AlertMapping: Codable, Hashable { public let alert: API.Alert public let operators: [String]? public let serviceTripIDs: [String]? @@ -66,7 +66,7 @@ extension API { public let modeInfo: ModeInfo? } - public struct Route: Codable, Equatable { + public struct Route: Codable, Hashable { public let id: String public let name: String? public let number: String? diff --git a/TripKit/Classes/model/API/BaseAPIModels.swift b/TripKit/Classes/model/API/BaseAPIModels.swift index 1e40952f2..721f2c03d 100644 --- a/TripKit/Classes/model/API/BaseAPIModels.swift +++ b/TripKit/Classes/model/API/BaseAPIModels.swift @@ -10,7 +10,7 @@ import Foundation extension API { - public struct CompanyInfo : Codable, Equatable { + public struct CompanyInfo : Codable, Hashable { public let name: String public let website: URL? public let phone: String? @@ -43,7 +43,7 @@ extension API { } - public struct DataAttribution : Codable, Equatable { + public struct DataAttribution : Codable, Hashable { public let provider: CompanyInfo public let disclaimer: String? @@ -53,7 +53,7 @@ extension API { } } - public struct Location: Codable, Equatable { + public struct Location: Codable, Hashable { let lat: CLLocationDegrees let lng: CLLocationDegrees let bearing: CLLocationDirection? @@ -69,7 +69,7 @@ extension API { case canceled = "CANCELLED" } - public struct RGBColor: Codable, Equatable { + public struct RGBColor: Codable, Hashable { let red: Int let green: Int let blue: Int diff --git a/TripKit/Classes/model/CoreData/Alert.h b/TripKit/Classes/model/CoreData/Alert.h index d50cbddc5..730fe9263 100644 --- a/TripKit/Classes/model/CoreData/Alert.h +++ b/TripKit/Classes/model/CoreData/Alert.h @@ -11,7 +11,7 @@ @class Service, StopLocation, SGKNamedCoordinate; -typedef NS_ENUM(NSInteger, AlertSeverity) { +typedef NS_CLOSED_ENUM(NSInteger, AlertSeverity) { AlertSeverityInfo = -1, AlertSeverityWarning = 0, AlertSeverityAlert = 1, diff --git a/TripKit/Classes/model/CoreData/Service.swift b/TripKit/Classes/model/CoreData/Service.swift index 9015606fa..502aec884 100644 --- a/TripKit/Classes/model/CoreData/Service.swift +++ b/TripKit/Classes/model/CoreData/Service.swift @@ -12,21 +12,13 @@ import Foundation extension Service { - convenience init(into context: NSManagedObjectContext) { - if #available(iOS 10.0, macOS 10.12, *) { - self.init(context: context) - } else { - self.init(entity: NSEntityDescription.entity(forEntityName: "Service", in: context)!, insertInto: context) - } - } - @objc(fetchOrInsertServiceWithCode:inTripKitContext:) public static func fetchOrInsert(code: String, in context: NSManagedObjectContext) -> Service { if let existing = fetchExistingService(code: code, in: context) { return existing } - let service = Service(into: context) + let service = Service(context: context) service.code = code return service } diff --git a/TripKit/Classes/model/CoreData/StopLocation.swift b/TripKit/Classes/model/CoreData/StopLocation.swift index 344f10656..e785d8a44 100644 --- a/TripKit/Classes/model/CoreData/StopLocation.swift +++ b/TripKit/Classes/model/CoreData/StopLocation.swift @@ -88,7 +88,7 @@ extension StopLocation: STKStopAnnotation { return "" } - public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType?) -> Any? { + public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? { guard let last = lastTopVisit else { return nil } var output: String = self.title ?? "" diff --git a/TripKit/Classes/model/CoreData/StopVisits.swift b/TripKit/Classes/model/CoreData/StopVisits.swift index 94ff0c320..07aa7002b 100644 --- a/TripKit/Classes/model/CoreData/StopVisits.swift +++ b/TripKit/Classes/model/CoreData/StopVisits.swift @@ -120,7 +120,7 @@ extension StopVisits: STKDisplayableTimePoint { extension StopVisits: UIActivityItemSource { - public func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String { + public func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivity.ActivityType?) -> String { return service.modeTitle ?? "" } @@ -128,7 +128,7 @@ extension StopVisits: STKDisplayableTimePoint { return "" } - public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType?) -> Any? { + public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? { let format = NSLocalizedString("I'll take a %@ at %@ from %@.", tableName: "TripKit", bundle: TKTripKit.bundle(), comment: "Indication of an activity. (old key: ActivityIndication)") return String(format: format, diff --git a/TripKit/Classes/model/CoreData/Trip.swift b/TripKit/Classes/model/CoreData/Trip.swift index 8d7649f42..e98cc2f11 100644 --- a/TripKit/Classes/model/CoreData/Trip.swift +++ b/TripKit/Classes/model/CoreData/Trip.swift @@ -142,13 +142,13 @@ extension Trip: STKTrip { return "" } - public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType?) -> Any? { + public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? { guard activityType == .mail else { return nil } return constructPlainText() } - public func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivityType?) -> String { + public func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivity.ActivityType?) -> String { return Loc.Trip } diff --git a/TripKit/Classes/model/CoreData/TripGroup.h b/TripKit/Classes/model/CoreData/TripGroup.h index e05cf7c8d..6f6b998ac 100644 --- a/TripKit/Classes/model/CoreData/TripGroup.h +++ b/TripKit/Classes/model/CoreData/TripGroup.h @@ -13,7 +13,7 @@ @class DLSEntry, TKSegment; -typedef NS_ENUM(NSInteger, TripGroupVisibility) { +typedef NS_CLOSED_ENUM(NSInteger, TripGroupVisibility) { TripGroupVisibilityFull = 0, TripGroupVisibilityMini = 1, TripGroupVisibilityHidden = 2, diff --git a/TripKit/Classes/model/CoreData/TripRequest.swift b/TripKit/Classes/model/CoreData/TripRequest.swift index a3a34bd5e..76aab103e 100644 --- a/TripKit/Classes/model/CoreData/TripRequest.swift +++ b/TripKit/Classes/model/CoreData/TripRequest.swift @@ -128,11 +128,7 @@ extension TripRequest { var timeString = formatter.string(from: time) timeString = timeString.replacingOccurrences(of: " pm", with: "pm") timeString = timeString.replacingOccurrences(of: " am", with: "am") - if #available(iOS 9.0, *) { - string.append(timeString.localizedLowercase) - } else { - string.append(timeString.lowercased(with: SGStyleManager.applicationLocale())) - } + string.append(timeString.localizedLowercase) } if let offset = timeZone?.secondsFromGMT(), let short = timeZone?.abbreviation(), offset != TimeZone.current.secondsFromGMT() { diff --git a/TripKit/Classes/model/TKSegment.h b/TripKit/Classes/model/TKSegment.h index 80a6ed8a5..302a9a923 100644 --- a/TripKit/Classes/model/TKSegment.h +++ b/TripKit/Classes/model/TKSegment.h @@ -17,7 +17,7 @@ @protocol STKDisplayableTimePoint, STKTripSegment; -typedef NS_ENUM(NSInteger, TKSegmentOrdering) { +typedef NS_CLOSED_ENUM(NSInteger, TKSegmentOrdering) { TKSegmentOrderingStart = 1, TKSegmentOrderingRegular = 2, TKSegmentOrderingEnd = 4 @@ -29,7 +29,7 @@ typedef NS_ENUM(NSInteger, TKSegmentWaypoint) { TKSegmentWaypointGetOff }; -typedef NS_ENUM(NSInteger, TKSegmentType) { +typedef NS_CLOSED_ENUM(NSInteger, TKSegmentType) { TKSegmentTypeUnknown = 0, TKSegmentTypeStationary, TKSegmentTypeScheduled, diff --git a/TripKit/Classes/model/TKSegment.swift b/TripKit/Classes/model/TKSegment.swift index cbe75f4cc..7aeac1cca 100644 --- a/TripKit/Classes/model/TKSegment.swift +++ b/TripKit/Classes/model/TKSegment.swift @@ -18,7 +18,7 @@ extension TKSegment { guard let trip = trip else { return false } // A segment should be in its trip's segments - guard let _ = trip.segments().index(of: self) else { return false } + guard let _ = trip.segments().firstIndex(of: self) else { return false } // Passed all checks return true @@ -197,6 +197,9 @@ extension TKSegment: STKDisplayablePoint { case .alert: return nil // not supported for segments + + @unknown default: + return nil } if let part = iconFileNamePart { @@ -279,8 +282,11 @@ extension TKSegment: STKTripSegment { let mutable = NSMutableString(string: rawString) fill(inTemplates: mutable, inTitle: true) return mutable as String + } else if let date = self.departureTime { + return date } else { - return self.departureTime + assertionFailure("Uh-oh. No instruction and no date?") + return "" } } @@ -340,7 +346,7 @@ extension TKSegment: STKTripSegment { return "" } - public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivityType?) -> Any? { + public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? { guard order() == .end else { return nil } let format = NSLocalizedString("I'll arrive at %@ at %@", tableName: "TripKit", bundle: TKTripKit.bundle(), comment: "First '%@' will be replaced with destination location, second with arrival at that location. (old key: MessageArrivalTime)") diff --git a/TripKit/Classes/server/TKSettings.h b/TripKit/Classes/server/TKSettings.h index 22fd1d7d6..5f0d00b6e 100644 --- a/TripKit/Classes/server/TKSettings.h +++ b/TripKit/Classes/server/TKSettings.h @@ -22,6 +22,7 @@ typedef NS_ENUM(NSInteger, TKSettingsSpeed) { TKSettingsSpeed_Fast, }; +NS_ASSUME_NONNULL_BEGIN @interface TKSettings : NSObject @@ -64,3 +65,5 @@ typedef NS_ENUM(NSInteger, TKSettingsSpeed) { + (void)setEmissions:(float)gramsCO2PerKm forModeIdentifier:(NSString *)modeIdentifier; @end + +NS_ASSUME_NONNULL_END diff --git a/TripKit/Classes/server/TKSettings.m b/TripKit/Classes/server/TKSettings.m index 7f9330d1a..d02a749e0 100644 --- a/TripKit/Classes/server/TKSettings.m +++ b/TripKit/Classes/server/TKSettings.m @@ -23,12 +23,7 @@ + (NSMutableDictionary *)defaultDictionary [paras setValue:@(11) forKey:@"v"]; // distance units - NSString *unit; - if (@available(iOS 10.0, *)) { - unit = [NSLocale currentLocale].usesMetricSystem ? @"metric" : @"imperial"; - } else { - unit = @"auto"; - } + NSString *unit = [NSLocale currentLocale].usesMetricSystem ? @"metric" : @"imperial"; [paras setValue:unit forKey:@"unit"]; // profile settings diff --git a/TripKit/Classes/server/parsing/SegmentTemplate+Parsing.swift b/TripKit/Classes/server/parsing/SegmentTemplate+Parsing.swift index 12704bea1..896417e09 100644 --- a/TripKit/Classes/server/parsing/SegmentTemplate+Parsing.swift +++ b/TripKit/Classes/server/parsing/SegmentTemplate+Parsing.swift @@ -26,12 +26,7 @@ extension SegmentTemplate { return nil } - let template: SegmentTemplate - if #available(iOS 10.0, macOS 10.12, *) { - template = SegmentTemplate(context: context) - } else { - template = NSEntityDescription.insertNewObject(forEntityName: "SegmentTemplate", into: context) as! SegmentTemplate - } + let template = SegmentTemplate(context: context) template.action = dict["action"] as? String template.visibility = NSNumber(value: visibility.rawValue) diff --git a/TripKit/Classes/server/parsing/TKAPIToCoreDataConverter.swift b/TripKit/Classes/server/parsing/TKAPIToCoreDataConverter.swift index 6de1eddaa..364ba5f2d 100644 --- a/TripKit/Classes/server/parsing/TKAPIToCoreDataConverter.swift +++ b/TripKit/Classes/server/parsing/TKAPIToCoreDataConverter.swift @@ -72,7 +72,7 @@ extension TKAPIToCoreDataConverter { extension Service { convenience init(from model: API.Departure, into context: NSManagedObjectContext) { - self.init(into: context) + self.init(context: context) // update(from: model) // } // @@ -118,13 +118,8 @@ extension Service { func addVisits(_ visitType: E.Type, from model: API.Departure, at stop: StopLocation) -> E? { guard let context = managedObjectContext else { return nil } - let visit: E - if #available(iOS 10.0, macOS 10.12, *) { - visit = E(context: context) - } else { - let entityName = (visitType == DLSEntry.self) ? "DLSEntry" : "StopVisits" - visit = E(entity: NSEntityDescription.entity(forEntityName: entityName, in: context)!, insertInto: context) - } + let visit = E(context: context) + if let start = model.startTime { // we use 'time' to allow KVO visit.time = Date(timeIntervalSince1970: start) @@ -196,11 +191,7 @@ extension TKAPIToCoreDataConverter { extension Alert { convenience init(from model: API.Alert, into context: NSManagedObjectContext) { - if #available(iOS 10.0, macOS 10.12, *) { - self.init(context: context) - } else { - self.init(entity: NSEntityDescription.entity(forEntityName: "Alert", in: context)!, insertInto: context) - } + self.init(context: context) hashCode = NSNumber(value: model.hashCode) title = model.title @@ -263,11 +254,7 @@ extension TKAPIToCoreDataConverter { extension Vehicle { fileprivate convenience init(from model: API.Vehicle, into context: NSManagedObjectContext) { - if #available(iOS 10.0, macOS 10.12, *) { - self.init(context: context) - } else { - self.init(entity: NSEntityDescription.entity(forEntityName: "Vehicle", in: context)!, insertInto: context) - } + self.init(context: context) update(with: model) } diff --git a/TripKitBookings.podspec b/TripKitBookings.podspec index b6c928d38..7f58a1cd7 100644 --- a/TripKitBookings.podspec +++ b/TripKitBookings.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TripKitBookings" - s.version = "3.1.1" + s.version = "3.2.0" s.summary = "Booking integration for SkedGo's TripKit" s.homepage = "https://github.com/skedgo/tripkit-ios" s.license = 'Apache License, Version 2.0' @@ -11,8 +11,8 @@ Pod::Spec.new do |s| # s.source = { path: "." } # s.source = { git: "." } s.source = { git: "https://github.com/skedgo/tripkit-ios.git", tag: "v#{s.version}" } - s.swift_version = '4.0' - s.ios.deployment_target = '9.0' + s.swift_version = '5.0' + s.ios.deployment_target = '10.3' s.requires_arc = true s.prefix_header_file = "prefix.pch" @@ -20,8 +20,8 @@ Pod::Spec.new do |s| s.dependency 'TripKit', "~> #{s.version}" s.dependency 'TripKitUI', "~> #{s.version}" - s.dependency 'RxSwift', '~> 4.0.0' - s.dependency 'RxCocoa', '~> 4.0.0' + s.dependency 'RxSwift', '~> 5.0.0' + s.dependency 'RxCocoa', '~> 5.0.0' s.dependency 'KeychainAccess' s.dependency 'OAuthSwift' diff --git a/TripKitInterApp.podspec b/TripKitInterApp.podspec index 692389910..ee51e7e6f 100644 --- a/TripKitInterApp.podspec +++ b/TripKitInterApp.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TripKitInterApp" - s.version = "3.1.1" + s.version = "3.2.0" s.summary = "Add-ons to SkedGo's TripKit" s.homepage = "https://github.com/skedgo/tripkit-ios" s.license = 'Apache License, Version 2.0' @@ -10,8 +10,8 @@ Pod::Spec.new do |s| # s.source = { path: "." } # s.source = { git: "." } s.source = { git: "https://github.com/skedgo/tripkit-ios.git", tag: "v#{s.version}" } - s.swift_version = '4.0' - s.ios.deployment_target = '9.0' + s.swift_version = '5.0' + s.ios.deployment_target = '10.3' s.requires_arc = true s.prefix_header_file = "prefix.pch" diff --git a/TripKitUI.podspec b/TripKitUI.podspec index 2329d68e4..856377f61 100644 --- a/TripKitUI.podspec +++ b/TripKitUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TripKitUI" - s.version = "3.1.1" + s.version = "3.2.0" s.summary = "SkedGo's TripKitUI" s.homepage = "https://github.com/skedgo/tripkit-ios" s.license = 'Apache License, Version 2.0' @@ -11,8 +11,8 @@ Pod::Spec.new do |s| # s.source = { path: "." } # s.source = { git: "." } s.source = { git: "https://github.com/skedgo/tripkit-ios.git", tag: "v#{s.version}" } - s.swift_version = '4.0' - s.ios.deployment_target = '9.0' + s.swift_version = '5.0' + s.ios.deployment_target = '10.3' s.requires_arc = true s.prefix_header_file = "prefix.pch" @@ -23,9 +23,9 @@ Pod::Spec.new do |s| s.dependency 'ASPolylineView' s.dependency 'Kingfisher' - s.dependency 'RxSwift', '~> 4.0.0' - s.dependency 'RxCocoa', '~> 4.0.0' - s.dependency 'RxDataSources', '~> 3.0.0' + s.dependency 'RxSwift', '~> 5.0.0' + s.dependency 'RxCocoa', '~> 5.0.0' + s.dependency 'RxDataSources', '~> 4.0.0' s.source_files = [ "TripKitUI-iOS/*.h", diff --git a/TripKitUI/controller/TKAlertViewController.swift b/TripKitUI/controller/TKAlertViewController.swift index 528c43293..6fa4d6988 100644 --- a/TripKitUI/controller/TKAlertViewController.swift +++ b/TripKitUI/controller/TKAlertViewController.swift @@ -85,7 +85,7 @@ public class TKAlertViewController: UITableViewController { self.title = Loc.Alerts - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 150 tableView.register(UINib(nibName: "TKAlertCell", bundle: Bundle(for: TKAlertCell.self)), forCellReuseIdentifier: "TKAlertCell") SGStyleManager.styleTableView(forTileList: tableView) diff --git a/TripKitUI/controller/TKSectionedAlertViewController.swift b/TripKitUI/controller/TKSectionedAlertViewController.swift index ff2d96603..11c74e906 100644 --- a/TripKitUI/controller/TKSectionedAlertViewController.swift +++ b/TripKitUI/controller/TKSectionedAlertViewController.swift @@ -61,7 +61,7 @@ public class TKSectionedAlertViewController: UITableViewController { let nib = UINib(nibName: "TKRouteCell", bundle: Bundle(for: TKSectionedAlertViewController.self)) tableView.register(nib, forCellReuseIdentifier: "TKRouteCell") - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 60 let dataSource = RxTableViewSectionedReloadDataSource(configureCell: { [weak self] (ds, tv, ip, item) -> UITableViewCell in diff --git a/TripKitUI/controller/TKSectionedAlertViewModel.swift b/TripKitUI/controller/TKSectionedAlertViewModel.swift index 293abc64d..3e0d597d1 100644 --- a/TripKitUI/controller/TKSectionedAlertViewModel.swift +++ b/TripKitUI/controller/TKSectionedAlertViewModel.swift @@ -108,10 +108,6 @@ extension API.Route { } } -extension API.Route: Hashable { - public var hashValue: Int { return id.hashValue } -} - // MARK: - struct ModeGroup { @@ -136,7 +132,9 @@ func == (lhs: ModeGroup, rhs: ModeGroup) -> Bool { } extension ModeGroup: Equatable {} extension ModeGroup: Hashable { - var hashValue: Int { return title.hashValue } + public func hash(into hasher: inout Hasher) { + hasher.combine(title) + } } struct RouteAlerts { diff --git a/TripKitUI/core/Categories/UIImageView+Kingfisher.swift b/TripKitUI/core/Categories/UIImageView+Kingfisher.swift index 257b371bc..ee2b7ece6 100644 --- a/TripKitUI/core/Categories/UIImageView+Kingfisher.swift +++ b/TripKitUI/core/Categories/UIImageView+Kingfisher.swift @@ -48,12 +48,12 @@ extension UIImageView { extension UIButton { - public func setImage(with url: URL?, for state: UIControlState) { + public func setImage(with url: URL?, for state: UIControl.State) { setImage(with: url, for: state, placeholder: nil) } @objc(setImageWithURL:forState:placeholderImage:) - public func setImage(with url: URL?, for state: UIControlState, placeholder: SGKImage?) { + public func setImage(with url: URL?, for state: UIControl.State, placeholder: SGKImage?) { let options: KingfisherOptionsInfo? if let url = url, url.path.contains("@2x") { diff --git a/TripKitUI/core/Cells/SGCountdownCell.swift b/TripKitUI/core/Cells/SGCountdownCell.swift index 4d1bdbb05..d4048b195 100644 --- a/TripKitUI/core/Cells/SGCountdownCell.swift +++ b/TripKitUI/core/Cells/SGCountdownCell.swift @@ -189,6 +189,8 @@ extension SGCountdownCell { case .individual, .edgeToEdge: contentWrapperTopConstraint.constant = 0 contentWrapperBottomConstraint.constant = 0 + @unknown default: + assertionFailure("Unexpected grouping: \(position)") } } @@ -208,18 +210,10 @@ extension SGCountdownCell { // Hook up constraints. view.translatesAutoresizingMaskIntoConstraints = false - if #available(iOS 9.0, *) { - view.leadingAnchor.constraint(equalTo: footnoteView.leadingAnchor).isActive = true - view.topAnchor.constraint(equalTo: footnoteView.topAnchor).isActive = true - footnoteView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true - footnoteView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true - } else { - let leadingSpace = NSLayoutConstraint(item: view, attribute: .leading, relatedBy: .equal, toItem: footnoteView, attribute: .leading, multiplier: 1, constant: 0) - let topSpace = NSLayoutConstraint(item: view, attribute: .top, relatedBy: .equal, toItem: footnoteView, attribute: .top, multiplier: 1, constant: 0) - let trailingSpace = NSLayoutConstraint(item: footnoteView, attribute: .trailing, relatedBy: .equal, toItem: view, attribute: .trailing, multiplier: 1, constant: 0) - let bottomSpace = NSLayoutConstraint(item: footnoteView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1, constant: 0) - footnoteView.addConstraints([leadingSpace, topSpace, trailingSpace, bottomSpace]) - } + view.leadingAnchor.constraint(equalTo: footnoteView.leadingAnchor).isActive = true + view.topAnchor.constraint(equalTo: footnoteView.topAnchor).isActive = true + footnoteView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true + footnoteView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true } } diff --git a/TripKitUI/core/TransportKitUI/STKTransportKitHelper.swift b/TripKitUI/core/TransportKitUI/STKTransportKitHelper.swift index d709fb14a..0d8170350 100644 --- a/TripKitUI/core/TransportKitUI/STKTransportKitHelper.swift +++ b/TripKitUI/core/TransportKitUI/STKTransportKitHelper.swift @@ -9,7 +9,7 @@ import UIKit public extension UIImageView { - @objc public convenience init(asRealTimeAccessoryImageAnimated animated: Bool, tintColor: UIColor? = nil) { + @objc convenience init(asRealTimeAccessoryImageAnimated animated: Bool, tintColor: UIColor? = nil) { self.init() let images = UIImageView.realTimeAccessoryImage(animated, tintColor: tintColor) @@ -33,9 +33,9 @@ public extension UIImageView { var image3 = TripKitUIBundle.imageNamed("icon-signal-bars3") if let tintColor = tintColor { - image1 = image1.withTintColor(tintColor) - image2 = image2.withTintColor(tintColor) - image3 = image3.withTintColor(tintColor) + image1 = image1.tk_image(withTintColor: tintColor) + image2 = image2.tk_image(withTintColor: tintColor) + image3 = image3.tk_image(withTintColor: tintColor) } return [image1, image2, image3, image3, image3, image3, image3, image3] } else { @@ -43,12 +43,12 @@ public extension UIImageView { } } - @objc public convenience init(asWheelchairAccessoryImageWithTintColor tintColor: UIColor?) { + @objc convenience init(asWheelchairAccessoryImageWithTintColor tintColor: UIColor?) { self.init() let image = SGStyleManager.imageNamed("icon-wheelchair") if let tintColor = tintColor { - self.image = image.withTintColor(tintColor) + self.image = image.tk_image(withTintColor: tintColor) } else { self.image = image } diff --git a/TripKitUI/helper/MapManagerHelper.swift b/TripKitUI/helper/MapManagerHelper.swift index f0db94e52..6410b4d7c 100644 --- a/TripKitUI/helper/MapManagerHelper.swift +++ b/TripKitUI/helper/MapManagerHelper.swift @@ -52,7 +52,7 @@ public class MapManagerHelper: NSObject { return segmentOne.duration(true) < segmentTwo.duration(true) } - sorted.forEach { $0.superview?.bringSubview(toFront: $0) } + sorted.forEach { $0.superview?.bringSubviewToFront($0) } } public static func shapeAnnotations(for segment: TKSegment) diff --git a/TripKitUI/helper/TKAnnotationViewBuilder.swift b/TripKitUI/helper/TKAnnotationViewBuilder.swift index 3630dd646..7c6ec1c86 100644 --- a/TripKitUI/helper/TKAnnotationViewBuilder.swift +++ b/TripKitUI/helper/TKAnnotationViewBuilder.swift @@ -132,14 +132,14 @@ private extension TKAnnotationViewBuilder { if let url = glyphable.glyphImageURL { ImageDownloader.default.downloadImage( with: url, - options: [.imageModifier(RenderingModeImageModifier(renderingMode: .alwaysTemplate))] - ) { image, error, downloadedURL, _ in + options: [.imageModifier(RenderingModeImageModifier(renderingMode: .alwaysTemplate))]) + { result in guard - let image = image, + let imageResult = try? result.get(), let latest = view.annotation as? TKGlyphableAnnotation, - latest.glyphImageURL == downloadedURL + latest.glyphImageURL == imageResult.url else { return } - view.glyphImage = image + view.glyphImage = imageResult.image } } @@ -157,7 +157,7 @@ private extension TKAnnotationViewBuilder { // MARK: - Vehicles fileprivate extension TKAnnotationViewBuilder { - fileprivate func build(for vehicle: Vehicle) -> MKAnnotationView { + func build(for vehicle: Vehicle) -> MKAnnotationView { let identifier = "VehicleAnnotationView" let vehicleView: TKVehicleAnnotationView @@ -195,7 +195,7 @@ fileprivate extension TKVehicleAnnotationView { fileprivate extension TKAnnotationViewBuilder { - fileprivate func semaphoreView(for annotation: MKAnnotation) -> SGSemaphoreView { + func semaphoreView(for annotation: MKAnnotation) -> SGSemaphoreView { let identifier = "Semaphore" let semaphoreView: SGSemaphoreView @@ -208,7 +208,7 @@ fileprivate extension TKAnnotationViewBuilder { return semaphoreView } - fileprivate func semaphoreLabel(for bearing: CLLocationDirection?) -> SGSemaphoreLabel { + func semaphoreLabel(for bearing: CLLocationDirection?) -> SGSemaphoreLabel { if let bearing = bearing, let heading = heading { return (bearing - heading) > 180 ? .onRight : .onLeft } else { @@ -216,7 +216,7 @@ fileprivate extension TKAnnotationViewBuilder { } } - fileprivate func buildSemaphore(for point: STKDisplayableTimePoint) -> MKAnnotationView { + func buildSemaphore(for point: STKDisplayableTimePoint) -> MKAnnotationView { let semaphoreView = self.semaphoreView(for: point) // Set time stamp on the side opposite to direction of travel @@ -229,7 +229,7 @@ fileprivate extension TKAnnotationViewBuilder { return semaphoreView } - fileprivate func buildSemaphore(for segment: TKSegment) -> MKAnnotationView { + func buildSemaphore(for segment: TKSegment) -> MKAnnotationView { let semaphoreView = self.semaphoreView(for: segment) // Only public transport get the time stamp. And they get it on the side opposite to the @@ -286,7 +286,7 @@ fileprivate extension SGSemaphoreView { fileprivate extension TKAnnotationViewBuilder { - fileprivate func buildCircle(for visit: StopVisits) -> MKAnnotationView { + func buildCircle(for visit: StopVisits) -> MKAnnotationView { let color: SGKColor? if asTravelled, let serviceColor = visit.service.color as? SGKColor { color = serviceColor @@ -296,7 +296,7 @@ fileprivate extension TKAnnotationViewBuilder { return buildCircle(for: visit, color: color) } - fileprivate func buildCircle(for annotation: MKAnnotation, color: SGKColor? = nil) -> MKAnnotationView { + func buildCircle(for annotation: MKAnnotation, color: SGKColor? = nil) -> MKAnnotationView { let identifier = asLarge ? "LargeCircleView" : "SmallCircleView" let circleView: CircleAnnotationView @@ -328,7 +328,7 @@ fileprivate extension TKAnnotationViewBuilder { fileprivate extension TKAnnotationViewBuilder { - fileprivate func build(for displayable: STKDisplayablePoint, enableClustering: Bool) -> MKAnnotationView { + func build(for displayable: STKDisplayablePoint, enableClustering: Bool) -> MKAnnotationView { let identifier: String if #available(iOS 11, *), displayable is MKClusterAnnotation { @@ -379,7 +379,7 @@ fileprivate extension STKDisplayablePoint { public extension TKAnnotationViewBuilder { - @objc public static func update(annotationView: MKAnnotationView, forHeading heading: CLLocationDirection) { + @objc static func update(annotationView: MKAnnotationView, forHeading heading: CLLocationDirection) { if let vehicleView = annotationView as? TKVehicleAnnotationView, let vehicle = vehicleView.annotation as? Vehicle { vehicleView.rotateVehicle(heading: heading, bearing: vehicle.bearing?.doubleValue) diff --git a/TripKitUI/map managers/TripMapManager.swift b/TripKitUI/map managers/TripMapManager.swift index 7e3c773f0..5fe2a5661 100644 --- a/TripKitUI/map managers/TripMapManager.swift +++ b/TripKitUI/map managers/TripMapManager.swift @@ -39,7 +39,7 @@ extension TripMapManager { && mapView.visibleMapRect.origin.x >= 0 // might happen if map view is minimized { let fromToRect = [trip.request.fromLocation, trip.request.toLocation].mapRect - forzeZoom = (!MKMapRectIntersectsRect(mapView.visibleMapRect, fromToRect)) + forzeZoom = (!mapView.visibleMapRect.intersects(fromToRect)) } // don't force zooma gain @@ -119,9 +119,7 @@ extension TripMapManager { zoomTo += primaries.map { $0 as MKAnnotation } addPrimaryVehicles(primaries, secondaryVehicles: alternatives) - if #available(iOS 9.0, *) { - mapView.showsTraffic = affectedByTraffic - } + mapView.showsTraffic = affectedByTraffic if !zoomTo.isEmpty { mapView.zoom(to: zoomTo, edgePadding: delegate()?.mapManagerEdgePadding(self) ?? UIEdgeInsets.zero, animated: animated) diff --git a/TripKitUI/views/TKAlertInfoView.swift b/TripKitUI/views/TKAlertInfoView.swift index a57789f59..814118521 100644 --- a/TripKitUI/views/TKAlertInfoView.swift +++ b/TripKitUI/views/TKAlertInfoView.swift @@ -117,7 +117,7 @@ public class TKAlertInfoView: UIView { layoutIfNeeded() // This is the height that can just fit everything in the view. - let fittingSize = systemLayoutSizeFitting(UILayoutFittingCompressedSize) + let fittingSize = systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) // Update the frame to assume fitting height. frame.size.height = fittingSize.height diff --git a/TripKitUI/views/TKOccupancyView.swift b/TripKitUI/views/TKOccupancyView.swift index 496ca060a..a67e823ec 100644 --- a/TripKitUI/views/TKOccupancyView.swift +++ b/TripKitUI/views/TKOccupancyView.swift @@ -13,7 +13,6 @@ import UIKit import TripKit #endif -@available(iOS 9.0, *) extension API.VehicleOccupancy { var icon: UIImage? { @@ -40,7 +39,6 @@ extension API.VehicleOccupancy { } -@available(iOS 9.0, *) public class TKOccupancyView: UIView { public weak var icon: UIImageView! @@ -93,7 +91,6 @@ public class TKOccupancyView: UIView { } -@available(iOS 9.0, *) extension TKOccupancyView { public static var bundle: Bundle { @@ -102,7 +99,6 @@ extension TKOccupancyView { } -@available(iOS 9.0, *) extension TKOccupancyView { public enum Purpose {