Hako

Learn SwiftUI on your iPhone.

Hako is a free and open source app that teaches Swift and SwiftUI with interactive lessons and a sandbox.

9:41
main.swiftRun
struct ContentView: View {
  @State private var count = 0

  var body: some View {
    VStack(spacing: 12) {
      Text("Hello, Hako")
        .font(.title2.bold())
      Text("\(count) taps")
        .foregroundStyle(.secondary)
      Button("Tap") { count += 1 }
        .buttonStyle(.borderedProminent)
    }
    .padding()
  }
}
PreviewBuilt on device
Hello, Hako0 taps

You learn by writing code and running it.

Interactive lessons

Lessons take you through Swift and SwiftUI. The code in each lesson is live, so you can change it and run it.

A sandbox

The sandbox is an empty file for your own ideas. Your views are drawn by SwiftUI, so they look the way they do in any app.

Nothing leaves the phone

There is no account and no server. Hako works offline, and what you write stays where you wrote it.

Your code runs in a box.

All of it happens on your phone. Nothing is sent to a server.

  1. You write Swift

  2. You tap Run

  3. It runs in a box

  4. SwiftUI draws it

A Mac is optional.

Everything in Hako works on the phone alone. If you prefer your own editor, hako dev sends your sources from any computer to your phone.

~/MyApp
MyApp $ hako dev
watching MyApp/Sources
paired with iPhone
ContentView.swift saved, built on device

Questions

Is it free?

Yes, and it stays free. Hako is Apache 2.0, with no paid tier and nothing to sign up for.

Do I need a Mac?

No. The lessons and the sandbox work on the phone alone. If you want to send a project from your own editor, hako dev runs on any computer.

Does it work offline?

Yes. Your code is built and run on the phone, so Hako works with no network at all.

Which SwiftUI APIs work?

A growing subset. Views and modifiers are mapped one by one. When something is not supported yet, Hako tells you which API it is.

Can I ship an app with it?

No. Hako is for learning and trying things. Building and submitting an app is still Xcode's job.

Why the name?

Hako (箱) is Japanese for box. A hakoniwa is a box garden, a small world you shape by hand. That is what the app is: a box you can play in without breaking anything outside it.