evermeer / AttributedTextView

Easiest way to create an attributed UITextView (with support for multiple links and from html)
Other
440 stars 55 forks source link

Question #7

Closed Daman1208 closed 7 years ago

Daman1208 commented 7 years ago

Is there any option of conditional append?? e.g, append some variable if it is not nil

evermeer commented 7 years ago

you have to make sure it's not optional. So if you want to append an optional string you will get code like this:

let s1: String? = "asdf"
let s2: String? = "jkl"
let a = (s1 ?? "").red.append(s2 ?? "").green