Skip to content

Commit 0cfd47d

Browse files
author
Ernesto Rivera
committed
Allow multiple applyChanges call blocks where the outer one overrides all others
1 parent 34b6fc2 commit 0cfd47d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

Source/AMBTableViewController.m

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,22 @@ - (void)applyChanges:(void (^)(void))changes
161161
insertAnimation:(UITableViewRowAnimation)insertAnimation
162162
removeAnimation:(UITableViewRowAnimation)removeAnimation
163163
{
164-
_useCustomAnimations = YES;
165-
_customReloadAnimation = reloadAnimation;
166-
_customInsertAnimation = insertAnimation;
167-
_customRemoveAnimation = removeAnimation;
168-
169-
changes();
170-
171-
_useCustomAnimations = NO;
164+
if (_useCustomAnimations)
165+
{
166+
// Override emdded calls
167+
changes();
168+
}
169+
else
170+
{
171+
_useCustomAnimations = YES;
172+
_customReloadAnimation = reloadAnimation;
173+
_customInsertAnimation = insertAnimation;
174+
_customRemoveAnimation = removeAnimation;
175+
176+
changes();
177+
178+
_useCustomAnimations = NO;
179+
}
172180
}
173181

174182
#pragma mark - Convenience methods

0 commit comments

Comments
 (0)