0
if (coordinator != nil) {
var tempDidAnimate: Bool = false // breakpoint 1
coordinator!.addCoordinatedAnimations({
self.myFunctionThatDoesntGetCalled() // breakpoint 2
tempDidAnimate = true
}, completion: {
() in
if tempDidAnimate == false {
print("whaaaat?!??") // breakpoint 3
self.myFunctionThatDoesntGetCalled()
}
})
}
斷點的順序被打爲1,3。從來沒有2.
這個hackery使用if tempDidAnimate == false
確實解決了這個問題,但我不明白爲什麼會出現問題。
任何想法可能是錯的?
一個想法:我已經在堆棧中的addCoordinatedAnimations塊...我不這麼認爲,但堆棧很複雜......看不到任何方式來檢查通過代碼。
你在哪裏添加這個?自定義焦點動畫應該添加到'didUpdateFocusInContext',它具有'coordinator'參數,它不是可選的。 – beyowulf
我從didUpdateFocusInContext開始,然後深入到塊和選擇器/函數的幾個級別。 –