tvOS Side/Custom Menu

Thanks to other developers I discovered the magic of suspending an app on tvOS. I had a side menu using a UITabBarController underneath, but to close the app it involved some custom handling in pressesBegan that never quite worked like I wanted it to. Instead I am now able to put a gesture recognized on my menu for the menu button from the remote that then calls this to suspend the app and everything works as desired.

UIApplication.shared.perform(#selector(NSXPCConnection.suspend))

iOS Tests Timing Out Problem

Ran into a problem with our tests failing for iOS yesterday on GitHub Actions. Others were having no problem, but my branch was failing every time. There wasn’t that many changes either, mostly bumping the version number for a new release.

encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test crashed with signal abrt before starting test execution.

If I had been able to get a screenshot I would have saved a lot of time. Instead I spent all day and some of my evening trying to figure out what was causing my test phase with Fastlane to fail, but not other people’s branches. In the end a small bit for something related, but not quite the same error log about the push notifications prompt being on screen and stopping everything led me to realize our prompt on launch could be the problem. So since we don’t test notifications automatically, at least not yet, I just prevented the app from asking for permission on launch when running tests. With the following:

guard NSClassFromString("XCTest") == nil else { return }

Silent/Ringer or Side Switch Behavior

It seemed at one point that there was a lot of confusion about what the ring/silent switch on the iPhone and the side switch on the iPad should do. At the time I recall not being able to discern a clear distinction from Apple, but this week when asked about it again I was able to find clear direction in the current manuals for both device types. To quote from the iPad mini's manual:

The Side Switch doesn’t mute audio or video playback. Use the volume buttons on the side to silence these sounds.

If the device is muted/silenced by the switch it is supposed to only silence incidental sounds, however if sound is the primary purpose of the experience, then that should still be heard. It is one extra attention to detail thing when developers understand and make their apps obey this.

Another thought on audio in apps, specifically games, it is surprising to me how many don't allow me to listen to my own music while playing. Many get it right, but there are a couple that incorrectly setup their audio session, so even with sound effects and music turned off I can't listen to a podcast, or another uses a movie when launching the app, but the movie doesn't have any audio, but it still stops playback of my own audio.