objective c - How to conditionally fire segue based on block-based network operation in iOS? -
i have block-based network function want allow segue commence when successful. attempt @ authentication:
[user signupinbackgroundwithblock:^(bool succeeded, nserror *error) { nslog(@"in process"); if (!error) { nslog(@"succcess"); }else{ nslog(@"failure"); } }];
how can commence segue conditionally statement in viewcontroller?
[self performseguewithidentifier@"yoursegueidentifierthatyousetinstoryboard"];
should trick if understand question correctly.
edit 1:
to fire code on main thread, wrap code that:
dispatch_async(dispatch_get_main_queue(), ^{ [self performseguewithidentifier@"yoursegueidentifierthatyousetinstoryboard"]; });
Comments
Post a Comment