mirror of
https://github.com/easychen/pushdeer.git
synced 2024-11-02 08:39:20 +08:00
69ec4f3774
应用内打开网页使用 BetterSafariView 修复markdown中图片出现相对路径时, 界面会卡死的问题
25 lines
507 B
Swift
25 lines
507 B
Swift
//
|
|
// SafariView.swift
|
|
// PushDeer
|
|
//
|
|
// Created by HEXT on 2022/2/27.
|
|
//
|
|
|
|
import SwiftUI
|
|
import SafariServices
|
|
|
|
struct HSafariView: UIViewControllerRepresentable {
|
|
|
|
let url: URL
|
|
|
|
func makeUIViewController(context: Context) -> SFSafariViewController {
|
|
let safariVC = SFSafariViewController.init(url: url)
|
|
safariVC.dismissButtonStyle = .close
|
|
return safariVC
|
|
}
|
|
|
|
func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {
|
|
// update code
|
|
}
|
|
}
|