Post

Replies

Boosts

Views

Activity

The sample project freeze my Mac for several minutes
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.
2
0
889
Jun ’21
How to present Context Menu alongside software keyboard?
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     } }
1
0
1.2k
Jun ’20