module Appium::Ios

def textfield text

Returns:
  • (Textfield) -

Parameters:
  • text (String, Integer) -- the text to match exactly. If int then the textfield at that index is returned.
def textfield text
  # Don't use ele_index because that only works on one element type.
  # iOS needs to combine textfield and secure to match Android.
  if text.is_a? Numeric
    js = textfield_js "r = r.length > 0 ? $(r[#{text}]) : r;"
    return execute_script(js).first
  end
  textfield_include text
end