iOS: Swipe until text or element is found

How to swipe (Left/Right) until a text or element is found.
Does anybody know how to swipe until an element is found?
I tried the below:

		JavascriptExecutor js = (JavascriptExecutor) driver;
	Map<String, Object> params = new HashMap<>();
	params.put("direction", "left");
	params.put("element", mobEl.getId());
	js.executeScript("mobile: swipe", params);

The above swipes for once.

		JavascriptExecutor js = (JavascriptExecutor) driver;
	Map<String, Object> params = new HashMap<>();
		params.put("element", mobEl.getId());
		params.put("direction", "left");
		params.put("toVisible", "true");
		js.executeScript("mobile: scroll", params);

The above swipes half-way to the next view and heads back to the previous view.

Note: I can write my own version of swipe to left or right by the number of times using a loop to find an element but wondering if there is a default method already like we have on android.

I followed the example from here http://appium.io/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures/index.html

Hi, @Aleksei @mykola-mokhnach Wondering if you any suggestions?
Thanks in advance.

Follow any -> http://appium.io/docs/en/writing-running-appium/tutorial/swipe-tutorial/

Thanks for the comment.

So it looks like I have to loop anyway.
I was looking for a solution without a loop like scrolling using Android’s UiScrollable class.

I will write my own swipe method since I need to swipe left or right direction based on difference use cases.