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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:15:02+00:00 2026-06-11T09:15:02+00:00

I have a question that I’ve searched but can’t find a definative answer to.

  • 0

I have a question that I’ve searched but can’t find a definative answer to. Here is my layout:

UIView - ViewController   
   |_UIScrollView - added programatically
      | |_UIView to hold a backgound/perimeter  - added programmatically
      |_UIView 1 - added programmatically
      |_UIView 2 - added programmatically
       and so on

My question is how come the ViewController calls “touchesMoved” only once when I move say UIView 2 on touch?

Now UIView has it’s own touchesMoved method, but I need the controller’s touchesMoved to get called as I need it to talk to the ScrollView to update its position. Such as when that UIView 2 is near the corner, so that the ScrollView moves a little to fully show UIView 2.

If there is no way around this is there a way to update ScrollView from UIView 2 to scroll when its near a corner?

Edit:

I think I may have found a work around. Not sure if this will be accepted by Apple but:

I just made a call to a instance variable that is = to self.superview which then allows me to talk back to my ScrollView within UIView’s touchesMoved

in that i can call the method [ScrollView setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated] so my ScrollView gets updated as the subview(UIView2) moves close to the edge of the UIWindow.

Thank you for the suggestions.

  • 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-11T09:15:02+00:00Added an answer on June 11, 2026 at 9:15 am

    The behavior you describe is the result of the UIScrollView hijacking the touch moved event. In other words, as soon as the UIScrollView detect that a touch moved event falls within its frame, it takes control of it. I experienced the same behavior while trying so create a special swipe handler, and it failed each time a UIScrollView was also interested by the swipe.

    In my case, I solved the issue by intercepting the event in sendEvent: overridden in my custom UIWindow, but I don’t know if you want to do the same. In any case, this is what worked for me:

    - (void)sendEvent:(UIEvent*)event {
    NSSet* allTouches = [event allTouches];
    UITouch* touch = [allTouches anyObject];
    UIView* touchView = [touch view];
    
    //-- UIScrollViews will make touchView be nil after a few UITouchPhaseMoved events;
    //-- by storing the initialView getting the touch, we can overcome this problem
    if (!touchView && _initialView && touch.phase != UITouchPhaseBegan)
        touchView = _initialView;
    
        //-- do your own management of the event
    
        //-- let the event propagate if you want also the default event management
    [super sendEvent:event];
    
    }
    

    An alternative approach that you might investigate is attaching a gesture recognizer to your views — they have a pretty high priority, so maybe the UIScrollView will not mess with them and it might work better for you.

    If there is no way around this is there a way to update ScrollView from UIView 2 to scroll when its near a corner?

    Have you tried to make the UIScrollView scroll by calling:

    - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a question that I can't seem to find an answer for. I am
I have a question that I can't quite find the answer to... If you
I have a question that I can't seem to find an answer to. I'm
I have a question that must be answer several times before, but I can't
I have a quick question that I can't seem to find online. I am
I have a question that is probably very simple, but I cannot find an
I have a question that I cannot find an answer. I'm constructing a very
I have question that seems very simple, but I just can't get it right.
I have a question that I haven't been able to find the answer/script to.
I have a question that I'm sure it's very quick to answer, but I

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.