Skip to content

Commit 15291b7

Browse files
committed
Rename the TokenField related types
1 parent 9849589 commit 15291b7

File tree

11 files changed

+89
-89
lines changed

11 files changed

+89
-89
lines changed

Example/CustomizedTokenField.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import UIKit
2828
import ICInputAccessory
2929

30-
class CustomizedTokenField: ICTokenField {
30+
class CustomizedTokenField: TokenField {
3131

3232
override init(frame: CGRect) {
3333
super.init(frame: frame)
@@ -49,7 +49,7 @@ class CustomizedTokenField: ICTokenField {
4949
////////////////////////////////////////////////////////////////////////////////
5050

5151

52-
extension ICTokenField {
52+
extension TokenField {
5353

5454
func applyCustomizedStyle() {
5555
icon = UIImage(named: "icook-iphone-input-search")

Example/CustomizedTokenViewController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import UIKit
2828
import ICInputAccessory
2929

30-
class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {
30+
class CustomizedTokenViewController: UIViewController, TokenFieldDelegate {
3131

3232
private let tokenField = CustomizedTokenField()
3333
private let textView = UITextView()
@@ -84,40 +84,40 @@ class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {
8484
textView.endEditing(true)
8585
}
8686

87-
// MARK: - ICTokenFieldDelegate
87+
// MARK: - TokenFieldDelegate
8888

89-
func tokenFieldDidBeginEditing(_ tokenField: ICTokenField) {
89+
func tokenFieldDidBeginEditing(_ tokenField: TokenField) {
9090
print(#function)
9191
}
9292

93-
func tokenFieldDidEndEditing(_ tokenField: ICTokenField) {
93+
func tokenFieldDidEndEditing(_ tokenField: TokenField) {
9494
print(#function)
9595
}
9696

97-
func tokenFieldWillReturn(_ tokenField: ICTokenField) {
97+
func tokenFieldWillReturn(_ tokenField: TokenField) {
9898
print(#function)
9999
}
100100

101-
func tokenField(_ tokenField: ICTokenField, didChangeInputText text: String) {
101+
func tokenField(_ tokenField: TokenField, didChangeInputText text: String) {
102102
print("Typing \"\(text)\"")
103103
}
104104

105-
func tokenField(_ tokenField: ICTokenField, shouldCompleteText text: String) -> Bool {
105+
func tokenField(_ tokenField: TokenField, shouldCompleteText text: String) -> Bool {
106106
print("Should add \"\(text)\"?")
107107
return text != "42"
108108
}
109109

110-
func tokenField(_ tokenField: ICTokenField, didCompleteText text: String) {
110+
func tokenField(_ tokenField: TokenField, didCompleteText text: String) {
111111
print("Added \"\(text)\"")
112112
updateTexts()
113113
}
114114

115-
func tokenField(_ tokenField: ICTokenField, didDeleteText text: String, atIndex index: Int) {
115+
func tokenField(_ tokenField: TokenField, didDeleteText text: String, atIndex index: Int) {
116116
print("Deleted \"\(text)\"")
117117
updateTexts()
118118
}
119119

120-
func tokenField(_ tokenField: ICTokenField, subsequentDelimiterForCompletedText text: String) -> String {
120+
func tokenField(_ tokenField: TokenField, subsequentDelimiterForCompletedText text: String) -> String {
121121
return " ,"
122122
}
123123

Example/ExampleViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ExampleViewController: UITableViewController {
3131

3232
private let types: [UIView.Type] = [
3333
ICKeyboardDismissTextField.self,
34-
ICTokenField.self,
34+
TokenField.self,
3535
CustomizedTokenField.self
3636
]
3737

@@ -74,7 +74,7 @@ class ExampleViewController: UITableViewController {
7474
switch types[section] {
7575
case is ICKeyboardDismissTextField.Type:
7676
return "Dismiss Keyboard"
77-
case is ICTokenField.Type:
77+
case is TokenField.Type:
7878
return "Text Field with Tokens"
7979
case is CustomizedTokenField.Type:
8080
return "Customize Token Field"
@@ -98,7 +98,7 @@ class ExampleViewController: UITableViewController {
9898
cell.textLabel?.text = String(describing: type)
9999
cell.accessoryType = .disclosureIndicator
100100

101-
case let type as ICTokenField.Type:
101+
case let type as TokenField.Type:
102102
let container = UIView(frame: cell.bounds)
103103
let tokenField = type.init()
104104
tokenField.placeholder = String(describing: type)

Example/Main.storyboard

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="XY5-gz-UXC">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="XY5-gz-UXC">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
99
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
1010
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1111
</dependencies>
@@ -19,7 +19,7 @@
1919
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2020
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2121
<button key="tableFooterView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="N87-CU-PrP">
22-
<rect key="frame" x="0.0" y="219" width="375" height="88"/>
22+
<rect key="frame" x="0.0" y="217.5" width="375" height="88"/>
2323
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2424
<fontDescription key="fontDescription" type="system" pointSize="15"/>
2525
<state key="normal" title="Back to Code"/>
@@ -31,14 +31,14 @@
3131
<tableViewSection headerTitle="Dismiss Keyboard" id="tmE-Ln-PNX">
3232
<cells>
3333
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="hiq-lt-L5I">
34-
<rect key="frame" x="0.0" y="56" width="375" height="44"/>
34+
<rect key="frame" x="0.0" y="55.5" width="375" height="44"/>
3535
<autoresizingMask key="autoresizingMask"/>
3636
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hiq-lt-L5I" id="dNb-Qm-7pq">
37-
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
37+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
3838
<autoresizingMask key="autoresizingMask"/>
3939
<subviews>
4040
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Storyboard ICKeyboardDismissTextField" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qdb-Ab-nYe" customClass="ICKeyboardDismissTextField" customModule="ICInputAccessory">
41-
<rect key="frame" x="18" y="12" width="339" height="20"/>
41+
<rect key="frame" x="26" y="12" width="323" height="20"/>
4242
<fontDescription key="fontDescription" type="system" pointSize="16"/>
4343
<textInputTraits key="textInputTraits"/>
4444
<connections>
@@ -58,18 +58,18 @@
5858
<tableViewSection headerTitle="Text Field with Tokens" id="dx2-iZ-OPN">
5959
<cells>
6060
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="nCe-ZG-eEP">
61-
<rect key="frame" x="0.0" y="157" width="375" height="44"/>
61+
<rect key="frame" x="0.0" y="155.5" width="375" height="44"/>
6262
<autoresizingMask key="autoresizingMask"/>
6363
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="nCe-ZG-eEP" id="6tu-Im-VHX">
64-
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
64+
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
6565
<autoresizingMask key="autoresizingMask"/>
6666
<subviews>
67-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2dP-7v-mWC" customClass="ICTokenField" customModule="ICInputAccessory">
67+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2dP-7v-mWC" customClass="TokenField" customModule="ICInputAccessory">
6868
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
6969
<color key="backgroundColor" red="0.33333333333333331" green="0.33333333333333331" blue="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
7070
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
7171
<userDefinedRuntimeAttributes>
72-
<userDefinedRuntimeAttribute type="string" keyPath="placeholder" value="Storyboard ICTokenField"/>
72+
<userDefinedRuntimeAttribute type="string" keyPath="placeholder" value="Storyboard TokenField"/>
7373
<userDefinedRuntimeAttribute type="image" keyPath="icon" value="icook-iphone-input-search"/>
7474
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
7575
<real key="value" value="0.0"/>
@@ -124,7 +124,7 @@
124124
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="XY5-gz-UXC" sceneMemberID="viewController">
125125
<toolbarItems/>
126126
<navigationBar key="navigationBar" contentMode="scaleToFill" id="wet-wK-15h">
127-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
127+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
128128
<autoresizingMask key="autoresizingMask"/>
129129
</navigationBar>
130130
<nil name="viewControllers"/>

Example/StoryboardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import ICInputAccessory
2929

3030
class StoryboardViewController: UITableViewController {
3131

32-
@IBOutlet weak var tokenField: ICTokenField! {
32+
@IBOutlet weak var tokenField: TokenField! {
3333
didSet {
3434
tokenField.normalTokenAttributes = [
3535
.foregroundColor: UIColor.white,

0 commit comments

Comments
 (0)