mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-19 13:00:21 +01:00
32 lines
757 B
Swift
32 lines
757 B
Swift
|
//
|
||
|
// RichTextView.swift
|
||
|
// NetNewsWire-iOS
|
||
|
//
|
||
|
// Created by Maurice Parker on 9/16/19.
|
||
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
|
||
|
struct AttributedStringView: UIViewRepresentable {
|
||
|
|
||
|
let string: NSAttributedString
|
||
|
|
||
|
func makeUIView(context: Context) -> UITextView {
|
||
|
|
||
|
let textView = UITextView()
|
||
|
textView.attributedText = string
|
||
|
textView.adjustsFontForContentSizeCategory = true
|
||
|
textView.translatesAutoresizingMaskIntoConstraints = false
|
||
|
textView.font = .preferredFont(forTextStyle: .body)
|
||
|
textView.textColor = UIColor.label
|
||
|
textView.backgroundColor = UIColor.secondarySystemGroupedBackground
|
||
|
|
||
|
return textView
|
||
|
}
|
||
|
|
||
|
func updateUIView(_ textView: UITextView, context: Context) {
|
||
|
}
|
||
|
|
||
|
}
|