diff --git a/.travis.yml b/.travis.yml
index fa40334..4c734a5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ install:
before_script:
- xcodebuild -workspace ICInputAccessory.xcworkspace -list
script:
- - bundle exec rake ci:test[$VERSION]
+ - bundle exec rake ci:build[$VERSION]
notifications:
email: false
slack:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb51ca3..a911495 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,17 @@
+## v1.1.0
+
+#### Changes
+
+* Support storyboard
+* Support subspecs
+* Upgrade to Swift 2.2
+* Use CocoaPods (1.0.1)
+
## v1.0.0
Initial release written in Swift 2.1.
-#### Added
+#### Changes
* `ICKeyboardDismissTextField` with an accessory view to dismiss keyboard.
* `ICTokenField`, a text field that groups input texts as tokens.
diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj
index d53a7fc..1716855 100644
--- a/Example/Example.xcodeproj/project.pbxproj
+++ b/Example/Example.xcodeproj/project.pbxproj
@@ -163,12 +163,12 @@
isa = PBXNativeTarget;
buildConfigurationList = B5E9F90D1C8D3B6E00443DC7 /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
- 96705876C946719953BCD0C6 /* 📦 Check Pods Manifest.lock */,
+ 96705876C946719953BCD0C6 /* [CP] Check Pods Manifest.lock */,
B5E9F8F71C8D3B6E00443DC7 /* Sources */,
B5E9F8F81C8D3B6E00443DC7 /* Frameworks */,
B5E9F8F91C8D3B6E00443DC7 /* Resources */,
- CAB3B20531AAE2438C48D751 /* 📦 Embed Pods Frameworks */,
- 7B2FB96C7361D5883F3ADD14 /* 📦 Copy Pods Resources */,
+ CAB3B20531AAE2438C48D751 /* [CP] Embed Pods Frameworks */,
+ 7B2FB96C7361D5883F3ADD14 /* [CP] Copy Pods Resources */,
B5C50ADD1C917F4A0059032B /* Swift Lint */,
);
buildRules = (
@@ -240,14 +240,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 7B2FB96C7361D5883F3ADD14 /* 📦 Copy Pods Resources */ = {
+ 7B2FB96C7361D5883F3ADD14 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Copy Pods Resources";
+ name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -255,14 +255,14 @@
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
- 96705876C946719953BCD0C6 /* 📦 Check Pods Manifest.lock */ = {
+ 96705876C946719953BCD0C6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Check Pods Manifest.lock";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@@ -284,14 +284,14 @@
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then swiftlint; fi";
};
- CAB3B20531AAE2438C48D751 /* 📦 Embed Pods Frameworks */ = {
+ CAB3B20531AAE2438C48D751 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Embed Pods Frameworks";
+ name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
diff --git a/Example/Example/CustomizedTokenViewController.swift b/Example/Example/CustomizedTokenViewController.swift
index ab1229d..2f7ae64 100644
--- a/Example/Example/CustomizedTokenViewController.swift
+++ b/Example/Example/CustomizedTokenViewController.swift
@@ -50,7 +50,7 @@ class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {
navigationController?.navigationBar.translucent = false
navigationController?.navigationBar.barStyle = .Black
- let cancelBarButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: #selector(dismiss(_:)))
+ let cancelBarButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: .dismiss)
cancelBarButton.tintColor = UIColor.whiteColor()
navigationItem.rightBarButtonItem = cancelBarButton
@@ -106,3 +106,11 @@ class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {
}
}
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+private extension Selector {
+ static let dismiss = #selector(CustomizedTokenViewController.dismiss(_:))
+}
diff --git a/Example/Example/ExampleViewController.swift b/Example/Example/ExampleViewController.swift
index cfacb8d..f9c6c4f 100644
--- a/Example/Example/ExampleViewController.swift
+++ b/Example/Example/ExampleViewController.swift
@@ -39,7 +39,7 @@ class ExampleViewController: UITableViewController {
let _button = UIButton(type: .System)
_button.frame = CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width, height: 88)
_button.setTitle("Storyboard", forState: .Normal)
- _button.addTarget(self, action: #selector(showStoryboard(_:)), forControlEvents: .TouchUpInside)
+ _button.addTarget(self, action: .showStoryboard, forControlEvents: .TouchUpInside)
return _button
}()
@@ -133,3 +133,11 @@ class ExampleViewController: UITableViewController {
}
}
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+private extension Selector {
+ static let showStoryboard = #selector(ExampleViewController.showStoryboard(_:))
+}
diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist
index 6d52a7c..f41df19 100644
--- a/Example/Example/Info.plist
+++ b/Example/Example/Info.plist
@@ -15,11 +15,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 1.0.0
+ 1.1.0
CFBundleSignature
????
CFBundleVersion
- 1
+ 101
LSRequiresIPhoneOS
UILaunchStoryboardName
@@ -28,11 +28,14 @@
armv7
+ UIRequiresFullScreen
+
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
+ UIInterfaceOrientationPortraitUpsideDown
diff --git a/Example/ICInputAccessoryUITests/Info.plist b/Example/ICInputAccessoryUITests/Info.plist
index ba72822..3b9aa4a 100644
--- a/Example/ICInputAccessoryUITests/Info.plist
+++ b/Example/ICInputAccessoryUITests/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
BNDL
CFBundleShortVersionString
- 1.0
+ 1.1.0
CFBundleSignature
????
CFBundleVersion
diff --git a/Gemfile b/Gemfile
index f27c031..309c365 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
source "http://rubygems.org"
ruby "2.3.1"
-gem "cocoapods", "1.0.0"
+gem "cocoapods", "~> 1.0.0"
gem "pry"
gem "rake"
gem "xcpretty"
diff --git a/Gemfile.lock b/Gemfile.lock
index 831d0fd..2ac56c0 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,17 +1,16 @@
GEM
remote: http://rubygems.org/
specs:
- activesupport (4.2.6)
+ activesupport (5.0.0)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
- json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
claide (1.0.0)
- cocoapods (1.0.0)
+ cocoapods (1.0.1)
activesupport (>= 4.0.2)
claide (>= 1.0.0, < 2.0)
- cocoapods-core (= 1.0.0)
+ cocoapods-core (= 1.0.1)
cocoapods-deintegrate (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.0.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -24,13 +23,13 @@ GEM
fourflusher (~> 0.3.0)
molinillo (~> 0.4.5)
nap (~> 1.0)
- xcodeproj (>= 1.0.0, < 2.0)
- cocoapods-core (1.0.0)
+ xcodeproj (>= 1.1.0, < 2.0)
+ cocoapods-core (1.0.1)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.0)
- cocoapods-downloader (1.0.0)
+ cocoapods-downloader (1.1.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
@@ -38,30 +37,30 @@ GEM
cocoapods-trunk (1.0.0)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
- cocoapods-try (1.0.0)
+ cocoapods-try (1.1.0)
coderay (1.1.1)
colored (1.2)
+ concurrent-ruby (1.0.2)
escape (0.0.4)
- fourflusher (0.3.1)
+ fourflusher (0.3.2)
fuzzy_match (2.0.4)
i18n (0.7.0)
- json (1.8.3)
method_source (0.8.2)
minitest (5.9.0)
molinillo (0.4.5)
nap (1.1.0)
netrc (0.7.8)
- pry (0.10.3)
+ pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
- rake (11.1.2)
- rouge (1.10.1)
+ rake (11.2.2)
+ rouge (1.11.1)
slop (3.6.0)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
- xcodeproj (1.0.0)
+ xcodeproj (1.2.0)
activesupport (>= 3)
claide (>= 1.0.0, < 2.0)
colored (~> 1.2)
@@ -72,7 +71,7 @@ PLATFORMS
ruby
DEPENDENCIES
- cocoapods (= 1.0.0)
+ cocoapods (~> 1.0.0)
pry
rake
xcpretty
diff --git a/ICInputAccessory.podspec b/ICInputAccessory.podspec
index c3f15c2..f2d77e7 100644
--- a/ICInputAccessory.podspec
+++ b/ICInputAccessory.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ICInputAccessory"
- s.version = "1.0.0"
+ s.version = "1.1.0"
s.summary = "A customized token text field used in the iCook app."
s.description = <<-DESC
ICKeyboardDismissTextField:
diff --git a/ICInputAccessory/Info.plist b/ICInputAccessory/Info.plist
index 60b9c00..09bc972 100644
--- a/ICInputAccessory/Info.plist
+++ b/ICInputAccessory/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 1.0.0
+ 1.1.0
CFBundleSignature
????
CFBundleVersion
diff --git a/Podfile.lock b/Podfile.lock
index bdb9ac8..31383d6 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -1,6 +1,6 @@
PODS:
- - ICInputAccessory/KeyboardDismissTextField (1.0.0)
- - ICInputAccessory/TokenField (1.0.0)
+ - ICInputAccessory/KeyboardDismissTextField (1.1.0)
+ - ICInputAccessory/TokenField (1.1.0)
DEPENDENCIES:
- ICInputAccessory/KeyboardDismissTextField (from `./`)
@@ -11,8 +11,8 @@ EXTERNAL SOURCES:
:path: "./"
SPEC CHECKSUMS:
- ICInputAccessory: e3c0705263aa7c86cebf96425c95aa716ec83f25
+ ICInputAccessory: fa69a534ae8811866fa9d63a6b3ecf07bfced685
PODFILE CHECKSUM: bc37f46eb6efd595acab704850534a8198e06d74
-COCOAPODS: 1.0.0
+COCOAPODS: 1.0.1
diff --git a/README.md b/README.md
index 2752b96..6546e0b 100644
--- a/README.md
+++ b/README.md
@@ -26,10 +26,8 @@ Try .
ICInputAccessory | iOS | Xcode | Swift
---------------- | :--: | :---: | -----
-v1.0.0 | 8.0+ | 7.2 | 
-v1.1.0 | 8.0+ | 7.3 | 
-
-iOS 8.0+ with Xcode 7.2 or above.
+`~> v1.0.0` | 8.0+ | 7.2 | 
+`~> v1.1.0` | 8.0+ | 7.3 | 
## Installation
@@ -136,15 +134,19 @@ See `Example/CustomizedTokenField.swift` for more details.
## Development
-Meke sure you have [Homebrew](http://brew.sh/) installed, then run in the project root:
+* Meke sure [Homebrew](http://brew.sh/) is installed.
+* Current `develop` branch requires Ruby `2.3.1`.
+* Set up dependencies by running the following command in the project root:
-```
+ ```
make setup
```
-Tasks for testing:
+* Open **ICInputAccessory.xcworkspace** and run the demo app with the `Example` scheme.
-```
+* See more tasks for building and testing:
+
+ ```
rake -T
```
diff --git a/Rakefile b/Rakefile
index 4885628..f138ad8 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,6 +1,13 @@
task default: "ci:test"
namespace :ci do
+ desc "Build targets on Travis CI with a specified OS version, default OS=latest"
+ task :build, [:os] do |t, args|
+ version = args[:os] || "latest"
+ Rake::Task["framework:build"].invoke version
+ Rake::Task["example:build"].invoke version
+ end
+
desc "Run tests on Travis CI with a specified OS version, default OS=latest"
task :test, [:os] do |t, args|
version = args[:os] || "latest"
diff --git a/Source/KeyboardDismissTextField/ICKeyboardDismissTextField.swift b/Source/KeyboardDismissTextField/ICKeyboardDismissTextField.swift
index 20b6443..b0ecdf3 100644
--- a/Source/KeyboardDismissTextField/ICKeyboardDismissTextField.swift
+++ b/Source/KeyboardDismissTextField/ICKeyboardDismissTextField.swift
@@ -32,7 +32,7 @@ public class ICKeyboardDismissTextField: UITextField {
@IBOutlet public var keyboardAccessoryView: ICKeyboardDismissAccessoryView! {
didSet {
if UI_USER_INTERFACE_IDIOM() != .Phone { return }
- keyboardAccessoryView.dismissButton.addTarget(self, action: #selector(dismiss(_:)), forControlEvents: .TouchUpInside)
+ keyboardAccessoryView.dismissButton.addTarget(self, action: .dismiss, forControlEvents: .TouchUpInside)
inputAccessoryView = keyboardAccessoryView
}
}
@@ -74,3 +74,11 @@ public class ICKeyboardDismissTextField: UITextField {
}
}
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+private extension Selector {
+ static let dismiss = #selector(ICKeyboardDismissTextField.dismiss(_:))
+}
diff --git a/Source/TokenField/ICTokenField.swift b/Source/TokenField/ICTokenField.swift
index 2f8b237..767bc0f 100644
--- a/Source/TokenField/ICTokenField.swift
+++ b/Source/TokenField/ICTokenField.swift
@@ -172,7 +172,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
_textField.returnKeyType = .Search
_textField.delegate = self
_textField.backspaceDelegate = self
- _textField.addTarget(self, action: #selector(togglePlaceholderIfNeeded(_:)), forControlEvents: .AllEditingEvents)
+ _textField.addTarget(self, action: .togglePlaceholderIfNeeded, forControlEvents: .AllEditingEvents)
return _textField
}()
@@ -206,7 +206,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
}()
private lazy var tapGestureRecognizer: UITapGestureRecognizer = {
- UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:)))
+ UITapGestureRecognizer(target: self, action: .handleTapGesture)
}()
// MARK: - Initialization
@@ -282,9 +282,9 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
removeHighlightedToken() // as user starts typing when a token is focused
inputTextField.showsCursor = true
- guard
- let input = textField.text,
- let text: NSString = (input as NSString).stringByReplacingCharactersInRange(range, withString: string)
+ guard let
+ input = textField.text,
+ text: NSString = (input as NSString).stringByReplacingCharactersInRange(range, withString: string)
else {
return true
}
@@ -454,3 +454,12 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
}
}
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+private extension Selector {
+ static let togglePlaceholderIfNeeded = #selector(ICTokenField.togglePlaceholderIfNeeded(_:))
+ static let handleTapGesture = #selector(ICTokenField.handleTapGesture(_:))
+}