Turbo Native app template for Xcode

A custom Xcode project template to get started with Turbo Native development.

Turbo Native App template in Xcode

Once installed, this template can be used directly in Xcode to generate a new Turbo Native project. It removes boilerplate around creating new Xcode projects and integrating with Turbo Native.

Note: This project is an experiment with frequent, breaking changes as I learn how Xcode templates work.

Getting started

First, make sure you have Xcode downloaded and installed from the App Store.

Install the template

Create a new directory for custom Xcode project templates. Then clone this repo into that directory.

export DIR=~/Library/Developer/Xcode/Templates/Custom\ Templates
mkdir -p $DIR
git clone [email protected]:joemasilotti/TurboNativeXcodeTemplate.git $DIR/Turbo\ Native\ App.xctemplate

Create a new project

Open Xcode and create a new project via File → Project…

Select iOS from the tabs across the top and scroll to the bottom.

Select Turbo Native App, click Next, enter the name of your app, and click Next again.

Add the Turbo Native package dependency

Unfortunately, Xcode project templates don’t directly support Swift packages. So we have to add it manually.

Add the turbo-ios Swift package to an Xcode project

  1. Click the name of your app in the upper left.
  2. Select the Project (not target) from the middle column.
  3. Select the Package Dependencies tab from the top.
  4. Click the + to add a new package.
  5. In the upper right, enter https://github.com/hotwired/turbo-ios.
  6. Click Add Package and Add Package again.

Run the app via Product → Run. If all went well it should launch in the simulator!

For the best experience, start a Rails server with Turbo.js enabled on port 3000.


View Github