我有这段代码可以使用信标更新距离。
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/