Post

Replies

Boosts

Views

Activity

How to receive hardware keyboard events but block pop-up keyboard
I have a calculator app, and I would like to add support for using it with a hardware keyboard. I understand I can receive keyboard events by making my view implement canBecomeFirstResponder and having it return YES, and then calling becomeFirstResponder when the view becomes active. The problem is: I don't want the pop-up keyboard to appear. The app has its own keyboard; the UI simulates a physical calculator, and handles tap events by figuring out which calculator key is pressed and then acting accordingly. So the pop-up keyboard would literally just get in the way. But I do want to receive key events from hardware keyboards. I'm thinking of making canBecomeFirstResponder check for the presence of hardware keyboards, and return NO if none are present. But I'm not sure how to deal with hardware keyboards being connected or disconnected while the calculator view is active, and I'm also concerned about the keyboard bar on iPads. Is it possible to get hardware keyboard events without anything interfering with my UI like that?
0
0
255
Jan ’24
Loading crash log wih Direct Distribution
I have a MacOS app which I publish using Direct Distribution. A user has reported a crash which I am unable to reproduce. They have provided me with a crash log, but I can't figure out how to link this to the source code in my project. It seems like this is easy for apps distributed using Test Flight or the App Store, which I have done with the iOS version of my app, but I'm having no luck figuring out how to do this with my Direct Distribution app. Is it possible?
0
0
253
Dec ’23
sceneDidEnterBackground not called from App Switcher
When I go from my app to the App Switcher by double-clicking the home button, the app is shown in the App Switcher view, still running. However, if I then kill the app by sliding it upward, it is killed without sceneDidEnterBackground ever having been called. This means the saved state ends up being whatever it was when the app was launched. In an older app, which uses applicationDidEnterBackground, this problem does not exist; the method is always called, regardless of how I exit it, including when the app is killed by sliding it upward in the App Switcher. Isn't sceneDidEnterBackground supposed to be called at the same moments as applicationDidEnterBackground in older apps? As far as I can see, it isn't, and I don't see how to get my app to write its state reliably. Saving state in sceneWillResignActive is not a good alternative, because in the App Switcher, the app is still running after that method is called, so whichever changes happen to its state after sceneWillResignActive is called would still be lost.
3
0
1.2k
Apr ’22