Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created July 3, 2019 14:09
Show Gist options
  • Save vialyx/f5d0766ed5e7edfd11dcf7497f6500bd to your computer and use it in GitHub Desktop.
Save vialyx/f5d0766ed5e7edfd11dcf7497f6500bd to your computer and use it in GitHub Desktop.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Create MaskedLabelView
let edges = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
let maskedView = MaskedLabelView(frame: view.frame.inset(by: edges))
view.addSubview(maskedView)
// Setup UILabel preferences
maskedView.label.text = "Load your iOS Dev exp\nJust a min"
maskedView.label.textColor = .black
maskedView.label.font = .boldSystemFont(ofSize: 34)
// Setup Gradient Colors
maskedView.startColor = .red
maskedView.endColor = .black
// Setup Animation properties
maskedView.duration = 3
maskedView.repeatCount = Float.infinity
// Start Animation
maskedView.animate()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment