objective c - Searching and Auto-Scrolling UIScrollview with UILabel inside -


i have uiscrollview uilabel inside of populated non-english text.

i search scrollview/uilabel word/phrase , auto-scroll point.

i know theres no simple way because theres no function uilabel. can't use uitextview because reason regular scrolling on uitextview choppy makes bad user experience (reviews users). uilabel on uiscrollview scrolls extremely smoothly lacks ability of uitextview. ideas?

i got answer luke rogers answered so question

- (cgrect)boundingrectforcharacterrange:(nsrange)range {     nstextstorage *textstorage = [[nstextstorage alloc] initwithattributedstring:[self attributedtext]];     nslayoutmanager *layoutmanager = [[nslayoutmanager alloc] init];     [textstorage addlayoutmanager:layoutmanager];     nstextcontainer *textcontainer = [[nstextcontainer alloc] initwithsize:[self bounds].size];     textcontainer.linefragmentpadding = 0;     [layoutmanager addtextcontainer:textcontainer];      nsrange glyphrange;      // convert range glyphs.     [layoutmanager characterrangeforglyphrange:range actualglyphrange:&glyphrange];      return [layoutmanager boundingrectforglyphrange:glyphrange intextcontainer:textcontainer]; } 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -