Releases: zacwest/ZSWTaggedString
Releases · zacwest/ZSWTaggedString
Swift 5
Swift 4.2 support
Update to Swift 4.2.
Swift 4
Swift 3
Swift support
Swift support! You will need to add the ZSWTaggedString/Swift
dependency for this. This provides a cleaner API for setting attributes for tags, for example:
options["a"] = .Static([
NSForegroundColorAttributeName: UIColor.whiteColor()
])
options["b"] = .Dynamic({ tagName, tagAttributes, existingAttributes in
if tagAttributes["white"] != nil {
return [
NSForegroundColorAttributeName: UIColor.whiteColor()
]
} else {
return [
NSForegroundColorAttributeName: UIColor.redColor()
]
}
})
This release also fixes ZSWTaggedString
initialization methods init(string:)
and init(format:...)
under Swift.
Incompatibility notes:
ZSWTaggedString
no longer acceptsnil
input; it will convert anynil
input into@""
.ZSWTaggedStringOptions.returnEmptyStringForNil
flag has been removed.
Escaped string fix
Fixes some cases where escaped strings containing <
failed to include the escaped <
(though they parsed without error).
Initial release
Done over the weekend while sick, so hopefully not full of too many bugs.