Skip to content

Instantly share code, notes, and snippets.

@ycui1
Last active December 28, 2019 16:08
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/75f71523080a8b4a48a93729da2c5d4d to your computer and use it in GitHub Desktop.
Save ycui1/75f71523080a8b4a48a93729da2c5d4d to your computer and use it in GitHub Desktop.
// label.frame = CGRect(x: 150, y: 200, width: 200, height: 20)
// label.text = "Hello World!"
// label.textColor = .black
label.numberOfLines = 0
label.lineBreakMode = .byWordWrapping
label.translatesAutoresizingMaskIntoConstraints = false
label.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
label.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
label.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
label.isUserInteractionEnabled = true
label.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapLabel(sender:))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment