Class: UITextField
Instance Method Summary collapse
Instance Method Details
#sugarcube_to_s(options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/ios/sugarcube-to_s/uitextfield.rb', line 3 def sugarcube_to_s(={}) text = self.text if text && text.length > 20 text = text[0..20] + '...' end placeholder = self.placeholder if placeholder && placeholder.length > 20 placeholder = placeholder[0..20] + '...' end super .merge(inner: {text: text, placeholder: placeholder, firstResponder?: firstResponder?}) end |