Skip to content

Commit 8fc5b2e

Browse files
committed
Rename tokenField(_:didCompleteText:)
1 parent 38fb097 commit 8fc5b2e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Example/CustomizedTokenViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CustomizedTokenViewController: UIViewController, ICTokenFieldDelegate {
8383
print(#function)
8484
}
8585

86-
func tokenField(_ tokenField: ICTokenField, didEnterText text: String) {
86+
func tokenField(_ tokenField: ICTokenField, didCompleteText text: String) {
8787
print("Add: \"\(text)\"")
8888
updateTexts()
8989
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ See `Example/CustomizedTokenField.swift` for more details.
135135
* `tokenFieldDidBeginEditing(_:)`
136136
* `tokenFieldDidEndEditing(_:)`
137137
* `tokenFieldWillReturn(_:)`
138-
* `tokenField(_:didEnterText:)`
138+
* `tokenField(_:didCompleteText:)`
139139
* `tokenField(_:didDeleteText:atIndex:)`
140140

141141
## Development

Source/TokenField/ICTokenField.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import UIKit
3535
/// Tells the delegate that the token field will process the pressing of the return button.
3636
@objc optional func tokenFieldWillReturn(_ tokenField: ICTokenField)
3737
/// Tells the delegate that the text becomes a token in the token field.
38-
@objc optional func tokenField(_ tokenField: ICTokenField, didEnterText text: String)
38+
@objc optional func tokenField(_ tokenField: ICTokenField, didCompleteText text: String)
3939
/// Tells the delegate that the token at certain index is removed from the token field.
4040
@objc optional func tokenField(_ tokenField: ICTokenField, didDeleteText text: String, atIndex index: Int)
4141
}
@@ -297,7 +297,7 @@ open class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDelega
297297
if !newToken.isEmpty && newToken != delimiter {
298298
tokens.append(ICToken(text: newToken, normalAttributes: normalTokenAttributes, highlightedAttributes: highlightedTokenAttributes))
299299
layoutTokenTextField()
300-
delegate?.tokenField?(self, didEnterText: newToken)
300+
delegate?.tokenField?(self, didCompleteText: newToken)
301301
}
302302
togglePlaceholderIfNeeded()
303303

@@ -439,7 +439,7 @@ open class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDelega
439439
inputTextField.text = nil
440440
tokens.append(ICToken(text: text, normalAttributes: normalTokenAttributes, highlightedAttributes: highlightedTokenAttributes))
441441
layoutTokenTextField()
442-
delegate?.tokenField?(self, didEnterText: text)
442+
delegate?.tokenField?(self, didCompleteText: text)
443443
}
444444

445445
/// Removes the input text and all displayed tokens.

0 commit comments

Comments
 (0)