Skip to content

UIBlocks don't flush at the correct time #1365

Description

@vishnevskiy

I upgraded from a much lower version (I had a personal fork) to 0.4.4 and the POPAnimation native module I made is now having issues.

RCT_EXPORT_METHOD(addAnimation:(NSNumber *)tag animation:(NSNumber *)animation callback:(RCTResponseSenderBlock)callback) {
POPAnimation *anim = self.internalAnimations[animation];
[self.internalAnimations removeObjectForKey:animation];
anim.completionBlock = ^(POPAnimation *anim2, BOOL finished) {
callback(@[@(finished)]);
};
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
RCTAssertMainThread();
UIView *view = viewRegistry[tag];
if (view) {
[view.layer pop_addAnimation:anim forKey:[animation stringValue]];
}
}];
}

This is all I am doing to add animations to a view, but now sometimes the UIBlock won't execute until the next user interaction after this function was called or even more oddly if I just leave the simulator running within a minute or so it executes.

@vjeux told me to tag @tadeuzagallo on this 😄

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions