I’m developing a game and would like to home indicator to hide when the screen isn’t touched. In xcode, I’d use prefersHomeIndicatorAutoHidden in Swift or Obj-C, but that option’s not available in XOJO.
Would anyone be able to help guide me in implementing this in a XOJO iOS project?
This is similar to the macOS sample I did the other day. prefersHomeIndicatorAutoHidden is a read-only instance property which means that in most cases it needs to be implemented on the iOS view controller itself (the thing that the view instance is created from).
This demo project shows how to do what you want, but just so you understand what’s going on here, this method needs to be called before the screen is shown, because the property needs to be added to the parent class before the property would be requested.
In the sample project, I’ve created a screen called StartScreen which is completely blank. Its Opening event serves one purpose, instantiate screen1, create the property and then show the screen. Unfortunately I can’t find a way to intercept it fast enough to affect the first screen.
NOTE: I’ve used an array of WeakRefs to keep track of the views where you’ve chosen to set this property to True. This is to prevent MobileScreens from leaking memory.