Skip to content

Harlech1/TPackage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift iOS

About

A boilerplate for swift. It contains:

  • Onboarding/Paywall View
  • Settings View
  • Documents View

Installation

Swift Package Manager

You can install TPackage using the Swift Package Manager:

  1. In Xcode, open your project and navigate to File → Swift Packages → Add Package Dependency...
  2. Paste the repository URL: https://github.com/Harlech1/TPackage.git
  3. Click Next and select the version you want to use

Usage

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") }
                    )
                ])
            ]
        )
    }
}

About

Boilerplate for Swift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages