Images
Add your own photos and pictures to an app, show them with an Image, and rename or delete them.
Your app's images live in the Assets tab of the left panel. Add photos from your photo library or image files from Files, then show them anywhere with an Image. Images belong to the app you add them to.
#Open the Assets tab
In the Builder, tap the Assets tab (the photo icon, fourth along) at the top of the left panel, or press ⌘4. Images is its first section.
Until you add one, it says: "No images yet. Add photos from your library or Files, then drag them onto the canvas."
#Add images
- Open the Assets tab.
- Under Images, tap:
- Photos to pick from your photo library, up to 10 at a time.
- Files to pick image files from the Files app. You can pick several.
- Each image appears as a tile, with its name under it.
PadCode makes every image a comfortable size as it adds it: the longest side is scaled down to 2048 pixels, and it's saved as HEIC, which keeps see-through parts, at the best quality that keeps the file to about 400 KB. A picture that's already that small is kept exactly as it is, and so is a GIF.
Image files you add with Add file, in the Files section, go to Images too.
#Image names
An image's name is how the app finds it, so PadCode keeps names simple:
- An image from Files is named after the file; one from Photos is named photo.
- Names use lowercase letters, numbers, dashes and underscores. Anything else becomes a dash, so "IMG 2041 copy" becomes img-2041-copy.
- Each name is used once. If it's taken, PadCode adds a number: photo, photo-2, photo-3. Images, fonts and files share one set of names, so an image can't take a font's or a file's name either.
#Show an image on a screen
- Tap an image's tile to add an Image showing it. It goes where a tapped component goes: inside the selected container, after the selected view, or at the end of the page when nothing is selected. The new Image is named after the picture.
- Drag a tile onto the canvas, to exactly where you want it.
To change which picture an Image shows, select it and open the Inspector's Style tab. Its Image section has two choices: Photo shows one of the app's images (tap a tile to pick it, or add more with Photos and Files right there), and Symbol shows an SF Symbol instead.
To fit a big picture into a space, see the Image component and the Resizable, Scale to Fit and Scale to Fill modifiers.
#Rename or delete an image
Long-press an image's tile:
| Command | What it does |
|---|---|
| Add to Canvas | Adds an Image showing it, like a tap. |
| Rename… | Asks for a new name. Every Image showing it updates. |
| Delete Image | Removes the image from the app. |
A new name is cleaned up the same way, and if another image already has it, the image keeps its old name. Renaming and deleting change the files themselves, so Undo doesn't reverse them.