Closed hfossli closed 7 years ago
I want to know which name is better. Please vote.
Interface
@interface ANYAnimation (Operators)
- (instancetype)initially:(dispatch_block_t)initially;
- (instancetype)finally:(dispatch_block_t)finally;
@end
Usage
[[anim initially:^{
[view addSubview:maskView];
}] finally:^{
[maskView removeFromSuperview];
}];
Interface
@interface ANYAnimation (Operators)
- (instancetype)before:(dispatch_block_t)before;
- (instancetype)after:(dispatch_block_t)after;
@end
Usage
[[anim before:^{
[view addSubview:maskView];
}] after:^{
[maskView removeFromSuperview];
}];
RAC uses initially
and finally
on 2.5
what is latest RAC version? How about other libs like Rx and POP. And most important UIKit and CoreAnimation, because it's Apple :)
finally
feels like something that will be done under all circumstances - like a try-catch block, but I support @kostiakoval.
Well Apple is probably more along the line of
Interface
@interface ANYAnimation (Operators)
- (instancetype)willStart:(dispatch_block_t)willStart;
@end
Usage
[[anim willStart:^{
[view addSubview:maskView];
}] complete:^(BOOL success){
[maskView removeFromSuperview];
}];
@hfossli What's the status here? Looks like before
and after
is implemented?
Yep, I am not 100% satisfied. It somehow felter weird. It might be better to rename them. Let's close this and reopen a new one later.
before: work you want to do before the animation is created and added. after: work you want to do do after the animation is finished/cancelled/removed.