开发者

What is the difference between UIView and UIViewController?

开发者 https://www.devze.com 2023-02-03 16:25 出处:网络
I need a detailed explanation on the following: What do we use a UIViewController for? What is the use of it?

I need a detailed explanation on the following:

What do we use a UIViewController for? What is the use of it?

I have a class that looks like the following:

class one
{
    UINavigationController *nav = ...;

    two *secondObject = ...;

    // By use of it, I have push the new view class two//ok
}
class two
{
 .开发者_Go百科..
}

How can I use secondObject in the class one?

What is the class hierarchical start from the window?


The UIViewController is the controller part in the MVC design pattern.

Model<------->Controller<------->View

The controller's task is to handle navigation between different views, key presses, and screen touches etc.


A view is merely an object, kind of like a piece of paper, that other objects are put onto.

A View Controller is an object that controls views, pushing and popping them forwards and backwards in a navigation stack.

"View Controllers Programming Guide for iOS"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号