using completion with animateWithDuration causes exc_bad_access

前端 未结 2 1054
陌清茗
陌清茗 2020-12-16 11:14

I am trying to animate 2 UIButtons in a UITableViewCell called addToPlaylist and removeFromPlayList (they animate off to the right after being swiped on) and am using a bloc

相关标签:
2条回答
  • 2020-12-16 12:05

    Check if you are not calling a UIView (collectionView, Mapview, etc) from inside the UIView block, meaning, it would be a call outside the main thread. If you are, try this:

    DispatchQueue.main.async {
    self.mapBoxView.setZoomLevel(self.FLYOVERZOOMLEVEL, animated: true
    )}
    
    0 讨论(0)
  • 2020-12-16 12:11

    I had the same problem with animations. I've solved it by removing -weak_library /usr/lib/libSystem.B.dylib from Other Linker flags.

    Also, according to this answer, if you need this flag, you may replace it with -weak-lSystem.

    0 讨论(0)
提交回复
热议问题