Design app that supports both iOS8 and iOS7 - ios7

Suppose I want to design a master detail application, Xcode6 master-detail project template for universal app includes UISplitViewController and splitViewController is new in iOS8. I want to support app for iOS7 also.
In general
What is the best way to design an universal app using Xcode6
storyboard that support both iOS8 and iOS7 ?
Is it better to use separate story board for different OS version ?
What are the best practices we should follow to make app compatible with both OS?

The 'best way' to create such an app will likely depend on what exactly your app needs to be able to do. Some ways will be better than others depending on any special behavior needed.
But it is definitely possible to use a single Universal storyboard in Xcode 6 that uses Size Classes and still target iOS 7, both iPhone and iPad, using UISplitViewController. I have successfully done just that. It did take a lot of work to ensure it worked properly and looked consistent on iOS 7 and 8. You have to be a little careful when it comes to performing the various new adaptive segues, as that is a huge difference between iOS 7 and 8. For example, detecting when you have a popover is going to require some work for the two different OSes, handling unwind segues will require some special handling, etc. It will require a lot of testing. Dedicate time to testing the iPhone 6 Plus - in landscape it will show both the master and detail on screen, but you can have control over that.
After going through that experience, I would much rather implement a single storyboard as opposed to two storyboards, one for each OS, and definitely stay away from creating a storyboard for each OS and then one for each device type.
You'll want to read up on the SDK Compatibility Guide to learn how to detect API availability. If you implement an API that doesn't exist on iOS 7 the app will crash, so you need to only run that code if that function exists for the OS the app is running on. For example, you may want to utilize the new UIBlurEffect API, but that doesn't exist on iOS 7. Gain an understanding of what deprecation means, and knowing what has changed in iOS 8 will greatly help. For example, the rotation APIs are deprecated in favor of Size Class trait collections, but those aren't available on iOS 7 so you'll need to continue to use the deprecated rotation API.
Also check out some WWDC videos from this year. They have a couple videos that discuss the new adaptive segues and Universal storyboards. Note that these storyboards ARE backwards compatible with iOS 7, but there are some size classes that aren't made available on iOS 7. See this question and the answer I provided for more information. WWDC videos from previous years also discuss how one can support multiple OSes, progressive enhancement, etc.
And of course when you have questions/problems Stack Overflow is a great resource. A lot of the questions I've posted in the past few months are related to this topic exactly, how to modify UISplitViewController behavior, obtain support for both OSes, using a single storyboard and the new adaptive segues, etc. You may wish to read through those to get an idea of what you can expect to run into when developing an app in the same fashion.

Related

Switch to xCode5 with the new SDK will eliminate bugs?

I've just installed ios7 on my iPhone, however I have not yet downloaded xCode5, so I've been producing my archives using iOS6 SDK and using TestFlight to test them on my phone. When running my app on iOS7, I'm noticing a lot of bugs that I didn't see in iOS6 (some that are unpredictable and very difficult to fix). I've been avoiding downloading xCode7 because I'm not yet ready to make the commitment to the new UI elements, but I'm wondering if I did produce my app using the iOS7 SDK, is it possible some of these bugs could be eliminated?
This is a very broad question. iOS 7, despite its advanced beta count, is still very much a work in progress. There are bugs that should be reported to Apple that should not happen. But beyond that, there are changes in the internal API that influence how the app behaves. Apple has done its best to try and preserve SDK 6 apps as much as possible, but there is breaking API which can cause crashes. One example off the top of my head is the class cluster they are now using with ABPersonViewController. Subclassing that in iOS 6 works fine, but in iOS 7, even when compiled with SDK 6, causes a crash in most cases. These issues can be resolved even with Xcode 4.6 and SDK 6.
Compiling with SDK 7 may help you fix some issues, but it will come with a plethora of issues of its own. Depending on how complex your view hierarchy is, you may have to invest a considerable amount of effort to support the new API and functionality. You don't really have a choice, as this is the future, but you should be prepared for this, and arrange your schedule accordingly.

Titanium UI issues

I am beginning to look at options for cross-platform mobile development. In a couple of places I read that there are some problems with Titanium UI performance, here is a link to one of those (slide 12):
http://www.slideshare.net/bertouttier/crossplatform-tools-for-mobile-application-development
I then went to the Titanium site's App Showcase to download and test some apps to see if I noticed anything. I decided to start with the Khan Academy app since I know that they are pretty tech savvy (or assume so since their founder has 3 degrees from MIT including Comp Sci) and have some money (a few million from Google and Gates).
It only took me about 1 minute to get to a video with captions listed below the video and the first few words of the narration. I went down to the scrolling captions and tested how the gestures felt and couldn't believe that it was barely functional. Sometimes it goes in the wrong direction, sometimes it does nothing, and I cannot access the vertical scroll bar!
So the larger question I am trying to answer is potential not suitable for the Stack Overflow format...., which is: Is this one glitchy UI indicative of problems found in using Titanium in general?
More specific questions are: Why is the caption scrolling at the bottom of these videos so terrible? Is this an issue caused by Titanium? Have other people run into similiar problems with UI widgets in Titanium?
FYI - I am using an iPad 2.
If you are looking for the fastest possible UI performance, going "fully" native is probably the best overall option. Titanium offers you flexibility in that you are writing a single application with smaller changes, if necessary, across multiple platforms. It cuts your development time down significantly since you are able to share code across projects.
My understanding of the UI in Titanium is that they map to native controls on the target platform. So the performance you are seeing are native controls. The background logic of your application, the business rules, are controlled by JavaScript.
I downloaded (from iTunes) and played with the app and didn't see any issues with navigating their app. I am running it on an iPhone 4 with IOS 6. The animation flipping between between tables was responsive and the animations jumped in a predictable way. Perhaps you have a different OS version?
The Khan Academy appears to be a perfect example of an app that should take advantage of cross-platform development like Titanium. Though the app is relatively simple, it gets you access to what you need quickly and simply. This app could then be deployed on all the supported Titanium platforms, likely without any modifications at all.

Porting an iOS app to OSX and maintaining one code set?

I'm an experienced iOS developer but have not touched OSX development. I plan to port my iOS app to OSX. Of course, there will be certain differences based upon the obvious design paradigm and differences in SDKs, but I could easily see 80-90% of the code being identical, even including a lot of the UI. Is there any good approach for maintaining one code set that powers both apps? Of course, I could do some sort of static library, but I'm wondering if there is a complete solution, and/or advice on what pitfalls I might encounter as a new OSX developer...
Check out http://chameleonproject.org/, "a drop in replacement for UIKit that runs on Mac OS X".
Alternatively, you could have two different targets in your Xcode project, one for iOS and the other for Mac, then include the overlapping code files in both your iOS and Mac targets.

iOS 4 Document-Based Applications

I need to create an application capable to modify and manage files on IOS.
With IOS 5 is "easy" to create a Document-Based Application, but I need to support IOS 4 too.
Anyone knows if there is a way to create a Document-Based Applications in IOS 4?
Thanks in advance.
Short answer is no as UIDocument and UIManagedDocument only arrived with iOS 5
Long answer is yes. There are hundreds of document based apps for iOS. e.g Brushes, Sketchbook Pro which are all document based apps. My own app is document based, its not that hard to do.
What UIDocument/UIManagedDocument provides is a canned API for making a generic document. Feed it a URL and it does (most of) the rest of the housekeeping.
If you wish to do an iOS4 based app then stuff you will need to pay attention to is.
UIApplicationWillTerminateNotification/UIApplicationDidEnterBackgroundNotification
Opening a new document.
Saving a document.
Shutting a document.
Autosave (maybe)
Core Data stack , if you're using Core Data
www.raywenderlich.com has some great tutorials. Maybe even iOS4 based ones still.
IMO - Don't bother with iOS4 support. Like above post states 85% use iOS5 and anyone still on iOS4 probably isn't in your target market. Especially as this is (I assume) a new app and iOS6 will be around by the time you go to market.
Just going to ask, do you really need to support iOS 4?
The adoption of iOS is over 85% of devices.
Whats the basis for the need to continue iOS 4 support?

Porting from iOS to OS X

I have to port an iOS application to OS X. I have a little experience with iOS (although I didn't write the applications) and I would like have some suggests.
1) The application has some nice animations -- should I use Quartz to do them on OS X?
2) How can I change the View to have the same effect as the UINAvigationController on OSX? I searched for this component in the Object Library inside Interface Builder but I didn't find it.
This is liable to be quite an involved process, as (for example) none of the UIKit classes (currently) exist on Mac OS X.
As such, it's likely that you'll only be able to meaningfully retain the model level classes and that a substantial amount of the remaining code may need to be re-written.
My suggestion would be that you thoroughly prepare checklist that contains all tasks. It is not that simple as just looking for equivalent classes in Application Kit to UIKit classes.
it also depends on how app is written. If it has followed MVC properly, then complete files of business logic can be taken without any problems. If not, you will more or less write your new mac app from the scratch.
Yes, Core Animation is always a way to go in this cases, but it may happen that you'll encounter a lot of work because of possible different dimensions.
UINavigationController is something that doesn't exist on "normal" desktop interfaces. The closest equivalents are tab menus/tab sheets and you know how different they are.
If I were you, I would focus on binging content on the Mac, forget about interface concepts from iOS and rather make new interface concepts on the Mac that are compliant with Apple guidelines.