diff --git a/.swift-version b/.swift-version index a3ec5a4..5186d07 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.2 +4.0 diff --git a/README.md b/README.md index efb798d..9f2f90c 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ [![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat )](https://developer.apple.com/iphone/index.action) -![Swift](https://img.shields.io/badge/Swift-3.2-orange.svg) +![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg) [![Cocoapods](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage) [![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat )](http://mit-license.org) -![pod](https://img.shields.io/badge/pod-v1.2.0-red.svg) +![pod](https://img.shields.io/badge/pod-v2.0.0-red.svg) ## Overview SwipeMenuViewController provides `SwipeMenuView` and `SwipeMenuViewController`. @@ -368,6 +368,10 @@ public var isSafeAreaEnabled: Bool - Xcode 9.x - Swift 3.2 +### 2.0.0 ~ +- Xcode 9.x +- Swift 4.x + ## Creator ### Yusuke Morishita - [Github](https://github.com/yysskk) diff --git a/Sources/Extensions/UIColorExtension.swift b/Sources/Extensions/UIColorExtension.swift index 97fb872..62473d8 100644 --- a/Sources/Extensions/UIColorExtension.swift +++ b/Sources/Extensions/UIColorExtension.swift @@ -20,7 +20,13 @@ extension UIColor { return nil } - let results = (0...3).map { (toComponents[$0] - components[$0]) * abs(multiplier) + components[$0] } + var results: [CGFloat] = [] + + for index in 0...3 { + let result = (toComponents[index] - components[index]) * abs(multiplier) + components[index] + results.append(result) + } + return UIColor(red: results[0], green: results[1], blue: results[2], alpha: results[3]) } } diff --git a/Sources/SwipeMenuView.swift b/Sources/SwipeMenuView.swift index 43473b1..88499e5 100644 --- a/Sources/SwipeMenuView.swift +++ b/Sources/SwipeMenuView.swift @@ -304,7 +304,7 @@ extension SwipeMenuView { } } - func tapItemView(_ recognizer: UITapGestureRecognizer) { + @objc func tapItemView(_ recognizer: UITapGestureRecognizer) { guard let itemView = recognizer.view as? TabItemView, let tabView = tabView, let index: Int = tabView.itemViews.index(of: itemView), let contentScrollView = contentScrollView else { return } if currentIndex == index { return } diff --git a/Sources/TabView.swift b/Sources/TabView.swift index 5096c89..684f818 100644 --- a/Sources/TabView.swift +++ b/Sources/TabView.swift @@ -332,7 +332,7 @@ extension TabView { update(index) - UIView.animate(withDuration: 0.3, animations: { _ in + UIView.animate(withDuration: 0.3, animations: { let target = self.currentItem self.underlineView.frame.origin.x = target.frame.origin.x + self.options.underlineView.margin diff --git a/SwipeMenuViewController.podspec b/SwipeMenuViewController.podspec index 3702eef..db2602b 100644 --- a/SwipeMenuViewController.podspec +++ b/SwipeMenuViewController.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |s| # s.name = "SwipeMenuViewController" - s.version = "1.2.0" + s.version = "2.0.0" s.summary = "Swipable tab and menu UI framework" # This description is used to generate tags and improve search results. diff --git a/SwipeMenuViewController.xcodeproj/project.pbxproj b/SwipeMenuViewController.xcodeproj/project.pbxproj index 794b117..91c24ac 100644 --- a/SwipeMenuViewController.xcodeproj/project.pbxproj +++ b/SwipeMenuViewController.xcodeproj/project.pbxproj @@ -217,12 +217,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = yysskk; TargetAttributes = { 98EEED421EFA627000A149EB = { CreatedOnToolsVersion = 8.3; - LastSwiftMigration = 0830; + LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; 98EEED521EFA62D900A149EB = { @@ -339,7 +339,9 @@ 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -347,7 +349,11 @@ 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_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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -393,7 +399,9 @@ 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_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -401,7 +409,11 @@ 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_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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -435,7 +447,7 @@ buildSettings = { CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -450,7 +462,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -472,7 +485,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/SwipeMenuViewController.xcodeproj/xcshareddata/xcschemes/SwipeMenuViewController.xcscheme b/SwipeMenuViewController.xcodeproj/xcshareddata/xcschemes/SwipeMenuViewController.xcscheme index 728b48b..df6db41 100644 --- a/SwipeMenuViewController.xcodeproj/xcshareddata/xcschemes/SwipeMenuViewController.xcscheme +++ b/SwipeMenuViewController.xcodeproj/xcshareddata/xcschemes/SwipeMenuViewController.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/SwipeMenuViewController.xcodeproj/xcuserdata/a14764.xcuserdatad/xcschemes/Example.xcscheme b/SwipeMenuViewController.xcodeproj/xcuserdata/a14764.xcuserdatad/xcschemes/Example.xcscheme index 323e7b7..3d40ce9 100644 --- a/SwipeMenuViewController.xcodeproj/xcuserdata/a14764.xcuserdatad/xcschemes/Example.xcscheme +++ b/SwipeMenuViewController.xcodeproj/xcuserdata/a14764.xcuserdatad/xcschemes/Example.xcscheme @@ -1,6 +1,6 @@ @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO"