草庐IT

Viewcontroller

全部标签

ios - 如何在 Google maps ios sdk 中过滤自动完成国家?

目前,它在每个国家查询,但我希望它只在新加坡查询我找到了一个stackoverflow解决方案HowtogetcountryspecificresultwithGoogleautocompleteplaceapiiossdk?,但不知道我应该把代码放在哪里。这是代码,我使用全屏自动完成解决方案。importUIKitimportGoogleMapsclassOnlyLocationViewController:UIViewController{overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafter

ios - 如何从 GameScene 中的 ViewController 调用方法

我有一个在我的viewController中有一个自定义segue的方法,看起来像这样:funcgameOver(){performSegueWithIdentifier("GameOver",sender:nil)}我在GameScene.swift中这样调用方法:GameViewController().gameOver()我仔细检查了segue名称,它是正确的。每当我在我的GameScene.swift文件中调用它时,我都会收到SIGABRT消息,但我不知道为什么。我尝试仅使用println()消息调用该函数并且它起作用了。任何关于为什么会发生这种情况以及我如何成功调用GameS

ios - 如何从 GameScene 中的 ViewController 调用方法

我有一个在我的viewController中有一个自定义segue的方法,看起来像这样:funcgameOver(){performSegueWithIdentifier("GameOver",sender:nil)}我在GameScene.swift中这样调用方法:GameViewController().gameOver()我仔细检查了segue名称,它是正确的。每当我在我的GameScene.swift文件中调用它时,我都会收到SIGABRT消息,但我不知道为什么。我尝试仅使用println()消息调用该函数并且它起作用了。任何关于为什么会发生这种情况以及我如何成功调用GameS

ios - Swift - 显示另一个带有导航栏的 View Controller

我有两个ViewControllers--一个有Storyboard,一个没有。这两个ViewController在顶部都有自己的导航栏。现在,当我使用self.presentViewController(editorViewController,animated:true,completion:nil)时,我的editorViewController出现了,但没有导航栏。有什么办法解决这个问题吗? 最佳答案 我使用以下代码解决了这个问题:leteditorViewController=IMGLYMainEditorViewCont

ios - Swift - 显示另一个带有导航栏的 View Controller

我有两个ViewControllers--一个有Storyboard,一个没有。这两个ViewController在顶部都有自己的导航栏。现在,当我使用self.presentViewController(editorViewController,animated:true,completion:nil)时,我的editorViewController出现了,但没有导航栏。有什么办法解决这个问题吗? 最佳答案 我使用以下代码解决了这个问题:leteditorViewController=IMGLYMainEditorViewCont

iOS:返回上一个 View

我在StoryBoard中有两个这样的View:[View1]->[导航Controller]->[View2]要从View1(有tableview)转到View2,我通过单击View1上的一行来执行此操作:self.performSegueWithIdentifier("showmyview2",sender:self)这有效。现在我在View2上有一个按钮,单击该按钮时应该会返回到之前的View,即View1。我试过这个:navigationController!.popViewControllerAnimated(true)但这行不通。我如何返回第一View?

iOS:返回上一个 View

我在StoryBoard中有两个这样的View:[View1]->[导航Controller]->[View2]要从View1(有tableview)转到View2,我通过单击View1上的一行来执行此操作:self.performSegueWithIdentifier("showmyview2",sender:self)这有效。现在我在View2上有一个按钮,单击该按钮时应该会返回到之前的View,即View1。我试过这个:navigationController!.popViewControllerAnimated(true)但这行不通。我如何返回第一View?

ios - ( swift )PrepareForSegue : fatal error: unexpectedly found nil while unwrapping an Optional value

细节ViewController:@IBOutletvarselectedBundesland:UILabel!表格ViewController:overridefuncprepareForSegue(segue:UIStoryboardSegue!,sender:AnyObject!){if(segue.identifier=="BackToCalculator"){varvc:FirstViewController=segue.destinationViewControllerasFirstViewControllervc.selectedBundesland.text="Test

ios - ( swift )PrepareForSegue : fatal error: unexpectedly found nil while unwrapping an Optional value

细节ViewController:@IBOutletvarselectedBundesland:UILabel!表格ViewController:overridefuncprepareForSegue(segue:UIStoryboardSegue!,sender:AnyObject!){if(segue.identifier=="BackToCalculator"){varvc:FirstViewController=segue.destinationViewControllerasFirstViewControllervc.selectedBundesland.text="Test

ios - SWIFT/iOS : Parse XML data (RSS Feed) into clear text, 添加到带有图像和视频的 TextView

我环顾四周,我目前的情况是使用MWFeedParser,这是一个很棒的解析器。我的应用程序所做的是读取新闻网站提要,在表格中显示新闻故事,然后选择您想要的故事并在新的ViewController中显示完整故事。到目前为止,我已经关闭了此功能,但我正在努力处理文本。在对下载的XML数据使用.dataUsingEncoding(NSUTF16StringEncoding)之后,这会将不可读的文本变成清晰可读的文本。当我必须实现添加图像时,我的问题就出现了,我有一种方法可以获取图像并将其添加到标题旁边的TableView中的故事中,但我不知道如何保留结构我的完整故事ViewControlle