I just upgraded 5 of my apps to 7.0 from 5.0 (sometimes 4.x) compatibility. Here are some tips from what I learned:
Handling Different Screen Sizes
To handle the change in screen sizes, 3.5 to 4.0, for each xib, get all elements, and change to autosizing. Anchor to the bottom:
You can see here I’ve added a 60px delta for converting from 6 to 7, just lowering the element a little more in 7. Totally optional- in many apps I don’t even do a delta, fixing it to the bottom solves all the issues.
To test this, do a build, then click the View for that xib.
On the Identity and Type tab, select “ios 7.0 and later”, and view the change to your elements. They should all remain in the same place.
Create new splash screens, icons, app icons
Baseline, you need to create these icons
- Icon@2x.png (114.px)
- Icon.png (57px) *you probably already have this *
- Icon-120.png (120px)
I added all of these to my project, then assigned the 120px one (the rest auto assign, but not 120) in the App/Project/General Settings:
You also need to add these default splash screens:
- Default.png (320×480) – you probably have this
- Default@2x.png (640×960) – if you have a larger graphic, take a higher res screen otherwise, I expanded my 320×640
- Defaultfirstname.lastname@example.org (640×1136) – I copied the Default@2x.png. in Paintbrush, create a new canvas of the proper dimensions. Paste splash in it and center.
Drag those to the new project, and they should assign automatically to the proper files in Project/General
I regularly use Flurry and Facebook. I had old frameworks and took the opportunity to update them.
- Remove references to old frameworks- right click delete
- Remove references in Build Settings to header files, pointing to old framework libraries
- Comment-out code in my project related to framework ( a few methods, etc.)
- Build- should build without errors.
- Add new frameowrks in according to instructions, uncomment out the custom methods.
Seems obvious, but many hours were spent getting those new frameworks to build right. The key was to do a good clean remove before every installation.
Facebook changed from a project you dragged into your project, to a real framework, making it much simpler to integrate.
Note on Landscape Orientation and Launching
Here are some quick tips if your application is 100% landscape orientation, like mine were.
- Load the main view with
self.window.rootcontroller = self.navController. In old version I could just set the view to the navController view, now you have to set the rootController.
- This took me forever to figure out: the launch orientation is the first element in the plist entry “supported orientations”. So if you want it to load right, make sure that is the Item 0 in the array, in the plist. It was documented, but buried.
- There are some new methods in iOS 7.0 for autorotate, but by setting the supported orientations, it loaded all views in my NavController in landscape, so including those were extraneous.
Images in iOS 7.0
Only a few changes in imaging affected my apps:
- Segmented controller images- I check the iOS dynamically and assign images programmatically, adding:
self.segControl.tintColor = [UIColor redColor];
[[UIImage imageNamed:@"fr_flag"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
[self.segControl setImage:fr_flag forSegmentAtIndex:0];
- Check all of your imageViews in XIBs, many of them were deleted or floating off the view. I redragged them back on, anchored the autoresize,built, and all was fine.