Effortless Native

An iPhone app from the pages you have.

The app is an iOS shell around your site. Each screen is a page of it, and the shell draws the tab bar, the back button, the sheets and the menus with iOS's own parts. There is no second codebase and no API to write: deploy the site and the app shows the change.

The events list in the iPhone app: an account button and a plus in the bar, event covers with dates and places, and a tab bar with Events and Going.
A tabThe tab bar and the buttons at the top are iOS's. The rest is the page.
The board game night event, pushed over the list, with a back button above its title and the same tab bar.
A pushed screenA link slides in as the next screen, and a swipe goes back.
The form that emails everyone going, open as a sheet with a close button and a red Send button in its bar.
A sheetThe form opens as a sheet, with its button in the bar.
iOS asking Cancel your place?, with Cancel my place in red and Keep my place.
A questionThe page's confirmation is asked by iOS.

Commons, the meetup site from the home page, in the iPhone simulator.

The site says what the app shows.

config.lua names the tabs and the pages that open as sheets. The shell reads it from the server, so a new tab needs a deploy and shows the next time the app starts.

config.lualines 17–25
17  -- The iPhone app (ios/): its tabs, and the pages it opens as sheets.
18  native = {
19    name = "Commons",
20    tabs = {
21      { label = "Events", icon = "calendar", path = "/" },
22      { label = "Going", icon = "ticket", path = "/going" },
23    },
24    sheets = { "/events/new", "/events/*/message", "/login", "/signup" },
25  },
app/components/site-bar.x.htmllines 11–27
11      <a
12        href="/events/new"
13        class="text-muted hover:text-ink"
14        data-native-button="right"
15        data-native-icon="plus"
16        @if={me?.organizer}
17      >New event</a>
18      <button
19        class="avatar font-semibold text-ink"
20        popovertarget="account"
21        aria-label="Account"
22        data-native-button="left"
23        data-native-icon="person.crop.circle"
24        @if={me}
25      >
26        {me.initials}
27      </button>

The header of the web page becomes the bar of the app. Two attributes on a link or button say which side it goes to and which symbol it has, and data-native-bar folds the header away.

Parts of the page that iOS draws.

In the app effortless-ui also sets the page in iOS's type, at the text size the reader chose, with its large titles and grouped lists.

  • A link

    A screen that slides in. A path in sheets opens as a sheet, and a tab's path switches to the tab.

  • data-native-button

    A button in the bar of a tab's first screen, with an SF Symbol. One that opens a menu opens iOS's.

  • data-native-action

    The page's own action, Save or Send, in the bar.

  • ui-confirm

    iOS's question, with the action in red.

  • ui-combobox, ui-picker

    iOS's list with a search field.

  • data-native-search

    iOS's search field under the bar.

  • toast()

    A line in the bar for two seconds, with a haptic.

  • data-native-hide, data-native-only

    Left out in the app, or shown only there.

A handler reads request.native, which is "ios" in the app and nil in a browser, to leave out what the app must not show.

What you need, and what is missing.

  • The package

    The shell is a Swift package that an Xcode project of your own depends on. It is not public yet. The server's half is in Effortless v0.6.0.

  • iPhone

    iOS 18 or later. You need a Mac with Xcode to build it, and an Apple Developer account to put it in the App Store.

  • Android

    Not built yet.

  • Offline

    The app needs a connection, as the site does. Without one it says so and offers to try again.

  • Notifications

    native.push sends a title, a text and the page a tap opens to a person's phones, through a Firebase project of yours.

  • Links

    With the app's id in config.lua, the site's links open in the app, those in an email included.