Preface

If you're still unsure about creating native applications using Ruby on Rails and Hotwire Native, let me tell you something that might sound a bit confusing at first but will make total sense as you progress through this book:

“It’s not about creating native apps that run Rails but Rails apps that work as seamlessly as native ones.”

What does that mean?

The goal is to build a Rails application that performs excellently on mobile devices by leveraging native features (such as modals, buttons, and other functionalities) when needed. The iOS application will simply serve as the platform to deliver everything we implement in Rails.

Only iOS?

For this book, yes. My intention is to release an Android version in the near future. However, the concepts covered here regarding Rails, Hotwire, and Hotwire Native are also applicable to Android (considering the nuances between the platforms).

Why this book?

After a year of studying and applying Hotwire Native (formerly Turbo Native) in real-world projects, I decided to write this book to share what I’ve learned. The goal is to guide you in creating Rails applications integrated with Hotwire Native, focusing exclusively on the iOS platform.

Why iOS? Because the process is nearly identical for Android, and I plan to publish a dedicated Android version soon. For now, the focus is on helping you create your first, second, or even third Rails app with native iOS integration.

What will we cover?

Before writing a single line of code, we’ll explore the foundational concepts. We’ll dive into what Hotwire Native is and how it connects to Rails through Hotwire (including Turbo and Stimulus).

Then, we’ll move to hands-on practice:

  1. Build a Rails application: Rails 8 with basic functionalities.
  2. Set up an iOS application: Install and configure the Hotwire Native iOS package. 3.** Integrate both applications**: Incrementally implementing native interactions between Rails and the iOS app.
  3. Customize CSS: Based on the platform (web/native).
  4. PathConfiguration: Start making the Rails app more native.
  5. Bridge Components: Create a native component which interacts with the Rails app.
  6. Final tips: Insights about what comes next.

The goal is simple: to demonstrate how Rails can go beyond traditional web development and serve as the foundation for delivering native experiences that are "good enough" for most cases requiring a native application—all using the latest version of Hotwire Native!

Requirements!

To create iOS applications, you’ll need to have Xcode installed, which requires a machine running macOS.

Ruby and Rails should also be installed on your machine. In this book, I’ll use Ruby version 3.3.5 and Rails version 8.0.1.

A basic understanding of Rails is helpful but not mandatory—it won’t prevent you from grasping the key concepts presented in the book.

What do I hope for?

I hope this book inspires you to explore the potential of Hotwire Native and to see Rails as a solution that performs just as well in the native world as it does on the web.

Enjoy the read, and let’s get started! 🚀