diff --git a/ActionClosurable.podspec b/ActionClosurable.podspec index 5d065fd..d3565a2 100644 --- a/ActionClosurable.podspec +++ b/ActionClosurable.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "ActionClosurable" - s.version = "1.3.0" + s.version = "2.0.0" s.summary = "Extensions which helps to convert swifty closure to objc-style target/action." # This description is used to generate tags and improve search results. @@ -26,6 +26,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '8.0' s.source_files = 'ActionClosurable/*.swift' - s.swift_version = "4.2" + s.swift_version = "5.0" end diff --git a/ActionClosurable.xcodeproj/project.pbxproj b/ActionClosurable.xcodeproj/project.pbxproj index 2783fbb..f4388bb 100644 --- a/ActionClosurable.xcodeproj/project.pbxproj +++ b/ActionClosurable.xcodeproj/project.pbxproj @@ -403,7 +403,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -454,7 +454,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -494,6 +494,7 @@ INFOPLIST_FILE = ActionClosurable/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = takasek.ActionClosurable; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -514,6 +515,7 @@ INFOPLIST_FILE = ActionClosurable/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 2.0.0; PRODUCT_BUNDLE_IDENTIFIER = takasek.ActionClosurable; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/ActionClosurable/Extensions.swift b/ActionClosurable/Extensions.swift deleted file mode 100644 index 47db218..0000000 --- a/ActionClosurable/Extensions.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// Extensions.swift -// ActionClosurable -// -// Created by Yoshitaka Seki on 2016/04/11. -// Copyright © 2016年 Yoshitaka Seki. All rights reserved. -// - -import UIKit - -extension ActionClosurable where Self: UIControl { - public func on(_ controlEvents: UIControl.Event, closure: @escaping (Self) -> Void) { - convert(closure: closure, toConfiguration: { - self.addTarget($0, action: $1, for: controlEvents) - }) - } -} - -extension ActionClosurable where Self: UIButton { - public func onTap(_ closure: @escaping (Self) -> Void) { - on(.touchUpInside, closure: closure) - } -} - -public extension ActionClosurable where Self: UIRefreshControl { - func onValueChanged(closure: @escaping (Self) -> Void) { - on(.valueChanged, closure: closure) - } - - init(closure: @escaping (Self) -> Void) { - self.init() - onValueChanged(closure: closure) - } -} - - -extension ActionClosurable where Self: UIGestureRecognizer { - public func onGesture(_ closure: @escaping (Self) -> Void) { - convert(closure: closure, toConfiguration: { - self.addTarget($0, action: $1) - }) - } - public init(closure: @escaping (Self) -> Void) { - self.init() - onGesture(closure) - } -} - -extension ActionClosurable where Self: UIBarButtonItem { - public init(title: String, style: UIBarButtonItem.Style, closure: @escaping (Self) -> Void) { - self.init() - self.title = title - self.style = style - self.onTap(closure) - } - public init(image: UIImage?, style: UIBarButtonItem.Style, closure: @escaping (Self) -> Void) { - self.init() - self.image = image - self.style = style - self.onTap(closure) - } - public init(barButtonSystemItem: UIBarButtonItem.SystemItem, closure: @escaping (Self) -> Void) { - self.init(barButtonSystemItem: barButtonSystemItem, target: nil, action: nil) - self.onTap(closure) - } - public func onTap(_ closure: @escaping (Self) -> Void) { - convert(closure: closure, toConfiguration: { - self.target = $0 - self.action = $1 - }) - } -} diff --git a/ActionClosurable/Info.plist b/ActionClosurable/Info.plist index 331a2da..ca23c84 100644 --- a/ActionClosurable/Info.plist +++ b/ActionClosurable/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.0 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion