From 49634234e810dfb6f5f47df6c3b8f062e1548371 Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Tue, 2 Apr 2019 17:08:51 -0300 Subject: [PATCH] swift 5.0.0 compatibility --- .swift-version | 2 +- .travis.yml | 9 ++++--- CHANGELOG.md | 6 ++++- Example.xcodeproj/project.pbxproj | 22 ++++++++------- .../xcshareddata/xcschemes/Example.xcscheme | 2 +- Example/Info.plist | 2 +- LICENSE | 2 +- README.md | 9 +++---- Source/DynamicCollectionViewFlowLayout.swift | 2 ++ Source/Info.plist | 2 +- XLActionController.podspec | 6 ++--- XLActionController.xcodeproj/project.pbxproj | 27 ++++++++++++------- .../xcschemes/XLActionController.xcscheme | 2 +- 13 files changed, 54 insertions(+), 39 deletions(-) diff --git a/.swift-version b/.swift-version index bf77d54..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.2 +5.0 diff --git a/.travis.yml b/.travis.yml index 4bbe4cc..5c71b1b 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: objective-c -osx_image: xcode10.1 +osx_image: xcode10.2 +branches: + only: + - master env: - - DESTINATION="OS=12.1,name=iPhone 8" SCHEME="XLActionController" SDK=iphonesimulator -before_install: - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet + - DESTINATION="OS=12.2,name=iPhone XS" SCHEME="XLActionController" SDK=iphonesimulator script: - set -o pipefail - xcodebuild -version diff --git a/CHANGELOG.md b/CHANGELOG.md index 833fd6a..8dad325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +### [5.0.0](https://github.com/xmartlabs/XLActionController/releases/tag/5.0.0) + +* Swift 5.0 source compability. + ### [4.1.0](https://github.com/xmartlabs/XLActionController/releases/tag/4.1.0) * Swift 4.2 source compability. @@ -9,7 +13,7 @@ All notable changes to this project will be documented in this file. ### [4.0.1](https://github.com/xmartlabs/XLActionController/releases/tag/4.0.1) * Bug fixes and stability improvements. -* Added support for iphone X. +* Added support for iphone X. ### [4.0.0](https://github.com/xmartlabs/XLActionController/releases/tag/4.0.0) diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 2adf708..215e18c 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -258,24 +258,24 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Xmartlabs; TargetAttributes = { 28B3B8551BFA7EEC007337A2 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; 28B3B8691BFA7EEC007337A2 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; TestTargetID = 28B3B8551BFA7EEC007337A2; }; }; }; buildConfigurationList = 28B3B8511BFA7EEC007337A2 /* Build configuration list for PBXProject "Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -427,6 +427,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -469,7 +470,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -481,6 +482,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -517,7 +519,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; @@ -539,7 +541,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -556,7 +558,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.Example; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -570,7 +572,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; @@ -585,7 +587,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = Example; USES_XCTRUNNER = YES; }; diff --git a/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index ccf83e9..d1a3cac 100644 --- a/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.1.1 + 5.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/LICENSE b/LICENSE index ea59d36..4418b96 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 XMARTLABS (http://xmartlabs.com) +Copyright (c) 2019 XMARTLABS (http://xmartlabs.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5b4ab28..d92076d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

Build status Platform iOS -Swift 4 compatible +Swift 5 compatible Carthage compatible CocoaPods compatible License: MIT @@ -390,8 +390,8 @@ After the dismissal animation completes, `dismissView` calls `onDidDismissView` ## Requirements * iOS 9.3+ -* Xcode 10.1+ -* Swift 4.2+ +* Xcode 10.2+ +* Swift 5.0+ ## Getting involved @@ -412,7 +412,6 @@ Specify XLActionController into your project's Podfile: ```ruby source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '9.0' use_frameworks! target '' do @@ -443,7 +442,7 @@ dependency manager for Cocoa. Specify XLActionController into your project's Carthage: ``` -github "xmartlabs/XLActionController" ~> 4.1 +github "xmartlabs/XLActionController" ~> 5.0 ``` ### Manually as Embedded Framework diff --git a/Source/DynamicCollectionViewFlowLayout.swift b/Source/DynamicCollectionViewFlowLayout.swift index 3ddea99..3925a85 100644 --- a/Source/DynamicCollectionViewFlowLayout.swift +++ b/Source/DynamicCollectionViewFlowLayout.swift @@ -171,6 +171,8 @@ open class DynamicCollectionViewFlowLayout: UICollectionViewFlowLayout { translationX = isRTL(for: collectionView) ? rightMargin : leftMargin case .trailing: translationX = isRTL(for: collectionView) ? leftMargin : rightMargin + @unknown default: + translationX = isRTL(for: collectionView) ? rightMargin : leftMargin } frame.origin.x = translationX diff --git a/Source/Info.plist b/Source/Info.plist index 76d0c69..e677190 100644 --- a/Source/Info.plist +++ b/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.1.1 + 5.0.0 CFBundleSignature ???? CFBundleVersion diff --git a/XLActionController.podspec b/XLActionController.podspec index 0b428ce..6d40a63 100644 --- a/XLActionController.podspec +++ b/XLActionController.podspec @@ -1,16 +1,16 @@ Pod::Spec.new do |spec| spec.name = 'XLActionController' - spec.version = '4.1.1' + spec.version = '5.0.0' spec.license = 'MIT' spec.summary = 'Fully customizable and extensible action sheet controller written in Swift' spec.homepage = 'https://github.com/xmartlabs/XLActionController' spec.social_media_url = 'http://twitter.com/xmartlabs' spec.authors = { 'Miguel Revetria' => 'miguel@xmartlabs.com', 'Martin Barreto' => 'martin@xmartlabs.com' } spec.source = { :git => 'https://github.com/xmartlabs/XLActionController.git', :tag => spec.version } - spec.ios.deployment_target = '9.0' + spec.ios.deployment_target = '9.3' spec.ios.frameworks = 'UIKit', 'Foundation', 'CoreGraphics' spec.requires_arc = true - spec.swift_version = '4.2' + spec.swift_version = '5.0' # Core subspec spec.subspec 'Core' do |core| diff --git a/XLActionController.xcodeproj/project.pbxproj b/XLActionController.xcodeproj/project.pbxproj index 753be52..38b48ee 100644 --- a/XLActionController.xcodeproj/project.pbxproj +++ b/XLActionController.xcodeproj/project.pbxproj @@ -169,25 +169,26 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Xmartlabs; TargetAttributes = { 28E191661BFA618E00066B1C = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; 28E191701BFA618F00066B1C = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 1010; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = 28E191611BFA618E00066B1C /* Build configuration list for PBXProject "XLActionController" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 28E1915D1BFA618E00066B1C; productRefGroup = 28E191681BFA618E00066B1C /* Products */; @@ -254,6 +255,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -297,7 +299,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -313,6 +315,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -350,7 +353,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -374,12 +377,13 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionController; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -395,11 +399,12 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionController; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -408,11 +413,12 @@ buildSettings = { DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -421,10 +427,11 @@ buildSettings = { DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.XLActionControllerTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/XLActionController.xcodeproj/xcshareddata/xcschemes/XLActionController.xcscheme b/XLActionController.xcodeproj/xcshareddata/xcschemes/XLActionController.xcscheme index 872a388..360678c 100644 --- a/XLActionController.xcodeproj/xcshareddata/xcschemes/XLActionController.xcscheme +++ b/XLActionController.xcodeproj/xcshareddata/xcschemes/XLActionController.xcscheme @@ -1,6 +1,6 @@