Files
purchases-ios/RevenueCatUI/Views/SafariView.swift
T
Toni Rico 95aaf74888 Support custom URL paths in ManageSubscriptionsView (#4382)
* Support custom URL paths in ManageSubscriptionsView

* Fix tests

* More test fixes

* Add parsing and processing tests

* Consolidate SafariView

* Rename method

* Another rename

* Fix import issue with SafariView not being compatible to some platforms

* Style fix
2024-10-21 15:47:16 +02:00

33 lines
933 B
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// SafariView.swift
//
// Created by Antonio Rico Diez on 2024-10-18.
#if canImport(SafariServices) && canImport(UIKit)
import SafariServices
import SwiftUI
struct SafariView: UIViewControllerRepresentable {
let url: URL
func makeUIViewController(context: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
return SFSafariViewController(url: url)
}
func updateUIViewController(_ uiViewController: SFSafariViewController,
context: UIViewControllerRepresentableContext<SafariView>) {
// No need to update the controller, as it's static in this case
}
}
#endif