Repository: dotnet/maui
File: src/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cs (C#)

Code before:
		}

		public static void MapRequestScrollTo(IScrollViewHandler handler, IScrollView scrollView, object? args)
		{
			if (args is ScrollToRequest request)
			{
				var uiScrollView = handler.PlatformView;

				if (uiScrollView.ContentSize == CGSize.Empty && handler is ScrollViewHandler scrollViewHandler)
				{
					// If the ContentSize of the UIScrollView has not yet been defined,
					// we create a pending scroll request that we will launch after performing the Layout and sizing process.
					scrollViewHandler.PendingScrollToRequest = request;
					return;
				}

				var availableScrollHeight = uiScrollView.ContentSize.Height - uiScrollView.Frame.Height;
				var availableScrollWidth = uiScrollView.ContentSize.Width - uiScrollView.Frame.Width;
				var minScrollHorizontal = Math.Clamp(request.HorizontalOffset, 0, availableScrollWidth);
				var minScrollVertical = Math.Clamp(request.VerticalOffset, 0, availableScrollHeight);
				uiScrollView.SetContentOffset(new CGPoint(minScrollHorizontal, minScrollVertical), !request.Instant);

				if (request.Instant)
				{
					scrollView.ScrollFinished();
				}
			}
		}

		static UIView? GetContentView(UIScrollView scrollView)
		{
			for (int i = 0; i < scrollView.Subviews.Length; i++)
			{
				if (scrollView.Subviews[i] is { Tag: ContentTag } contentView)
				{
					return contentView;
				}
			}

			return null;
		}

		static void UpdateContentView(IScrollView scrollView, IScrollViewHandler handler)
		{
			var platformView = handler.PlatformView ?? throw new InvalidOperationException($"{nameof(PlatformView)} should have been set by base class.");
			var mauiContext = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

			if (GetContentView(platformView) is { } currentContentPlatformView)
			{
				currentContentPlatformView.RemoveFromSuperview();
			}

Review comment (suggestion):
Just a heads up, I'm adapting this to fix the issue on my app via an overridden handler and ran into the following issue:

If the ContentSize Width of the scroll view is for whatever reason less than the width of the UIScrollView Frame's width, it causes an argument error.  I'd suggest the following changes to account for it.
```
var minScrollHorizontal = Math.Clamp(request.HorizontalOffset, 0, Math.Max(availableScrollWidth, 0));
var minScrollVertical = Math.Clamp(request.VerticalOffset, 0, Math.Max(availableScrollHeight, 0));
```

Code after:
			if (handler?.PlatformView is not { } platformView)
			{
				return;
			}

			platformView.UpdateIsEnabled(scrollView);
			platformView.InvalidateMeasure(scrollView);
		}

		public static void MapRequestScrollTo(IScrollViewHandler handler, IScrollView scrollView, object? args)
		{
			if (args is ScrollToRequest request)
			{
				var uiScrollView = handler.PlatformView;

				if (uiScrollView.ContentSize == CGSize.Empty && handler is ScrollViewHandler scrollViewHandler)
				{
					// If the ContentSize of the UIScrollView has not yet been defined,
					// we create a pending scroll request that we will launch after performing the Layout and sizing process.
					scrollViewHandler.PendingScrollToRequest = request;
					return;
				}

				var availableScrollHeight = Math.Max(uiScrollView.ContentSize.Height - uiScrollView.Frame.Height, 0);
				var availableScrollWidth = Math.Max(uiScrollView.ContentSize.Width - uiScrollView.Frame.Width, 0);
				var minScrollHorizontal = Math.Clamp(request.HorizontalOffset, 0, availableScrollWidth);
				var minScrollVertical = Math.Clamp(request.VerticalOffset, 0, availableScrollHeight);
				uiScrollView.SetContentOffset(new CGPoint(minScrollHorizontal, minScrollVertical), !request.Instant);

				if (request.Instant)
				{
					scrollView.ScrollFinished();
				}
			}
		}

		static void UpdateContentView(IScrollView scrollView, IScrollViewHandler handler)
		{
			bool changed = false;
			var platformView = handler.PlatformView ?? throw new InvalidOperationException($"{nameof(PlatformView)} should have been set by base class.");
			var mauiContext = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

			if (platformView.GetContentView() is { } currentContentPlatformView)
			{
				currentContentPlatformView.RemoveFromSuperview();
				changed = true;
			}

			if (scrollView.PresentedContent is { } content)
			{
				var platformContent = content.ToPlatform(mauiContext);