Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 1.23 KB

File metadata and controls

39 lines (23 loc) · 1.23 KB

iOS Guide

Basic steps to build and run an iOS project generated by pn.

What gets generated

pn run ios unpacks the bundled iOS template (Swift + PythonKit, with optional Rubicon-ObjC) into build/ios/ios_template and copies your app/ under build/ios/app/ for later integration steps. The template zip is bundled with the package, so no network is required to scaffold.

The default ViewController.swift initializes PythonKit, prints the Python version, and attempts to import rubicon.objc if present.

Component model

Your app/ directory contains @pn.component function components. The native iOS template uses create_page() internally to bootstrap your root component inside a ViewController. You don't call create_page() directly — just export your component and configure the entry point in pythonnative.json.

Run / Prepare

pn run ios

Or prepare without building:

pn run ios --prepare-only

You can then open build/ios/ios_template/ios_template.xcodeproj in Xcode.

Clean

Remove the build directory safely:

pn clean

Notes

  • Building and running for Simulator via the CLI is best-effort. Opening the generated project in Xcode is recommended for iterative development.