Last active
December 28, 2019 16:08
-
-
Save ycui1/75f71523080a8b4a48a93729da2c5d4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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