Create max character length in UITextField using IBInspectable [duplicate]
问题 This question already has answers here : Limiting characters and character length in textField(_:shouldChangeCharactersInRange:replacementString:) (2 answers) Closed 13 days ago . I want to create a max length to my textfield with IBInspectable , I see a answer to this on a question here but I'm getting an error saying Expression type '()' is ambiguous without more context , My code was import UIKit private var __maxLengths = [UITextField: Int]() extension UITextField { @IBInspectable var