Does swipeWhileNotFound only work with XPath?

Hi,
i want to use swipeWhileNotFound with By or MobileElement but was only able to make it work with Xpath.

How can I use swipeWhileNotFound with io.appium.java_client.MobileElement ?

The swipeWhileNotFound method signature requires a String for elementtofind. Looking at the appium code, there is no overload method using MobileElement or By.