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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:44:54+00:00 2026-05-30T18:44:54+00:00

I have a Custom Scroll View, subclassing UIScrollView . I have added a scroll

  • 0

I have a Custom Scroll View, subclassing UIScrollView. I have added a scroll view in my viewcontroller nib file and changed its class to CustomScrollView. Now, this custom scroll view (made from xib) is added as a subview on self.view.

In this scroll view, I have 3 text fields and 1 UIImageView(named signImageView) added from xib. On clicking UIImageView (added a TapGestureRecogniser), a UIView named signView is added on the custom scroll view. I want to allow User to sign on this view, So I have created a class Signature.m and .h, subclassing UIView and implemented the touches methods (touchesBegan, touchesMoved and touchesEnded) and initialised the signView as follows:

signView = [[Signature alloc]initWithFrame:signImageView.frame];
    [customScrollView addSubview:signView];

But when I start signing on the signView, the view gets scrolled and hence the touches methods don’t get called.

I have tried adding signView on self.view instead of custom scroll view, but in that case the view remains glued to a fixed position when I start scrolling. (Its frame remains fixed in this case)

  • 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-30T18:44:56+00:00Added an answer on May 30, 2026 at 6:44 pm

    Try setting canCancelContentTouches of the scrollView to NO and delaysContentTouches to YES.

    EDIT:

    I see that similiar question was answered here Drag & sweep with Cocoa on iPhone (the answer is exactly the same).

    If the user tap-n-holds the signView (for about 0.3-0.5 seconds) then view’s touchesBegan: method gets fired and all events from that moment on go to the signView until touchesEnded: is called.

    If user quickly swipes trough the signView then UIScrollView takes over.

    Since you already have UIView subclassed with touchesBegan: method implemented maybe you could somehow indicate to user that your app is prepared for him to sign (‘green light‘ equivalent).

    You could also use touchesEnded: to turn off this green light.

    It might be better if you add signImageView as as subView of signView (instead of to customScrollView) and hide it when touchesBegan: is fired). You would add signView to customScrollview at the same place where you add signImageView in existing code instead.

    With this you achieve that there is effectively only one subView on that place (for better touch-passing efficiency. And you could achieve that green light effect by un-hiding signImageView in touchesBegan:/touchesEnded:

    If this app-behaviour (0.3-0.5s delay) is unacceptable then you’d also need to subclass UIScrollView. There Vignesh’s method of overriding UIScrollView‘s touchesShouldBegin: could come to the rescue. There you could possibly detect if the touch accoured in signView and pass it to that view immediately.

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

Sidebar

Related Questions

I have a UIScrollView . This scroll view scrolls my custom GameView . When
I have a custom-drawn view that I include in a UIScrollView that scrolls horizontally.
I have a custom UIScrollView in my app. When the user touches the scroll
i've problems with the scroll of my Table View. I have a custom cell
I am new to programming. I have a paging enabled scroll view with many
I have some custom table view cells that takes a while to draw, so
I have a custom list view and I want the background of the list
I got stuck in here, I have a custom scrollview in a view this
Possible Duplicate: Dismiss keyboard by touching background of UITableView I have a custom UIScrollView
I have a custom view in a custom table cell. Every time a specific

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.