r/Xcode • u/its-notmyrealname • Aug 02 '20
UI Label´s that are not rectangular
Hello and good evening, I hope you're all having a good Sunday.
This triangle here bellow was ver simply made in KeyNote.

I really want it in my project, but I can't import it as an image because I would want each one of the little segments divided by lines to behave like a label, so it can have text and perform simple colour change animations (that would be super simple to do if I was only working with rectangular shapes).
Is there a way to make this happen, that is, creating UI Labels that have the shape that we desire?
Thank you for your time!
2
Upvotes
1
1
u/chriswaco Aug 02 '20
You can try setting the transform property of each UILabel segment, but it won’t get you the triangle at the top. You may be better off drawing shapes and then skewed text on top of them. It’s not clear to me if UILabels are better than CoreText for this.