Skip to content

Spec: Image

Maatteogekko edited this page Feb 5, 2024 · 2 revisions

Assets

TODO: What kind of assets can be loaded? What are the initializers for the various asset types? Etc.

Layout

TODO: How do images get sized? What are the controls over image fit? Etc.

Animation

TODO: Look for any default animation behaviors related to images, such as autofades when loading, or switching between images, or animated size changes when constraints change. Find any default animations and document them here.

Localization

Images are stored in Assets.xcassets. An image can have a variant for each locale used by the app, plus a default.

The following is how Xcode shows image variants. Note the checkboxes on the right, where the locale variants are toggled on and off.

Screenshot 2024-01-28 at 10 22 48

An Image uses the name of the asset together with the locale available in the context of the View to resolve what image to show. If a variant of the image for the locale is not found, then the default is used (the one in the top left, in the screenshot above).

Accessibility

TODO:

Technical Design

TODO: Matt

Clone this wiki locally