Custom keyword using appium/selenium methods for mobile automation

Hi,

Can anybody please suggest how to create custom keyword using appium/selenium. Idea is to scroll and swipe.
Note: Inbuilt katalon methods scrollToText and swipe is not working for the application so have to try with custom methods.

Please suggest how to create the same for scroll and swipe so that it should work with latest appium version.

Regards