gpt4 book ai didi

ios - 一旦执行停止 performseguewithidentifier

转载 作者:行者123 更新时间:2023-11-28 06:45:10 26 4
gpt4 key购买 nike

我有这段代码可以使用信标更新距离。

func updateDistance(distance: CLProximity) {
UIView.animateWithDuration(0.8) {
switch distance {
case .Unknown:
print("unknown")
case .Far:
print("far")
case .Near:
print("near")
case .Immediate:
print("Immediate")
self.performSegueWithIdentifier("beaconSegue", sender: self)
}
}
}

我只想问一下,如果已经执行了 self.performSegueWithIdentifier 函数,如何停止它。

最佳答案

如果你想阻止performSegueWithIdentifier,你可以这样做:

override func shouldPerformSegueWithIdentifier(identifier: String,sender: AnyObject?) -> Bool {
if ... { // Set the condition if you want it can be perform
return true
} else {
return false
}
}

关于ios - 一旦执行停止 performseguewithidentifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36689343/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com