Now I did this implementation by using these steps:-
You can implement some delegate methods after extending class "UIGestureRecognizer".
Here are the methods.
// It will give the starting point of touch
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint startSwipePoint= [touches.anyObject locationInView:self.view];
}
// It will give the point of touch on regural basis
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint point=[touches.anyObject locationInView:self.view];
}
//It will give the end swipe point
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
CGPoint endSwipePoint= [touches.anyObject locationInView:self.view];
}
// Here is the code to calculate angle between two points. I am using start point and end point. But you can use any of the two point according to your requirement
CGFloat angle=atan2(startSwipePoint.y - endSwipePoint.y, endSwipePoint.x - startSwipePoint.x) * Rad2Deg;