Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Beginning iPhone Development with Swift - Chapter 03 - Button Fun







let nameRange = (plainText as NSString).rangeOfString(title)

styledText.setAttributes(attributes, range: nameRange)

statusLabel.attributedText = styledText

This code will make the title button name as Bold. ex: Right button pressed.

if we want to make the whole text bold ex: Right button pressed. we can change let nameRange = (plainText as NSString).rangeOfString(plainText)

my question is: if I want to make Right button bold only, so it will be like that Right button pressed. how can I set the index and the range? 

thank you

Comments

Sign In or Register to comment.