App loading Image - ios

sometimes when I start my App it shows me a black screen until its loaded.
Where is the place to add an Image or whatever to show that in instead of that nasty black screen?
Thanks in advance,
Philip

The black screen simply means that there is no launch image set for your app. The newest and in my opinion easiest way to add these is to use an Asset catalog.
If you created your app in a recent version of xCode, an asset catalog named Images.xcassets is automatically created for you.
Navigate to the same by clicking on it and then simply drag and drop your image into the same.
Here's a screenshot:
I would also strongly recommend that you maintain all graphics used in your app via this Asset catalog. The big advantage with using this process is you don't have to worry about the usual naming conventions you would need if you included graphics outside of an asset catalog - for e.g. You no longer have to name retina images as #2x

Something really simple in fact. Go to Xcode, Tap the project on the top, on the drop down menu on the top left select the target, then click General and select images at where it says Launch Images

Related

iOS Launch Screen Storyboard vs Launch Images

So, we have two options:
Launch Screen Storyboard
Launch Images
I found out that 'Launch Screen Storyboard' option is the easiest and most efficient, but if you want rounded edges or borders on certain elements, you are constrained.
'Launch Images' gives you way more room for you to create static PNG's of your UI. However, they create more files and add to app size.
Apple Indicates: (here)
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary.
During run time, in real life, which is faster? Which makes app launch faster or easier on the system?
App Thinning
It depends on the amount of artwork you are displaying in the launch screen vs the image size in the launch image. Also techniques like app thinning will create the right variant for each device type to pick the right asset avoiding other which are not necessary.
Check out this link when you are using image assets
iOS is fast enough to load either storyboard or image. There's no need to worry at all, just do what's the most handy for you.
By the way, there's a third option:
Let iOS first show the static launch screen/image. Then show your first view controller having the exact same layout as your launch image but adding dynamic UI elements. This first view controller should be alpha animated in. Examples of added dynamic UI elements: loading progress bar, or Sign Up / Log In buttons.

Add many images to xcodes asset catalog - how to manage naming and 1x,2x,3x for each?

I have an app where I would like to add many images (500+) to xcode's asset catalog. Adding the 1x images was easy, I simply had to drag the first folder. However to add the 2x and 3x images it seems I would need to drag each image in manually, and I'd prefer not to do that. The 3 different sizes for each image are all named the same, w/ just different sizes. Is there anyway to automate this process?
You can named image something like : yourimg.png, yourimg#2x.png, yourimg#3x.png ,so it's become one set. Let's take another : dogImg.png, dogImg#2x.png, dogImg#3x.png then this is second set.
So, you can name images like this and put every images to one single folder.
Then you simply drag and drop that folder to xcode, and you have done!
No need to use assets in this case! this naming conversion manage same as assetts.!
Refer Raywebderlich's one tutorial's portion where they are adding images like this.
OR (recommended way - because it is using assets)
Name your images like - test#1x.png, test#2x.png, test#3x.png and drag all them in to the assets and it will automatically take place at proper location. That's it!!
You can maintain folder structure also. For example If you have folder structure like below screen shot,
and If you drag and drop whole Images folder to assets then xcode will manage everything for you(see result in below screenshot) but you just need to keep in mind that follow the naming standard for the images like test#1x.png, test#2x.png, test#3x.png. You can ignore # for 1x image, I mean your image set can be like test.png, test#2x.png, test#3x.png also!
Screenshot of assets after dragging Images from the finder,
Happyxcasset is a python script that easily imports resource files into xcassets in Xcode.
https://github.com/qdvictory/happyxcasset
You will like it.

Dynamic launch screen image?

With the (relatively) new feature of iOS to have launch screens generated from a XIB file, a logical question arises: is it possible to reference any sort of dynamic resource from these XIBs? An example would be an app having customisable home screen, which makes it neccessary for the XIB file to adjust once the user changes smth (i.e. background color)?
Maybe it's possible to reference an image from Documents/ folder or read some dynamic plist file's values?
According to iOS Human interface guideline Launch file/image should be static.
Design a launch image that is identical to the first screen of the app, except for:
Text. The launch image is static, so any text you display in it won’t be localized.
UI elements that might change. If you include elements that might look different when the app
finishes launching, users can experience an unpleasant flash between
the launch image and the first app screen.
For more information see: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html

Setting the icon for my App?

![I'm trying to submit my app to Appstore but I'm facing a problem with setting up the icon for my app, I've tried all the variation of sizes for the icon size, but still it's giving me errors , I have taken a snapshot for those errors please help :]
Take 1024x1024 icon and generate other icons form http://makeappicon.com/
The images you use should be exactly in the specified dimensions. Even when you can put them "inside the box" of the UI, they must be correctly sized. Please check your files in the Editor, if they are really the right size.
And then, also try with clean build the project.
Remove the icons (Icon-*) from Images.xcassets, you don't need them there. You just need to drag your icons from Finder into their respective boxes inside AppIcon. And make sure you have the correct size for each icon.

Show splash screen only once IOS

I understand, Its a HIG violation to play around with the default launch icons and splash screens, but I have requirement such that, I need to display the splash screen only for the first time, Is it possible to implement it ?
One simple solution, I can think of is : displaying as an imageView on top of UIwindow and then removing it based on a timer. Am looking for other options.
My advice is to rework your view hierarchy so that the first view mimics the splash screen you wish to show (A view controller with a uiimage embedded should work fine for what you've described). Then push the "main screen" over top of that view after your specific period of time. A little code to ensure that this happens only on the first run with some persistent storage and you should be good to go.
I do not advise working with UIWindow directly. Doing so can lead to all sorts of headaches.
That is to simple.
But you aren't need to manipulate the launch image, but an image loaded by your app.
To prevent to launch the second time you can set a flag in the internal storage.
Make sure to use a lazy load / initalization technique and display the image fast as much is possible, than do the initializations.
I hope it helps!
If you use iOS6, you can use restoration feature.
At first run your app will show launch image. All other runs it'll show last state screenshot.
So you know its a HIG violation but looking for some workaround.
You have to have a launch image while uploading the app and showing on first launch.
I assume you dont care about app review in appstore.
Lets think
Launch image has to be in main bundle. And the main bundle is readonly for your code.
I have some workaround but it may work only for second time launch to show the launch image and then no again.
Add your launch image with any name
Add a symlink to your app bundle with name Default.png, which shows the file in 3. step
Copy that launch image to your app directory folder (your symlink in app bundle shows the file) on first launch.
Launch second time the app and see the launch image
Delete the copied image.
When your app can not find a png file which showed by your symlink it can not show launch image
PS: Personally I did not try that but may work.

Resources