Skip to content

Commit

Permalink
Paywalls: internal documentation for implementing templates (#3053)
Browse files Browse the repository at this point in the history
This is a start of some basic documentation for some basic principles to
follow when implementing new templates.
  • Loading branch information
NachoSoto committed Sep 14, 2023
1 parent ad14908 commit 2435a72
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions RevenueCatUI/Templates/TemplateViewType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import RevenueCat
import SwiftUI

/*
This file is the entry point to all templates.
For future developers implementing new templates, here are a few recommended principles to follow:
- Avoid magic numbers as much as possible. Use `@ScaledMetric` if necessary.
- Prefer reusable views over custom implementations:
- `FooterView`
- `PurchaseButton`
- `RemoteImage`
- `IntroEligibilityStateView`
- `IconView`
- Consider everything beyond the "basic"s:
- iPad
- VoiceOver / A11y
- Dynamic Type
- All `PaywallViewMode`s
- Fonts: use `PaywallFontProvider` to derive fonts
- Colors: avoid hardcoded colors
*/

/// A `SwiftUI` view that can display a paywall with `TemplateViewConfiguration`.
@available(iOS 15.0, macOS 12.0, tvOS 15.0, *)
@available(tvOS, unavailable)
Expand Down

0 comments on commit 2435a72

Please sign in to comment.