How to call Screen Time at settings from my app - ios

Apps set to Screen time are strongly constrained by their behavior.
If the screen time starts while the app is running, the nature of the app causes problems in operation.
Normally, the setting screen is called by the following code, but I do not know how to call Screen Time.
UIApplication.sharedApplication().openURL(settingsURL)
Do you know how to do that? Or tell me if there is another way around it.

Related

Launch screen for iOS

I have read a few posts on this topic about making the launch screen last longer, but I want to make it shorter.
Currently my launch screen takes 4 seconds before loading the login screen, and the app is not even close to being finished yet. Does that mean the launch screen could take longer to load once the app is finished?
Is there any way to make the launch screen appear for 2 seconds?
Xcode, Swift. backend in PHP.
The launch screen loading time depends on how "long" it takes your initial view controller to be prepared.
So, if you want it to "load faster" make your initial view controller more lightweight, do this by:
Reducing the number of interface elements being shown
Do not perform that many operations inside the "view did load" method.
Other than this, theres really not much you can do to control the time.
There isn't really a straightforward way of making the launch screen last shorter, because it depends on how long it takes for the necessities of your app to load.
Remember, the shorter the launch screen, the better, so the users of your app won't think that your app is taking a lot of time to boot up.

Having trouble with AppDelegate didFinishLoadingWithOptions execution order/timing

I'm having an issue with this code (I have it in didFinishLaunchingWithOptions). I need it to finish executing the code inside before the app continues because it sets up some critical things in core data. It sends this to the background though and starts running the rest of the app and it doesn't finish quick enough for the data to be usable.
DataManager.getDataWithSuccess { (data) -> Void in
//code to execute here
}
How can I force the app to wait for this code to finish before moving on?
You shouldn't block the didFinishLaunchingWithOptions method from returning so that it can wait on an asynchronous task. It's crucially important to note that iOS applications are only given a limited amount of time to complete launching before the application is killed by the operating system.
An approach I have used in the past when waiting on asynchronous things to happen that need to happen before I really launch my app is to create a LaunchViewController. The interface for this view controller matches perfectly to the app's splash screen. From an end-user perspective, you can't even tell we've left the splash screen.
Here, we do any set up code such as asking your DataManager to get data. Then, when it (and any other set up actions) completes, you simply present the next view controller in much the same way you'd move between any other view controllers.
A huge positive side effect here is that you can have much nice looking animations from your splash screen into the first screen of your application.

iOS Launch Screen Animation Time

It seems like the fade animation between the launch screen and my first view is really slow.
I don't think it used to be like that. Is there a way to control the speed of that transitional animation?
I looked at some apps on my phone and the launch screen doesn't fade as slowly as mine. What things could I have done to affect that?
(No I don't have slow animations turned on, only the fade animation is slow)
In WWDC 2012 video iOS App Performance: Responsiveness they enumerate a whole list of issues that have impact on the app startup time, ranging from attaching to unnecessary frameworks, optional linking to frameworks that you really could make required, the use of static initializers, overly complicated initial scenes, too much information stored in preferences, etc.
That video covers a range of topics, like the above, which impact startup time. In the demonstration, they show how one might benchmark the startup time. Unfortunately, in my experience, there's a good chance that you might not be able to do anything to fix this issue (e.g. you need certain features and therefore need certain frameworks), but it's still an illuminating video and it might give you some ideas of things you can try to alleviate the start-up performance issues.
If your app splash screen show more time, so please check following things in your app.
1. AppDelegate.m
in didFinishLaunchingWithOptions method have you called any heavy method which takes more time for finish task if yes then change that method location, basically in appDelegate class don't write any heavy methods.
2. first view of your app.
check viewDidLoad() method, if you call many method or any heavy method from here then your launch image will show still your control not come out from viewDidLoad method, so if you want call any methods at view launch time then call them from viewWillAppear or viewDidAppear method (in viewDidAppear method don't call any UI related methods)
I never figured out what was going on here, but the next day when I started up xCode and the simulator it was back to the normal loading time.

Can the startup/splash screen be changed depending upon the state of the application upon startup?

My app has a registration screen that is only presented once, and after registration is completed it is never shown again.
If my startup screen is a screenshot of the app then I would need to provide two screenshots and for the correct one to be initially displayed when the app launches.
Is this possible?
No, it is not currently possible. You cannot access the Default.png (or whatever you've named it instead) from your app to update it.
If it were me, I would set the startup screen to the one that is appropriate long term. You could also theoretically update your registration screen to be a bit closer to the look and feel of the main app screen, so it isn't so far off visually.

IOS: turn off camera

In my app I use iphone camera, but the process is very low when I open it; then I want to start the process when I shows a splashscreen.
The problem is that when splashscreen ends I don't want to show camera.
Then while I show splashscreen I want to start process of camera and quit it before splashscreen disappear. Is it possible?
First up, Apple specifically advise against using splash screens in their Human Interface Guidelines document. I don't know if your app would get rejected for it, but best not to try.
Second, it sounds like you need to optimise the startup of your application and probably the first view controller. To do this, you need to put off loading/initialising everything you can until it's actually needed (known as "lazy initialisation). All code in applicationDidFinishLaunching: in your app delegate and your view controller's init method, loadView, viewDidLoad, viewWillAppear, viewDidAppear should be reviewed for stuff that could be done later.

Resources