The crash occurs upon selecting the Text Field in the simulator. The debugger seems to tell me nothing useful.
import UIKit
class TextField: NSObject, UITextFieldDelegate {}
In the View Controller:
override func viewDidLoad() {
super.viewDidLoad()
textField.delegate = TextField()
}
@IBOutlet weak var textField: UITextField! // assigned in IB.
UITextField.delegate is unowned, so the delegates were being deallocated after viewDidLoad returned.