SkyFloatingLabelTextField icon indicating copy to clipboard operation
SkyFloatingLabelTextField copied to clipboard

Update Error Label Font

Open anish190 opened this issue 3 years ago • 0 comments

I am trying to set the font for error label, but it is always taking the title font. SkyFloatingLabelTextField creates error label with titleFont. Setting textfield.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

anish190 avatar May 09 '22 07:05 anish190