main_ios.go 776 B

1234567891011121314151617181920212223
  1. //go:build ios
  2. package main
  3. import (
  4. "C"
  5. )
  6. // For iOS builds we export a function the WailsAppDelegate can call.
  7. // This wrapper keeps the user's main.go unmodified.
  8. // WailsIOSMain runs the user's main() (application.New / app.Run). It is invoked
  9. // by the WailsAppDelegate from didFinishLaunchingWithOptions — i.e. only AFTER
  10. // UIKit has launched — on a BACKGROUND thread, so the Go runtime never starts
  11. // concurrently with UIApplicationMain (that race intermittently corrupts the
  12. // FrontBoard launch handshake on a physical device → blank cold launch /
  13. // scene-create watchdog 0x8BADF00D). Keeping all app setup off the OS main
  14. // thread also leaves UIApplicationMain unobstructed on the main thread.
  15. //
  16. //export WailsIOSMain
  17. func WailsIOSMain() {
  18. main()
  19. }