Skip to content

Instantly share code, notes, and snippets.

@ycui1
Created January 10, 2020 04:38
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 ycui1/ae85246fb46bc2be151f2b4b11db740e to your computer and use it in GitHub Desktop.
Save ycui1/ae85246fb46bc2be151f2b4b11db740e to your computer and use it in GitHub Desktop.
class TaskPreviewController: UIViewController {
let label = UILabel()
var task: Task!
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
label.numberOfLines = 0
label.font = UIFont.systemFont(ofSize: 30)
view.addSubview(label)
label.translatesAutoresizingMaskIntoConstraints = false
label.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
label.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 100).isActive = true
label.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -100).isActive = true
label.text = task.description
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment