ios – iOS 7 UITextView is slow after typing lots of text
I’m having trouble with a slowdown that occurs in UITextView on iOS 7 when typing lots of text. I put a tracer in NSLayoutManager and identified that drawGlyphsForGlyphRange runs N*2 times, where N is the number of times your lines word-wrapped.
Here is the sample code:
To reproduce the problem run it on an iPad and attach a physical keyboard. Mash the letters and the space bar for about 15 seconds, and notice it slows down. Then when you try to type normally, it’s really slow. That’s an extreme example, but if you just try typing two paragraphs at a reasonable speed, it’ll jam up.
This is not a problem with UITextView on iOS 6.
- Facebook SDK login never calls back my application on iOS 9
- Best approach to decode Youtube cipher signature using PHP or JS
- iOS: Modal ViewController with transparent background
- iOS Documents Directory size limit
- NSUnknownKeyException : was sent to an object that is not KVC-compliant for the “player” property
- Is it possible to opt your iPad app out of multitasking on iOS 9
2 Solutions Collect From Internet About “ios – iOS 7 UITextView is slow after typing lots of text”
Turn off Background App Refresh in Settings General. Also, get rid of NSLog–they slow down beyond what it takes them to print.
I was able to reproduce the slow down effect on iPad under IOS7. In fact IOS6 did not have Background App Refresh.
I believe Apple aims for top of the line models, all others have to adjust.
Is the slows down happen when you plugged in (Xcode debugging) your ipad to the macbook/iMac? If yes, try to unplug the cable and try it again with the cable unplugged, see if it still slows down or not. If not, then it only happen when debugging process. (It’s just my guess, since I’m not owner of an external keyboard)
- Check if iPad is in silent mode
- How to deal with accented characters in iOS SQLite?
- Idiomatic, classy, open-source examples of Cocoa Interfaces?
- iOS Web App touch gestures
- What's the advantage of #selector update in Swift 2.3?
- multipeer connectivity test on iphone and a simulator simultaneously
- Scope of variables Objective C
- How to create a rounded rectangle label in Xcode 7 and Swift 2
- Constraint controls greyed out in Xcode (pinning toolbar to bottom)
- Unable to trust a self signed certificate on iphone
- UIStatusBarStyle not working in Swift
- CTRunGetImageBounds returning inaccurate results
- How to load an image in prepareForInterfaceBuilder with a IBDesignable UIImageView
- How to get URL for a PHAsset?
- Creating thumbnail from local video in swift