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.
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.
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 },
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
sheetsopens as a sheet, and a tab's path switches to the tab. data-native-buttonA button in the bar of a tab's first screen, with an SF Symbol. One that opens a menu opens iOS's.
data-native-actionThe page's own action, Save or Send, in the bar.
ui-confirmiOS's question, with the action in red.
ui-combobox,ui-pickeriOS's list with a search field.
data-native-searchiOS's search field under the bar.
toast()A line in the bar for two seconds, with a haptic.
data-native-hide,data-native-onlyLeft 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.pushsends 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.