简体   繁体   English

屏幕A - >按键> 10s操作 - >需要显示屏幕B(我使用故事板)

[英]SCREEN A -> press button > 10s operation -> it's need to show SCREEN B (I use a Storyboard)

I create a UI using a storyboard , and on one of my screens I start to perform a heavy time consuming operation (the waiting dialog is being shown in this time), and after finishing this operation I need to show another screen with getting results. 我使用storyboard创建了一个UI,在我的一个屏幕上,我开始执行耗时的操作(此时正在显示等待对话框),并且在完成此操作后,我需要显示另一个屏幕并获得结果。

What should I use for this case: 在这种情况下我应该使用什么:

  1. Declare a new screen in the Storyboard and use SEGUE Storyboard声明一个新屏幕并使用SEGUE
  2. Create a nib -file dynamically 动态创建一个nib -file
  3. Other? 其他?

EDIT: 编辑:

Question is - how can I move from one screen to another after performing time consuming operation (I use a Storyboard). 问题是 - 如何在执行耗时的操作后从一个屏幕移动到另一个屏幕(我使用故事板)。 It seems that if I use nibs - I should only change rootViewControoler 似乎如果我使用nibs - 我应该只更改rootViewControoler

SCREEN A -> press button > 10s operation -> it's need to show SCREEN B (I use a Storyboard). 屏幕A - >按下按钮> 10s操作 - >需要显示屏幕B(我使用故事板)。 How can I do it? 我该怎么做?

There are a variety of things that you could could do in this situation. 在这种情况下,你可以做很多事情。

It sounds like you want to present a waiting view modally. 听起来你想要以模态方式呈现等待视图。 A commonly used 3rd party class for this is MBProgressHUD which allows you to present a heads-up display modally in your view during the execution of a long-running task. 一个常用的第三方类是MBProgressHUD ,它允许您在执行长时间运行的任务期间在视图中以模态方式呈现抬头显示。

With MBProgressHUD you present an instance of the HUD in your view and remove it after the task completes. 使用MBProgressHUD您可以在视图中显示HUD的实例,并在任务完成后将其删除。 It requires no nib loading, etc. 它不需要笔尖装载等。

Just one option. 只有一个选择。 It depends on what you want to present to the user. 这取决于您要向用户呈现的内容。

EDIT: It appears the OP is mostly interested in how to transition to a new view controller following a lengthy operation under Storyboards. 编辑:看起来OP主要关注如何在故事板下进行漫长的操作后转换到新的视图控制器。 I think the solution is performSegueWithIdentifier:sender: . 我认为解决方案是performSegueWithIdentifier:sender: . So, set up the segue of interest in the Storyboard and call performSegueWithIdentifier:sender: on the view controller in whose context the long-running task is being performed. 因此,在Storyboard中设置感兴趣的segue,并在视图控制器上调用performSegueWithIdentifier:sender:在其上下文中执行长时间运行的任务。

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

相关问题 按下按钮时需要“刷新”应用程序的屏幕 - Need to “refresh” app's screen on button press 每10秒重复一次UILocalNotification的间隔 - Repeat Interval for UILocalNotification every 10s 按下按钮将照片发送到下一个屏幕 - Send photo to next screen on button press 使用情节提要时如何更改按钮的autoResizingMask? - How do I change a button's autoResizingMask when using storyboard? 当我运行我的iPhone应用程序时,它只显示一个白色的窗口,但是当我按下主屏幕按钮时,它显示了输出问题。 - When i run my iPhone application it just show a white window, but when I press home button then it shows output what's wrong with it? 成就屏幕的“完成”按钮在某些设备上不起作用 - Achievements screen's “Done” button not working on some devices 早在iOS 6中,由于沙箱传输,使用1000个本地文件中的10个更新应用程序花费了数小时 - Back in iOS 6, updating an app with 10s of 1000s of local files took hours because of the sandbox transfer 使用Storyboard在屏幕上显示两个视图控制器,例如SplitViewController - Show Two view controllers on screen using Storyboard, like SplitViewController 适用于所有屏幕尺寸的情节提要 - Storyboard for all screen size 使用情节提要的登录屏幕 - Login Screen using Storyboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM