I want to draw text into UIView‘s subview using drawInRect:withFont:lineBreakMode call but that operates on the current context only.
Is it possible to draw text into a subview from current view?
The subview is a generic UIView instance and I don’t really want to create a new UIView-derived class just for this purpose if I can avoid it.
One option would be to add a CALayer to the view’s layer instead of adding a UIView to the view. The CALayer has a
delegateproperty which you can assign any object to. The CALayer calls:on the
delegate, which you can take to do something like: