I am going through a tutorial that mentions the following method:
-(void)layoutSubviews
located in CustomerCell.m
When is this method called during the app execution? Is it automatically invoked? I dont see any callback.
You will find your answer here
EDIT: copied directly from the blog:
- init does not cause layoutSubviews to be called (duh)
- addSubview causes layoutSubviews to be called on the view being added, the view it’s being added to (target view), and all the subviews of the target view
- setFrame intelligently calls layoutSubviews on the view having it’s frame set only if the size parameter of the frame is different
- scrolling a UIScrollView causes layoutSubviews to be called on the scrollView, and it’s superview
- rotating a device only calls layoutSubview on the parent view (the responding viewControllers primary view)
- removeFromSuperview – layoutSubviews is called on superview only