diff --git a/RHSideButtons.xcodeproj/project.pbxproj b/RHSideButtons.xcodeproj/project.pbxproj index 5f7576c..4bf58f6 100644 --- a/RHSideButtons.xcodeproj/project.pbxproj +++ b/RHSideButtons.xcodeproj/project.pbxproj @@ -116,22 +116,23 @@ B1579AA11DF34F92000EB296 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1110; ORGANIZATIONNAME = "Robert Herdzik"; TargetAttributes = { B1579AA91DF34F92000EB296 = { CreatedOnToolsVersion = 8.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1110; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = B1579AA41DF34F92000EB296 /* Build configuration list for PBXProject "RHSideButtons" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = B1579AA01DF34F92000EB296; productRefGroup = B1579AAB1DF34F92000EB296 /* Products */; @@ -179,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; @@ -217,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 = ""; @@ -232,15 +243,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; @@ -262,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"; @@ -283,8 +304,8 @@ PRODUCT_BUNDLE_IDENTIFIER = x.RHSideButtons; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -302,8 +323,8 @@ PRODUCT_BUNDLE_IDENTIFIER = x.RHSideButtons; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + 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