Closed malcommac closed 4 years ago
imageProvider callback should provide a list of parsed attributes along with the image name.
imageProvider
let xmlText = """ - <img named="check" myAttribute="5" otherAttribute="test"/> Performed! """ let base = Style { $0.font = UIFont.boldSystemFont(ofSize: 14) $0.color = UIColor(hexString: "#8E8E8E") } let xmlStyle = StyleXML(base: base) xmlStyle.imageProvider = { imageName, attributes in // attributes contains named, myAttribute and otherAttribute } self.textView?.attributedText = xmlText.set(style: xmlStyle)
imageProvider
callback should provide a list of parsed attributes along with the image name.