Skyscanner / SkyFloatingLabelTextField

A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.
Apache License 2.0
4.09k stars 540 forks source link

Update Error Label Font #340

Open anish190 opened 2 years ago

anish190 commented 2 years ago

I am trying to set the font for error label, but it is always taking the title font. SkyFloatingLabelTextField creates error label with titleFont. Settingtextfield.errorLabel.font = UIFont.systemFont(ofSize: 12.0) is not working. It updates only when i update titleFont but I want to have different font size for title and error label.

// SkyFloatingLabelTextField.swift

fileprivate func createErrorLabel() {
        let errorLabel = UILabel()
        errorLabel.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        errorLabel.font = titleFont
        errorLabel.alpha = 0.0
        errorLabel.textColor = errorColor
        addSubview(errorLabel)
        self.errorLabel = errorLabel
}

Xcode Version: 13.3.1 SkyFloatingLabelTextField Version: 4.0