agens-no / Anymotion

one unified API for animating UIKit, CoreAnimation, POP and your library of choice.
Other
33 stars 9 forks source link

Investigate wether factories should inherit from `ANYAnimation` #6

Closed hfossli closed 7 years ago

hfossli commented 7 years ago

We could possibly go from this

POPBasicAnimation *alpha0 = [[[[POPBasicFactory propertyNamed:kPOPViewAlpha] duration:3] toValue:@0] build];
POPBasicAnimation *alpha1 = [[[[POPBasicFactory propertyNamed:kPOPViewAlpha] duration:3] toValue:@1] build];
POPBasicAnimation *frame0 = [[[[POPBasicFactory propertyNamed:kPOPViewFrame] duration:5] toValue:[NSValue valueWithCGRect:CGRectMake(100.0, 300.0, 50.0, 50.0)]] build];
POPBasicAnimation *frame1 = [[[[POPBasicFactory propertyNamed:kPOPViewFrame] duration:5] toValue:[NSValue valueWithCGRect:CGRectMake(100.0, 0.0, 50.0, 50.0)]] build];

AGAnimation *group1 = [AGAnimation group:@[
                                           [alpha0 animation:view0],
                                           [frame0 animation:view0],
                                           [alpha1 animation:view1],
                                           [frame1 animation:view1],
                                           ]];

to this

POPBasicFactory *alpha0 = [[[POPBasicFactory propertyNamed:kPOPViewAlpha object:view0] duration:3] toValue:@0];
POPBasicFactory *alpha1 = [[[POPBasicFactory propertyNamed:kPOPViewAlpha object:view0] duration:3] toValue:@1];
POPBasicFactory *frame0 = [[[POPBasicFactory propertyNamed:kPOPViewFrame object:view1] duration:5] toValue:[NSValue valueWithCGRect:CGRectMake(100.0, 300.0, 50.0, 50.0)]];
POPBasicFactory *frame1 = [[[POPBasicFactory propertyNamed:kPOPViewFrame object:view1] duration:5] toValue:[NSValue valueWithCGRect:CGRectMake(100.0, 0.0, 50.0, 50.0)]];

AGAnimation *group = [AGAnimation group:@[alpha0, frame0, alpha1, frame1]];