Hi All,
If you need to pass data from one ViewContrlloer to other ViewController then first make properties in second ViewController in which you need that data For example:-
In SecondViewController.h
@interface SecondViewController : UIViewController
@property (nonatomic,strong) NSString *model;
@end
Now, In first ViewController before pushing viewControlller ,just initialize that property with passing value:-
In FirstViewController.m
SecondViewController *verifyVC = [self.storyboard instantiateViewControllerWithIdentifier:@"SecondViewController"];
verifyVC.model = @"pass this data";
[self.navigationController pushViewController:verifyVC animated:YES];
Now , you can access this value in second view controller .
0 Comment(s)