Reusing threads through multiple UIViewControllers

I created some custom UITableViewCellsin the nib file and would like to use it after a few UIViewControllers.

Can someone tell me the best way to do this? My limited knowledge around boot tips seems to suggest that you need to specify one owner class in Interface Builder.

Thank.

+3
source share
2 answers

Just do it; no real obstacles. As for the File Owner class, if the keys you bind in nib exist in any object that you want to use nib in, you will be fine.

+2

UIViewController initWithNibName:bundle: . , , GameController, . GameController GameController.xib, :

- (id)initWithOptions:(NSDictionary *)gameOptions
{    
    if (self = [super initWithNibName:@"GameController" bundle:nil])
    {
        // code here
    }
    return self;
}

: , . , , GameController. , , :

local = [[LocalGameController alloc] initWithOptions:options];
online = [[OnlineGameController alloc] initWithOptions:options];

, , GameController, GameController.xib . GameController .

+1

Source: https://habr.com/ru/post/1741654/


All Articles