ios - how to call google page after shake -



ios - how to call google page after shake -

i tried phone call google page after shake iphone.i tried this

- (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event { if(event.type == uieventsubtypemotionshake) { [self shakemethod]; [self open]; } } -(void)shakemethod { cabasicanimation *shake = [cabasicanimation animationwithkeypath:@"position"]; [shake setduration:1.1]; [shake setrepeatcount:2]; [shake setautoreverses:yes]; [shake setfromvalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x - 15,lockimage.center.y)]]; [shake settovalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x + 15, lockimage.center.y)]]; [lockimage.layer addanimation:shake forkey:@"position"]; } -(void)open { [[uiapplication sharedapplication] openurl:[nsurl urlwithstring: @"http://google.co.in"]]; }

two methods working when shake iphone shaking image not showing google page open please help me .i need when shake mobile first shake image,after shaking completed shaking open google page.

thanks in advanced.

set delgate self shake animation @ animation finish delgate phone call open method

- (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event { if(event.type == uieventsubtypemotionshake) { [self shakemethod]; } } -(void)shakemethod { cabasicanimation *shake = [cabasicanimation animationwithkeypath:@"position"]; [shake setduration:1.1]; [shake setrepeatcount:2]; [shake setautoreverses:yes]; //set animation delgate self [shake setdelegate:self]; [shake setfromvalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x - 15,lockimage.center.y)]]; [shake settovalue:[nsvalue valuewithcgpoint: cgpointmake(lockimage.center.x + 15, lockimage.center.y)]]; [lockimage.layer addanimation:shake forkey:@"position"]; } //when animation finish phone call open method -(void)animationdidstop:(caanimation *)anim finished:(bool)flag { [self open]; } -(void)open { [[uiapplication sharedapplication] openurl:[nsurl urlwithstring: @"http://google.co.in"]]; }

hope want.

ios objective-c iphone method-call handshaking

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -