Skip to content

Instantly share code, notes, and snippets.

View EPIKorial's full-sized avatar

Huet Florian EPIKorial

  • Bordeaux
View GitHub Profile
/// Represents the data structure expected from the web checkout JSON payload.
struct WebCheckoutData: Codable, Equatable {
// Properties matching the JSON keys (using camelCase)
let presentationId: String?
let placementId: String?
let abTestId: String?
let abTestVariantId: String?
let stripePriceId: String
let stripeObjectType: String
@EPIKorial
EPIKorial / MainView.swift
Created July 18, 2024 07:54
Example: Display Purchasely Paywall with SwiftUI
import SwiftUI
import Purchasely
// Only for example purpose
@MainActor
struct MainView: View {
@State private var showingSheet = false
@StateObject var viewModel: MainViewModel = MainViewModel()
@EPIKorial
EPIKorial / MainView.swift
Last active July 18, 2024 07:27
Simple way to present a Purchasely Screen using SwiftUI
import SwiftUI
import Purchasely
// ONLY FOR EXAMPLE PURPOSE
@MainActor
struct MainView: View {
@StateObject var viewModel: MainViewModel = MainViewModel()
@EPIKorial
EPIKorial / MainView.swift
Last active July 18, 2024 07:09
Example: Display Purchasely Paywall with SwiftUI
import SwiftUI
import Purchasely
@MainActor
struct MainView: View {
@State private var showingSheet = false
@StateObject var viewModel: MainViewModel = MainViewModel()
var body: some View {
import SwiftUI
@available(iOS 13.0, tvOS 13.0, macOS 12.0, watchOS 8.0, *)
public struct PLYPresentationView: UIViewControllerRepresentable {
public typealias UIViewControllerType = PLYPresentationViewController
private let presentationViewController: PLYPresentationViewController!
init(presentation: PLYPresentationViewController) {