PNG within an iPhone app - iphone

I have the following issue:
My iPhone app makes some kind of graphics.
How can I save these graphics or drawings made by the app as a png file on the device?
Would it then be possible to set such a png file to become the icon for the app from within the app itself? (Provided the size is right of course.)
Thanks for any possible tip.

No, you can't change the app's icon at runtime (like the Calendar app that comes with the iPhone does)
How do I change the default icon of iPhone application programmatically?

For saving PNG images on your device, look into UIImagePNGRepresentation which is part of the UIImage Class.
As for changing the app icon, this would only be possible if you are jailbroken and have the right package dependencies that allow the icons to refresh in SpringBoard on the fly.
Outside of being Jailbroken, changing the app icon would require an app update which would include the new icon.

I wouldn't think it's possible for the actual icon for the app to change, because it's set on the phone when the app is installed.

Related

iPhone 5 Optimization Requirement - Launch image really necessary?

When trying to upload a binary to App Store, I get the following response in an email:
"iPhone 5 Optimization Requirement - Your binary is not optimized for iPhone 5. As of May 1, all new iPhone apps and app updates submitted must support the 4-inch display on iPhone 5. All apps must include a launch image of the appropriate size. Learn more about iPhone 5 support by reviewing the iOS Human Interface Guidelines."
Also, the status of the app is "Illegal binary".
I've read that I must include a launch image called "Default-568h#2x.png". Question is: My app was not intending to have a launch image at all. Am I really required to have a launch image now?
Yes you must include one. Not only does the launch image give the hint to the OS about the app's iPhone 5 (4" screen) support, but launch images in general are required:
From Apple's Interface Guidelines
To enhance the user’s experience at app launch, you must provide at least one launch image. A launch image looks very similar to the first screen your app displays. iOS displays this image instantly when the user starts your app and until the app is fully ready to use. As soon as your app is ready for use, your app displays its first screen, replacing the launch placeholder image.
Furthermore:
Generally, design a launch image that is identical to the first screen of the app.
So really, making a launch image that is about the same as the first screen of your app (e.g. if the first screen is a UITableViewController with a toolbar and navigation bar, perhaps the screen looks like an empty navigation bar, an empty toolbar, and an empty table view, which then suddenly all become populated as soon as your app really gets going), is the way to go for the best user experience.
If really you don't want or need this, then make the default images just be black.
Yes, as stated, as of May 1, 2013, all new apps and app updates must provide support for the new iPhone 5 4-inch display.
The way to indicate that your app supports (has been tested with) the new iPhone 5 resolution is to simply include the launch image for that device.
You can simply create a black .png image (which is what your other default launch images are anyway) that is 640 x 1136 pixels and use that as the launch image for that device.
Simply including the new splash screen image (Default-568h#2x.png) is not enough
You must re-build your project with the iOS 6.0 SDK (or newer) - which supports iPhone 5
So if you're still using an older SDK, update your XCode in the App Store first
Yes. from 1st May, you can't upload application with out including Default-568h#2x.png in your application.

How can I make a screenshot of iPhone desktop programmatically?

I need to make a screenshot of the iphone desktop and set it as background for my app, is it possible?
UIGetScreenImage should do what you want - check out this example.
But apparently, Apple (in its great wisdom) has banned its usage in apps for the App Store, and has removed it from iOS 7 arm64 and newer.
If you are looking to take a screenshot then you need to press the menu button and the lock button at the same time, as for setting it as the background of the app, just use the image which will automatically be placed in your camera roll.

How do I make an app icon for different versions of iOS?

I want iPhone app icon and graphic (not only the app icon shows on springboard but also in app inner view) auto meet on OS3 device and OS4 retina device , does it exist a way auto meet but coding ? as I know that we can set the icon configure in setting.plist to define the different app icon on springboard but seem no way to set the inner icon or graphic of the app ....
Every graphic that you display on a normal-resolution device has an #2x counterpart for a high-resolution device. This applies both to app icons and to the graphics you use within your app.
For example, if you had an image called navbar.png and a hi-res one called navbar#2x.png both in your Xcode project, when you specify it as the image of a UIImageView in Interface Builder or when you specify it in code:
[UIImage imageNamed:#"navbar"];
iOS will automatically pick navbar#2x.png for hi-res devices without you having to write any extra code.
Create all of your graphic assets at the two sizes, then name the double-sized assets with "#2x" at the end of the name. ie: Icon.png and Icon#2x.png. The iPhone will automatically choose the correct one.

Is it possible to make my iPhone app's icon look correct on both the iPad and iPhone?

Our CEO wants our iPhone app's icons to look correct (ie not scaled) on both the iPad and iPhone. He does not want to actually create separate versions, or a universal version of the app. The app will remain iPhone only, but the icon would need to show up proper on both devices.
This is a "business decision", and I think its rather silly but regardless - is this possible? OR would we have to create a universal version?
No. You have to create all the 72x72 (iPad), 57x57 (iPhone) and 29x29 (Settings, if you have one) icons, if you(r boss) don't want scaling.
And you need to create a 512x512 version to submit to AppStore anyway, so I don't see a reason to avoid an extra image.
To use the 72x72 icon for iPad, see How do I specify both icons for a universal iPhone/iPad app?.

iPhone - Change app icon pointed to by info.plist within the application?

Is there any way to change the 47x47 PNG, pointed to within info.plist, for the iPhone springboard icon from within code?
I understand I can add a translation and change the springboard icon per language that the iPhone supports via a changed info.plist per language, but I would like to change the springboard icon for my iPhone app based on a user preference within the app.
Any ideas?
I haven't tried this, but can a file be copied over another within an app bundle? Could I ship with info.plist pointing to "base.png" then replace "base.png" with another PNG I package with my app from within code?
Thanks.
--Batgar
This cannot be done - an iPhone application main bundle is read only, so you cannot change your app icon from within your app.
What you want to do is create a new target (with the relevant icon) for each "sister" app and that will allow you to compile multiple apps using the same code base. Hope this helps!