Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow title label font to be set #94

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Sources/SkyFloatingLabelTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ open class SkyFloatingLabelTextField: UITextField {
}
}

/// A UIFont value that determines font of the title label
@IBInspectable open var titleFont:UIFont? = UIFont.systemFont(ofSize: 13.0){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pelase put a space before { on this line.

didSet {
self.updateTitleLabel()
}
}

/// A UIColor value that determines the text color of the title label when in the normal state
@IBInspectable open var titleColor:UIColor = UIColor.gray {
didSet {
Expand Down Expand Up @@ -284,7 +291,7 @@ open class SkyFloatingLabelTextField: UITextField {
fileprivate func createTitleLabel() {
let titleLabel = UILabel()
titleLabel.autoresizingMask = [.flexibleWidth, .flexibleHeight]
titleLabel.font = UIFont.systemFont(ofSize: 13)
titleLabel.font = self.titleFont
titleLabel.alpha = 0.0
titleLabel.textColor = self.titleColor
self.addSubview(titleLabel)
Expand Down