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