Skip to main content
  1. Tutorials/

iOS Tutorial

·1 min
Author
Zylix Team
Build once, run natively on 6 platforms

Overview
#

Build the Zylix demo app with SwiftUI and the C ABI bridge on iOS.

Prerequisites
#

  • macOS 12+
  • Xcode 14+
  • XcodeGen

1. Clone the Repo
#

git clone https://github.com/kotsutsumi/zylix.git
cd zylix

2. Build the Zig Core
#

cd platforms/ios
./build-zig.sh

This produces platforms/ios/lib/libzylix.a.

3. Open the Xcode Project
#

open Zylix.xcodeproj

4. Run
#

Select an iOS simulator or device and run the Zylix scheme.

5. Confirm State Updates
#

Open the Counter tab and tap +/-. The counter should update immediately.

Key files:

  • platforms/ios/Zylix/Sources/ContentView.swift (Counter UI)
  • platforms/ios/Zylix/Sources/ZylixBridge.swift (C ABI bridge)

Troubleshooting
#

  • Build fails: ensure lib/libzylix.a exists after ./build-zig.sh.
  • XcodeGen not found: brew install xcodegen.

Next Steps
#