Friday, May 30, 2014

Upgrading for iOS 7

Upgraded my app for iOS 7, had to following a few things:
1. Had to add following code to the (void)viewDidLoad method to avoid Views overlapping:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;
2. Had to change some button type from System to Custom so as to allow the image button work properly.
3. image button on the Navigation Bar also need special care in order to made them work:
    UIImage image=[UIImage imageNamed:@"clock.png"];
    UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [customButton  setFrame:(CGRect){CGPointZero, image.size}];
    [customButton  addTarget:self action:@selector(randomMsg) forControlEvents:UIControlEventTouchUpInside];
    [customButton  setImage:image forState:UIControlStateNormal];
    UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:customButton ];
    self.navigationItem.rightBarButtonItem = barItem;
    [barItem release];
4. needed to create a dozen or so icon files from various devices, and add them to the Asset Catalog.
5. distribution process also changed, now you can no longer submit to App Store directly from Archive window any more and have to build a .ipa file and use Application Loader to send to App Store
6. Also one of my precious mistakes ignored by the old Interface Builder now is causing the new Interface Builder and Xcode to crash, I somehow had a UILabel inside another UILabel on one of my .XIB file, and this would cause error message like:
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-5056/InterfaceBuilderKit/Document/IBDocument.m:2578
Details:  An instance of IBUILabel with object ID 13 did not archive its child (IBUILabel) with an object of ID 24.
Removing the nested UILabel stopped the crashing of the Xcode.

Will Apple Approve it? let's keep fingers crossed.

No comments:

Post a Comment