-3

Possible Duplicate:
How do i put a void(shake gesture) inside a IBAction(button)?

Hi I have posted this question quite a few times before and I am getting quite tired. I am a total beginner and I will state exactly what I need but if you answer and want votes and other things like that then please explain your answer and instruct me what to do, as I said before I am a total beginner.
So I have a animation ready but I need a code and I'll explain what the code needs to do now: So their should be a button saying PLAY and when the button press's PLAY, the button disappear's and a label shows saying 'SHAKE TO START' once the user shake's the iPhone the label disappear's and the animation plays one time and ends. Thats all I'm asking so please answer and explain with code and I will vote up and anything else you need, thank you!

Community
  • 1
  • 1
Stevenp
  • 3
  • 3
  • 2
    This is very rudely worded. I'm surprised you got an answer at all. We are not here to do your work for you. You've had help in your other answers, and you keep reposting the same question in order to find someone to do the work for you. This is probably the reason people aren't helping you. A quick search turns up http://stackoverflow.com/questions/1170917/how-to-use-shake-api-in-iphone-sdk-3-0 http://stackoverflow.com/questions/150446/how-do-i-detect-when-someone-shakes-an-iphone http://stackoverflow.com/questions/6806937/ios-how-to-implement-a-shake-device-event – Thomas Clayson Jul 01 '12 at 00:09
  • 1
    All those questions have code in them. That's literally 30 secs and the first 3 or 4 results when I google "detect shake ios". There are hundreds of other resources out there too. You have to do some of the work yourself, you can't expect us to do it for you. Especially when you write your questions like that. – Thomas Clayson Jul 01 '12 at 00:10
  • Steven, while I appreciate that you're just getting started, this isn't the way to go about getting your question answered. Asking the same question multiple times, then demanding that we give you code to solve your issue when none of the earlier solutions provided to you were satisfactory really tries the patience of the volunteers here. – Brad Larson Jul 01 '12 at 00:24
  • 1
    With all due respect, may I suggest taking a step back from this and reading some guides on the fundamentals of iOS development, such as the ["Motion Events"](http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/MotionEvents/MotionEvents.html) section of the Event Handling Guide for iOS. If you're having trouble with even setting up a BOOL property for your controller class, you may also wish to read [The Objective-C Language](http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html). – Brad Larson Jul 01 '12 at 00:31

1 Answers1

0

I won't write out the code for you (that's not what this site is for) but I'll tell you what you should do:

  1. Button appears on screen
  2. User clicks button, use UIView animation blocks or Core Animation to animate the button fading away and the label fading in (or some other animation).
  3. Detect a shake using the accelerometer (see this question for more info: How do I detect when someone shakes an iPhone?).
  4. Label fades away again with UIView animation or Core animation and your animation plays

Hope this provides a start for you!

Community
  • 1
  • 1
pasawaya
  • 11,515
  • 7
  • 53
  • 92