iOS Platform Support — MyPHP
Native iOS immediate-mode UI support via Metal and CoreText, powered by an embedded static PHP 8.3 runtime and ext-ffi.
Architecture
- Toolchain & Runtime:
libffi.across-compiled forarm64-apple-ios16.0.- Embedded static
libphp.a(PHP 8.3) withext-ffi,opcache,mbstring,zlib, targeting iOS SDK. - Native iOS launcher (
src/Platform/iOS/launcher/main.m) initializes PHP embed SAPI on a dedicated background thread and drives full-screenUIWindow. - GPU Rendering:
- Full reuse of Metal rendering pipeline (
MyPHP\Native\Metal) and CoreText font shaping engine (MyPHP\Native\CoreText). - Platform Layer (
src/Platform/iOS/): Backend: iOS event loop and service dispatch.Window: Full-screen single window constraint.Clipboard: Integrated withUIPasteboard.Dialogs: System alerts viaUIAlertController.Shell: External URL handling viaUIApplication.sharedApplication.Power: Screen wake lock viaidleTimerDisabled.Theme: System dark/light mode viaUITraitCollection.Screen: Display metrics viaUIScreen.mainScreen.
Building
# Package an iOS application (.app and .ipa)
bin/myphp build -platform ios/arm64 examples/counter-native
Running in Simulator
# Build and automatically run inside the iOS Simulator
./scripts/run-ios-app.sh examples/counter-native