How to automate swipe gestures in iOS 8

I need to automate swipe gesture for both side(Right To Left and Left to Right) in iOS mobile app.

 I am using appium version 1.4.8 , iOS simulator 6 and platform version as 8.3.

 I am writing test cases using java language.

 I have tried with below coding for swipe gestures. But, the swipe action doesn't happens for me.

  public void swipeLeftToRight(AppiumDriver driver) {
      Dimension size = driver.manage().window().getSize();
      int endx = (int) (size.width * 0.8);
      int startx = (int) (size.width * 0.20);
      int starty = size.height / 2;

      driver.swipe(startx, starty, endx, starty, 1000);

  public void swipeRightToLeft(AppiumDriver driver) {
      Dimension size = driver.manage().window().getSize();
      int startx = (int) (size.width * 0.8);
      int endx = (int) (size.width * 0.10);
      int starty = size.height / 2;

      driver.swipe(startx, starty, endx, starty, 1000);

For Android This works fine

public class TouchActions{

public static AndroidDriver<WebElement> _driver;

public void setUpAppium() throws InterruptedException, IOException {
	DesiredCapabilities capabilities = new DesiredCapabilities();   
	_driver = new AndroidDriver<WebElement>(new URL(""), capabilities);	

public void TouchActionsTest() throws InterruptedException{
	// Wait for first app to launch
	// Press Home Key
           // Press Menu Button
	TouchAction tAction=new TouchAction(_driver);
	int startx = _driver.findElement("Email")).getLocation().getX();
	int starty = _driver.findElement("Email")).getLocation().getY();
	int endx = _driver.findElement("Dev Settings")).getLocation().getX();
	int endy = _driver.findElement("Dev Settings")).getLocation().getY();
	System.out.println(startx + " ::::::: " + starty + " ::::::: " + endx +  " ::::::: " +	endy);
            //First tap on the screen and swipe it right using moveTo function
	//Second tap on the screen and swipe it left using moveTo function,endy+20).moveTo(startx+20,starty+20).release().perform();

public void teardown(){

public DesiredCapabilities AppCapabilitiesSetUp(DesiredCapabilities cap){
	return cap;


@amitjaincoer191 Can you tell me solution for iOS

@amitjaincoer191 @amitjaincoer191 Here is my scenario

Scenario 1:-

  1. There are 20 article in the page
  2. Only 5 articles are displayed. Other articles are displayed when you scroll
  3. How can i scroll with x and y co-ordinates and find an expected article. I want to reach 20th article and click it.
  4. This is list of articles page, Here you see 5 articles are displayed.

Scenario 2:-

  1. Article content is displayed
  2. There are more paragraphs are displayed in an article. In centre of the page , mobile ad(Image) will be displayed.
  3. Mobile Ad(Image) will be displayed only when we scroll to position of centre of an article. I want to verify that image is present or not.
  4. This is a article page, When you scroll, Mobile Ad(image) will be displayed

How can i do it above scenarios?