this solution might be helpful for others.You can use long press gesture to start recording video and pan gesture simultaneously to zoom upwards and downwards to zoom back.
let longGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPress))
let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture))
longGesture.delegate = self
panGestureRecognizer.delegate = self
self.addGestureRecognizer(panGestureRecognizer)
self.addGestureRecognizer(tapGesture)
self.addGestureRecognizer(longGesture)
extension CameraButton: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}