iOS, change splash screen by code - ios

Basically, I want my app could change its splash screen by app settings. Settings are saved in plist file.
Actually it's about different language, I want enable my user to choose my app language, even if it's different with the system preferred language.
Is it possible? I searched some answer, suggesting to use another view controller to simulate as splash screen, but my splash screen itself will take some to to load my app, not by my pause. So should I display nothing in the real splash screen?
I wonder if there is a way to change the splash screen by some conditions.
Thanks a guys.

The splash screen will show only for as long as it takes for the appDidFinishLoading method to return YES. One possible solution is for you to have a really simple (not localizable) splash screen and to basically do nothing in this method and return YES straight away.
You can then use an actual view controller as your splash screen that is dynamically initialized and actually does any initialization your app may need in the viewDidAppear method. Once the initialization is done, you can then proceed and show what would normally be your root view controller.
EDIT:
You should also consider, however, that splash screens are not intended to provide any kind of content to the user, as pointed out in this answer.

Apple does not provide a way to do that, as that would involve either modifying the Info.plist or modifying the splash images, both of which would in turn spoil your code signature. It would also open a very ugly can of worms, so modifying Info.plist will probably never be allowed which in turn means you will not be able to change the splash screen dynamically unless Apple adds explicit support for that via some other means. But right now, you're out of luck, I'm afraid.

Related

Editing the LaunchScreen.storyboard on Google Place Picker Demo

I have been trying to implement the Google Places API and stumbled upon the Place Picker Demo provided by Google. I have been trying to edit the code and tailor it to my project but to no avail. For example I tried changing the launchscreen.storyboard file to fit my needs, but in the simulator it shows up for about a second before it goes back the original app screen. So is it even possible to edit the demo code that Google has created or transfer it to my project somehow? I am also quite new to Swift and Xcode so any help would be appreciated.
This is the link to where I obtained the code from:
https://developers.google.com/places/ios-api/code-samples
The LaunchScreen.storyboard interface is only shown for a split second while the app is loading and should not contain any actual content besides a logo or a barebones preview interface (Apple discourages logos) so that the app appears to have a fast start time.
On the Human Interface Guidelines:
A launch screen appears instantly when your app starts up. The launch
screen is quickly replaced with the first screen of your app, giving
the impression that your app is fast and responsive. The launch screen
isn’t an opportunity for artistic expression. It’s solely intended to
enhance the perception of your app as quick to launch and immediately
ready for use.
If you want to have a different starting screen, add a View Controller to the Main.storyboard and set it as the Initial View Controller (a checkbox in the right sidebar).

iOS development - launch screens where image on main screen can change?

So I am new to iOS development and I have a question about the launch screen.
My app will have an image (that loads when the app opens from the internet) this can change anytime the image is updated on the website, so what is the done thing when designing a launch screen as the image could be different to what is on the launch screen?
Thanks
In Apple's Human Interface Guidelines, they suggest that the launch screen should match the first screen of your app. In the example they give, the only parts of the launch screen are the non-dynamic parts (the UI around the web content).
Design a launch screen that’s nearly identical to the first screen of your app. If you include elements that look different when the app finishes launching, people can experience an unpleasant flash between the launch screen and the first screen of the app.
The launch screen is presented before your app loads, and it should be used for static content only.
If there are any UI elements around the image that is displayed, show those in your launch screen. If not, choose a neutral background color that works well with the theme of your app.
Omit the image. A launch image should be a bare outline of what the screen will certainly contain. It might be no more than the correctly-colored background. It is just to cover the gap between nothing and something.
Read the Guidelines: https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/ Look at the picture on the left. That's a launch screen — basically empty.
LaunchScreen image is always the same..
You can set it in LaunchScreen.storyboard
The launch screen is used to display something whilst your app is initialising, making network requests or whatever.
You shouldn't be looking to load dynamic content here as if a user is on a very slow connection then they wont see anything until your image has loaded. This is why it doesn't have a view controller associated with it. it should be static.
You should only really be loading your logo or something in here, you could just use the company name. it will only show for a short amount of time. then when assets change, submit the changes to store

iPhone SDK - possible to have multiple splash screens?

I'm making an app with a different screen for its first run. Once it has completed its first run, this screen is never shown again. The issue I have is that my launch image is built to look like the view that the user sees every other time they run the app, so at first run the loading screen looks weird. Is there any way to have one loading screen for first run and one loading screen for other runs? Thanks
You cannot have multiple or dynamic launch images. Even with the new storyboard/nib launch files, they are still quite static.
Make sure to open an enhancement report with Apple, requesting this feature.
In the meantime, consider a slight change of your flow to first display the initial view, and have an animation to display your first-launch view. This way, the transition will be smoother and more natural to your users.

Show a view on main screen while the app is in background in ios

Thanks in advance.
Is it possible to show a capture screen like assistive touch view in ios when we click on application icon.Means i want to show the iPad screen and top on the with transparent background a view need to display.
I want to create an app like this after clicking the app icon i want a screen like this on my main screen and i can able to customize it and capture the selected area. is it possible to do that. and is there any api for that.
i don't think you are allowed to capture the home screen in public api. this question had similar request.
How can I take a screenshot of the iPhone home screen programmatically
UIGetScreenImage() mentioned in the answer is very useful, if you only targeting Jailbroken phones.
However, i found an open source library called "Record My screen", which claim can
Record the display even on non-jailbroken iPhones.
I personally didn't test that, since i believe Apple would somehow find that and pull the app off (that happened to several apps before). If you really interested in it, maybe you can learn something from that library.
Hope that helps you.

Screenshot that taken by iOS when (before) application go into background?

I hope that you all know about it, iOS takes screenshot before your application goes to background.
I got it from official document.
Remove sensitive information from views before moving to the background: When an app transitions to the background, the system takes a snapshot of the app’s main window, which it then presents briefly when transitioning your app back to the foreground. Before returning from your applicationDidEnterBackground: method, you should hide or obscure passwords and other sensitive personal information that might be captured as part of the snapshot.
So, Here We can hide our "sensitive personal information" and the system takes a snapshot of the app’s main window, so we can not change its feature.
But I want to know..
1) If in my application I'm at 4th View, and my app goes to background then system takes screen shot of which view/page? first one (start up view of apps?) or 4th view/page of the app ?? (here is little confusion for me).
2) Can we fire any action when system is taking screenshot or any notification is available that will inform us of system taking screenshot ??
3) I just want to know, is it possible to take screen shot (programmatically) before my application launch ?? If YES then give me suggestion for how to do it. And if NO then where/when I'm able to take screenshot (I mean at which minimum stage of application we'll be able to take screenshot ?) ?
It will take a screen short of the top most view, actually it is taking a screen shot of the window which is displaying your app.
No there is no notification that the screen shot is going to or being taken. You should just handle the handle it in the applicationDidEnterBackground; method. Just a stated in the documentation
No this is not possible, how do you want to execute any code before you app is running? The OS will make the screen shot, just be sure to have everything hidden in the applicationDidEnterBackground;. The minimum state is that your app is up and running.
What I've done is on of my apps is as soon as my app gets pushed to the background place an extra view on my UIWindow. Thus when the screen shot is made this view is captured.
1) There is just one screen. The screenshot is taken of that screen. In your model case that should be the 4th view controller's view. However, it is quite possible that your 4th controller's view does not cover all of the screen or has transparent elements. In that case parts of the 3rd or even 2nd and 1st view controller's view are part of the screen.
It is a screenshot not a view controller shot or anything.
2) You understood the documentation all right. The screenshot is taken after you returned from applicationDidEnterBackground. There will be no further dokumentation.
3) No, you cannot execute any code before your app is invoked. However, I have the feeling that you are looking for something different than you asked literally.
For some other reason I have executed a small program in the simulator by implementing the main function only even without calling UIApplicatoinMain. This is the first point in time where code from your app may be executed, although that would not be exactly "out of the book". If I remember right, the screen was blank/black at that point in time. So if you are asking for a way of creating screenshots of other apps, this is not the way to go forward.
It is not taking a screenshot quite like a user pressing buttons.
This functionality is related to state restoration. When the application goes to the background it flattens the view hierarchy for each screen into a screenshot used for the task manager. If you are opted into state restoration it will also persist the state of the user interface. This means that a person can bring the application back from the background state and potentially see sensitive information that way as well, which may be something you need to handle.
Preventing information from being included in the state screenshot is covered in Tech QA 1838.
1) I'm pretty sure the system will take the snapshot of the current visible view, so the last one on the stack, not the first one
2) Also, there will probably be a Notification to let us know that the system is going to take a screenshot (otherwise how can we hide sensible information? :) ), but I'm afraid we're currently under NDA I guess?
3) What do you mean "take screenshot before my application launch"? Your code starts executing when your application launches, so this question almost makes no sense :-/
You can anywhere in your application take a snapshot of the screen, however, and there are many stackoverflow posts for that

Resources