swift - iOS text field not resigning first responder -
i can't seem resign first responder text field. please , have looked @ other solutions on stackoverflow can't find solution. here error thrown unrecognized selector sent instance
class viewcontroller: uiviewcontroller, uitextfielddelegate { @iboutlet var textinputscreen: uitextfield! override func viewdidload() { super.viewdidload() textinputscreen.delegate = self } func textfieldshouldreturn(_ textfield: uitextfield) -> bool { // textfield.canresignfirstresponder true textfield.resignfirstresponder() // throws error // view.endediting(true) // throws same error // textinputscreen.resignfirstresponder() // throws same error return true }
the common case textfield has @ least 1 referencing outlet not link anything. if can take again @ storyboard, might see this.

Comments
Post a Comment