From d46a11c09e10044321d8ddac74e49a14010b09e4 Mon Sep 17 00:00:00 2001 From: Kirill Pahnev Date: Sat, 5 Oct 2019 19:07:31 +0300 Subject: [PATCH 1/4] Migrate to Swift 5 --- RHSideButtons.xcodeproj/project.pbxproj | 7 ++++--- RHSideButtons/RHSideButtons/RHSideButtons.swift | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/RHSideButtons.xcodeproj/project.pbxproj b/RHSideButtons.xcodeproj/project.pbxproj index 5f7576c..443f972 100644 --- a/RHSideButtons.xcodeproj/project.pbxproj +++ b/RHSideButtons.xcodeproj/project.pbxproj @@ -121,7 +121,7 @@ TargetAttributes = { B1579AA91DF34F92000EB296 = { CreatedOnToolsVersion = 8.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1110; ProvisioningStyle = Automatic; }; }; @@ -131,6 +131,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = B1579AA01DF34F92000EB296; @@ -284,7 +285,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -303,7 +304,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/RHSideButtons/RHSideButtons/RHSideButtons.swift b/RHSideButtons/RHSideButtons/RHSideButtons.swift index b2a7a1e..a67f73f 100755 --- a/RHSideButtons/RHSideButtons/RHSideButtons.swift +++ b/RHSideButtons/RHSideButtons/RHSideButtons.swift @@ -86,7 +86,7 @@ public class RHSideButtons { triggerButton.delegate = self parentView.addSubview(triggerButton) - parentView.bringSubview(toFront: triggerButton) + parentView.bringSubviewToFront(triggerButton) } fileprivate func setDefaultTriggerButtonPosition() { @@ -136,7 +136,7 @@ public class RHSideButtons { button.delegate = self parentView?.addSubview(button) - parentView?.bringSubview(toFront: button) + parentView?.bringSubviewToFront(button) buttonsArr.append(button) } } @@ -205,7 +205,7 @@ public class RHSideButtons { extension RHSideButtons: RHButtonViewDelegate { public func didSelectButton(_ buttonView: RHButtonView) { - if let indexOfButton = buttonsArr.index(of: buttonView) { + if let indexOfButton = buttonsArr.firstIndex(of: buttonView) { delegate?.sideButtons(self, didSelectButtonAtIndex: indexOfButton) state = .hidden From 7f534820c97ced3b7a936771c2eb8dc6032853a2 Mon Sep 17 00:00:00 2001 From: Kirill Pahnev Date: Sat, 5 Oct 2019 19:08:11 +0300 Subject: [PATCH 2/4] Update base localization settings --- RHSideButtons.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RHSideButtons.xcodeproj/project.pbxproj b/RHSideButtons.xcodeproj/project.pbxproj index 443f972..f20cf86 100644 --- a/RHSideButtons.xcodeproj/project.pbxproj +++ b/RHSideButtons.xcodeproj/project.pbxproj @@ -128,11 +128,11 @@ }; buildConfigurationList = B1579AA41DF34F92000EB296 /* Build configuration list for PBXProject "RHSideButtons" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, + Base, ); mainGroup = B1579AA01DF34F92000EB296; productRefGroup = B1579AAB1DF34F92000EB296 /* Products */; From bff1ba782c0aeb6adcc2b1607e3ed2fd286a9eca Mon Sep 17 00:00:00 2001 From: Kirill Pahnev Date: Sat, 5 Oct 2019 19:08:37 +0300 Subject: [PATCH 3/4] Update to Xcode 11 recommended settings --- RHSideButtons.xcodeproj/project.pbxproj | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/RHSideButtons.xcodeproj/project.pbxproj b/RHSideButtons.xcodeproj/project.pbxproj index f20cf86..1a2186a 100644 --- a/RHSideButtons.xcodeproj/project.pbxproj +++ b/RHSideButtons.xcodeproj/project.pbxproj @@ -116,7 +116,7 @@ B1579AA11DF34F92000EB296 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1110; ORGANIZATIONNAME = "Robert Herdzik"; TargetAttributes = { B1579AA91DF34F92000EB296 = { @@ -180,15 +180,24 @@ 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; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -233,15 +242,24 @@ 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; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; From 11ca6e78ff83ff751b80d59ce2300742c9937fff Mon Sep 17 00:00:00 2001 From: Kirill Pahnev Date: Sat, 5 Oct 2019 19:10:38 +0300 Subject: [PATCH 4/4] Turn off Swift 3 objc inference --- RHSideButtons.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RHSideButtons.xcodeproj/project.pbxproj b/RHSideButtons.xcodeproj/project.pbxproj index 1a2186a..4bf58f6 100644 --- a/RHSideButtons.xcodeproj/project.pbxproj +++ b/RHSideButtons.xcodeproj/project.pbxproj @@ -227,6 +227,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -281,6 +282,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -302,7 +304,7 @@ PRODUCT_BUNDLE_IDENTIFIER = x.RHSideButtons; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; name = Debug; @@ -321,7 +323,7 @@ PRODUCT_BUNDLE_IDENTIFIER = x.RHSideButtons; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; name = Release;