ios - Use of undeclared type ‘UIContainerView’ -
i’m using xcode 7 , i’ve storyboard controller uicontainerview
when i’m trying create outlet controller there error "use of undeclared type uicontainerview
"
it’s not bug of xcode 7 because there same error on xcode 6
i need create outlet because when switch segmented control have programmatically change embed of container
it's error or mustn't create outlet container? it's seems there not called uicontainerview
in library, it's strange
there no such class called uicontainerview
. need create outlet of uiview
, connect container view.
you can switch content of container view like:
// property @property (nonatomic, weak) iboutlet uiview *container; @property (nonatomic, strong) uiviewcontroller *first; @property (nonatomic, strong) uiviewcontroller *second; // method removes first vc view , shows second vc // assumes first , second properties initialized - (void)showsecondvc { // removes first view controller [self.first.view removefromsuperview]; [self.first willmovetoparentviewcontroller:nil]; [self.first removefromparentviewcontroller]; // shows second view controller [self addchildviewcontroller:self.second]; [self.second didmovetoparentviewcontroller:self]; self.second.view.frame = self.container.bounds; [self.container addsubview:self.second.view]; }
Comments
Post a Comment