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

  • SEARCH
  • Home
  • 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 6881257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:05+00:00 2026-05-27T05:05:05+00:00

although this is a answered question here . the solution works fine in rootviewcontroller

  • 0

although this is a answered question here. the solution works fine in rootviewcontroller of the appdelegate. if same methods are written in a viewcontroller which is presented as a modalviewcontroller from the app delegate it doesn’t work :(. can somebody help me out.

thanks in advance!!

  • 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-27T05:05:05+00:00Added an answer on May 27, 2026 at 5:05 am

    I got the answer after breaking head for a day!!! (maybe a piece of cake for others).

    here goes the solution:

    In the root view controller or view controller from where we present modal view controller we have to detect shake:

    - (void) viewWillAppear:(BOOL)animated
    {
        [self becomeFirstResponder];
        [super viewWillAppear:animated];
    }
    - (void) viewWillDisappear:(BOOL)animated
    {
        //[self resignFirstResponder];
        /*dont resign first responder on view disappear */  
        [super viewWillDisappear:animated];
    }
    - (BOOL)canBecomeFirstResponder
    { 
           return YES;
    }
    
    - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
    {
       if ( event.subtype == UIEventSubtypeMotionShake )
        {
        // Put in code here to handle shake
         }
    
       if ( [super respondsToSelector:@selector(motionEnded:withEvent:)] )
          [super motionEnded:motion withEvent:event];
    }
    

    present the modal view normally… shake will be detected in modalview also…
    Its tested and working!!
    Thanks all 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just answered this question , which asked why iterating until 10 billion in
Although this question have been asked and answered before, including on this website, I
Although this is a very general question, here's my specific example so you can
Although this question and this question are close to what I'm asking, I believe
Although this is FAQ i still couldn't find a suitable solution. I'd like to
This is a follow on from my previous question although this is about something
I have a HashMap (although I guess this question applies to other collections) of
I'm working with ExpertPDF's Html-to-PDF conversion utility for this question (although I'm open to
(This question should probably be answered with a reference to Stroustrup.) It seems extremely
I was using the topcoder C++ compiler, and although this code just run fine

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.