Posts

Post not yet marked as solved
0 Replies
289 Views
With iOS 15 there are changes to keyboard handling. Besides usual overriding of keyCommands a programmer has to assign own commands higher priority than system commands. So, the following code works for me: final class MyViewController: UIViewController { override var keyCommands: [UIKeyCommand]? { let action = UIKeyCommand(input: UIKeyCommand.inputUpArrow, modifierFlags: [], action: #selector(myAction)) if #available(iOS 15, *) { action.wantsPriorityOverSystemBehavior = true } return [action] } // rest of the code } On the other hand, almost the same code but with inheriting from QLPreviewController doesn't work: final class PreviewViewController: QLPreviewController { // same internals as above } In view hierarchy I spotted that there is actually some kind of extra navigation, maybe that is stealing my keyboard presses, maybe that's why above code isn't working. Does anyone have an idea how to fix or workaround this issue? Obviously, the extra navigation is from Apple and I don't have access to these extra presented controllers. I was trying to print the following details, but neither helps: print(presentedViewController ?? "none") // output: none print(topMostViewController) // output: <MyApp.PreviewViewController: 0x7fbe44156203> print(inputViewController ?? "none") // output: none It's worth to add I've also tried to add method override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("test?") super.pressesBegan(presses, with: event) } And test never appears in the console, whatever button I press. So clearly something else steals the key presses. This did not happen before iOS 15. I conclude it, thinking it may be a bug in the API. Probably just no one thought of this scenario when adding the new keys..?
Posted Last updated
.
Post not yet marked as solved
0 Replies
322 Views
If we have a QLPreviewController with video file inside, the video is loaded in a paused state. The user has to tap on play icon to make it play. I can't find any programmatic way to play the video, is there anything? Since I think there is no such option, however it would certainly be handy, maybe this is a good place to ask for such new API feature? I know where to ask for Swift evolution changes, but where to ask for API changes?
Posted Last updated
.