objective c - iOS moving cursor from keyboard extension -


we can update cursor position of uitextfield this.

[textfield setselectedrange:beginningrange]; 

is possible update cursor position keyboard extension? checking textdocumentproxy , inputview though.

simply set length of selection zero.

one possible implementation:

+ (void)setcursorintextfield:(uitextfield *)textfield atindex:(nsinteger)index {     uitextposition *start = [textfield positionfromposition:[textfield beginningofdocument] offset:index];     uitextposition *end = [textfield positionfromposition:start offset:0];     [textfield setselectedtextrange:[textfield textrangefromposition:start toposition:end]]; } 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -