简体   繁体   中英

How to add the same child View controllers to a parent view controller in iOS?

Let's say I have two UIViews in a parent view (a xib ). I want to show in these two views different instances of the same View Controller.

I know how I can do it if I have just one view:

    [self addChildViewController:MyChildController];
    [self.myUIVIew addSubview:myChildView];

But how does it work if I want to have two of these ? (a comparison of views with different data for example).

Thanks!

It will work. Framework uses instances, not a class. So two instances of the same class are different beings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM