PadCodedocs

Screens

Add screens, rename them, choose where your app opens, style a whole screen, and move between screens.

An app is one or more screens. The Library's Screens tab lists them, and is where you add, open and delete them. The first screen is where your app opens.

Open it with the third icon at the top of the left panel, or ⌘3.

The Screens tab of an app with three screens: Sign in, the first, marked with a house, then Profile and Products.

#The Screens tab

  • Each row is a screen. The first one has a house icon: it's where your app opens.
  • Tap a screen to open it on the canvas. Its row is highlighted.
  • Add screen, under the list, adds one.
  • Widgets, under the screens, lists the app's Home Screen widgets, and Add widget adds one. See An app's widget.

#Add a screen

  1. In Screens, tap Add screen, or press ⌘N.
  2. A screen called "New screen" is added at the end of the list, and opens on the canvas.
  3. Give it a name: see Rename a screen.

A new screen has a Scroll Area, so it scrolls when it's long, holding an empty Column called Page that says Drop components here. Add components and they go into the Page.

A new screen, open: New screen highlighted in the list, and an empty canvas that says Drop components here.

#Rename a screen

Either:

  • In Screens, the open screen's row is a text field: tap its name and type.
  • Or select nothing (tap the empty canvas around the device), then type in the title at the top of the Inspector, above the word "Screen".

A screen's name can be up to 40 characters. It's the name a Page Link's Screen menu shows.

#A screen's menu

Touch and hold a screen in the list for its menu:

ItemWhat it doesShown when
Open App on This ScreenMoves the screen to the top of the list, so your app opens on it.It isn't the first screen already
Delete ScreenDeletes the screen and everything on it. Undo brings it back.The app has more than one screen
Delete WidgetDeletes one of the app's widgets. Undo brings it back.It's a widget, under Widgets

An app with a single screen and no widgets has nothing in this menu: you can't delete your app's only screen.

#The screen's own settings

When nothing is selected, the Inspector shows the screen itself. To get there, tap the empty canvas around the device, press esc, or tap the top row in Layers.

A new app with nothing selected. On the right, the Inspector shows the screen's Appearance, Background, Accent, Text color and Font style.

#Style

The Screen section styles the whole screen:

SettingWhat it doesChoicesStarts as
AppearanceWhether this screen is dark or light. Auto follows the iPad's own setting.Auto, Dark, LightAuto
BackgroundA color behind the whole screen, edge to edge.Color menu, or the color wheelNone
AccentThe color of the controls' active parts, like a switch when it's on.Color menu, or the color wheelNone
Text colorThe color every text on this screen uses, unless it sets its own.Color menu, or the color wheelNone
Font styleThe letter shapes every text on this screen uses, unless it sets its own.Default, Rounded, Serif, MonospacedDefault

Accent, text color and font style are defaults: every view on the screen uses them unless it sets its own. Under them, All modifiers lists the screen's modifiers and adds more.

#Actions

The screen can run steps too, at these moments:

TriggerWhen it runs
When ShownEach time the screen appears.
When LoadingWhen it appears; it stops if the screen goes away before it's done. The right place for Call API.
When HiddenWhen the screen goes away.
When a Value ChangesWhen a variable you pick changes.

See Triggers.

#Data

The Data tab has the screen's inputs: see Screen inputs.

#Move between screens

Your app moves from screen to screen when someone taps something. Pick the way that fits:

UseWhat happensHow
Page LinkA tappable link that slides in another screen, with a back button.Add it from the Library's Navigation section, then pick the screen under Opens → Screen in its Style tab.
Go to ScreenA step that slides in another screen, with a back button.Add it to any view's steps, like a Button's When Tapped. Pick the screen in To.
Open as SheetA step that shows a screen over the current one, as a sheet or full screen.Pick the screen in Screen, and how in As.
Go Back / CloseA step that closes the sheet, or goes back one screen.Turn on All to close every sheet and go back to the first screen.
A Page Link selected on the canvas. Under Opens, its Screen is My App.

The canvas shows one screen at a time. To try moving between them, use Preview.

#Screen inputs

A screen can take values from the screen that opens it: which note to show, which product, which day. Those values are the screen's inputs.

#Add an input

  1. Open the screen that receives the value.
  2. In the Inspector's Data tab, open Screen inputs, then tap Add input. It's there whatever is selected.
  3. An input called input1 appears (then input2, and so on). Type a Default: the value it has when the screen is opened without one.

Tap ⊖ beside an input to remove it.

#Use an input on the screen

An input is read as params. and its name:

  • In a formula, write params.input1.
  • In a setting, tap ⚡︎ and pick it under Screen inputs.

#Send a value

In the step that opens the screen, Go to Screen or Open as Sheet, use With:

  1. Tap Add field.
  2. Name the field after the input, like input1.
  3. Type its value, or tap ⚡︎ to link a variable or a formula.

The screen then opens with that value in place of the default. A Page Link can't send values: use a Go to Screen step instead.

#See also