簡體   English   中英

如何禁用模態搜索iOS

[英]How to disable modal segue iOS

我有一個7屏幕的應用程序。 在屏幕7上,我有一個按鈕,該按鈕進行評估並提交數據,然后使用模式搜索跳到屏幕1。 但是,如果驗證成功,我只想移動screen1,否則我不想移動到screen1。 目前,它獨立於驗證而移至屏幕1。

按鈕點擊代碼如下

- (IBAction)submitButtonActionForDemo:(id)sender
{
    if (![JLTValidator validateFields:@[_authRepresentative, _acceptDeclarationStatement,_homeTeamRepName,_homeTeamRepPosition,_awayTeamRepName,_awayTeamRepPosition]])
    {
       // how to disable a modal segue here.
        return; 
    }
}

JLTValidator是我的驗證類。

請提出建議/幫助。 感謝在廣告中。

如果您只想幾次允許segue,則需要在InterfaceBuilder中“命名” segue,然后實現此例程:

- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
    if ([identifier isEqualToString:@"your segue name"]) {
        return false;
    }
    return true;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM