An Xcode template for Turbo Native apps

Hey everyone,

Last week Dave Paola asked if there is an equivalent to rails generate for Xcode.

Xcode has a concept of templates. You can see the built-in ones by clicking File → New → File… in Xcode.

No alt text provided for this image
New File templates in Xcode

And you can even create your own. But they aren’t documented or officially supported by Apple.

So I decided to jump off the deep end and create a project template for Turbo Native! 🙂

I spent the better part of last week Googling around and tweaking XML files. And I’m pretty excited with what I have so far. It isn’t perfect but I think it will save you a lot of time when creating new Turbo Native projects.

After installing the template you can click File → New → Project… and select Turbo Native App right in Xcode. This creates a new project with the boilerplate needed to get up and running.

No alt text provided for this image
Turbo Native App template in Xcode

The template does everything I do when starting a new Xcode project for a client, like:

  • Removing the Storyboard
  • Removing the comments and unused methods in AppDelegate
  • Organizing the folders/groups to match Rails apps
  • Wrapping the Turbo Native integration in UINavigationController

Using this template would have shortened my Turbo Native in 15 minutes video to like… 3 minutes. 😆

The only remaining hurdle is that after running the template you still have to manually add the turbo-ios package. This is sadly a limitation of Xcode and I’m not sure if it will be possible to fix.

But I’m looking forward to expanding the template. Some ideas include an option for Turbo Navigator, multiple tabs, error handling, and more.

I’d love if you could give it a try and let me know what you think. I added instructions to the README and am looking forward to feedback. Comment if you need help.

👉 Install the template

And a heads up that this is still an experiment! I'm not (yet) convinced that this is the _perfect_ approach to new Turbo Native apps. I'm also experimenting with XcodeGen which can generate projects from YAML files. It's an external dependency but can be used after a single brew install. If you've used this tool let me know – I'd love to pick your brain.

To view or add a comment, sign in

More articles by Joe Masilotti

Others also viewed

Explore content categories