Do iPhones support UIPopoverView? - iphone

I have a universal app. Will I be able to use the UIPopover View Controller universally (for both iPad and iPhone)?

No. It is only supported on iPad. There are third party widgets that emulate it, but the Apple one will throw an exception if you use it on iPhone.
From the class reference:
Popover controllers are for use exclusively on iPad devices.
Attempting to create one on other devices results in an exception.
See CocoaControls for some substitutes.

As Aaron has already pointed out, UIPopoverView is available only for iPad,
I know from experience that if you implement your own without following the HIG, apple will reject your app, in my case my menu didn't have an arrow pointing to the element triggering it to appear.
iOS Human Interface Guidelines

Related

Universal Apps workflow

So far I've only dealed with iPhone Apps and the time has come to make them universal. I was watching the lecture about universal Apps by Paul Hegarty on iTunesU and some questions poped into my head.
If I understood the concep allright the main difference between an iPad and an iPhone (when coding) is that the iPad allows the splitview controller and one should take advantadge of it, right?
What Mr. Hegarty did was to adapt the code on one App and add conditionals to differ when the App was running on an iPad or an iPhone.
My question is, is that the usual way it is done? I am a very organized guy and I like stuff to be as much structured as possible. So my first though was to create a complete set of view controllers to manage the iPad storyboard rather that have a single view controller filled with code for both devices.
is it possible to do so as well? what is considered to be a good practice?
Thanks in advance!
I think a good practice for a universal app would be reuse as much code as possible. Otherwise, why not create two different apps?
There are not that many differences between iphone and ipad controls except on iPad we can use popover and split view. So I would share the code in view controller as much as I can.
I just published a git for "converting" iPhone app into Universal app. Take a look - https://github.com/BTLibrary/BTSplitViewController

Recognising gestures from the home screen

I am developing an app for iPhone.
I am looking for a way to run some code once a drag gesture is recognized on the homescreen (or on all screens if possible).
Does anyone know how to get this with the iOS SDK using Xcode and Objective-C?
Your app cannot receive gestures anywhere in iOS except within itself and its own views while it's active (not counting system notifications and the app icon).
I doubt this is possible. To do this, you will need to hook into the OS at a lower level than is usually allowed.
iOS is locked down much more than Mac OS, I'm afraid.

How to make my app to support multitasking

i am developing an app for iphone and ipad with 4.0 as base SDK and 3.0 as target.
how to enable multitasking to this app.
thanks..
To adopt Multi-Tasking in your app. apply the following points:
Support all orientation from the target's General section in settings.
In the General section too. remove the check next to Requires full screen if any.
Select storyboard, click the File Inspector icon in the right side bar. check the box next to Use Size Classes. Check out tutorials how to use size class to adjust your views according to the screen size assigned to your app.
Refer http://answers.oreilly.com/topic/1867-how-to-update-your-iphone-app-for-multitasking-with-ios-4/
Also duplicate question how to do multitasking application in ios 4.0
If you build an iOS app using a 4.x SDK, Apple's "multitasking" will be enabled by default, unless you explicitly add a plist key to prevent it.
But multitasking may not work properly unless you add support for it in the app's resign/become active, and/or app's suspend/resume delegates.
If you actually want to run code in the background, then your app needs to be of a few very specific types, or add support for running some code for a very limited amount of time, for which you probably want to read Apple's documentation.

Is it the same write the iPhone and iPad app?

I have a question about the objective C. I am writing the iPhone application and I want to app which can also run on iPad. Is there are some change do I need to do? As I set the element in code rather than using the Interface builder. Do I need to reset the x,y,width and height for the application? Thank you very much.
You can run exactly the same app developed for iPhone on the iPad. However, it will not use the full screen of the iPad. Look at the Facebook app for instance, you can zoom it but it doesn't look very nice. If your goal is to run an iPhone app on the iPad, you don't have to bother much. If you want to really support iPad in your application you should implement a separate UI for iPad and this is supported in XCode. The iPad has of course a larger screen but also some additional layouts and controls that make apps look great on the iPad.
Have a look at http://developer.apple.com they have more information about this.

Dynamic (Default.png) splashscreen in 3.0 [iPhone SDK]

I know it's possible to create a dynamically changable Default.png by creating a symbolic link. But that's not possible in iPhone SDK 3.0 anymore (only in 2.0).
How can I make this in 3.0, or is this impossible?
Tim
This worked on iPhone OS 2.0 http://collison.ie/blog/2008/11/dynamic-defaultpng-files-on-the-iphone but not on iPhone OS 3.0 anymore. The default-screen is always black.
I can change the default-screen in the documents-folder and the symbolic-link does link to that file. I tested that by browsing to the app-folder from the Simulator. I saw the right file in the documents-directory and I saw that the symbolic link points to that (the right) file.
It's not possible in 3.0. It was only possible on 2.0 because it was an exploitable bug. The bug was fixed in 3.0 which is why it's not possible.
Apple don't intend the Default.png to be a "splash screen".
If you read the HIG, you'll see that the Default.png is suppose to represent your user interface as it would be "empty" - without any content. It is intended to give the user the illusion of an "near instant" launch.
Check out all of the Apple apps on the iPhone and you'll see how the default.png is meant to be used properly.
Apple frown upon using the Default.png as a splash screen. They say that it is really only appropriate for apps such as games that don't use the standard UI elements that are provided in the SDK.
That being said - lots of apps these days are using this feature to show splash screens, and seems Apple aren't really enforcing this guideline.
Long story short, you can do a splash screen, but it can't be dynamic - not anymore.
Use a blank Default.png and then in your app delegate's -applicationDidFinishLaunching: method, load a UIView that contains your dynamic content. This solution sidesteps any conflicts with Apple's SDK terms as well as all technical problems.