Posts

Post not yet marked as solved
1 Replies
774 Views
The KeyboardNavigation sample project has a crazy long list of SF Symbol names coded for SampleData in SymbolLibrary.swift file, which causes significant amount of time for Xcode to perform an initial indexing and ultimately cause the Xcode to stop responding on my Mac. The code should be refactored with a plain text file or plist that lists all symbol names, then at runtime, iterate through them and generate an array of SampleData accordingly.
Posted
by Jonny.
Last updated
.
Post not yet marked as solved
1 Replies
1k Views
Is it possible to present a Context Menu alongside software keyboard? I'm trying to present context menu via tapping a button while locking focus on a UITextField in the meantime. But found out whenever the context menu is presented, keyboard is automatically dismissed. Even strangely, canResignFirstResponder() and resignFirstResponder() are not called at all. Sample code: class TextField: UITextField {     override var canResignFirstResponder: Bool {         print(#function)         return false     }     override func resignFirstResponder() -> Bool {         print(#function)         return false     } } class ViewController: UIViewController {     @IBOutlet var textField: UITextField!     @IBOutlet var button: UIButton!     override func viewDidLoad() {         super.viewDidLoad()         button.menu = UIMenu(title: "", children: [             UIAction(title: "Hello") { _ in }         ])         button.showsMenuAsPrimaryAction = true     }     override var disablesAutomaticKeyboardDismissal: Bool {         print(#function)         return true     } }
Posted
by Jonny.
Last updated
.