I have Two UIButtons on Right and Left and a UIView At Middle of the button..
I have to swipe ContainerView with some animation on UIButton click..
If user tap on right button ContainerView swipe to .right direction....If user tap on Left button ContainerView swipe to .left direction..
I have not found it anyWhere....Need help with full coding part
I have done this on my view
override func viewDidAppear(_ animated: Bool) {
leftSwipe()
rightSwipe()
}
//MARK:Left Swipe Function
func leftSwipe()
{
let swipeLeft = UISwipeGestureRecognizer()
swipeLeft.direction = .left
self.insideContainerViewSecond.addGestureRecognizer(swipeLeft)
swipeLeft.addTarget(self, action: #selector(swipe(sender:)))
}
//MARK:Right Swipe Function
func rightSwipe()
{
let swipeRight = UISwipeGestureRecognizer()
swipeRight.direction = .right
self.insideContainerViewSecond.addGestureRecognizer(swipeRight)
swipeRight.addTarget(self, action: #selector(swipe(sender:)))
}
//MARK: Swipe Function
@objc func swipe(sender: UISwipeGestureRecognizer)
{
switch sender.direction
{
case .left:
print("swiped left")
case .right:
print("swiped right")
default:
print("no action")
}
}
In this image I have a UIView and two button right and left..When I swipe on my UIView It swipe Left and right without animation.....But I need to swipe my UIView on right or Left button action with flip animation

We have CATransition Classes with iOS. You should use this. Or you should constraint animation. Maybe this repo is helped you for first trick.
https://github.com/barankaraoguzzz/FastOnBoarding/blob/master/FOView/Classes/FOAnimation.swift
if this answer doesn't be true for this question. Come again :)