My goal is to animate my UI, and I am using UIView animations. The problem is I need more than one animation going on at a time, but apparently I can only perform one UIView animation at a time. I have asked questions on this topic previously (Multiple UIView Animations), and all the responders say I have to set a delegate to the animation with a method like animationDidStop:performSelector:
but I was wondering if I could instead add subviews to the main view and perform animations simultaneously on each subview. Also, I am unable to perform back to back animations, and I was thinking maybe I could perform an animation on view1 and then on view2 without delegating.
For example:
//Header
@property (nonatomic, strong) UIView *view1;
@property (nonatomic, retain) UIView *view2;
//Implementation
@synthesize view1;
@synthesize view2;
//ViewDidLoad
view1 = [[UIView alloc]initWithFrame:CGRectMake(0,0,480,640)];
view2 = [[UIView alloc]initWithFrame:CGRectMake(0,0,480,640)];
view1.backgroundColor = [UIColor clearColor];
view2.backgroundColor = [UIColor clearColor];
[performAnimationsOn View1]; //I don't know the code I would put here because the code
//I usually use is [UIView beginAnimation:@"animation"
//context:nil]; but that is a class method and I am not
//sure how to perform an animation on a specific subview.
[performAnimationsOn View2];