Tag Archive for 'ios 5'

Customizing UI elements in iOS 5

As you can see in the brand new Apple App Find My Friends, in iOS 5 it is possible to modify UI controls skin via API. You can find a great summary and tutorial
here.

Although if you wish to be compatible with older iOS versions and devices, you should use custom components or other “hacking” solutions.

iOS 5 NSDateComponents bug

It seems, that there is an issue with iOS5 NSDateComponents NSWeekCalendarUnit property.
It returns one week ahead the current, however it returns the correct number on iOS 4.
You can test it with the following code:
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *weekComponents = [gregorian components:(NSWeekCalendarUnit) fromDate:[NSDate date];
NSInteger weekNr = [weekComponents week]

Update I have tested NSWeekOfYearCalendarUnit or NSWeekWeekOfMonthCalendarUnit (available in iOS 5 only), and they still return incorrect value, so currently the best solution is to check iOS version and modify the number manually.