agens-no / Anymotion

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

Change init of pop factories #5

Closed hfossli closed 7 years ago

hfossli commented 7 years ago

Now it is +[POPBasicFactory propertyNamed:] it should be +[POPBasicFactory propertyNamed:object:] where object can be a view, a layer or any NSObject.

hfossli commented 7 years ago

And we should also investigate wether we should inherit from ANYAnimation as well...

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]];
hfossli commented 7 years ago

https://github.com/agensdev/anymotion/commit/600011a2184750f0e90f30f1d5b0ea5b2c162262