struct UIkitTextView: UIViewRepresentable {
@Binding var isBold: Bool
@Binding var isItalics: Bool
func makeUIView(context: Context) -> UITextView {
let view = UITextView()
view.text = "Defutl"
view.font = UIFont.systemFont(ofSize: 24)
return view
}
func updateUIView(_ uiView: UITextView, context: Context) {
uiView.toggleBoldface(isBold ? self : nil)
uiView.toggleItalics(isItalics ? self : nil)
}
typealias UIViewType = UITextView
}
When isBool = true, modify the font Bold.
But when isBool changes, isItalics will also change, WHY? ? ?
Selecting any option will automatically load the page