title: Xamarin Forms ViewCell Swipe to Show Buttons
body: <p>tl;dr: How do I use swipe to show buttons in Xamarin Forms like the iOS mail app</p>
  
  <p>I am trying to implement <em>swipe to show buttons</em> for a Xamarin Forms iOS app similar to the UI of the iOS mail app or this <a href="https://components.xamarin.com/view/swtableviewcell" rel="nofollow">https://components.xamarin.com/view/swtableviewcell</a>. That component among many other examples I found look great for iOS native implementations but I need to show this UI via Xamarin forms. </p>
  
  <p>Currently I have a custom swipe gesture recognizer like this: </p>
  
  <pre><code>    [assembly: ExportRenderer(typeof(SwipeViewCell), typeof(SwipeIosRenderer))]
  
  namespace MyApp.iOS.Renderers
     {
      public class SwipeIosRenderer : ViewCellRenderer
         {
  
  
      UISwipeGestureRecognizer swipeRightGestureRecognizer;
      UISwipeGestureRecognizer swipeLeftGestureRecognizer;
  
      protected override void OnElementChanged(ElementChangedEventArgs&lt;Label&gt; e)
      {
          base.OnElementChanged(e);
  
  
          swipeRightGestureRecognizer = new UISwipeGestureRecognizer(() =&gt; UpdateRight()) { Direction = UISwipeGestureRecognizerDirection.Right };
          swipeLeftGestureRecognizer = new UISwipeGestureRecognizer(() =&gt; UpdateLeft()) { Direction = UISwipeGestureRecognizerDirection.Left };
  
          if (e.NewElement == null)
          {
  
              if (swipeRightGestureRecognizer != null)
              {
                  this.RemoveGestureRecognizer(swipeRightGestureRecognizer);
              }
              if (swipeLeftGestureRecognizer != null)
              {
                  this.RemoveGestureRecognizer(swipeLeftGestureRecognizer);
              }
          }
  
          if (e.OldElement == null)
          {
  
              this.AddGestureRecognizer(swipeRightGestureRecognizer);
              this.AddGestureRecognizer(swipeLeftGestureRecognizer);                
          }
  
      }
  
      private void UpdateLeft()
      {
  
          Console.WriteLine("Left swipe");
  
      }
      private void UpdateRight()
      {
  
          Console.WriteLine("Right swipe");
  
      }
  }
  </code></pre>
  
  <p>That is bound to viewcells in a list. Now that I can recognize the "swipe" gesture I need help on how to actually move the view cell over and show a button like the examples I gave above? </p>
  
  <p>It would be great to able to do this within the views XAML but am open to anything. I have a UpdateLeft and UpdateRight function that gets called on the respective swipe motions too if that can be used? </p>
  
  <p>**EDIT: I need to do this for both left AND right swipe. ContextActions only provide the left swipe functionality.</p>
  
  <p>Hope that makes sense! </p>