Skip to main content
The reward sheet is drawn from a variant that Encore serves, so its layout can change between experiments while your code stays the same. AppearanceConfig.sheet styles the parts of that sheet, such as the title, the offer rows, the close button, and the main button, with your fonts, colors, corners, and images. You style a part by its component name, so one style holds for every variant that draws that part.
New in iOS SDK 2.6.0.

Style the sheet from code

Pass a SheetAppearance as sheet in the AppearanceConfig you give the placement (func appearance(_ config: AppearanceConfig) -> Self). Every field is optional. With no sheet value, and no style from the Style editor, the sheet draws the variant as Encore designed it.
The appearance option is in the placement reference, and every SheetAppearance field is in the SheetAppearance reference. The trigger fields of AppearanceConfig, such as fontFamily, cornerRadius, borderWidth, borderColor, backgroundImage, and iconImage, style trigger components only. They never reach the sheet, so setting them leaves the sheet as it was.

Fonts

SheetAppearance takes two fonts, both optional:
  • headingFontFamily: for the text of every component whose style sets the heading role (font: heading). Your code or the Style editor can set that role.
  • bodyFontFamily: for every other text on the sheet, including text that is not in a styled component.
A role you leave unset draws the system font. Each is a font your app already has, never a download. Pass a font name that UIFont(name:size:) resolves, from a font your app registers (for example in UIAppFonts). The SDK uses that font’s family and picks the face for each weight the variant asks for. Fonts come from your code only: when the Style editor is on for your app, it shows which text is heading and which is body, and points to this page to set the families. The variant keeps its own text sizes and weights; only the face changes. A font with a single face draws that face at every weight, with no synthetic bold.

Component styles

Each entry in components names a component and gives it a SheetComponentStyle. Every property is optional, and each one applies by the kind of element the variant draws for that component. A property that does not apply to that element, or a value out of range, is skipped with a warning in the SDK log.
Colors are hex: #RRGGBB, or #RRGGBBAA for transparency. A hex string applies in light and dark mode; SheetColor(light: "#FFFFFF", dark: "#1C1C1E") sets each mode. Image URLs must be HTTPS. A closeButton content color must be opaque, so the close mark always shows. An image on an icon button, such as closeButton, draws fit in a box up to 48 points wide and 20 points tall, centred across the icon with its bottom on the icon’s bottom, and takes no layout space, so the sheet does not move. Upload it at up to 144 by 60 pixels. A 2:1 image draws 40 by 20 points, and a square draws 20 by 20 points (60 by 60 pixels). The button’s tap target grows to at least 44 by 44. An image that replaces any other icon draws at that icon’s size.

Component names

A variant tags the parts of the sheet with these names. Each name except header has a constant on SheetComponent, such as .offerRow. SheetComponent is also a string literal, so "header" works as a key, and so does a name Encore adds later, with no SDK update. A name that no element in the variant carries does nothing. badge, heroImage, and offerLogo are not in the Style editor in the publisher portal. App code can still style them: the SDK applies a style to any component name a variant carries. The Style editor lists footnote, statusIcon, offerCard, pageIndicator, filterChip, panel, and giftBox under Others, because the default preview does not draw them. Selecting one shows the preview’s optional parts. Each takes only what the SDK draws on it today: offerCard and giftBox take the box (fill, corner radius, border), pageIndicator takes the box and the dot color, and panel takes the box, text color, and font. filterChip takes its corner radius, border, and font, and statusIcon takes its icon color. footnote takes text color and font. The selected chip has no style of its own yet. The advertiser’s own content is not editable. Neither app code nor the Style editor can style offerTitle or offerDetail, or replace the offerLogo image; app code can still set the logo’s corner radius and border. The SDK ignores anything else on them with a warning. Your body font still reaches their text.

Precedence

A value set in the Style editor in the publisher portal wins over your app code, when the editor is on for your app. Encore turns the editor on for an app on request. It wins per property, so a publisher can restyle the sheet without shipping a build. Your app code applies to each property the Style editor leaves unset, and the variant’s own value applies when neither sets it. For example, if the Style editor sets primaryButton.fill and your code sets primaryButton.fill and primaryButton.contentColor, the button takes the editor’s fill and your content color. image and animation count as one slot: if the Style editor sets either one, the editor’s choice wins both, so an editor image is never hidden behind an app animation.

Motion

Entrances, loops, and transitions between the sheet’s screens come from Encore’s variants. You need no code for them: the SDK plays them, and shows their still pose when the device asks for reduced motion. To add motion to one component from code, set its style’s animation (a Lottie file in place of a picture), enter (an entrance played once), or loop (a repeating animation that replaces the variant’s loop).
The limits of each motion field are in the SheetAppearance reference.

Lottie animations

A variant can play a Lottie animation over a part of the sheet. Lottie is optional: without it, the variant’s still image shows in its place. It also shows when the device asks for reduced motion, or when an animation file fails to load. Add lottie-ios 4.x to your app, through Swift Package Manager (lottie-spm or lottie-ios) or CocoaPods. EncoreKit does not link it.