1.12.0
-
Added
freeIf
parameter toPaidFeatureButton
&PaidFeatureView
for freemium features with usage limitsExample 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 }