ios - Dynamic number of UIViews in custom UIView -
i'm making custom uiview. holds bunch of uilabel objects subviews. count of uilabel objects unknown @ creation time. method in should initialize these uilabel objects? drawrect suitable job?
no, drawrect:
not suitable. drawrect:
drawing content of view, not modifying subviews of view. should update based on triggering event - perhaps viewdidload
, viewwillappear:
, or user event them pushing button. if triggering event on background thread need switch main thread before adding new labels subviews.
Comments
Post a Comment