Skip to content

1.12.0

Compare
Choose a tag to compare
@Jeehut Jeehut released this 08 Nov 16:15
· 4 commits to main since this release
  • Added freeIf parameter to PaidFeatureButton & PaidFeatureView for freemium features with usage limits

    Example usage with PaidFeatureButton:

    // Let users export 3 PDFs for free, then require subscription
    // - Shows normal button while free exports remain
    // - Shows locked button & paywall after limit reached
    PaidFeatureButton(
        "Export PDF",  
        systemImage: "doc.pdf",
        freeIf: { remainingFreeExports > 0 }
    ) {
        exportPDF()
        remainingFreeExports -= 1
    }

    Example usage with PaidFeatureView:

    PaidFeatureView(freeIf: { usedPremiumContents.count < freeUsageLimit }) {
        Text("Premium Content")  // Shown when subscribed or free condition is met
    } lockedView: {
        Label("Get Premium Content", systemImage: "lock")  // Shown when locked
    }