2019-09-17 17:34:54 +02:00
|
|
|
//
|
2019-09-17 17:58:41 +02:00
|
|
|
// SettingsAttributedStringView.swift
|
2019-09-17 17:34:54 +02:00
|
|
|
// NetNewsWire-iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 9/16/19.
|
|
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
2019-09-17 17:58:41 +02:00
|
|
|
struct SettingsAttributedStringView: UIViewRepresentable {
|
2019-09-17 17:34:54 +02:00
|
|
|
|
|
|
|
let string: NSAttributedString
|
|
|
|
|
|
|
|
func makeUIView(context: Context) -> UITextView {
|
|
|
|
let textView = UITextView()
|
2019-09-17 18:05:16 +02:00
|
|
|
|
2019-09-17 17:34:54 +02:00
|
|
|
textView.attributedText = string
|
|
|
|
textView.translatesAutoresizingMaskIntoConstraints = false
|
2019-09-17 18:40:58 +02:00
|
|
|
textView.isEditable = false
|
|
|
|
|
2019-09-17 18:05:16 +02:00
|
|
|
textView.adjustsFontForContentSizeCategory = true
|
2019-09-17 17:34:54 +02:00
|
|
|
textView.font = .preferredFont(forTextStyle: .body)
|
|
|
|
textView.textColor = UIColor.label
|
|
|
|
textView.backgroundColor = UIColor.secondarySystemGroupedBackground
|
|
|
|
|
|
|
|
return textView
|
|
|
|
}
|
|
|
|
|
|
|
|
func updateUIView(_ textView: UITextView, context: Context) {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|