I have an array of labels for my buttons:
whenButtonArray = ["THURSDAY\nJUNE 5", "FRIDAY\nJUNE 6", "SATURDAY\nJUNE 7", "SUNDAY\nJUNE 8"]
What I'm trying to do is to use NSMutableAttributedString to make the text before the "\n" be a bigger font than the text after it.
I initialized my string like this:
myMutableString = NSMutableAttributedString(string: whenWhereButtonArray[i], attributes: [NSFontAttributeName:UIFont(name: "Tungsten-Book", size: 22.0)!])
But how can I make the second part of the string (after the \n) be a smaller font size? I know I can do something like this:
myMutableString.addAttribute(NSFontAttributeName, value: UIFont(name: "Tungsten-Book", size: 12.0)!, range: NSRange(location:3,length:4))
But I need the range to be dynamic based on the text for each button. Thanks!