Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7693767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:09:56+00:00 2026-05-31T21:09:56+00:00

I succesfully implemented the shake gesture, but now I would like to limit it

  • 0

I succesfully implemented the shake gesture, but now I would like to limit it to activate only in one specific situation (in the options panel of my app).

  • I first created ShakeWindow class which is a subclass of UIWindow. In ShakeWindow I added - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event to register shake gesture.

  • Next I went to AppDelegate.m and edited window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; to use the new ShakeWindow instead of UIWindow.

It works great, but how do I limit it’s functionality? I’m just starting Objective-C and consider myself as a novice coder overall so keep that in mind when answering, thank you!

I use Cocos2D as the framework and I don’t use Interface Builder if those matter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:09:57+00:00Added an answer on May 31, 2026 at 9:09 pm

    I might be misunderstanding, but how about…

    - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    
        if (/* conditions where my app responds to shake */) {
            // respond to shake
        }
        // otherwise, it's like it never happened
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implemented RestSharp succesfully in my WP7 application, but one issue remains: When I
I've successfully implemented an accordion as outlined here , but would like to wrap
I successfully implemented the OpenCV square-detection example in my test application, but now need
I have successfully implemented my GridView now, but, as always, the whole ASP.NET life
I have successfully implemented authentication using GTM OAuth 2 library. But now I want
I have successfully implemented sectioned listview , but now I'm facing a problem i.e.
I have written several procedures and succesfully implemented them on my webhost's server. However
I have successfully implemented a cel shader using glsl. But my problem is about
I have successfully implemented a network application in visual CLR project using boost.asio. but
I have successfully implemented Forms Authentication in SSRS, so it now uses both Roles

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.