Random launch screen on iOS apps [duplicate] - ios

I have a sponsor logo on the launch image. Is there a way to dynamically change the launch image to rotate sponsor logos?
Thanks

The default image for an iphone app must be a fixed image file in your bundle. You cannot change it dynamically.
However, you can have a dynamic image that appears when the app loads after the launch image. You can set that up with animations or simply to select a random image each time.

According to Apple's HIG, Human Interface Guide, the splash screen is supposed to be used only as a placeholder to give the user the illusion the app is open while it completes it's startup process.
Apple will allow some use of the startup screen, but know they can and do have the right to reject your app solely on how you use it.
Like the previous answer stated, you could do anything you want after the initial startup screen has passed. Play a video, run an animation, or display a second view with your sponsored images.
And finally, I don't recommend doing this, but if you are determined to work something into the startup screen, you could try this.
The splash screen is hardcoded or set to 1 filename. Before your app closes, you could dynamically replace the hardcoded filename with a new file from a webservice or local storage, replacing the existing splash screen image. I haven't tried this, but it is more than likely possible. Just beware that it may not pass muster with Apple's approval process. Good luck.

As i needed different images on iPhone & iPad Splash screens, i followed below steps:
1. Add two UIImageViews
2. Set Width & Height constants for both UIImageViews as per your requirements.
3. Now select the iPhone UIImageView and set its Height Constraints Regular Regular (RR) height constant as 0.
4. Do the same for for iPad UIImageView and set its Height Regular Regular (RR) height constant as actual required height and set 0 to the Constant.
5. When you test it on iPhone the iPad ImageView will disappear and vice-versa will happen on iPad.

Related

Launch screen image not displaying correctly

Working with the iOS launch screen and it's a very painful experience.
Finally got it to appear, but no matter what I do it won't align properly. It's either stretched too far, or in a weird position off the screen.
What values for mode and stretching should I use to display this image viewer in my .xib?
If you're using the Launch Screen.xib or Launch Screen.storyboard, you need to set the correct AutoLayout constraint in your IB file.
If you're not, you need to set the Launch Images Source in your project general settings page.

Making UIImageView full screen on .xib

I'm trying to implement a "Launch Screen" .xib so that my app will get "This app is optimized for the iPhone6 and iPhone6 Plus" denotation in the app store.
So I create a new Launch Screen .xib template, delete the included label, drop a UIImageView onto it, I push the pin button and I set all the "spacing to the nearest neighbor" constraints to 0, I set the UIImageView to aspect fit, and have it point to one of my asset catalogs.
When I run the app on my phone, I'm getting some very weird results as far as the positioning of the UIImageView and the size of the image in it (it definitely isn't filling out the screen with the image). Does anyone have anyone have any idea of what I'm doing wrong here?
You don't give any actual details of what you are doing, so one has to guess. There are, however, two things to keep in mind here:
Where the image is shown doesn't really have all that much to do with the position/size of the image view. It has something to do with it, but the most important thing is actually the Content Mode of the image view.
Image views under auto layout are tricky, because they are resized based on the image - unless your constraints completely determine the height and width of the image view in some other way. In all probability your constraints are not doing that.
So the problem I was having was I trying to link the LaunchScreen.xib to a LaunchImage asset catalog. This will not work, you have to link it to a normal image asset catalog and use the universal image grouping.

Using a launch screen (.xib) stops scaling

It's my understanding that apps for iOS 8 should have a storyboard file as launch screen rather than an image. I've created a really simple launch screen file that has any width and any height, and has one label of plain text reading "placeholder" and set it as my launch screen. However, when I try to run my app on the iPhone 6 and 6 Plus simulators, there's black bars around the background and the buttons on the main menu are out of place. The problem doesn't seem to be present in the 5s or iPad. Most of my assets aren't optimized for the 6 and 6 Plus though, since they were created before they came out. Is that why this is happening? Or is it something else? Thanks in advance.
Edit: Apparently, putting in a launch screen stops the app from automatically scaling. Is there a way to have both a launch screen, and keep the app scaling? Or do I need to make new assets?
This is a bit of an old question, and I ended up using a launch image instead of a launch screen, but you can probably solve this by using constraints. If you set top, bottom, leading, and/or trailing constraints on an item in the view, it'll scale itself to fit those constraints (if possible). For text, it has the autoshrink property which you can change to minimum font scale (instead of fixed font size), though I'm not sure how you can scale text up. The autolayout documentation is here.
To create a launch screen from a xib file first create a new file from under “User Interface” and select the option called “Launch Screen”
Using autolayout, design the first view of you app so it scales to suit all resolutions that your app supports.
Using the new Launch Screen
Under the app setting select the newly created Launch Screen from the app options.
This is the example for using a xib file. It can also be done using storyboard as shown in Ole Begemann blog

Xcode button with size classes

I am wanting to create a button that changes its size based on the device (Ex: 1:2 aspect ratio) in a Universal Storyboard. For example, the button would be much bigger on the iPad that it would on an iPhone. The problem I am running into is that it seems like I am unable to add the constraints needed to the button in order to make this happen. The problem is that the margins on each device are different which ends up not letting the aspect ratio solution work. Is this possible to do or I am going to have to do this separately for each device using different size classes instead of just the universal class that works for every device?

One splash screen for all display sizes

So, the question:
Is there any way to use a simple .xib or something like it, to have a splash screen with just a solid background extending the full width and height of the screen with a single, centered image?
I'm just learning iOS development and Objective-C.
I'm trying to find a simpler way of creating a splash screen for an app without using the traditional loading images.
Why?
In android development, I can use a fragment as a splash screen and place a single image at the center on a colored background. This will scale for ANY screen size, in ANY orientation.
In iOS development, they want me to create multiple image files for every orientation and screen size. This is not very scalable. If the logo or design changes, every one of these files has to be recreated and added again to the app.
You need to understand that the launch image Apple requires you to include is not for the purpose of being a splash screen. It is there to make the transition from the launchpad into the splash screen smooth. Yeah, it doesn't scale well, but it's just one image - you can handle it.
I don't know how to do it using auto layouts, but the old school way would be to place a UIImageView in the centre of the view set its autoresizingMask property to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight. In Interface Builder it would look like this:

Resources