UIComponent icon indicating copy to clipboard operation
UIComponent copied to clipboard

How to modify UITextField text font?

Open Channe opened this issue 1 year ago • 0 comments

        VStack(justifyContent: .center, alignItems: .center) {
            ViewComponent(view: UITextField())
                .placeholder("input")
                .text(self.viewModel.image)
                .font(.systemFont(ofSize: 16))
                .textColor(.blue)
                .size(width: .fill)
                .inset(5)
                .update {
                    $0.layer.borderColor = UIColor.black.cgColor
                    $0.layer.borderWidth = 1
                    $0.layer.cornerRadius = 6
//                    $0.font = .systemFont(ofSize: 16)
                }
                .inset(10)
        }

.font(.systemFont(ofSize: 16)) Setting the font doesn't take effect and gets overridden by the font in the extension Component.

Channe avatar Oct 11 '24 04:10 Channe