Question

I know we can add a view to it's superView by calling addSubview method. But when does a view displayed and draw? Does it display immediately when addSubview method called? what's real happening inside addSubview method? can anybody tell me,very thanks!

Was it helpful?

Solution

In regards to the drawing:

No, the subview is not instantaneously drawn when addSubview is executed. According to the authors Rob Napier and Mugunth Kumar, "iOS consolidates all drawing requests during the run loop, and draws them all at once" (iOS 5 Programming Pushing the Limits, 2012).

OTHER TIPS

You can cmd click on that method to see all the header file of that object. It is NOT possible to look/see what really happens inside that method or its implementation. You can refer here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top