Change default app icon and loading screen in SpriteBuilder - ios

I'm making a game with SpriteBuilder and cocos2d in Objective-C and don't know how to change the default loading image an app icons in SpriteBuilder.
Does anyone know how to do that

This isn't something you can change from within the Spritebuilder app. You simply do it by replacing the images that you'll find in the Source->Resourcessubfolder in your project folder. There you'll find all the different default.png images (for the different resolutions), and the icons (in the iconsfolder). All you have to do, really, is to replace them with your own designs.

my solution was to create a Launch Screen.xib file (File, New, File, iOS, User Interface, LaunchScreen). Then in the general settings for the project, where it says Launch Image Source, click "Don't use assets catalog." The last step is to set the launch screen file to your new .xib file, if you didn't change the name like I didn't, just type in Launch Screen.xib
Now if you launch your app, you should see that the loading screen is the same as the screen made in the launch screen.xib file.
The downside to this is that (I think) you can't use your own image. However most launch images tend to be a simple background color and some text, which is easily editable in Xcode.
The upside to this is that Xcode handles all scaling and aspect ratios, so you only need to set everything to percents and make one image, as appose to creating many different sized images.
Hope this helps.

Related

Abandon image cassetts for LaunchScreen.storyboard

So I have a fairly old app, last time worked on before iPhone X(s) was released. Always used Launch Images Source instead of Launch Screen File as seen below.
I am now having issues launching on iPhone X, as the screen size is assumed from the LaunchImage and there is NO launch image currently provided for iPhone X(s) in the "LaunchImage" file of .xcassets folder.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"? I have already tried creating this and using it, but had no luck getting an UIImageView to resize an image with said screen sizes on devices.
Im really looking for a straightforward guide for creating a LaunchImage.storyboard file that can adapt a launch screen image(full-sized image) to any device size.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"?
Change the Launch Images Source pop-up menu to "Don't use asset catalogs".
Make a LaunchScreen.storyboard if there isn't one, and point Launch Screen File at it. Make sure your launch image storyboard uses autolayout and is designated as a launch screen.
Now configure your storyboard's view controller using autolayout so that it lays out correctly on all devices.

Add Launch Screen Image instead of using LaunchScreens.storyboard for iOS

I'm doing my UI for my iOS apps programmatically. The only things that is left is the LaunchScreen.storyboard where I didn't find a way around using it, yet.
Strangely I can't find much about that in the internet.
Is there a way to get rid of it and use an AssetSet instead?
That's (the highlighted file) what I want to get rid of
Since the question included "use a View or and UIImage instead?"
From Apple's docs...
Static Launch Screen Images
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary.
Reference page, including a list of required image sizes: https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/launch-screen/
Note: To use images instead of a storyboard...
In Xcode open your Assets catalog (or create a new one), right-click in the assets section and select App Icons & Launch Images -> New iOS Launch Image and it will create the proper template. Also go to project General settings and select Launch Images Source - Use Asset Catalog...
There is noway to accomplish what you want , you have to supply a storyboard file for the launch screen in plist , if you want to customize go to the layout and add image or anything you want , there is no place to configure a programmatically UIView for that
Here a short description of the steps based on the answer from https://stackoverflow.com/users/6257435/donmag:
create a new AssetSet: + -> AppIcons & Launch Images -> New iOS Launch Image
Go to your Target Settings to General
Under App Icons and Launch Images clear the field Launch Screen File and select your LaunchScreen Asset set that you just created at Launch Images Source
You might have to delete the App from the device/simulator that you test it on and the new Launch Image should show up on start

Not able to set Launch Image in iOS

I am a newbie in iOS. I want to set Launch Image in my app. And I'm using Asset Catalog. And I know I have to drag and drop the image to the boxes that shows up when I'm using Asset Catalog. But a weird thing which is happening at that time is when I'm trying to drag-drop, it just comes back . As if Xcode is telling me NO PLACE HERE. Xcode doesn't let me set my Launch Images. I'm not able to DROP my images in those boxes. And I know the sizes of my images are quite correct. 640*960, 640*1136, 750*1334, 1242*2208.(And I don't want to use LaunchScreen because it only supports iOS 8 and later.)
It's even more weird that people are down voting without even telling the reason. (If you are not good enough to help at least don't discourage newbies)
Got the solution.
Just answering my question so that if anyone is having same problem then here is the solution. My problem was because by mistake I was using images of "jpg" format where in fact I should have used "png" . Now I'm using "png" and it works perfect.
Click on images.xcassets. You should see app icon in the list. At the bottom of that column there is a plus and minus button. Click the plus button.
Click on new Launch Image in the list. This covers iPad's and iPhone's from iOS 5-8 and covers portrait and landscape.
Launch screen can also be support for ios 8,
What you need to do set the Go to project->Media.xcassets on right side information tab you need to select iOS 7.0 and later sizes.
Then you set your launch screen inside the Launch images.
It will work definitely.
By apple provide the document Adding an iOS App Icon Set or Launch Image Set
Thanks
open Images.xcassets of your project
Drag file one by one on boxes as per its size.
See following image.
After doing all Remove LaunchScreen.xib file from your project
And remove Launch screen interface file base name from your plist file.

iOS how to set app icon and launch images

How do I set the images so that I can archive and validate my app? The screen looks like this now:
So the first one says 29pt, but then it also says 2x. So do I put a 29x29 image or a 58x58 image? And where do I put all of the other ones? (I know that there are more sizes than 29, 40, and 60).
Anyway, what I tried was I dragged a 29x29 png onto the first slot, a 40x40 onto the second, and a 60x60 onto the third and fourth. When I went to Product->Archive, I get
/Users/kendon/Documents/iPhone Apps/Sales Tool/Sales Tool/Images.xcassets: The app icon set named "AppIcon" did not have any applicable content.
I recently found this App called Icon Set Creator in the App Store which is free, without ads, updated on new changes, straight forward and works just fine for every possible icon size in OSX, iOS and WatchOS:
In Icon Set Creator:
Drag your image into the view
Choose your target platform
Export the Icon Set folder
In XCode:
Navigate to the Assets.xcassets Folder
Delete the pre existing AppIcon
Right click -> Import your created Icon-Set as AppIcon and you're done
Update: Unless you love resizing icons one by one, check out Schmoudi's answer. It's just a lot easier.
Icon sizes
Above image from Designing for iOS 9. They are the same for iOS 10.
How to Set the App Icon
Click Assets.xcassets in the Project navigator and then choose AppIcon.
This will give you an empty app icon set.
Now just drag the right sized image (in .png format) from Finder onto every blank in the app set. The app icon should be all set up now.
How to create the right sized images
The image at the very top tells the pixels sizes for for each point size that is required in iOS 9. However, even if I don't get this answer updated for future versions of iOS, you can still figure out the correct pixel sizes using the method below.
Look at how many points (pt) each blank on the empty image set is. If the image is 1x then the pixels are the same as the points. For 2x double the points and 3x triple the points. So, for example, in the first blank above (29pt 2x) you would need a 58x58 pixel image.
You can start with a 1024x1024 pixel image and then downsize it to the correct sizes. You can do it yourself or there are also websites and scripts for getting the right sizes. Do a search for "ios app icon generator" or something similar.
I don't think the names matter as long as you get the dimensions right, but the general naming convention is as follows:
Icon-29.png // 29x29 pixels
Icon-29#2x.png // 58x58 pixels
Icon-29#3x.png // 87x87 pixels
Launch Image
Although you can use an image for the launch screen, consider using a launch screen storyboard file. This will conveniently resize for every size and orientation. Check out this SO answer or the following documentation for help with this.
Useful documentation
App Icon
Launch Screen
The Xcode images in this post were created with Xcode 7.
To save a bit time:
1) You can mark your app icon images all in finder and drag them into your Assets catalog all at once by dragging into one of the empty slots of the app icon imageset. When you hold your drag over the slot, several of the other slots look selected and when you drop those all will be filled up at once. Note that this works in XCode 8 (I haven't tried XCode 7), but in XCode 9 beta not yet.
2) The "Technical Q&A QA1686" apple documentation site has the sizes per app icon slot already calculated for you in a nice image and also contains the correct image names conventions.
I've tried most of the above and a few others and have found https://appicon.co to be the easiest, fastest, and provides the most comprehensive set.
Drag your image onto the screen
Click Generate
Open the file just downloaded to your Downloads folder
Here, you may be able to drag this entire folder into Xcode. If not:
Double-click the Assets.xcassets folder
Select all files
Drag them to Assets.xcassets
Rename it to AppIcon
The correct sizes are as following:
1)58x58
2)80x80
3)120x120
4)180x180
I use a tool called Prepo to produce all the right image sizes. You simply feed the app you image file and it will spit out each necessary file with an appropriate name.
Once you do this, you can then drag in the appropriate files or simply point to your Prepo exported folder.
Now a days is really easy to set app-icon, just go to
https://makeappicon.com/ add your image, they will send you all size of App-icon (Also for watch & itunes as well), now Click Assets.xcassets in the Project navigator and then choose AppIcon. Now you just have to drag n drop the icon as required.
I found App called Iconizer. You can find repository on github. Iconizer can generate app icons for OS X, iPad, iPhone, CarPlay and Apple Watch with just one image.
Simply Drag and Drop your icon onto Iconizer, select the platforms you need and whether or not you want all platforms generated into one asset catalog, then hit export.
After that just replace (delete and import) your AppIcon in the Assets.xcassets
In the left list, right click on "AppIcon" and click on "Open in finder"
A folder with name "AppIcon.appiconset" will open.
Paste all the graphics with required resolution there.
Once done, all those images will be visible in this same screen(one in your screen shot). then drag them to appropriate box.
App icons have been added.
Same process for Launch images.
Launch images through this process are added for iOS 7 and below.
For iOS 8 separate LaunchScreen.xib file is made by default.
I quite like this app made by Jordi Bruin called Bakery
It allows emoji and SFSymbols for quick prototyping (not for the App Store in this case!)
It is as easy as drag and drop your design to the app and then again drag and drop to the asset catalog without having to fill in all the sizes by hand.
This is a very frustrating part of XCode. Like many, I wasted hours on this when I switched to a newer version of xcode (version 8). The solution for me was to open the properties for my project and under the "App Icons and Launch Images" choose the "migrate" option for the icons. This made absolutely no sense to me as I already had all my icons there, but it worked! Unfortunately I now seem to have two copies of my launcher icons in the project though.
As per updated version(Xcode 8.3.3) I saw that below resolution are required for all fields of AppIcon sets.
40x40
58x58
60x60
80x80
87x87
120x120
180x180
It comes with hdpi, xhdpi, xxhdpi etc.
Hope it will helps others.
Edited to 120x120
You can easily do it without resizing yourself or doing anything, just choose your icon at an app store icon generator website
https://getappscreenshots.com/app-icon-generator and it'll generate all required files and all icon sizes so you can just copy the files and paste in your project's folder!
You can get away with just adding a single image of size 1024*1024px.
Just add the image in like so
and select single size in the menu to the right.

XCode5 won't accept all my icons and launch images

After switching to XCode5 I've just re-done all my icons and launch images for an app, with the exception of retina launch images I should have a complete set for both iPad and iPhone, iOS6 and iOS7, thanks to this tool: http://www.appiconsizes.com/
But XCode5 absolutely refuses to use them all. I removed all the old images from my project and added the new ones. Some, XCode automatically detects, seemingly at random. Many others, it says it can't find the images needed even though they are named according to Apple's guidelines (as far as I can see, it's all a bit confusing with so many variants). It lets me find them manually but doesn't seem to be using them properly.
And my launch images, it insists on using images from a different target even though these are definitely not marked to be included in this target. It won't even let me change those ones, if I try to then it just ignores my selection.
A few screenshots follow. I originally had just an "Icon" icon identifier in my plist, since Apple say it will automatically detect different variants, but XCode has then added Icon-76 and Icon-120, seemingly contradicting this. I'm aware XCode5 supports controlling things more through your plist than XCode4, but shouldn't require that - you should be able to tell it the icon base name or use "default" and it would figure things out?
Use an asset catalog for your project.
It has placeholders for the launch image and the icon and each one tells you which size it needs.
Much easier than handling lots of dirrefent files in different locations.
In the project info page there is a button that says "use asset catalog". It will import all your images for you. The code doesn't change when using an asset catalog so it will all still work.
Another thing with asset catalog is that the name of the files doesn't matter. You just drag the image to the slot you want it to go into. With icons and stuff there is only a size restriction.
Even for retina images you don't need the #2x before because there is now a slot for "standard" and "retina" images.
I guess the problem is in Your icon Name,
for iPhone retina Name should be Icon-60.png , Icon-60#2x.png
So as Fogmeister suggested use asset catalog
Like
So its like

Resources