Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS 7 compatibility issues (UITextView)

iOS 7 compatibility issues (UITextView)

iOS 7 UITextView has many critical bugs. Introduce workaround or alternative libraries.

Kishikawa Katsumi

November 13, 2013
Tweet

More Decks by Kishikawa Katsumi

Other Decks in Technology

Transcript

  1. - (void)scrollRangeToVisible:(NSRange)range { [super scrollRangeToVisible:range]; if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {

    if (self.layoutManager.extraLineFragmentTextContainer != nil && self.selectedRange.location == range.location) { CGRect caretRect = [self caretRectForPosition:self.selectedTextRange.end]; [self scrollRectToVisible:caretRect animated:NO]; } } } 4VCDMBTTJOHQBUDI
  2. 1BUDIJOEFMFHBUFNFUIPE - (void)textViewDidChange:(UITextView *)textView { NSString *text = textView.text; NSRange

    selectedRange = textView.selectedRange; textView.scrollEnabled = NO; textView.text = nil; textView.text = text; selectedRange.length = 0; textView.selectedRange = selectedRange; textView.scrollEnabled = YES; }