ios - In Objective-C, how do I reanimate? -


- (void)viewdidappear:(bool)animated{ [super viewdidappear:animated];  uiimageview *circleview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"face.png"]]; circleview.frame = cgrectmake(0, 0, 200, 200);  circleview.layer.cornerradius = 100; circleview.center = self.view.center;  [self.view addsubview:circleview]; circleview.transform = cgaffinetransformmakescale(0, 0);  [uiview animatewithduration:1 delay:0 usingspringwithdamping:.5 initialspringvelocity:1 options:0 animations:^{     circleview.transform = cgaffinetransformmakescale(1, 1); } completion:nil]; 

as can see, made view called circleview in animation method. then, created touchesbegan method , want run through animation again when touching screen. how should that?

as sujay said, create new method , put below lines inside method. call method touchbegan method.

circleview.transform = cgaffinetransformmakescale(0, 0);  [uiview animatewithduration:1 delay:0 usingspringwithdamping:.5 initialspringvelocity:1 options:0 animations:^{     circleview.transform = cgaffinetransformmakescale(1, 1); } completion:nil]; 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -