Reputation: 1307
I have a view that carries out a task, when the task is completed the activity indicator will become hidden, I want to send the user to another view when the activity is completed, or give the user an error if unsuccessful. So far I am using an If Else statement to give a success alert or an error alert. There is no buttons to click or anything, simply after the activity is completed the user will be sent to another view passing a few variables along the way.
How would I go about sending the user to another view after completion?
Upvotes: 0
Views: 172
Reputation: 1307
I actually got it working, along with passing a variable to the other view using this method:
DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailView"];
[detail setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
detail.videoURL = outputURL;
Upvotes: 0
Reputation: 3821
To elaborate on AlexWien's answer a little...
@protocol UpdatePricesDelegate;
@interface NXUpdatePricesViewController : UITableViewController
@property (strong, nonatomic) NSArray *calculationProducts;
@property (strong, nonatomic) NSArray *filteredCalculationProducts;
@property (weak, nonatomic) id<UpdatePricesDelegate>delegate;
@end
@protocol UpdatePricesDelegate <NSObject>
- (void)updatePricesController:(NXUpdatePricesViewController *)controller didUpdateCalculationProducts:(NSArray *)calculationProducts;
@end
NXUpdatePricesViewController *updatePricesController = [[NXUpdatePricesViewController alloc] initWithStyle:UITableViewStyleGrouped];
updatePricesController.delegate = self;
updatePricesController.calculationProducts = self.calculationProducts;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:updatePricesController];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[self.navigationController presentViewController:navigationController animated:YES completion:nil];
NXCalculationViewController *calculationController = [[NXCalculationViewController alloc] init];
calculationController.calculation = calculation;
[self.navigationController pushViewController:calculationController animated:YES];
Upvotes: 1
Reputation: 28747
If you use a navigationcontroller:
[self.navigationController pushViewController:theNextViewController animated:YES];
For Storyboard, look up the method in the docu.
Upvotes: 1