ImageView is defined in class named Third
- (void)viewDidLoad
{
// Displays UIImageView
UIImageView* ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 300, 235)];
self.view.backgroundColor = [UIColor brownColor];
// load all the frames of our animation
ImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"3a.png"],
[UIImage imageNamed:@"3b.png"],
nil];
// all frames will execute in 24 seconds
ImageView.animationDuration = 24;
// start animating
[ImageView startAnimating];
ImageView.layer.borderWidth = 2;
ImageView.layer.borderColor = [[UIColor whiteColor]CGColor];
[ImageView.layer setMasksToBounds:YES];
[ImageView.layer setCornerRadius:15.0f];
[self.view addSubview:ImageView]; }
How can i get reference of this image view.layer from this third class to another class.
Basically i want to use pause layer and resume layer for image view animation.
To use
[self pauseLayer:myImageView.layer]; // Pause the CALayer of the UIImageView
I should have reference some thing like this but don’t know how to implement it in viewdidload of third class or where to implement it in third class or in another class.
UIImageView *myImageView = [OtherClass getTheImageView];
So looking for some help.
Thanks.
I solved it. In another class i was loading third class and the code is below
i was using same layer in this loading code. So i used that for reference.
I used
for pausing image view animation and for resuming
So basically in playpauseAction when i m pausing and resuming timer right their i am pausing and resuming image view.layer animation
It was that simple and i wasted my two days to solve this but at last happy that it is working like charm have no issues.