PadCodedocs

Key ideas

The few ideas behind every PadCode app: screens, views, settings, variables, actions, formulas, Preview and My Apps.

Every PadCode app is built from the same few ideas. Once they click, the rest of the editor makes sense. Each section ends with where to read more.

The examples come from Your first app, a coffee counter with one screen, one variable and one button.

#An app is screens

An app is one or more screens, like pages. The first screen is where the app opens. You add screens and move between them in the Library's Screens tab.

Coffee Counter has one screen. A sign-in app might have three: Sign in, Profile and Products.

Read more: Screens.

#A screen is views inside views

Everything you see on a screen is a view: a Text, a Button, an Image. You make views from components, the tiles in the Library's Components tab.

Some views hold other views. A Column stacks the views inside it from top to bottom; a Row puts them side by side. So a screen is a tree of views: a Column holding a Text and a Row, the Row holding two Buttons, and so on. The Library's Layers tab shows that tree.

Read more: Components, Laying out views and Layers.

#Settings and modifiers change how a view looks

Select a view and the Inspector's Style tab shows its settings: a Text's words and font, a Button's title, the padding around a view, its background, its corners.

Most of those looks, like the font, the padding and the background, are modifiers: extra settings added to the view. All modifiers, at the bottom of the Style tab, lists the ones a view has, in order, and adds more.

Read more: The Inspector and Modifiers.

#Variables hold your app's data

A variable is a named value your app keeps while it runs: a number, some text, on or off, a date, a list. You add them in the Library's Data & Logic tab with Add variable. Each has a type and a starting value.

Coffee Counter has one: count, a Whole Number that starts at 0. A variable can also be remembered, so it keeps its value after the app closes.

Read more: Variables.

#Views show and change variables

A view can show a variable, so it always shows the latest value:

  • In text, put the variable's name in braces: Coffees today: {count}.
  • In most settings, tap ⚡︎ (Set from variable) beside it and pick the variable. The setting then follows the variable.

Controls people use, like a Text Field, a Switch or a Slider, change the variable you link them to: what someone types or picks goes into it.

When a variable changes, everything that shows it updates by itself.

Read more: Connecting views to data and Text with values.

#Actions are steps that run when something happens

Actions are steps like Set Value, Go to Screen or Call API. A view runs its steps in order when something happens to it: that's the trigger. When Tapped is the one you'll use most. Others include When Shown, When Long-Pressed and When a Value Changes.

You set them up in the Inspector's Actions tab: pick the trigger, then Add action. In Coffee Counter, the button's steps are "When Tapped: set count to count + 1".

Steps you need in more than one place can be a reusable action, kept in Data & Logic.

Read more: How steps run, Triggers, All actions and Reusable actions.

#Formulas work values out

A formula is a small sum or rule that works out a value: count + 1, price * 2, 'Hi, ' + name. It can use your variables by name, and functions for dates, text, lists and more.

You write one wherever ⚡︎ offers Formula…. The formula editor shows what it works out to right now, so you can check it as you type.

Read more: Formulas and Formula functions.

#Preview runs your app

The canvas shows how your app looks. Nothing runs there: buttons don't press, and variables show their starting values. To try your app for real, tap Preview. It runs on a device you choose, and Done editing brings you back.

Read more: Preview.

#Finish puts it in My Apps

When your app is ready, tap Finish. You give it a name and an icon, and it goes into My Apps, where you can open it like any app and add it to your Home Screen.

Read more: Finish your app and My Apps.

#The AI Agent can build it with you

Instead of building by hand, you can describe an app, or a change, to the AI Agent, and it builds it on the canvas: the screens, the views, the variables and the steps. In Manual mode you keep or undo each change; Auto builds straight through; Plan writes a plan first. It's part of PadCode Pro.

Read more: The AI Agent.

#Widgets are a view on the Home Screen

A widget is one small view that sits on your iPad's Home Screen or Lock Screen, built with the same components, variables and steps as an app. It can stand on its own, or show what one of your apps remembers.

Read more: Widgets.

#Free and Pro

PadCode Free lets you build one app and one widget, with 19 essential components, and use the Marketplace, themes, Preview and My Apps. PadCode Pro adds every component, unlimited apps and widgets, the AI Agent, and publishing to the Marketplace.

Read more: Plans and billing.

#See also