問題:本人實(shí)現(xiàn)了一個(gè)table view,并在didSelectRowAtIndexPath函數(shù)中調(diào)用了performSegueWithIdentifier函數(shù)耀找。但發(fā)現(xiàn)在點(diǎn)擊cell后野芒,切換到目標(biāo)view的過程延遲很大狞悲,花費(fèi)了好幾秒的時(shí)間才能切換到目標(biāo)view摇锋。
解決: 在主線程中調(diào)用performSegueWithIdentifier函數(shù)荸恕,例如:
dispatch_async(dispatch_get_main_queue(),{
self.performSegueWithIdentifier(mysegueIdentifier, self)
})
參考:《(Xcode 6 beta / Swift) performSegueWithIdentifier has delay before segue》