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

Code before:
			base.ConnectHandler(platformView);
			_proxy.Connect(VirtualView, platformView);
		}

		protected override void DisconnectHandler(UISlider platformView)
		{
			base.DisconnectHandler(platformView);
			_proxy.Disconnect(platformView);
		}

		internal void MapUpdateOnTap(bool isMapUpdateOnTapEnabled)
		{
			if (isMapUpdateOnTapEnabled)
			{
				if (_sliderTapRecognizer == null)
				{
					_sliderTapRecognizer = new UITapGestureRecognizer((recognizer) =>
					{
						var control = PlatformView;
						if (control != null)
						{
							var tappedLocation = recognizer.LocationInView(control);
							if (tappedLocation != default)
							{
								var val = tappedLocation.X * control.MaxValue / control.Frame.Size.Width;
								VirtualView.Value = val;
							}
						}
					});
					PlatformView.AddGestureRecognizer(_sliderTapRecognizer);
				}
			}
			else
			{
				if (_sliderTapRecognizer != null)
				{
					PlatformView.RemoveGestureRecognizer(_sliderTapRecognizer);
					_sliderTapRecognizer = null;
				}
			}
		}

		public static void MapMinimum(ISliderHandler handler, ISlider slider)
		{
			handler.PlatformView?.UpdateMinimum(slider);
		}

		public static void MapMaximum(ISliderHandler handler, ISlider slider)
		{
			handler.PlatformView?.UpdateMaximum(slider);
		}

Review comment (bug):
This is capturing the handler and thus the platform view and virtual view (which also holds on to the handler) creating a circular reference I think. @jonathanpeppers?

Maybe we need to add a specific memory leak test for this?

Or, maybe we need another proxy type situation to avoid even doing anything remotely scary of keeping the universe alive.

Might just be able to add this into the slider proxy that already exists...

Code after:
			base.ConnectHandler(platformView);
			_proxy.Connect(VirtualView, platformView);
		}

		protected override void DisconnectHandler(UISlider platformView)
		{
			base.DisconnectHandler(platformView);
			_proxy.Disconnect(platformView);
			if (_sliderTapRecognizer is not null)
			{
				_sliderTapRecognizer.ShouldReceiveTouch = null;
				platformView.RemoveGestureRecognizer(_sliderTapRecognizer);
				_sliderTapRecognizer.Dispose();
				_sliderTapRecognizer = null;
			}
		}

		internal void MapUpdateOnTap(bool isMapUpdateOnTapEnabled)
		{
			if (isMapUpdateOnTapEnabled)
			{
				if (_sliderTapRecognizer is null)
				{
					var weakPlatformSlider = new WeakReference<UISlider>(PlatformView);
					var weakVirtualSlider = new WeakReference<ISlider>(VirtualView);
					_sliderTapRecognizer = new UITapGestureRecognizer((recognizer) =>
					{
						if (weakPlatformSlider.TryGetTarget(out var platformSlider) && weakVirtualSlider.TryGetTarget(out var slider))
						{
							var tappedLocation = recognizer.LocationInView(platformSlider);
							if (tappedLocation != default)
							{
								var val = tappedLocation.X * platformSlider.MaxValue / platformSlider.Frame.Size.Width;
								slider.Value = val;
							}
						}
					})
                    {
      					CancelsTouchesInView = false,
      					ShouldRecognizeSimultaneously = (gesture, otherGesture) => true
                    };
					
					PlatformView.AddGestureRecognizer(_sliderTapRecognizer);
				}
			}
			else
			{
				if (_sliderTapRecognizer != null)
				{
					PlatformView.RemoveGestureRecognizer(_sliderTapRecognizer);
					_sliderTapRecognizer = null;