mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
* 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
33 lines
933 B
Swift
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
|