以前採用純代碼,對各個不同頁面控制器之間進行跳轉。有兩種方式:(1)push(2)present ;
現在使用storyboard,對於跳轉也總結兩幾點:
(1)用segue進行跳轉,在prepareForSegure裏面寫跳轉代碼。er isEqualToString:@"PushContractController"]) {
<span style="font-size:18px;"> ContractController *controller = segue.destinationViewController;
controller.delegate = self;
//這裏可以傳遞參數
}</span>
(2)用identify ID進行跳轉
<span style="font-size:18px;">- (void)tapAction{
UIStoryboard *storyboard = [[UIStoryboard alloc] init];
SuiXinCunContractController *controller = [storyboard instantiateViewControllerWithIdentifier:@"controllerIdentifier"];
controller.delegate = self;
//這裏可以傳遞參數
[self.navigationController pushViewController:controller animated:YES];
}</span>