- Adaptive iPhone/iPad layout with NavigationSplitView sidebar - Auto-detect SSL-pinned domains, fall back to passthrough - Certificate install via local HTTP server (Safari profile flow) - App Group-backed CA, per-domain leaf cert LRU cache - DB-backed config repository, Darwin notification throttling - Rules engine, breakpoint rules, pinned domain tracking - os.Logger instrumentation across tunnel/proxy/mitm/capture/cert/rules/db/ipc/ui - Fix dyld framework embed, race conditions, thread safety
35 lines
1.2 KiB
Swift
35 lines
1.2 KiB
Swift
import SwiftUI
|
|
import UIKit
|
|
|
|
struct SelectableTextView: UIViewRepresentable {
|
|
let text: String
|
|
|
|
func makeUIView(context: Context) -> UITextView {
|
|
let textView = UITextView()
|
|
textView.isEditable = false
|
|
textView.isSelectable = true
|
|
textView.isScrollEnabled = false
|
|
textView.backgroundColor = .clear
|
|
textView.textContainerInset = .zero
|
|
textView.textContainer.lineFragmentPadding = 0
|
|
textView.adjustsFontForContentSizeCategory = true
|
|
textView.font = .monospacedSystemFont(ofSize: 12, weight: .regular)
|
|
textView.textColor = .label
|
|
textView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
|
|
return textView
|
|
}
|
|
|
|
func updateUIView(_ uiView: UITextView, context: Context) {
|
|
if uiView.text != text {
|
|
uiView.text = text
|
|
}
|
|
}
|
|
|
|
func sizeThatFits(_ proposal: ProposedViewSize, uiView: UITextView, context: Context) -> CGSize? {
|
|
let width = proposal.width ?? UIScreen.main.bounds.width
|
|
let fittingSize = CGSize(width: width, height: .greatestFiniteMagnitude)
|
|
let size = uiView.sizeThatFits(fittingSize)
|
|
return CGSize(width: width, height: ceil(size.height))
|
|
}
|
|
}
|