라이브 UI 변경
This commit is contained in:
31
SodaLive/Sources/Live/Room/V2/Component/Text/TextView.swift
Normal file
31
SodaLive/Sources/Live/Room/V2/Component/Text/TextView.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// TextView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2024/01/18.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
struct DetectableTextView: UIViewRepresentable {
|
||||
var text: String
|
||||
|
||||
func makeUIView(context: Context) -> UITextView {
|
||||
let textView = UITextView()
|
||||
textView.isEditable = false // Make it readonly
|
||||
textView.backgroundColor = .clear
|
||||
textView.isScrollEnabled = true
|
||||
textView.dataDetectorTypes = .link
|
||||
textView.font = UIFont(name: Font.light.rawValue, size: 11.3)
|
||||
textView.textColor = .white
|
||||
textView.textContainer.lineFragmentPadding = 0
|
||||
textView.textContainerInset = .zero
|
||||
|
||||
return textView
|
||||
}
|
||||
|
||||
func updateUIView(_ uiView: UITextView, context: Context) {
|
||||
uiView.text = text
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user