This commit is contained in:
2026-02-04 02:21:23 +08:00
commit 208786aa90
112 changed files with 9571 additions and 0 deletions

23
build/ios/main.m Normal file
View File

@@ -0,0 +1,23 @@
//go:build ios
// Minimal bootstrap: delegate comes from Go archive (WailsAppDelegate)
#import <UIKit/UIKit.h>
#include <stdio.h>
// External Go initialization function from the c-archive (declare before use)
extern void WailsIOSMain();
int main(int argc, char * argv[]) {
@autoreleasepool {
// Disable buffering so stdout/stderr from Go log.Printf flush immediately
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
// Start Go runtime on a background queue to avoid blocking main thread/UI
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{
WailsIOSMain();
});
// Run UIApplicationMain using WailsAppDelegate provided by the Go archive
return UIApplicationMain(argc, argv, nil, @"WailsAppDelegate");
}
}