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 8638427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:43:32+00:00 2026-06-12T10:43:32+00:00

In my app there are two view controllers. I wrote touchesmoved method in both

  • 0

In my app there are two view controllers. I wrote touchesmoved method in both the view controllers. But even if i touch on second view controller on simulator, the first VC touches moved method is called.

// for VCOne

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"first view vc move method");

     UIStoryboard *storyboard = self.storyboard;
     ThreadedView *secViewController = [storyboard instantiateViewControllerWithIdentifier:@"threaded"];
     [self.view addSubview:secViewController.view];

     [self viewDidUnload];
}

So once the above method is called, it will navigate to second view controllers “ViewDIDLoad” method. In this file, i have written one more touches moved method.

// for VCTwo

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSLog(@"second view vc move method");
}

Now if i touch in second view controller, the first VC touchesmethod is called instead of second VC touches method.

Is there any way to do this? I needed different touches moved method for different view controllers.

  • 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-06-12T10:43:34+00:00Added an answer on June 12, 2026 at 10:43 am

    If you want to transit from first view controller to second view controller,
    you can try this method: presentModalViewController:animated:.

    In your touchesMoved:withEvevt: of first view controller

    NSLog(@"first view vc move method");
    
    UIStoryboard *storyboard = self.storyboard;
    ThreadedView *secViewController = [storyboard instantiateViewControllerWithIdentifier:@"Threaded"];
    [self presentModalViewController:secViewController animated:NO];
    

    In second view controller, you can use dismissModalViewControllerAnimated: to go back to first view controller.

    Hope this will help.

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

Sidebar

Related Questions

In the iPhone app I'm currently working on, I'd like two view controllers (I'll
I have a simple iPhone app based on a navigation controller. There are two
I'm working on an iOS app with two different view controllers and three different
My app has two distincts modes. There's a tab bar controller in the app
I have created an app for the iPhone where I have two view controllers.
Within my app there are two view-classes: UIViewA and UIViewB. In the Storyboard I
In my app there are numerous view controllers which have their own purposes. However,
guys: There is two buttons in my viewController of test app, the right one
There are two projects: 1) applet project that outputs jar file 2) web app
In my android app, there are two processes, let's say process A and B

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.