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

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -