I see there is a class ASTextKitRenderer, but I'm not sure the proper usage of this and how to import it into my swift project.
I want to recreate the behavior of minimumScaleFactor of UILabel for ASTextNode
I see there is a class ASTextKitRenderer, but I'm not sure the proper usage of this and how to import it into my swift project.
I want to recreate the behavior of minimumScaleFactor of UILabel for ASTextNode
Just spent 2 hours searching for the same finally came up with the solution, you just have to use
_textNode.pointSizeScaleFactors = @[@(0.5)];
as the documentation says
An array of descending scale factors that will be applied to this text node to try to make it fit within its constrained size. This array should be in descending order and NOT contain the scale factor 1.0. For example, it could
return @[@(.9), @(.85), @(.8)];
defaults to nil (no scaling)
Is not necessary to use the renderer class directly, and in fact this is not a necessary step to solve your problem. As you pointed out, there is a usable API in Beta that has this behavior, and you can also look at the open source project for the changes that landed this functionality for some additional details on how to use it.