PaywallModels.swift 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import Foundation
  2. enum PaywallPlan: String, CaseIterable, Identifiable {
  3. case monthly
  4. case yearly
  5. case lifetime
  6. var id: String { rawValue }
  7. var title: String {
  8. switch self {
  9. case .monthly: "Monthly"
  10. case .yearly: "Yearly"
  11. case .lifetime: "Lifetime"
  12. }
  13. }
  14. var subtitle: String {
  15. switch self {
  16. case .monthly: "Billed every month"
  17. case .yearly: "Save 42%. Billed once per year."
  18. case .lifetime: "One-time payment. All future updates."
  19. }
  20. }
  21. var productID: String {
  22. switch self {
  23. case .monthly: SubscriptionProductID.monthly
  24. case .yearly: SubscriptionProductID.yearly
  25. case .lifetime: SubscriptionProductID.lifetime
  26. }
  27. }
  28. var fallbackMainPrice: String {
  29. switch self {
  30. case .monthly: "$7.99"
  31. case .yearly: "$49.99"
  32. case .lifetime: "$79.99"
  33. }
  34. }
  35. var price: String { fallbackMainPrice }
  36. var priceSuffix: String? {
  37. switch self {
  38. case .monthly: "/mo"
  39. case .yearly: "/yr"
  40. case .lifetime: nil
  41. }
  42. }
  43. var ctaTitle: String {
  44. switch self {
  45. case .monthly: "Get Premium"
  46. case .yearly: "Get Premium"
  47. case .lifetime: "Unlock Lifetime"
  48. }
  49. }
  50. var fallbackBillingDescription: String {
  51. switch self {
  52. case .monthly:
  53. return "Billed at \(fallbackMainPrice) every month"
  54. case .yearly:
  55. return "Billed at \(fallbackMainPrice) every year"
  56. case .lifetime:
  57. return "One-time payment of \(fallbackMainPrice)"
  58. }
  59. }
  60. var isBestValue: Bool {
  61. self == .lifetime
  62. }
  63. var features: [String] {
  64. [
  65. "Unlimited AI Generations",
  66. "Post Generator & Title Optimizer",
  67. "Comment Writer with smart replies",
  68. ]
  69. }
  70. }
  71. struct PaywallFeature: Identifiable {
  72. let id = UUID()
  73. let title: String
  74. let systemImage: String
  75. }
  76. enum PaywallContent {
  77. static let title = "Unlock Full Pro Power"
  78. static let subtitle = "Generate unlimited posts, optimize titles, and craft smarter replies with advanced AI."
  79. static let includedSectionTitle = "Everything included in Premium"
  80. static let features: [PaywallFeature] = [
  81. PaywallFeature(title: "Unlimited AI Generations", systemImage: "sparkles"),
  82. PaywallFeature(title: "Post Generator", systemImage: "square.and.pencil"),
  83. PaywallFeature(title: "Title Optimizer", systemImage: "textformat.size"),
  84. PaywallFeature(title: "Comment Writer", systemImage: "bubble.left.and.bubble.right.fill"),
  85. PaywallFeature(title: "Custom AI Prompts", systemImage: "wand.and.stars"),
  86. PaywallFeature(title: "Post Analytics", systemImage: "chart.bar.fill"),
  87. ]
  88. static let continueWithFreePlan = "Continue with free plan"
  89. static let restorePurchases = "Restore Purchases"
  90. static let privacyPolicy = "Privacy Policy"
  91. static let support = "Support"
  92. static let termsOfService = "Terms of Services"
  93. }