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's superview.

try viewwillappear method:

-(void)viewwillappear:(bool)animated {     [super viewwillappear:animated];      // here } 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

qt - Passing a QObject to an Script function with QJSEngine? -

c# - Web API response xml language -