Migrating from v1.4.0 to v1.5.0
Overview
v1.5.0 introduces one breaking change from v1.4.0:
- Renamed appearance key.
AppearanceColorKey.postScanUGCPurchaseBackgroundhas been renamed toAppearanceColorKey.postScanInlineProductTaskBackgroundto reflect that the key controls the row background for any inline earn row (Snap & Earn and Watch & Earn).
Existing code that references the removed key name will no longer compile. The fix is a one-line rename in your Theme implementation.
Renamed theme key
Swift
// v1.4.0
func color(forKey key: AppearanceColorKey) -> UIColor? {
switch key {
case .postScanUGCPurchaseBackground: // ← removed
return .systemCyan
default: return nil
}
}
// v1.5.0
func color(forKey key: AppearanceColorKey) -> UIColor? {
switch key {
case .postScanInlineProductTaskBackground: // ← renamed
return .systemCyan
default: return nil
}
}
Objective-C
// v1.4.0
- (UIColor *)colorForKey:(AppearanceColorKey)key {
switch (key) {
case AppearanceColorKeyPostScanUGCPurchaseBackground: // ← removed
return UIColor.cyanColor;
default: return nil;
}
}
// v1.5.0
- (UIColor *)colorForKey:(AppearanceColorKey)key {
switch (key) {
case AppearanceColorKeyPostScanInlineProductTaskBackground: // ← renamed
return UIColor.cyanColor;
default: return nil;
}
}
note
Always match on enum case names, not raw integer values. Renaming postScanUGCPurchaseBackground in v1.5.0 shifted the raw values of subsequent AppearanceColorKey cases.
New theme keys
v1.5.0 exposes styling for the "Snap & Earn" and "Watch & Earn" pill badges on inline earn rows. These keys have sensible defaults and require no action unless you want to customize them.
Color keys
| New key | Controls |
|---|---|
postScanInlineProductTaskScanAndEarnBackground | "Snap & Earn" pill background and leading camera icon tint. |
postScanInlineProductTaskScanAndEarnLabel | "Snap & Earn" pill text color. |
postScanInlineProductTaskWatchAndEarnBackground | "Watch & Earn" pill background and leading play icon tint. |
postScanInlineProductTaskWatchAndEarnLabel | "Watch & Earn" pill text color. |
postScanInlineProductTaskPointsLabel | "+100" reward amount on inline earn rows. |
Font keys
| New key | Controls |
|---|---|
postScanInlineProductTaskScanAndEarnLabel | "Snap & Earn" pill text font. |
postScanInlineProductTaskWatchAndEarnLabel | "Watch & Earn" pill text font. |
postScanInlineProductTaskPointsLabel | Font for the "+100" reward amount on inline earn rows. |
At a glance
| Removed API (v1.4.0) | Replacement (v1.5.0) | Notes |
|---|---|---|
AppearanceColorKey.postScanUGCPurchaseBackground | AppearanceColorKey.postScanInlineProductTaskBackground | Rename only — semantics and default color (#EBF2FE) are unchanged. |