Relationship between uiviewcontroller and uiview

Source: Internet
Author: User

Uiviewcontroller and uiview are two different classes.
Uiviewcontroller is a view controller.
While uiview is a view
That is to say, uiviewcontroller controls uiview.
You can also think that uiviewcontroller is a photo frame.
Uiview is a photo.
The photo frame can take this photo and change it to another one anytime, anywhere.
Or Add a new photo to the photo. And photos
But cannot manipulate the photo frame.


Uiview is working on the front line. It displays the displayed content to users and accepts user interaction. Uiviewcontroller is equivalent to the Director. According to the plan, the uiview is displayed in the form of fancy techniques, such as flip and fade-in.

Another function of uivewcontroller is to process user interaction operations. Note that I am talking about "processing" here. Of course, uiviewcontroller does not know user interaction, in this case, uiview needs to pass user interaction operations (for example, touchesbegintouchesmoved. Two common methods are used to complete the transfer:

1. [self nextresponder] touchesbegin: touches...

2. Use notification


Regardless of the method, if the uiviewcontroller obtains the user input, it should make some changes to the uiview to respond to the user input. Note that the uiviewcontroller should only change the performance of the uiview, instead of dealing with other things,

More operations are carried out through Delegate. Next time we will explain the message transmission methods in the application scenarios of delegate.


Uiview is a view, and uiviewcontroller is a controller. Each viewcontroller manages a view

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.