有navigation导航,在storyboard中拉线不起作用,就代码实现
[_setButton addTarget:self action:@selector(goToSet) forControlEvents:UIControlEventTouchUpInside];
-(void)goToSet{
_setController=[self.storyboard instantiateViewControllerWithIdentifier:@"setPage"];
[self.navigationController pushViewController:_setController animated:YES];
}
本文介绍了一种在Swift中使用导航控制器实现页面跳转的方法。当Storyboard中的连接无法正常工作时,可以通过编程方式设置按钮目标和操作来完成页面跳转。具体实现包括设置目标控制器并将其推送到导航堆栈。
1548

被折叠的 条评论
为什么被折叠?



