using completion with animateWithDuration causes exc_bad_access

前端 未结 2 1058
陌清茗
陌清茗 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
    )}
    

提交回复
热议问题