Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// 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