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);
			if (_sliderTapRecognizer is not null)
			{
				PlatformView.RemoveGestureRecognizer(_sliderTapRecognizer);
				_sliderTapRecognizer.Dispose();
				_sliderTapRecognizer = null;
			}
		}

		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)
		{

Review comment (bug):
The `PlatformView` should be passed into the gesture’s action via a `WeakReference`, otherwise the memory leak test will fail.

Something like this.

https://github.com/dotnet/maui/blob/5ee4e8f4d234f915896f4c3b47b459c30656c673/src/Core/src/Platform/iOS/LabelExtensions.cs#L117C3-L123C52

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);