Example:
let dummy = UILabel()
dummy.text = "this is a String"
I want the view to show something like this. Also, is it possible to change the font size of "String" in dummy?
this is a String
You can use NSAttributedString to do that:
let dummy = UILabel()
let theString = "this is a String"
let attributedString = NSMutableAttributedString(string: theString, attributes: [NSFontAttributeName:UIFont.systemFontOfSize(12.0)])
let boldFontAttribute = [NSFontAttributeName: UIFont.boldSystemFontOfSize(24.0)]
attributedString.addAttributes(boldFontAttribute, range: NSMakeRange(10, theString.characters.count))
dummy.attributedText = attributedString