ios - Is there a method called after viewDidLayoutSubviews? -
i need add calayer uilabel, after uilabel has changed frame. uilabel changes frame in viewdidlayoutsubviews
method, , if add calayer there, create multiple instances of calayers since viewdidlayoutsubviews
called multiple times. i've tried removing of calayers before adding new one, removes text well. i've used self.eventattending!.layer.sublayers = nil
set sublayers null.
so, think simplest answer issue add calayer after frame has been adjusted in viewdidlayoutsubviews
, brings me question: method called after viewdidlayoutsubviews
?
there no method always called after viewdidlayoutsubviews
, called during creation process can called when things happen view adding new subview.
your best bet create reference variable layer can either remove it, adjust necessary, or check if reference variance not nil , don't recreate it.
Comments
Post a Comment