Skip to content

iOS support targets iOS 15 and later. The SDK and generated project configure CMake/Xcode sources, UIKit application lifecycle, and the HuxerUI static application link.

Terminal window
huxerui setup ios
huxerui run ios

UIKit delivers touch, keyboard, UITextInput, accessibility, activation, lifecycle, file picking, HTTP, and display-link scheduling to the shared runtime. Safe-area and edge-to-edge policies use the same WindowOptions, WindowMetrics, SafeAreaPadding, and SystemBarsAppearance contracts as Android.

Platform views are registered through <huxerui/ios/platform_registry.h>. External texture producers use <huxerui/ios/external_texture.h>. UIKit and platform texture publication must follow the main-thread and ownership rules stated by those headers.

Build and device validation require macOS with Xcode; non-macOS hosts can edit shared code but cannot validate the iOS adapter. The website’s cross-platform contract checks do not verify UIKit accessibility, keyboard behavior, UIView composition, signing, or device safe-area behavior.

Keep UIApplicationSceneManifest in platform/ios/App/Info.plist, including in single-window applications. The generated manifest sets UIApplicationSupportsMultipleScenes to false. Set that key to true inside the manifest dictionary to enable multiple scenes, then follow the scene request flow. Existing projects should update the manifest and scene startup together using the current generated shell.

Local notifications use User Notifications. An embedded Notification Content Extension owns template UI; HUXGetLocalNotificationData reads its submitted payload. Clicks enter OnActivation even when launching the process. This does not supply remote push registration.

See Local notifications for shared usage and platform configuration, and System API for exact contracts.

An application-bound HUXPlatformModuleFactory receives options/events without a controller. HUXUIKitWindowPlatformModuleFactory receives the original UIViewController; register it with ObjectiveCWindowPlatformModuleFactory for modal UI operations. Registration belongs to application_hooks and instance creation follows OpenPlatformModule’s live-host rules.

Retain the coordinator returned by HUXGetPresentationCoordinator(owner) at module creation. This fragment belongs inside that module’s invoke implementation; the module supplies its controller, completion and failure policy:

HUXPresentationCoordinator* coordinator = HUXGetPresentationCoordinator(owner);
id<HUXPlatformCancellation> request =
[coordinator enqueueWithStart:^id<HUXPlatformCancellation>(
UIViewController* presenter, void (^finished)(void)) {
return PresentDocumentPicker(presenter, finished);
} failure:^(NSError* error) {
FailDocumentRequest(error);
}];

PresentDocumentPicker must synchronously install its UI and return native cancellation, or call finished before returning nil. Call finished exactly when the UI is absent: after dismiss completion, interactive dismissal or failed startup. A canceled active presentation retains its queue slot until then; duplicate/late finished calls are harmless. A still-live request needs a result/failure when its host closes.

All presentation coordinator operations run on the main thread. Inactive windows defer admission; unmanaged modal UI fails admission instead of being covered. Use AwaitCallback in a typed C++ facade to await one result while preserving these cancellation and native-cleanup rules.

HUXFileReference::copyFromFileURL:error: (Swift FileReference.copy(from:)) snapshots a readable ordinary file into SDK-owned temporary storage. It can run on a background queue and must finish while the provider URL is valid. The result is read-only; source contents are unchanged.

The SDK balances security-scoped access it acquires for that copy. Retain the HUXFileReference or a derived stream/operation, not only its fileURL: the last capability owner releases temporary storage. A nil result carries an NSError and partial copies are removed. Forward the reference through PlatformPayload instead of serializing its URL.

UIKit attachments share application services, while each UiWindow retains its own focus, presentation, resource context and system-theme preference. Use the asynchronous scene API to request another UIKit window. Each connected scene gets its own HuxerUI window lifetime.

Manual software-keyboard requests preserve focus and selection; actual UIKit keyboard visibility and accessibility behavior still require a real iOS host. Custom families use static font data with platform fallback. See Fonts and typography.