How to disable scrolling in NSScrollView with enabled responsive scrolling - macos

I need to disable programmatically scrolling in NSSrollView with enabled responsive scrolling.
I try override isCompatibleWithResponsiveScrolling, then is possible to override scrollWheel and have enabled responsive scrolling but scrollWheel works different in that implementation. Is called only once, on start of scroll but I want to break scroll that is in progress.
It's possible to do this in different way that not need to override scrollWheel method?

Related

AppKit prevent tracking area updates

Some built in AppKit components temporarily "pause" NSTrackingArea updates while their content is being scrolled or resized. For example, if you inspect tracking areas using the Quartz Debug tool, you can see that tracking areas embedded in an NSScrollView don't move onscreen as the content is being scrolled, and only update when scrolling ends. Tracking areas within NSSplitView panes similarly don't update while the panes are being resized. How do these components achieve this behavior?
I'm working on a custom scrolling component that handles scrollWheel events and enters a mouse tracking loop as described here and I'd like to replicate this behavior as a performance improvement.

Using infinite scrolling UICollectionView with iOS 13 pullable modals

I have a modal window, which is perfect for iOS 13's drag to dismiss gesture, because this way the user remains in the context, so I don't want to use full screen. The controller contains a UICollectionView which displays a month calendar, which is scrollable vertically.
The problem is, that when the user wants to scroll upwards in the collection view, the dismiss gesture is triggered instead. If I scroll down first, then can I only scroll up.
I've tried to disable the internal UIPanGestureRecognizer (it seems somehow there is no presentedView, so it didn't work), tried to set the UICollectionView's pan gesture recognizer delegate to prevent the system recognizer to fire (it turned out you can't do that), and tried to scroll the collection view on appearing a bit (ugly).
How can I elegantly convince the the modal presentation, that my scrollview isn't scrolled to the top?

Disable Manual Zooming on UIScrollView

I have a project with a UIScrollView which I want to control the zooming programmatically but not via user interaction. I have tried setting the multipleTouchedEnabled property to false. This doesn't work. When I pinch on the scroll view, the scrollViewDidZoom and viewForZoomingInScrollView are called. I have also tried subclassing UIScrollView and overriding addGestureRecognizer and disabling the gesture which passes a [gesture [isKindOfClass: [UIPinchGestureRecognizer class]]. After breakpointing on that override, no gestures are matched.
So how can I have zooming on the scroll view but not allow manual interaction with the zooming. I still need single finger panning for normal scrolling.
Try to set scrollView.pinchGestureRecognizer.enabled = NO;

Programmatically scrolling NSTextView without scrollbar

I'm trying to scroll a textview programmatically using the scrollToPoint method. This works fine if the textview has a scrollbar, but if I disable it with setHasVerticalScroller:NO, I get some strange results: if I try to scroll using the two-finger gesture after the programmatic scroll, the textview automatically jumps back to the point that was shown before the programmatic scroll. I already tried redrawing the textview and actualizing it, but nothing worked.

Scroll Gestures not Passed to IScrollInfo implementing panel in Windows Phone 7 CTP

I am using a custom panel as a ItemsPanel for a ItemsControl in a with a custom template that provides for a scroll viewer. (See Xaml below.) So long as my panel does not implement IScrollInfo, scrolling works in this scenerio.
I implement IScrollInfo and update my viewport and extent sizes in measure override. The scroll bar shows the correct relative size, and if I call the IScrollInfo methods directly, scrolling works as expected. However, the drag and flick gestures no longer scroll the content. Putting a breakpoint on the input of every IScrollInfo method shows that drag and pick are not calling the interface. Removing the IScrollInfo interface declaration restores the scroll on drag and flick behavior.
Is there a simple way to restore the flick and pan gestures to ItemControls with panels that implement IScrollInfo?
An unfortunate answer I received from Eric Sink, A MSFT forum moderator.
I believe that what is happening is that, when you inherit from
IScrollInfo, your panel takes over all of the scroll functionality but
we use an internal interface, as martin mentioned, to control the
flick animation. Since your object does not inherit from this
interface the underlying code will bypass this functionality.
I think that you should still be able to override the OnManipulation*
events and setup your own storyboard animation.
It sounds like if you want to do IScrollInfo, you're on your own for the manipulation.

Resources