Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class RootViewController: UIViewController {
- //MARK: Properties
- let label = UILabel(frame: .zero)
- //MARK: Lifecycle
- override func viewDidLoad() {
- super.viewDidLoad()
- //Set up label
- self.label.translatesAutoresizingMaskIntoConstraints = false
- self.label.textAlignment = .center
- self.label.font = IconFont().iconFont(50)
- self.label.text = IconFont().arrow_right
- self.label.textColor = UIColor.red
- //Set up view
- self.view.addSubview(self.label)
- self.view.backgroundColor = UIColor.white
- self.label.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 0).isActive = true
- self.label.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: 0).isActive = true
- self.label.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: 0).isActive = true
- self.label.leftAnchor.constraint(equalTo: self.view.leftAnchor, constant: 0).isActive = true
- }
- //MARK: Functions
- }
Add Comment
Please, Sign In to add comment