[英]Load UIViewController from UIView(.xib) Button Action
我已经在Interface Builder中创建了一个UIView。我有一个按钮。我可以通过点击UIView的Button来加载应用程序中的任何ViewController吗? 我的UIView不在导航控制器下。
你可以这样
YourViewController *aView = [[YourViewController alloc]
initWithNibName:@"xibName" bundle:nil];
[self presentViewController:aView animated:YES completion:nil];
您可以使用NSNotification通知ViewController呈现另一个ViewController。
此处的更多信息:
显示ViewController:
ViewController *viewController = ...;
[self presentViewController:viewController animated:YES completion:NULL];
另一种选择是从您的按钮调用委托。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.