ios - When to check if presenting viewController is of type if using autolayout -
this code using set constraints in viewdidload:
if (self.presentingviewcontroller?.iskindofclass(gameviewcontroller) != nil) { print("huhu") self.bottomviewtobottomconstraint.constant = -367 self.bottomviewtohiddenbuttonconstraint.constant = 401 } else { self.bottomviewtobottomconstraint.constant = -200 self.bottomviewtohiddenbuttonconstraint.constant = 200 print("no presenting viewcontroller") }
the message i'm getting no presenting viewcontroller. can see setting constraints animated differently, depending on class presenting viewcontroller. @ time known presenting view controller , right time set constraints? help
as simple as:
after add
bottomview
it'ssuperview
.
try viewwillappear method:
-(void)viewwillappear:(bool)animated { [super viewwillappear:animated]; // here }
Comments
Post a Comment