How to automate Pan gesture in iOS

Need to automate a scenario in which pan gesture is used. I tried by using swipe which is not working . Please suggest me on how to proceed further.