Search code examples
swiftxcodeuitextfieldibaction

Can't add action on UITextfield to view controller


It was fine til suddenly i can't add action to UITextfield on xcode, the view controller's class name on storyboard == the view controller's code, no problem on adding action to UIButton, but UITextField has no action option when ctrl dragging to code :((

I wonder what the hell happened

no Action option


Solution

  • okay found the problem,

    i used SwiftValidator and this: https://github.com/jpotts18/SwiftValidator/blob/43fddfb3851b8edc3b26ec0d49404fa445963483/SwiftValidator/Core/Validatable.swift

    the extension somehow fucked XCode and i can't add IBAction for UITextFIeld on interface builder.

    similar problem but on UIButton: Can't connect IBAction in Xcode