- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个从名为 DetailViewController
的 UIViewController
到 MainViewController
的展开转场,定义为(在 MainViewController
中):
@IBAction func deleteItemUnwind(sender: UIStoryboardSegue)
{
let sourceViewController = sender.sourceViewController
}
在 DetailView 中,我有一个应该执行 segue 的按钮,该按钮连接到名称为 deleteItemUnwindSegue
的场景导出,在 DetailViewController 中,我有 prepareForSegue
更改值的一些变量。这很好用。问题是,我在 DetailViewController
override func shouldPerformSegueWithIdentifier(identifier: String!, sender: AnyObject!) -> Bool {
if (identifier == "deleteItemUnwindSegue") {
let deleteItemAlert: UIAlertController = UIAlertController(title: "Delete item", message: "Are you sure you want to delete this item?", preferredStyle: .ActionSheet)
let cancelAction: UIAlertAction = UIAlertAction(title: "Cancel", style: .Cancel) { action -> Void in
return false
}
deleteItemAlert.addAction(cancelAction)
let deleteItemAction: UIAlertAction = UIAlertAction(title: "Yes", style: .Destructive) { action -> Void in
return true
}
deleteItemAlert.addAction(deleteChoreAction)
self.presentViewController(deleteItemAlert, animated: true) {
}
}
return true
}
虽然 prepareForSegue
代码有效,但不会触发 Unwind segue 本身 以关闭 View 。有什么想法吗?
最佳答案
我发现(在阅读 UIAlertController
之后)显示警报后的那一刻,执行后的代码,所以每次都会自动给出 false。我能够通过创建一个通用的 First Responder
来绕过这个问题,以 Exit
展开 segue,并让按钮项触发 segue。
关于ios - 在 shouldPerformSegueWithIdentifier UIAlertController 之后未执行 Unwind Segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30560580/
我正在尝试进行 segue,但我有一个小问题,即我正在单击一个按钮,如果 bool 值为 YES,它将在 segue 中返回 YES,否则返回 NO,但每次我都必须单击两次检查文本字段,因为它首先传递
在 WatchKit 扩展中是否有一种名为“shouldperformseguewithidentifier”的方法或类似的方法?这是因为我需要在推送到另一个 View 之前进行检查。 最佳答案 在
我试图在发生转折之前提示警报并请求为我的应用程序中的高级功能付费,但 shouldPerformSegue 似乎不起作用。我有一个 SWRevealViewController 打开一个侧边菜单,我从
我正在制作一个非常基本的应用程序,它有一个搜索字段来获取传递给 tableview 的数据。 我想做的是运行一个异步任务来获取数据,如果数据成功获取,则转到下一个 View ,在加载期间屏幕不能卡住,
背景 导航 Controller View 带有包含 ftp 信息的单元格的表格 Cell segue 将连接到 ftp 服务器并显示列表 shouldPerformSegueWithIdentifi
我有一个检查登录是否正确的功能。如果没问题,我会显示下一个屏幕。如果用户不正确,我会取消 segue 并显示警报。 问题的出现是因为当我在shouldPerformSegueWithIdentifie
我有两个 View Controller 。在 View Controller 1 上,我有以下内容: 将我带到 viewcontroller2 的 segue - 这个 segue 被命名为“sho
我创建了一个推送序列并将标识符命名为“CustomIdentifier”之类的名称。用户注册成功后, shouldPerformSegueWithIdentifier 执行并推送到另一个 View C
我尝试在计时器完成后执行转场,但无法执行转场。 这是我的代码 var timer = NSTimer() @IBOutlet weak var imageView: UIImageView!
当我想从登录 View 转到应用程序的主视图时,我遇到了一些麻烦。问题是我必须点击登录按钮两次才能显示下一个 View 。 当我调试该函数时,Loginbool 在第一次单击时返回 false,但在第
我正在尝试执行 shouldPerformSegueWithIdentifier 并在 Controller 之间传递一些参数。 - (BOOL)shouldPerformSegueWithIdent
我有一个从点击按钮到 View Controller 的转折点。在包含按钮的 View Controller 的 swift 类中: override func shouldPerformSegueW
我正在尝试学习 Swift,我想做的是创建简单的登录页面。每当用户单击登录按钮时,我都会在 shouldPerformSegueWithIdentifier 中向我的 Web 服务发出请求,以检查用户
我正在尝试使用 swift 的 shouldPerformSegueWithIdentifier() 方法,但它接受 2 个参数。这些是(标识符:String!,发件人:AnyObject) 我的主要
我有一个从名为 DetailViewController 的 UIViewController 到 MainViewController 的展开转场,定义为(在 MainViewController
我需要验证凭据。因此,segue 在登录按钮中从第一个 View Controller 链接到第二个 View Controller 。当我在没有任何条件检查的情况下进行转场时。导航工作正常。 但是当
我是一名优秀的程序员,十分优秀!