Why does my updateUIView change state at the same time

Code Block import SwiftUI
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? ? ?

Can you show the complete code (including the view using your UIkitTextView and the root view of your app)?
With some info please.
  • Steps to reproduce the issue

  • What you expect

  • What you actually get

Why does my updateUIView change state at the same time
 
 
Q