Skip to content

Add isPremium badge support to UIOnboardingFeature#33

Open
FelixLisczyk wants to merge 1 commit intolascic:mainfrom
FelixLisczyk:sn-768
Open

Add isPremium badge support to UIOnboardingFeature#33
FelixLisczyk wants to merge 1 commit intolascic:mainfrom
FelixLisczyk:sn-768

Conversation

@FelixLisczyk
Copy link
Copy Markdown
Contributor

@FelixLisczyk FelixLisczyk commented Mar 25, 2026

Summary

This PR adds an optional premium badge overlay to feature rows in the onboarding screen.

New properties on UIOnboardingFeature

  • isPremium: Bool (default: false) — when true, renders a small capsule badge over the bottom-trailing corner of the feature icon
  • premiumBadgeTitle: String (default: "Pro") — the text shown inside the badge, always rendered uppercase

Both properties are additive with default values, so existing code requires no changes.

Badge rendering

The badge is implemented directly in UIOnboardingCell as a UIView overlay using Auto Layout. It is anchored to the bottom-trailing corner of the feature glyph and correctly handles cell reuse (removed and re-evaluated on every configure(feature:) call).

Demo apps updated

All three demo apps (UIOnboarding Demo, UIOnboarding Demo SPM, UIOnboarding SwiftUI) have been updated to showcase the badge on the #teamarmee feature using the app's camouflage tint color.

Usage

UIOnboardingFeature(
    icon: UIImage(named: "feature-3")!,
    iconTint: .systemBlue,
    isPremium: true,
    premiumBadgeTitle: "Pro", // rendered as "PRO"
    title: "Cloud Sync",
    description: "Access your data on all your devices."
)

Screenshots

Simulator Screenshot - iPhone 17 Pro - 2026-03-25 at 11 33 52

…ature

- Add `isPremium: Bool = false` and `premiumBadgeTitle: String = "Pro"` to `UIOnboardingFeature`
- Render PLUS-style badge overlay on the feature icon when `isPremium` is true
- Badge text is always rendered uppercase regardless of input casing
- Fix badge persisting on reused table view cells
- Update demo apps to showcase the premium badge on the third feature

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lascic lascic self-requested a review March 25, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant