Create custom sheet

It is possible to design your own sheet and apply the contents (CheckoutViewController) of CheckoutSheet in your own customised sheet. In your own View in SwiftUI, you can present your Sheet with the content of CheckoutViewController by wrapping it as in the example below. Check out our demo app for more info.

if let checkoutVC = self.checkoutSheet?.getCheckoutViewController() {
  UIViewControllerWrapper(viewController: checkoutVC)
}
import SwiftUI
import UIKit

struct UIViewControllerWrapper: UIViewControllerRepresentable {
  let viewController: UIViewController

  func makeCoordinator() -> Coordinator {
    Coordinator(self)
  }

  func makeUIViewController(context: Context) -> UIViewController {
    viewController
  }

  func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}

  class Coordinator: NSObject, UIViewControllerTransitioningDelegate {
    let parent: UIViewControllerWrapper

    init(_ parent: UIViewControllerWrapper) {
      self.parent = parent
    }
  }
}