Targets · Swift · Capabilities
Capabilities
Which high-level features a Program can use when it renders to Swift and runs on Apple platforms — iOS, macOS, and the rest of the family.
Contents
How a Program becomes Swift, in parts. Start with the introduction, then follow each part into the rendered output and the runtime it links against.
- Introduction — what the Swift target is, and how to read the rest of this section.
- Capabilities — which high-level features are possible, built in or through a library.
- Example — a full program using every keyword, and the Swift it renders to.
- Naming considerations — how Program's dotted names are carried into Swift.
- Entry point — starting a program and mounting it as a SwiftUI app.
- Drivers — the native drivers that provide the interface, animation and network.
- Runtime — the Reactive and Context machinery the rendered code links against.
- Native modules — the hand-written Swift behind
NATIVEfunctions. - Keywords — how each of Program's keywords renders to Swift.
- Project setup — the files and commands to build and run the rendered program.
- Reserved words — the words Swift keeps for itself, and how a colliding name is escaped.
What Apple platforms can do
Swift on Apple platforms is a full native application stack. The reactive core is host-agnostic; the drivers decide what a program can reach, and nearly everything is available through a system framework.
| Feature | Status | How |
|---|---|---|
| User interface | Built in | The interface driver renders Ui as SwiftUI views; a custom component returns an AnyView. |
| Networking | Built in | Network uses URLSession and URLSessionWebSocketTask. |
| Asynchrony | Built in | A LOCKED state models an in-flight value; the driver resolves it from a Task and re-enters the cycle. |
| Animation | Built in | The Animate driver shares one CADisplayLink. |
| Storage & files | Built in | Storage maps to FileManager and UserDefaults. |
| Graphics | Built in | SwiftUI Canvas / Core Graphics through a custom interface component or the Graphics driver. |
| Location & maps | Built in | Location uses Core Location; a map is a custom component backed by MapKit. |
| Background work | Built in | Swift concurrency (Task, actors) behind a native module; reactive state stays on the main cycle. |
| Reach | Apple only | iOS, macOS, watchOS and tvOS — not Android or the web. Use Dart or JavaScript for those. |
Where a capability needs host code it arrives as a NATIVE Swift function or a driver — see native modules and drivers.