jjzjj

presentviewcontroller

全部标签

ios - swift “线程 1 : Signal SIGABRT in PresentViewController

我想知道为什么我的代码无法正常工作,我在thisvideo中遵循的位置.它总是不断抛出这个错误:Thread1:signalSIGABRT.我是Swift和iOS开发的新手。错误抛出:self.presentViewController(homeViewController,animated:true,completion:nil)代码:FIRAuth.auth()?.addAuthStateDidChangeListener{auth,userinifletuser=user{letmainStoryboard:UIStoryboard=UIStoryboard(name:"Main

ios - 来自 TableViewCell 的 presentViewController

我有一个TableViewController、TableViewCell和一个ViewController。我在TableViewCell中有一个按钮,我想用presentViewController呈现ViewController(但ViewController在Storyboard上没有View)。我尝试使用:@IBActionfuncplayVideo(sender:AnyObject){letvc=ViewController()self.presentViewController(vc,animated:true,completion:nil)}Error:Valueoft

swift - 如何从类内部调用 presentViewController

在我的完成处理程序中,我试图返回http响应代码,就像JS中的alert一样。一旦我得到这个排序,我希望改进我的if语句来识别最终用户的连接问题。我正在看这篇文章。http://www.ioscreator.com/tutorials/display-an-alert-view-in-ios8-with-swift我也看到了这个答案SimpleAppDelegatemethodtoshowanUIAlertController(inSwift)但我得到了一个关于未命名的window的类似方法。我没有所有噪音的代码是这样的:classNewsViewController:UIViewCo

ios - 卡住!只能给presentviewcontroller传数据,不能传pushviewcontroller

letchatController=ChatLogController()chatController.user=userletnav:UINavigationController=UINavigationController(rootViewController:chatController)self.presentViewController(nav,animated:true,completion:nil)上面的代码有效,我试图在呈现之前将用户传递给下一个ViewController但是,这不起作用,它在下一个ViewController中为用户提供了nil:letchatCon

ios - 如何使用 swift 以编程方式转换到不同 Storyboard 中存在的不同 View Controller ?

letcustomerStoryboard=UIStoryboard(name:"Customer",bundle:nil)//First(Current)storyboardletagentStoryboard=UIStoryboard(name:"Agent",bundle:nil)//SecondstoryboardvarotherVC=UIViewController!//ViewControllerreferenceotherVC=agentStoryboard.instantiateViewControllerWithIdentifier("AgentProfile")最后

ios - 如何同时呈现两个 View Controller ?

我的目标是呈现一个ViewController而不直接关闭它的presentingViewController.为了更清楚,请考虑以下示例:引用这个Storyboard:假设第一个黑色ViewController是第一个(初始)ViewController,它应该呈现第三个白色ViewController;问题是白色ViewController应该关闭到第二个橙色ViewController,但不是黑色ViewController,所以它应该表现得像:黑色VC礼物白色VC。WhiteVC解雇给OrangeVC。OrangeVCDismisses给BlackVC。如何应用这样的行为?备注

ios - 在 Swift 中从 TableViewCell 类切换 View Controller

我想在用户单击tableviewcell中的元素时显示一个新的ViewController。然而,用于启动VC的标准代码不适用于tableview单元格甚至辅助类,因为TVC和辅助类都不能呈现ViewController。这是帮助程序类中的代码。无论是放置在helperclass还是tableview单元格中,它都没有启动VC的present方法。classlaunchVC{funclaunchVCNamed(identifier:String){letstoryBoard:UIStoryboard=UIStoryboard(name:"Main",bundle:nil)letseco

ios - 如何在 UIView 类中调用 presentViewController?

我的项目中有一个自定义选项卡,它位于应用程序的每个屏幕上,因此我创建了自定义UIView类和xib文件,并在其中添加了按钮。现在我想要我的按钮在具有不同storyboardid的不同屏幕上进行导航。但是我不能从UIView类中调用presentViewController。以前我在extension类中自定义函数以在屏幕之间导航,但UIView类也无法调用该函数。importUIKit@IBDesignableclasstab:UIView{varview:UIView!@IBActionfuncbtn1(sender:UIButton){letstoryboard=UIStorybo

ios - 如何从 UICollectionViewCell 中调用 presentViewController

从UIViewController调用这个函数没有问题,但是从UICollectionViewCell调用它会引发预编译错误函数:funcdidTapShare(sender:UIButton){lettextToShare="Swiftisawesome!Checkoutthiswebsiteaboutit!"ifletmyWebsite=NSURL(string:"http://www.google.com/"){letobjectsToShare=[textToShare,myWebsite]letactivityVC=UIActivityViewController(activ

ios - 关闭所有非当前 View

我一直在关注一个视频教程,该视频教程教我如何以编程方式创建没有Storyboard的iOS应用程序。进展顺利,我喜欢它的大部分内容,但我有一个小问题。我只读了一半,我注意到一个潜在的内存问题,教程向我展示的方式是,对于每个下一个View,我都这样呈现:letChooseCategoryController=ChooseCategoryViewController()present(ChooseCategoryController,animated:true,completion:nil)然后我从那里的角度展示另一个。回过头来看,我也提出了另一种观点。我在运行应用程序时注意到内存使用量在