content top

Radar 15159094: UITextView + NSAttributedString is hopelessly broken on iOS 7

iOS 7 breaks UITextView + NSAttributedString pretty badly that it’s almost unusable. Submitted this Radar today. Issue 1. The UITextView calculates the contentSize as the user scrolls. As a result the scroll indicators jump randomly. Issue 2. Because the text view doesn’t know about the complete size of content, methods like firstRectForRange: caretRectForPosition:firstRectForRange: caretRectForPosition: don’t return the...

Read More

MKBlockTimer

Just published a NSObject category, MKBlockTimer. Use this nifty utility to measure the time taken to execute a block of code, without macros. Usage The method is fairly straightforward to use. [self logTimeTakenToRunBlock:^{   // your time consuming piece of code here for(int i = 0 ; i < 1000000000; i ++);   } withPrefix:@"For Loop"]; [self logTimeTakenToRunBlock:^{ ...

Read More

Performance improvements to MKNetworkKit

Over the past couple of weeks, I was profiling MKNetworkKit and looking for bottlenecks. I found around five major bottlenecks. Performance Fix 1: Decoding images in Background UIImage will not decompress the PNG/JPG image until it’s actually displayed. This is fine for artwork or pattern images that you normally bundle with your iOS app. But for displaying avatar images on a Twitter timeline or a photo library application, the...

Read More

iOS Tip: Applying a background pattern globally to all your views

Applying a pattern is something that you already know. But supporting the older 3.5 inch iPhones and the iPhone 5’s taller resolution means, shipping two sets of background images and choosing the right one depending on the device. However, there are at least two drawbacks of the above mentioned method. Firstly, shipping multiple images means you are increasing the download size of your app. Default.png and Background.png are usually...

Read More

Supporting the iPhone 5

Supporting the iPhone 5

Update: A Russian translation available at osxdev.ru here iPhone 5 is out and it poses a new challenge to developers, a bigger screen. iOS developers have never been required to support multiple device resolutions in the past. But fret not, Apple has made things easy for us. Follow the four steps below and you are all set. Step 1: iPhone 5 requires a new instruction set, the armv7s. Only the latest Xcode, version 4.5 as on writing supports...

Read More

iOS Tip: Informing the user of your intent to use their data

iOS Tip: Informing the user of your intent to use their data

I showed you previously how to let the user know why you require their location in one of the previous blog posts. Apple added similar access dialogs for Contacts, Reminders, Calendars and Photos in iOS 6. If you ever use anyone of these services in your app, you should set a usage description text string in your Info.plist file that explains the user why you need access to the requested information. Along with this change, the purpose...

Read More
Page 1 of 912345...Last »
content top