Skip to content

Instantly share code, notes, and snippets.

@svetlanama
Created June 4, 2018 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svetlanama/028a148b8fd071a73bfd9644574a85cb to your computer and use it in GitHub Desktop.
Save svetlanama/028a148b8fd071a73bfd9644574a85cb to your computer and use it in GitHub Desktop.
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