ios - how to set timer when closed subviews -



ios - how to set timer when closed subviews -

i tried open 2 subviews , closed @ time tried this

- (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event { if(event.type == uieventsubtypemotionshake) { [self shakeview]; //[self open]; } } -(void)shakeview { [uiview animatewithduration:2.8 animations:^{ //open firstview.frame = cgrectmake(0, -40, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame = cgrectmake(0, 260, self.view.frame.size.width, self.view.frame.size.height/2); // final location } completion:^(bool finished) { // closed firstview.frame = cgrectmake(0, 0, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame = cgrectmake(0,230 , self.view.frame.size.width, self.view.frame.size.height/2); } ]; }

i need 2 view changed postions , come same postions ,but when phone call 2 methods open slow closed fast.

so please 1 help me ,how set timer when closed views

thanks in advanced.

try this.

-(void)shakeview { [uiview animatewithduration:2.8 animations:^{ //open firstview.frame =cgrectmake(0, -40, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame =cgrectmake(0, 260, self.view.frame.size.width, self.view.frame.size.height/2); // final location } completion:^(bool finished) { //closed [uiview animatewithduration:0.5 animations:^{ firstview.frame=cgrectmake(0, 0, self.view.frame.size.width, self.view.frame.size.height/2); secondview.frame=cgrectmake(0,230 , self.view.frame.size.width, self.view.frame.size.height/2); }]; }];}

ios objective-c uiview uiviewanimation handshake

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -