This is the View layer I created. I want to transfer all Touch Events that happen in UIView to UIScrollView, but I don't know how. I didn't put it as a SubView of ScrollView because UIView should be lock. I want to use the default Gesture in UIScrollView for up or down drag (PanGesture) that happens in UIView. I made a PanGesture in the ViewController using ResponderChain to respond, but when it is Touch State.Ended like ScrollView I couldn't implement a scroll that ends smoothly. Any way to solve this problem? Thank you for your reply.
How to pass a responder to ScrollView?
89 Views Asked by jkey At
1
There are 1 best solutions below
Related Questions in SWIFT
- Navigate after logged in with webservice
- URLSession requesting JSON array from server not working
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Protect OpenAI key using Firebase function
- How to correct error: "Cannot convert value of type 'MyType.Type' to expected argument type 'Binding<MyType>'"?
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Using @Bindable with a Observable type in SwiftUI
- How to make a scroll view of 9 images in a forEach loop open on image 6 if image 6 is clicked on from a grid?
- Using MTLPixelFormat.rgba16Float results in random round-off errors
- Search and highlight text of current text in PDFKit Swift
- How is passing a function as a parameter related to escaping autoclosure?
- Actionable notification api call not working in background
- Custom layout occupies all horizontal space
- Is it possible to fix slow CKAsset loading on Cloudkit?
- Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value - MapView.isMyLocationEnabled
Related Questions in UISCROLLVIEW
- ScrollView disable on Device Orientation
- How to detect user scrolll on the scrollview
- UITableView gets cut off at the bottom / UIScrollView, UITableView, uitableviewdiffabledatasource
- Hide a Url address bar on scroll in Flutter Web (Mobile)
- When using UIScrollView, how can I fade the left and right edges if content is outside the visible bounds?
- UIScrollView is unexpectedly initially zoomed in in UIViewControllerRepresentable
- UITextField Jumps Above UIImageView When Keyboard Appears
- How to right align a UIStackView inside a UIScrollView when the stack view's size is smaller than scroll view?
- How to make ScrollView includes WebView in iOS
- Why is my UIView list not visible in my UIStackView and UIScrollView?
- WKWebView crash [WKScrollView _systemContentInset]
- SwiftUI / Animation based on scrollPosition in ScrollView
- SwiftUI ScrollView sliding weird
- Replicating iOS modal card UIScrollView dismiss behavior
- how to make UIScrollView's dynamic height
Related Questions in UITOUCH
- Pencil touch not recognized after finger touch
- Why does UITapGestureRecognizer not work properly for cell images in Swift collection view?
- Apple Pencil touchesEstimatedPropertiesUpdated lag
- Multitouch UITouches after SwiftUI Drag
- How to change and apply the responder?
- How to pass a responder to ScrollView?
- SwiftUI is missing UITouch properties
- Only allow touch after a certain time
- Touch duration in SpriteKit
- Can we check if an Objc object was deallocated before "bridging" it from void* to UIKit object?
- Allow interaction with view behind depending on UITouch.TouchType using point(inside:with:). (PKCanvasView)
- Get touch type in hitTest() or pointInside()
- draw line only in one direction starting with cgpoint
- Multithreaded Coregraphics Drawing with Multitouch Actions, Swift
- SWIFT: detect touch outside current view
Related Questions in HITTEST
- How to get the TextPosition in a RichTex from a Gesture callback
- c# WPF - problem with MouseLeave event on canvas
- Is there a HitTest property or something in VCL for Delphi?
- How to set up hit-test AR in A-Frame?
- Trouble Integrating reticle.glb as a Marker for Surface Detection in WebXR
- Using hittest and UIGestureRecognizer to determine which view to use
- Graphics2D.hit method returns an unexpected boolean value
- Check number of touches in hitTest - Swift
- Make the hit testing for a NavigationLink from a Rectangle with plain button style and no foregroundColor (clear Color) include the empty space
- ArCore frame.hittest implementation or how to detect all screen corner points on the arcore Plane
- Pass UITableView default PanGesture to another UIView
- HitTestObject between a Jelly and a character
- How to pass a responder to ScrollView?
- UIView hanging off edge of superview... tap events seen by *unrelated* underlying view
- How do you pass a gesture between subviews in UIKit?
Related Questions in UIRESPONDER
- How to determine what triggers a context menu presentation
- How to catch button press event from external keyboard in swift while full keyboard access is active?
- canPerformAction(_ action: Selector, withSender sender: Any?) function in UITextView does not recognize 'replace(_:)' action
- How to change and apply the responder?
- How to pass a responder to ScrollView?
- UIResponder chain produces two extra responders
- UIViewController's canPerformAction is called multiple times with the same action and sender
- Event Delegation like in JavaScript, but in iOS Swift
- Catch what user tapped (Textview1 or Textview2 or Button1) when keyboardDidShow (via NSNotification)
- How does the new UIResponderStandardEditActions.pasteAndGo(_:) work?
- How can I put UIResponder prior to Gesturer Recognizer
- When are touch events called in the SpriteKit frame-cycle?
- Xcode code completion suggests `printContent(_)` above `print(_)`
- What is first responder?
- Using UIResponder methods for UIControl views
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
One approach that may work for you...
Use a
UIViewsubclass for your "stationary pink view" and implementhitTest:that will allow the touch/drag to effectively "pass through" to the scroll view underneath, while still allowing user interaction with its own subviews.
Here's an example controller showing it in use:
The result - I inset the "pink view" from the leading edge of the scroll view to make it easy to see the scroll contents scrolling behind it:
Touching and dragging on the yellow OR the pink will scroll the scrollView as normal.