Created
June 4, 2018 16:11
-
-
Save svetlanama/028a148b8fd071a73bfd9644574a85cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
class UIAnimatedTitleView: UIView { | |
private var label = UILabel() | |
var text: String = "" { | |
didSet { | |
label.text = text | |
label.textColor = UIColor.black | |
label.textAlignment = .center | |
label.font = UIFont.systemFont(ofSize: 17.0, weight: UIFontWeightSemibold) | |
setNeedsLayout() | |
} | |
} | |
// MARK: Initializers | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
label.frame = self.frame | |
addSubview(label) | |
clipsToBounds = true | |
isUserInteractionEnabled = false | |
} | |
required init?(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment