JSONObject payload = request.getPayload();
Dimension screenSize = getNativeDriver().getScreenSize();
String elementId = payload.optString("element");
if (!payload.isNull("element") && !elementId.equals("")) {
Point offset = new Point(payload.getInt("xoffset"), payload.getInt("yoffset"));
double speed = payload.optDouble("speed", 1.0);
if (RemoteIOSWebDriver.isPlainElement(elementId)) {
NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
plainFlickFromElement(request, screenSize, offset, speed, nodeId.getId());
} else {
nativeFlickFromElement(request, screenSize, offset, speed, elementId);