diff --git a/AsyncDisplayKit/Private/ASInternalHelpers.h b/AsyncDisplayKit/Private/ASInternalHelpers.h index 8cfc7713de..79f500e77c 100644 --- a/AsyncDisplayKit/Private/ASInternalHelpers.h +++ b/AsyncDisplayKit/Private/ASInternalHelpers.h @@ -32,26 +32,6 @@ BOOL ASRunningOnOS7(); ASDISPLAYNODE_EXTERN_C_END -/** - @summary Conditionally performs UIView geometry changes in the given block without animation and call completion block afterwards. - - Used primarily to circumvent UITableView forcing insertion animations when explicitly told not to via - `UITableViewRowAnimationNone`. More info: https://github.com/facebook/AsyncDisplayKit/pull/445 - - @param withoutAnimation Set to `YES` to perform given block without animation - @param block Perform UIView geometry changes within the passed block - @param completion Call completion block if UIView geometry changes within the passed block did complete - */ -ASDISPLAYNODE_INLINE void ASPerformBlockWithoutAnimationCompletion(BOOL withoutAnimation, void (^block)(), void (^completion)()) { - [CATransaction begin]; - [CATransaction setDisableActions:withoutAnimation]; - if (completion != nil) { - [CATransaction setCompletionBlock:completion]; - } - block(); - [CATransaction commit]; -} - /** @summary Conditionally performs UIView geometry changes in the given block without animation. @@ -62,7 +42,11 @@ ASDISPLAYNODE_INLINE void ASPerformBlockWithoutAnimationCompletion(BOOL withoutA @param block Perform UIView geometry changes within the passed block */ ASDISPLAYNODE_INLINE void ASPerformBlockWithoutAnimation(BOOL withoutAnimation, void (^block)()) { - ASPerformBlockWithoutAnimationCompletion(withoutAnimation, block, nil); + if (withoutAnimation) { + [UIView performWithoutAnimation:block]; + } else { + block(); + } } ASDISPLAYNODE_INLINE void ASBoundsAndPositionForFrame(CGRect rect, CGPoint origin, CGPoint anchorPoint, CGRect *bounds, CGPoint *position)