I made a CALayer *sublayer over the main view, then I added CATextLayer over sublayer.
Now I want to show text on the CATextLayer by clicking a button on my main view.
How can I do this?
I made a CALayer *sublayer over the main view, then I added CATextLayer over sublayer.
Now I want to show text on the CATextLayer by clicking a button on my main view.
How can I do this?
Copyright © 2021 Jogjafile Inc.
Set the buttons action using
-[UIButton addTarget:selector:forControlEvents:]:, then in that function set theCATextLayers string property to either anNSStringor anNSAttributedString.I remind you that
CATextLayerdoesn't respect paragraph settings on attributed strings, so line height is kind of off and does not look so great.