I could actually fix it by modifying SDL. It took quite some time ![]()
So basically I copied the code related to the scene-based UIKit app lifecycle from SDL 3.4 to the current SDL module included in Lime. The fix is not easy to apply, but anyway, this is how you can do it:
- Clone a GIT version of Lime ( GitHub - openfl/lime: A foundational Haxe framework for cross-platform development · GitHub ). This can be installed to haxelib directly from GitHub with
haxelib git lime https://github.com/openfl/lime. Change the branch if you don’t want the default ‘develop’ branch. - You will need Lime submodules to rebuild lime and tools (and ios later). You can follow these steps (except it’s macos, not windows): How rebuild Lime? - #10 by singmajesty.
- Replace the files in Lime/SDL ([YOUR LIME DIR]/project/lib/sdl) with the files from here: Dropbox.
- Rebuild lime and tools (see step 2). Most probably it can be done right on step 2, but just in case. You may get ‘error: SDK macosx26 cannot be located’ while trying to rebuild lime, in this case you’ll need a patched version of HXCPP with a fix from @joshtynjala found here: Comparing HaxeFoundation:master...joshtynjala:fix/mac-dot-zero-sdk · HaxeFoundation/hxcpp · GitHub.
- Rebuild lime for iOS with
lime rebuild ios -clean.
Focus events should start working in iOS builds from this point and the red log message in the console on app start up should be gone.
UIScene lifecycle will soon be required.
Failure to adopt will result in an assert in the future.
You may want to configure the info.plist then as described here: TN3187: Migrating to the UIKit scene-based life cycle | Apple Developer Documentation
Please note that the version of the SDL submodule may change in Lime and the files may then need changes. This fix was done for SDL 2.30.12 ( GitHub - libsdl-org/SDL at 8236e01a9f758d15927624925c6043f84d8a261f · GitHub ).
It’s definitely not a good solution, it can’t be even submitted as a pull request, because it makes changes to a submodule… I guess the only real fix would be updating the SDL submodule in Lime to version 3.4.0+, that can be hard since there was a lot of changes in SDL v3+ compared to v2.
