@objc func promptForAnswer() {
let ac = UIAlertController(title: "Enter Answer", message: nil, preferredStyle: .alert)
ac.addTextField()
let submitAction = UIAlertAction(title: "Submit", style: .default) {
[weak self, weak ac] action in
guard let answer = ac?.textFields?[0].text else {return}
self?.submit(answer)
}
ac.addAction(submitAction)
present(ac, animated: true)
}
With ac.addTexfield() the alert controller isn't appearing, However, without that line and the closure, the alert is appearing.
There's no error, the alert just doesnt appear.
However, in the console I do see
Class _PointQueue is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore (0x10fe0b628) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/TextInputUI.framework/TextInputUI (0x12fd836b8). One of the two will be used. Which one is undefined.
Could anyone help please?