Swift 3 triggering segue causes crash -
hi trying perform segue entering specific word in textfield. far noob skills brought me this. don't error, simulator crashes.
any hints?
import uikit
class codewordvc: uiviewcontroller, uitextfielddelegate { @iboutlet weak var passwordinput: uitextfield!
override func viewdidload() { super.viewdidload()
passwordinput.delegate = self }
@ibaction func losbutton(_ sender: uibutton) { //passwords let realpassword1 = "rudi" if passwordinput.text == realpassword1 { self .performsegue(withidentifier: "rudi", sender: self) } func dismissbutton(_ sender: uibutton) { dismiss(animated: true, completion: nil)
got work! can't explain, answer:
import uikit
class codewordvc: uiviewcontroller, uitextfielddelegate {
@iboutlet weak var passwordinput: uitextfield! override func viewdidload() { super.viewdidload() }
let realpassword1 = "rudi"
@ibaction func losbutton(_ sender: uibutton) { passwordinput.delegate = self //passwords if self.passwordinput.text == realpassword1 { dispatchqueue.main.async(){ self.performsegue(withidentifier: "rudi", sender: self) } } } func dismissbutton(_ sender: uibutton) { dismiss(animated: true, completion: nil) } }
Comments
Post a Comment