@@ -43,7 +43,7 @@ import UIKit
4343
4444/// A text field that groups input texts with delimiters.
4545@IBDesignable
46- public class ICTokenField : UIView , UITextFieldDelegate , ICBackspaceTextFieldDelegate {
46+ open class ICTokenField : UIView , UITextFieldDelegate , ICBackspaceTextFieldDelegate {
4747
4848 // MARK: - Public Properties
4949
@@ -130,7 +130,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
130130 }
131131
132132 /// The tint color of icon image and text field.
133- public override var tintColor : UIColor ! {
133+ open override var tintColor : UIColor ! {
134134 didSet {
135135 inputTextField. tintColor = tintColor
136136 leftView? . tintColor = tintColor
@@ -223,29 +223,29 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
223223
224224 // MARK: - UIResponder
225225
226- public override var isFirstResponder : Bool {
226+ open override var isFirstResponder : Bool {
227227 return inputTextField. isFirstResponder || super. isFirstResponder
228228 }
229229
230- public override func becomeFirstResponder( ) -> Bool {
230+ open override func becomeFirstResponder( ) -> Bool {
231231 return inputTextField. becomeFirstResponder ( )
232232 }
233233
234- public override func resignFirstResponder( ) -> Bool {
234+ open override func resignFirstResponder( ) -> Bool {
235235 super. resignFirstResponder ( )
236236 return inputTextField. resignFirstResponder ( )
237237 }
238238
239239 // MARK: - UIView
240240
241- public override func layoutSubviews( ) {
241+ open override func layoutSubviews( ) {
242242 super. layoutSubviews ( )
243243 layoutTokenTextField ( )
244244 }
245245
246246 // MARK: - NSKeyValueCoding
247247
248- public override func setValue( _ value: Any ? , forKey key: String ) {
248+ open override func setValue( _ value: Any ? , forKey key: String ) {
249249 switch value {
250250 case let image as UIImage ? where key == " icon " :
251251 icon = image
@@ -262,23 +262,23 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
262262
263263 // MARK: - UITextFieldDelegate
264264
265- public func textFieldShouldBeginEditing( _ textField: UITextField ) -> Bool {
265+ open func textFieldShouldBeginEditing( _ textField: UITextField ) -> Bool {
266266 tokens. forEach { $0. highlighted = false }
267267 return true
268268 }
269269
270- public func textFieldDidBeginEditing( _ textField: UITextField ) {
270+ open func textFieldDidBeginEditing( _ textField: UITextField ) {
271271 delegate? . tokenFieldDidBeginEditing ? ( self )
272272 }
273273
274- public func textFieldDidEndEditing( _ textField: UITextField ) {
274+ open func textFieldDidEndEditing( _ textField: UITextField ) {
275275 completeCurrentInputText ( )
276276 togglePlaceholderIfNeeded ( )
277277 tokens. forEach { $0. highlighted = false }
278278 delegate? . tokenFieldDidEndEditing ? ( self )
279279 }
280280
281- public func textField( _ textField: UITextField , shouldChangeCharactersIn range: NSRange , replacementString string: String ) -> Bool {
281+ open func textField( _ textField: UITextField , shouldChangeCharactersIn range: NSRange , replacementString string: String ) -> Bool {
282282 _ = removeHighlightedToken ( ) // as user starts typing when a token is focused
283283 inputTextField. showsCursor = true
284284
@@ -307,7 +307,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
307307 return true
308308 }
309309
310- public func textFieldShouldReturn( _ textField: UITextField ) -> Bool {
310+ open func textFieldShouldReturn( _ textField: UITextField ) -> Bool {
311311 completeCurrentInputText ( )
312312 togglePlaceholderIfNeeded ( )
313313 delegate? . tokenFieldWillReturn ? ( self )
@@ -432,7 +432,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
432432 // MARK: - Public Methods
433433
434434 /// Creates a token with the current input text.
435- public func completeCurrentInputText( ) {
435+ open func completeCurrentInputText( ) {
436436 guard let text = inputTextField. text, !text. isEmpty else {
437437 return
438438 }
@@ -443,7 +443,7 @@ public class ICTokenField: UIView, UITextFieldDelegate, ICBackspaceTextFieldDele
443443 }
444444
445445 /// Removes the input text and all displayed tokens.
446- public func resetTokens( ) {
446+ open func resetTokens( ) {
447447 inputTextField. text = nil
448448 tokens. removeAll ( )
449449 layoutTokenTextField ( )
0 commit comments