A boilerplate for swift. It contains:
- Onboarding/Paywall View
- Settings View
- Documents View
You can install TPackage using the Swift Package Manager:
- In Xcode, open your project and navigate to File → Swift Packages → Add Package Dependency...
- Paste the repository URL: https://github.com/Harlech1/TPackage.git
- Click Next and select the version you want to use
Here's a simple example for using TKPaywallView:
import SwiftUI
import TPackage
struct ContentView: View {
@State var showPaywall = false
var body: some View {
VStack {
Button {
showPaywall.toggle()
} label: {
Text("Show Paywall")
}
}
.sheet(isPresented: $showPaywall) {
TKPaywallView(headerImage: "crown.fill",
title: "Upgrade to Premium",
subtitle: "Try Now",
symbolColor: .purple,
features: [
.init(icon: "star.fill", title: "First Feature", description: "About First Feature"),
.init(icon: "star.fill", title: "Second Feature", description: "About Second Feature"),
.init(icon: "star.fill", title: "Third Feature", description: "About Third Feature")
]
)
}
}
}
Tap to show Paywall | TKPaywallView |
---|---|
Here's a simple example for using TKSettingsView:
import SwiftUI
import TPackage
struct ContentView: View {
var body: some View {
TKSettingsView(
title: "Settings",
sections: [
.init(header: "Account", items: [
.init(
icon: "person.circle.fill",
iconBackgroundColor: .blue,
title: "Profile",
action: { print("Profile tapped") }
),
.init(
icon: "key.fill",
iconBackgroundColor: .green,
title: "Security",
action: { print("Security tapped") }
),
.init(
icon: "bell.fill",
iconBackgroundColor: .orange,
title: "Notifications",
action: { print("Notifications tapped") }
)
])
]
)
}
}