简体   繁体   English

在2个视图控制器之间进行筛选(模态)

[英]Segue between 2 view controllers (modal)

I am using the modal segue to navigate between 2 view controllers. 我正在使用模式搜索在2个视图控制器之间导航。 Below is the 2 segue's I setup. 以下是2 segue的I设置。

The purpose of the Segue is to navigate back and forth between the store url screen and the web view screen. Segue的目的是在商店URL屏幕和Web视图屏幕之间来回导航。

I don't want to use a navigation controller as this is NOT a common use case and I don't want the user to go back easily. 我不想使用导航控制器,因为这不是常见的用例,也不希望用户轻松返回。

  1. Is there a way to prevent a segue from happening? 有没有办法防止segue发生? (I want to present a warning first) (我想先提出警告)

  2. Is this the proper use of segues? 这是对segues的正确使用吗?

Segue设置

The - (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender gets called before the segue is being executed. - (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender在执行segue之前调用- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender Here you can do a check and return false if you don't want the segue to go through. 在这里,您可以进行检查,如果不希望继续进行测试,则返回false。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM