我正在构建一个应用程序,该应用程序在首次启动时需要注册。我习惯于使用 nib 并呈现它们,但我如何以模态方式呈现此 View ,然后在注册完成后将其关闭。
另外,在 Storyboard或单独的 Storyboard中只有一个 View 会更好吗(我假设是前者。)
最佳答案
您需要在 Storyboard 中有一个单独的 View (登录或注册 View )。如果用户未登录,您将显示它:
UIViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"YourLoginViewIdentifier"];
[viewController setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentViewController:viewController animated:NO completion:nil];
与您使用的方法几乎相同。
关于iphone - 在首次启动应用程序时呈现特定的 Storyboard / View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18390468/