• Ah sorry, you're right, I forgot about that.

    You can work around this limitation with some Objective-C trickery though:

    import ui from objc_util import * from functools import partial def select_all(textfield): tf = ObjCInstance(textfield).subviews()[0] start_pos = tf.beginningOfDocument() end_pos = tf.endOfDocument() range = tf.textRangeFromPosition_toPosition_(start_pos, end_pos) tf.setSelectedTextRange_(range) class MyTextFieldDelegate (object): def textfield_did_begin_editing(self, textfield): ui.delay(partial(select_all, textfield), 0) tf = ui.TextField(frame=(0, 0, 500, 500)) tf.text = 'Lorem Ipsum Dolor Sit' tf.font = ('Helvetica', 18) tf.delegate = MyTextFieldDelegate() tf.present('sheet')
  • You can hide your dummy text field by setting its height and/or width to zero.

Internal error.

Oops! Looks like something went wrong!