Actually I love UILabel
. They\'re sweet. Now I had to go to UITextView
because UILabel
is not aligning text vertically to the top. Damn. O
Swift 3
let textView = UITextView(frame: view.frame)
textView.font = UIFont(name: "Helvetica", size: 64.0)
textView.textColor = .red
textView.text = "Hello World"
textView.layer.shadowColor = UIColor.black.cgColor
textView.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
textView.layer.shadowOpacity = 1.0
textView.layer.shadowRadius = 2.0
textView.layer.backgroundColor = UIColor.clear.cgColor
Swift 2.3
let textView = UITextView(frame: view.frame)
textView.font = UIFont(name: "Helvetica", size: 64.0)
textView.textColor = UIColor.redColor()
textView.text = "Hello World"
textView.layer.shadowColor = UIColor.blackColor().CGColor
textView.layer.shadowOffset = CGSize(width: 2.0, height: 2.0)
textView.layer.shadowOpacity = 1.0
textView.layer.shadowRadius = 2.0
textView.layer.backgroundColor = UIColor.clearColor().CGColor