From 4a292d44291cb8c2b5f2cdbca0b93f74f88676b8 Mon Sep 17 00:00:00 2001 From: ThibaultKlein Date: Thu, 20 Sep 2018 09:55:10 -0400 Subject: [PATCH] Added compatibility to Swift 4.2 --- .swift-version | 2 +- .travis.yml | 2 +- .../project.pbxproj | 30 +++++++++++++++---- .../xcschemes/AddressGeocoderExample.xcscheme | 2 +- .../AddressGeocoderExampleTests.xcscheme | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++ .../AddressGeocoderExample/AppDelegate.swift | 27 +---------------- Example/Podfile.lock | 4 +-- Gemfile | 2 +- 9 files changed, 41 insertions(+), 38 deletions(-) create mode 100644 Example/AddressGeocoderExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/.swift-version b/.swift-version index f398a20..8012ebb 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 \ No newline at end of file +4.2 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f8d95a5..c314a3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ # # * https://github.com/supermarin/xcpretty#usage # language: objective-c -osx_image: xcode8.1 +osx_image: xcode10 cache: directories: diff --git a/Example/AddressGeocoderExample.xcodeproj/project.pbxproj b/Example/AddressGeocoderExample.xcodeproj/project.pbxproj index 595ab5c..caa11a2 100644 --- a/Example/AddressGeocoderExample.xcodeproj/project.pbxproj +++ b/Example/AddressGeocoderExample.xcodeproj/project.pbxproj @@ -179,15 +179,17 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Prolific Interactive"; TargetAttributes = { 8E444DA61DE3AE96008342BC = { CreatedOnToolsVersion = 8.1; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; 8E444DBA1DE3AE96008342BC = { CreatedOnToolsVersion = 8.1; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; TestTargetID = 8E444DA61DE3AE96008342BC; }; @@ -382,15 +384,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; @@ -432,15 +442,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; @@ -470,13 +488,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = BE30EDBC6AEEB692F45F51CA /* Pods-AddressGeocoderExample.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = AddressGeocoderExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.AddressGeocoderExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -484,13 +503,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = 111D22EB19AB45587E5F332D /* Pods-AddressGeocoderExample.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = AddressGeocoderExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.AddressGeocoderExample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -503,7 +523,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.AddressGeocoderExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AddressGeocoderExample.app/AddressGeocoderExample"; }; name = Debug; @@ -517,7 +537,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.prolificinteractive.AddressGeocoderExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AddressGeocoderExample.app/AddressGeocoderExample"; }; name = Release; diff --git a/Example/AddressGeocoderExample.xcodeproj/xcshareddata/xcschemes/AddressGeocoderExample.xcscheme b/Example/AddressGeocoderExample.xcodeproj/xcshareddata/xcschemes/AddressGeocoderExample.xcscheme index 48de7a9..81c5d78 100644 --- a/Example/AddressGeocoderExample.xcodeproj/xcshareddata/xcschemes/AddressGeocoderExample.xcscheme +++ b/Example/AddressGeocoderExample.xcodeproj/xcshareddata/xcschemes/AddressGeocoderExample.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/AddressGeocoderExample/AppDelegate.swift b/Example/AddressGeocoderExample/AppDelegate.swift index f0c41bb..900a335 100644 --- a/Example/AddressGeocoderExample/AppDelegate.swift +++ b/Example/AddressGeocoderExample/AppDelegate.swift @@ -13,34 +13,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - } - diff --git a/Example/Podfile.lock b/Example/Podfile.lock index b44ab44..737151a 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - AddressGeocoder (0.0.2) + - AddressGeocoder (0.0.3) DEPENDENCIES: - AddressGeocoder (from `../`) @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - AddressGeocoder: 9248dfcdb0e0dc75a5583e4940414e1e08732713 + AddressGeocoder: 5573dced5f8cd6162a66eed522edbb669b90cd13 PODFILE CHECKSUM: 2e3a566fe5d8c369bca2f63a1d5ae83cdbce5057 diff --git a/Gemfile b/Gemfile index 94a11c3..3185ac5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'cocoapods', '1.1.1' +gem 'cocoapods', '1.5.0'