wails/v3/pkg/application/mainthread_ios.go
Lea Anthony db8f1f3d41 chore: remove temporary debug print statements from mobile merge
Remove emoji debug logs (🔴, 🟢, 🟠, 🔵, 🔥) that were accidentally left in
from the iOS/Android mobile platform support merge. These were development
debugging statements that should not have been included in the final code.

Files cleaned:
- application.go
- application_debug.go
- init_android.go
- init_ios.go
- mainthread_android.go
- mainthread_ios.go
- webview_window.go
- webview_window_ios.go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 06:26:23 +11:00

44 lines
978 B
Go

//go:build ios
package application
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation -framework UIKit
#import <Foundation/Foundation.h>
#import <dispatch/dispatch.h>
extern void dispatchOnMainThreadCallback(unsigned int);
static void dispatchOnMainThread(unsigned int id) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatchOnMainThreadCallback(id);
});
}
static bool onMainThread() {
return [NSThread isMainThread];
}
*/
import "C"
func (a *iosApp) isOnMainThread() bool {
return bool(C.onMainThread())
}
func (a *iosApp) dispatchOnMainThread(id uint) {
C.dispatchOnMainThread(C.uint(id))
}
//export dispatchOnMainThreadCallback
func dispatchOnMainThreadCallback(callbackID C.uint) {
mainThreadFunctionStoreLock.RLock()
id := uint(callbackID)
fn := mainThreadFunctionStore[id]
if fn == nil {
Fatal("dispatchCallback called with invalid id: %v", id)
}
delete(mainThreadFunctionStore, id)
mainThreadFunctionStoreLock.RUnlock()
fn()
}