How to bind Carousel click and Swipe to the same function?

Solution for How to bind Carousel click and Swipe to the same function?
is Given Below:

Using BS 4, I have a carousel which I am showing/hiding the Next/Previous buttons with this function:

$('.controllers a').click(function() {
    $(this).addClass('d-none').siblings().removeClass('d-none');
});

and this is my HTML:

<div class="controllers">
  <a class="carousel-control-prev d-none" href="#carouselControls2" role="button" data-slide="prev">
    <i class="fa fa-arrow-left" aria-hidden="true"></i>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carouselControls2" role="button" data-slide="next">
    <i class="fa fa-arrow-right" aria-hidden="true"></i>
    <span class="sr-only">Next</span>
  </a>
</div>

The above works for mouse click of course, but is it possible to make the Swipe on mobile to trigger the same function? Is there a way to extend the same code and bind .on(swipe) (either left or right) to the same function?