Skip to content

Commit a194373

Browse files
committed
Merge branch 'release/1.0.0' into develop
2 parents d453ccd + 0b30ead commit a194373

10 files changed

Lines changed: 99 additions & 37 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## v1.0.0
2+
3+
Initial release written in Swift 2.1.
4+
5+
#### Added
6+
7+
* `ICKeyboardDismissTextField` with an accessory view to dismiss keyboard.
8+
* `ICTokenField`, a text field that groups input texts as tokens.

Example/Example.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@
402402
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
403403
GCC_WARN_UNUSED_FUNCTION = YES;
404404
GCC_WARN_UNUSED_VARIABLE = YES;
405-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
405+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
406406
MTL_ENABLE_DEBUG_INFO = YES;
407407
ONLY_ACTIVE_ARCH = YES;
408408
SDKROOT = iphoneos;
@@ -440,7 +440,7 @@
440440
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
441441
GCC_WARN_UNUSED_FUNCTION = YES;
442442
GCC_WARN_UNUSED_VARIABLE = YES;
443-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
443+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
444444
MTL_ENABLE_DEBUG_INFO = NO;
445445
SDKROOT = iphoneos;
446446
VALIDATE_PRODUCT = YES;
@@ -457,6 +457,7 @@
457457
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
458458
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
459459
PRODUCT_NAME = "$(TARGET_NAME)";
460+
TARGETED_DEVICE_FAMILY = "1,2";
460461
};
461462
name = Debug;
462463
};
@@ -470,6 +471,7 @@
470471
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
471472
PRODUCT_BUNDLE_IDENTIFIER = com.polydice.ICInputAccessoryExample;
472473
PRODUCT_NAME = "$(TARGET_NAME)";
474+
TARGETED_DEVICE_FAMILY = "1,2";
473475
};
474476
name = Release;
475477
};

Example/Example/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.1.0</string>
18+
<string>1.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

ICInputAccessory.podspec

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
Pod::Spec.new do |s|
22
s.name = "ICInputAccessory"
3-
s.version = "0.1.0"
4-
s.summary = "A customized input accessory UI to dismiss keyboard."
3+
s.version = "1.0.0"
4+
s.summary = "Customized text fields used in the iCook app."
5+
s.description = <<-DESC
6+
ICKeyboardDismissTextField:
7+
* An input accessory view with a button to dismiss keyboard.
58
9+
ICTokenField:
10+
* A horizontal scrolling UI that groups input texts.
11+
* Easy to add and delete tokens.
12+
* Customizable icon and colors.
13+
DESC
14+
15+
s.screenshots = "https://raw.githubusercontent.com/polydice/ICInputAccessory/gh-pages/screenshots/ICKeyboardDismissTextField.png",
16+
"https://raw.githubusercontent.com/polydice/ICInputAccessory/gh-pages/screenshots/ICTokenField.png"
617
s.homepage = "https://github.com/polydice/ICInputAccessory"
718
s.license = { type: "MIT", file: "LICENSE" }
819
s.authors = "bcylin", "trisix"

ICInputAccessory.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
218218
GCC_WARN_UNUSED_FUNCTION = YES;
219219
GCC_WARN_UNUSED_VARIABLE = YES;
220-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
220+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
221221
MTL_ENABLE_DEBUG_INFO = YES;
222222
ONLY_ACTIVE_ARCH = YES;
223223
SDKROOT = iphoneos;
@@ -259,7 +259,7 @@
259259
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
260260
GCC_WARN_UNUSED_FUNCTION = YES;
261261
GCC_WARN_UNUSED_VARIABLE = YES;
262-
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
262+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
263263
MTL_ENABLE_DEBUG_INFO = NO;
264264
SDKROOT = iphoneos;
265265
TARGETED_DEVICE_FAMILY = "1,2";

ICInputAccessory/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.1.0</string>
18+
<string>1.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ bundle-install:
99

1010
pod-install:
1111
bundle exec pod install --no-repo-update
12+
13+
setup: brew-install
14+
bundle install
15+
bundle exec pod install --no-repo-update

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- ICInputAccessory (0.1.0)
2+
- ICInputAccessory (1.0.0)
33

44
DEPENDENCIES:
55
- ICInputAccessory (from `./`)
@@ -9,6 +9,6 @@ EXTERNAL SOURCES:
99
:path: "./"
1010

1111
SPEC CHECKSUMS:
12-
ICInputAccessory: 99d2957193e587e3d82c4b3a045c58c3b02c120c
12+
ICInputAccessory: 341225aaa67a035b266880a5795001b363d1b1da
1313

1414
COCOAPODS: 0.39.0

README.md

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# ICInputAccessory
22

3-
Customized text fields used in the iCook app.
3+
Customized text fields used in the [iCook app](https://itunes.apple.com/app/id554065086).
4+
Try <https://testflight.icook.tw>.
45

5-
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
66
[![Build Status](https://travis-ci.org/polydice/ICInputAccessory.svg?branch=develop)](https://travis-ci.org/polydice/ICInputAccessory)
7+
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
8+
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/ICInputAccessory.svg)](https://img.shields.io/cocoapods/v/ICInputAccessory.svg)
9+
![Platform](https://img.shields.io/cocoapods/p/ICInputAccessory.svg?style=flat)
10+
![Swift 2.1.1](https://img.shields.io/badge/Swift-2.1.1-orange.svg)
711

812
### ICKeyboardDismissTextField
913

@@ -12,20 +16,14 @@ Customized text fields used in the iCook app.
1216
### ICTokenField
1317

1418
* A horizontal scrolling UI that groups input texts.
15-
* Easy to add and delete tokens.
19+
* Easy to add, select and delete tokens.
1620
* Customizable icon and colors.
1721

18-
<table>
19-
<tr>
20-
<th>ICKeyboardDismissTextField</th>
21-
<th rowspan="2"></th>
22-
<th>ICTokenField</th>
23-
</tr>
24-
<tr>
25-
<th><img src="https://raw.githubusercontent.com/polydice/ICInputAccessory/gh-pages/screenshots/ICKeyboardDismissTextField.png" width="90%" /></th>
26-
<th><img src="https://raw.githubusercontent.com/polydice/ICInputAccessory/gh-pages/screenshots/ICTokenField.png" width="90%" /></th>
27-
</tr>
28-
</table>
22+
![ICTokenField](https://raw.githubusercontent.com/polydice/ICInputAccessory/gh-pages/screenshots/ICTokenField.gif)
23+
24+
## Requirements
25+
26+
iOS 8.0+ with Xcode 7.2 or above.
2927

3028
## Installation
3129

@@ -37,21 +35,22 @@ Customized text fields used in the iCook app.
3735
github "polydice/ICInputAccessory"
3836
```
3937

40-
* On your application targets' **General** settings tab, in the **Linked Frameworks and Libraries** section, drag and drop `ICInputAccessory.framework` from the Carthage/Build directory.
38+
* Follow the [instruction](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add the framework to an iOS project.
4139

42-
* On your application targets’ **Build Phases** settings tab, click the **+** icon and choose **New Run Script Phase**. Create a Run Script with the following contents:
40+
### Install via [CocoaPods](http://guides.cocoapods.org/)
4341

44-
```
45-
/usr/local/bin/carthage copy-frameworks
46-
```
42+
* Create a `Podfile` with the following specification and run `pod install`.
4743

48-
and add the following path to **Input Files**:
44+
```rb
45+
platform :ios, '8.0'
46+
use_frameworks!
4947

50-
```
51-
$(SRCROOT)/Carthage/Build/iOS/ICInputAccessory.framework
48+
pod 'ICInputAccessory'
5249
```
5350

54-
* For more information, please check out the [Carthage Documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios).
51+
### Install Manually
52+
53+
* Everything you need resides in the `Source` directory. Drag those files to a project.
5554

5655
## Usage
5756

@@ -107,7 +106,7 @@ public var normalTokenAttributes: [String : NSObject]? { get set }
107106
public var highlightedTokenAttributes: [String : NSObject]? { get set }
108107
```
109108

110-
See `Example/CustomizedTokenField.swift` for more detail.
109+
See `Example/CustomizedTokenField.swift` for more details.
111110

112111
#### ICTokenFieldDelegate
113112

@@ -118,3 +117,33 @@ public var highlightedTokenAttributes: [String : NSObject]? { get set }
118117
* `tokenFieldWillReturn(_:)`
119118
* `tokenField(_:didEnterText:)`
120119
* `tokenField(_:didDeleteText:atIndex:)`
120+
121+
## Development
122+
123+
Meke sure you have [Homebrew](http://brew.sh/) installed, then run in the project root:
124+
125+
```
126+
make setup
127+
```
128+
129+
Tasks for testing:
130+
131+
```
132+
rake -T
133+
```
134+
135+
## Contributing
136+
137+
Thank you for being interested in contributing to this project. We'd love to hear your ideas!
138+
139+
Please fork this repository, create a branch named like `feature/some-new-feature` and send us a pull request to make this project better.
140+
141+
## Contact
142+
143+
[![Twitter](https://img.shields.io/badge/twitter-@polydice-blue.svg?style=flat)](https://twitter.com/polydice)
144+
145+
## License
146+
147+
Copyright (c) 2016 [Polydice, Inc.](https://polydice.com)
148+
149+
**ICInputAccessory** is released under the MIT license. See [LICENSE](https://github.com/polydice/ICInputAccessory/blob/master/LICENSE) for details.

Source/ICKeyboardDismissTextField.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,31 @@ public class ICKeyboardDismissTextField: UITextField {
3838

3939
override public init(frame: CGRect) {
4040
super.init(frame: frame)
41-
inputAccessoryView = accessoryView
41+
setUpAccessoryView()
4242
}
4343

4444
required public init?(coder aDecoder: NSCoder) {
4545
super.init(coder: aDecoder)
46-
inputAccessoryView = accessoryView
46+
setUpAccessoryView()
4747
}
4848

4949
// MARK: - UIResponder
5050

5151
override public func becomeFirstResponder() -> Bool {
52-
accessoryView.alpha = 1
52+
if UI_USER_INTERFACE_IDIOM() == .Phone {
53+
accessoryView.alpha = 1
54+
}
5355
return super.becomeFirstResponder()
5456
}
5557

5658
// MARK: - Private Methods
5759

60+
private func setUpAccessoryView() {
61+
if UI_USER_INTERFACE_IDIOM() == .Phone {
62+
inputAccessoryView = accessoryView
63+
}
64+
}
65+
5866
@IBAction private func dismiss(sender: UIButton) {
5967
resignFirstResponder()
6068
UIView.animateWithDuration(0.3) {

0 commit comments

Comments
 (0)