20.1 · Shared cores, platform conditions, capabilities, and the release train

The same Swift runs on a phone, a tablet, a computer, a TV, a watch and a headset, but the product, input, process and power model differ on each. Multiplatform work is mostly deciding what to share and what to let differ.

Mental model. Share the core, vary the leaves. Models, networking, storage and business rules are common; navigation, input and presentation belong to each platform.

Sharing safely

Platform conditions, availability, and the shape of a shared codebase.

  1. How do you structure one codebase for several Apple platforms: shared cores, UI leaves, #if os, canImport and @available? 20.1.1 · L3
    The workable shape is a shared core with thin platform leaves. The core (domain models, business rules, networking and persistence, view models, formatting…
  2. How do the platforms differ in input, process model and capabilities, and which entitlements and APIs change per platform? 20.1.2 · L3
    Think of each platform as a different device contract. iPhone and iPad: touch (plus pointer, keyboard and Pencil on iPad), a foreground app with background…

Shipping it

One core, several UI leaves, one release train.

  1. How do you run one shared core with several UI leaves on a single release train? 20.1.3 · L8
    Shipping an iPhone app, an iPad layout, a Mac app, an Apple TV app and a watch app from one team is an organisation and release problem at least as much as a…

More in Multiplatform Apple