Skip to content
inertia-nativePublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Inertia Hotwire Native Demo (iOS)

A minimal iOS app demonstrating Hotwire Native driving an Inertia-powered web app. It wraps a server-rendered site in a native shell, adds native navigation/tabs, intercepts selected routes with native screens, and exposes native UI to the web layer through bridge components.

The app loads https://demo.inertia-native.dev by default.

Note

This project started as a copy of the official Hotwire Native iOS demo and is currently almost identical to it, adapted to point at an Inertia-powered backend. See Credits.

App preview

Requirements

  • Xcode 26+
  • iOS 26.5 deployment target
  • Swift 5 language mode

Dependencies are managed with Swift Package Manager and resolve automatically on first build. The only dependency is hotwire-native-ios, currently pinned to the main branch (see Package.resolved).

Running

  1. Open inertia-native-demo.xcodeproj in Xcode.
  2. Select the inertia-native-demo scheme and an iOS Simulator.
  3. Build & Run (⌘R).

Pointing at a local server

By default the app talks to the hosted demo. To run against a local Inertia/Rails server, edit Demo.swift:

static var current: URL {
    local   // http://localhost:3000
}

How it works

  • AppDelegate.swift — configures Hotwire: loads the path configuration, registers bridge components, and sets global options (back button mode, modal done button, debug logging).
  • SceneController.swift — sets up the HotwireTabBarController, handles navigation proposals (routing /numbers to a native screen), and handles auth (401 → /session/new).
  • Tabs.swift — defines the native tab bar tabs.
  • path-configuration.json — declarative rules: present /new, /edit, /modal as modals; render /numbers with a native view controller; reset the stack at root. Merged with a server-hosted configuration at configurations/ios_v1.json.
  • NumbersViewController.swift — example of a fully native screen replacing a web route.
  • Bridge/ — bridge components that let the web page drive native UI:
    • FormComponent — native toolbar submit button wired to a web form.
    • MenuComponent / OverflowMenuComponent — native menus populated from the web.

Project structure

inertia-native-demo/
├── AppDelegate.swift            # Hotwire configuration
├── SceneController.swift        # Scene + navigation + auth
├── Tabs.swift                   # Native tab definitions
├── Demo.swift                   # Base URL (remote/local switch)
├── ViewController.swift
├── NumbersViewController.swift  # Native screen for /numbers
├── path-configuration.json      # Routing/presentation rules
└── Bridge/                      # Bridge components (web ↔ native)
    ├── FormComponent.swift
    ├── MenuComponent.swift
    └── OverflowMenuComponent.swift

Credits

Based on the official Hotwire Native iOS demo by Hotwire, also released under the MIT License. This repository adapts it to demonstrate an Inertia-powered backend.

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages