草庐IT

segueing

全部标签

ios - Segue 已准备就绪,但性能无一异常(exception)地失败

我有两个View,A和B,它们之间有模态转场。A的Controller定义了@IBActionfuncunwindSegue(segue:UIStoryboardSegue)。我正在尝试以编程方式执行展开转场(从ViewB返回到A),但失败但未产生任何错误。在ViewB的Controller中,我调用了performSegueWithIdentifier("unwind",sender:self)并且可以看到调用了funcprepareForSegue(segue:UIStoryboardSegue,sender:AnyObject?)但是之后什么也没有发生。我已经在XCode中为un

条件下的 Swift 自定义 segue

我正在尝试根据用户登录信息是否正确有条件地执行segue。我有一个从我的登录ViewController到一个新的NavigationController的模态转场。我几乎尝试了所有遇到的建议,但似乎没有任何效果。使用Sift和Xcode6。importUIKitimportAudioToolboxclassViewController:UIViewController{@IBOutletweakvarusernameTextField:UITextField!@IBOutletweakvarpasswordTextField:UITextField!@IBOutletweakvari

ios - 在 Swift 中通过 Storyboard Segue 传递自定义初始化参数

我对自定义初始化程序的概念有些陌生,所以我很难理解我尝试做的事情是否可行。我正在使用源代码创建消息应用程序。所有代码都是在不使用Storyboard的情况下编写的,我现在想实现它。在源代码中实现的init是这样的:init(chat:Chat){self.chat=chatsuper.init(nibName:nil,bundle:nil)title=chat.user.name}requiredinit(coderaDecoder:NSCoder){fatalError("init(coder:)hasnotbeenimplemented")}在didSelectRowAtIndex

ios - UIAlertController 按钮代表不会触发(在 Modally Segue 中)

我正在使用带有两个按钮的非常基本的UIAlertController设置。varalert=UIAlertController(title:"Leaveplayer?",message:"Youwillnotbeabletoreturntothisroutineafter!",preferredStyle:.Alert)letcancelAction:UIAlertAction=UIAlertAction(title:"Continue",style:.Cancel){action->Voidinprintln("here")}letdeleteAction:UIAlertAction

ios - 在 unwind segue 停止 segue 后显示警报。如何确保在 unwind segue 完成后显示警报?

我有一个从AViewController到BViewController的unwindsegue。在B中做了一个网络操作,操作完成后,响应会显示在AViewController中。我成功制作了这个结构。但是有一个问题:当我尝试显示警报时,它显示但停止了segue。我如何确保在segue完成后显示警报。错误在这里:2016-04-2714:39:28.350PROJECT[9100:128844]Presentingviewcontrollersondetachedviewcontrollersisdiscouraged.2016-04-2714:39:28.359PROJECT[910

ios - 如何在不使用 segue 的情况下在 View Controller 之间传递图像

我收到一个错误:Thread1:EXC_BAD_INSTRUCTION(code=EXC_1386_INVOP,subcode=0x0)同时尝试将从照片库中选择的图像传递给另一个ViewController。源ViewController-@IBActionfuncmyButtonTapped(_sender:UIButton){letsecondVC=storyboard?.instantiateViewController(withIdentifier:"secondVC")as!secondVCsecondVC.passedVName=VNameTextField.text!se

ios - sigabrt 错误在 Swift 中以编程方式调用 segue

我是iOS开发的新手,目前正在尝试在选择UITableViewController中的单元格后以编程方式调用segue。尽管我已经在我的Storyboard中创建了segue并为其分配了一个标识符,但我仍然在重写的didSelectRowAtIndexPath方法中调用performSegueWithIdentifier方法时收到sigabrt错误。任何帮助将不胜感激。overridefunctableView(tableView:UITableView!,didSelectRowAtIndexPathindexPath:NSIndexPath!){self.performSegueW

ios - 执行 segue 后,嵌入式导航栏在 iOS 7(小屏幕)上消失,但在 iOS 9(大屏幕)上不消失

我有一个名为showPage的节目转场从ViewController到TableViewController,我正在调用performSegueWithIdentifier()在单击警报中的按钮上的“确定”后使其显示:@IBActionfuncenterManuallyTap(sender:AnyObject){varcode:String!if#available(iOS8.0,*){letalert=UIAlertController(title:"Entercode",message:"Pleaseentercode",preferredStyle:UIAlertControll

ios - 从 prepare segue 获取数据后将值字典添加到标签

在preparesegue中,我将数据添加到另一个Controller中的字典中,这是该字典:vardata=[String:String]()并且在准备segue时,我将值和键添加到字典中movieDetail.data.updateValue("title",forKey:self.animationItems[index!].snippet.title)movieDetail.data.updateValue("description",forKey:self.animationItems[index!].snippet.description)是吗?然后,新Controller

ios - Xcode 8.1 和 unwind segues 有问题

我无法放松segue以使用最新的Xcode8.1GM。我只是想知道我是唯一一个,还是其他人正在经历同样的事情。我已经像以前一样设置了ViewController,它在Xcode8.0中工作,但现在我没有运气了。试图清洁等等,但没有任何帮助。我希望其他人也可以在我提交雷达之前对其进行测试...首先实例化viewcontroller的viewcontroller具有以下代码:@IBActionfuncunwindToSettingsTableViewController(_segue:UIStoryboardSegue){print("unwind")}我也试过不加下划线,但没有用。设置它