Closed ramunasjurgilas closed 7 years ago
Hi,
paragraph styling is a combination of multiple style features in one. Because of that it needs to be applied separately. At the end of your code you need to call .paragraphApplyStyling
Thanks for the quick answer, but unfortunately it did not work. Now I have like that:
textView.attributer = "by_clicking_tou_pp".white
.match(.terms_of_use).underline.makeInteract({ (link) in
print("TODO: open terms of user screen")
})
.match(.privacy_policy).underline.makeInteract({ (link) in
print("TODO: open privacy policy")
}).paragraphAlignRight.paragraphApplyStyling
ah... you did a .match. When doing that, the active selection will be set to that match. So you are applying the paragraph styling to only the seleted .privacy_policy. You want the styling on the entire text. I did a test in the demo app and added the following:
func showSample8() {
attributedTextView.attributer = decorate(6) { content in return (content + (
"The quick brown fox jumps over the lazy dog.\nPack my box with five dozen liquor jugs.\nSeveral fabulous dixieland jazz groups played with quick tempo.".brown
.match("brown fox").underline.makeInteract { (link) in
print("TODO: open terms of user screen")
}
.match("fabulous dixieland").underline.makeInteract { (link) in
print("TODO: open privacy policy")
}.all.paragraphAlignRight.paragraphApplyStyling
))
}
}
The result of that is:
Thanks for the quick support! Now works as designed! 👍
paragraphAlignRight is not working. Below I posted how I am using it.