swift - UITextView change dynamically font -
hello i'm using next code observe new line on uitextview
func textview(textview: uitextview, shouldchangetextinrange range: nsrange, replacementtext text: string) -> bool { allow newline:bool = text == "\n" if newline { println("new line") } homecoming true }
i want alter font when new line occurs first thing seek use
if newline { textview.typingattributes = highlighttypingattributes } else { textview.typingattributes = normaltypingattributes }
the other thing set attributed string alter whole text want append bold font after new line happens
any ideas?
thanks
swift uitextview nsattributedstring
No comments:
Post a Comment