Difference between "didBecomeActive" and "willResignActive" method pairs for UISceneDelegate and UIApplicationDelegate? - swift

My main task is to overlap the screen with non-transparent view to hide info when app enters background. The official solution is described here.
The problem is it sometimes doesn't work on iOS 13.
I found this article:
It explains how sceneDidBecomeActive(_:) and sceneWillResignActive(_:) work. But new projects have AppDelegate+SceneDelegate, old ones have AppDelegate only. Could I just use applicationDidBecomeActive(_:) and applicationWillResignActive(_:)? Or should I somehow migrate the project to use UISceneDelegate (which is not supported in iOS 12 and earlier versions)?

If you have an app created prior to Xcode 11 then it has no support for scenes. As long as you don't add anything related to scenes (which Apple may disallow in the future), then your app's lifecycle will continue to work under iOS 13 just as it always has under iOS 12 and earlier. Just continue to use the UIApplicationDelegate methods.
If you have an app that supports iOS 12 and iOS 13 and you are using scenes in iOS 13, then you must implement both applicationWillResignActive (in support of iOS 12 and earlier) and sceneWillResignActive (in support of iOS 13 and later).
In fact, in an app that supports both iOS 12 and 13 you basically need to implement both sets of UIApplicationDelegate and UISceneDelegate/UIWindowSceneDelegate methods. The methods of UIApplicationDelegate will be called when your app runs on a device with iOS 12 or earlier and the UISceneDelegate/UIWindowSceneDelegate methods will be called when your app runs on a device with iOS 13 or later.
Just remember that under iOS 13, if you support multiple windows/scenes, the scene delegate methods are associated with a specific scene.

Related

Effect of iOS 7 update on my app

I have an app released on the app store and I am still working on my iOS 7 update. How will the upgrade to iOS 7 affect the version of my app that is already out there? Will the users who have upgraded still be able to use the existing version?
If your app was built with Xcode 4 and the iOS 6 SDK, it will look the same on iOS 7, except for UIAlertViews and UIActionSheets.
If you make an update to your app with Xcode 5 and the iOS 7 SDK, all UI elements will be updated.
Apple hasn't said how much longer you can submit apps using Xcode 4, but it won't be forever.
If your existing app uses any native controls and ui, it will change in the upgraded iOS. So if you have a navigation bar translucent in your current app, it will show up as the iOS 7 navigation bar translucent. If you have Custom buttons, they will stay unchanged. They will still be there.
So my answer is: Depends.
If you have all the native controls, it will be changed to iOS 7 elements.
If you have all the custom controls (custom buttons, backgrounds etc.), it will not be effected.
Try to look into iOS 7 transition guide once its available.
If you mean how will the existing version of your app work on iOS 7, then, the simple answer is: try it!

iOS 7 UI elements

My understanding of iOS 7 was that when it was running on a given device that older applications (complied for iOS 6) that use standard UIControls (UITableView, UINavigationController, etc) would automagically have the iOS 7 look.
I have an app which utilizes a UITabBarController, UINavigationController, a UITableView and some UIButtons, however none of the controls in my app have the iOS 7 look or feel.
My navigation controllers are not translucent or blurred and my back buttons are not words they are still arrow encapsulated.
Am I missing something?
Thanks for your input,
Regards,
John
If you app is compiled for iOS SDK version 6, you'll have the iOS6 components on your app, even if your phone is upgraded to iOS7.
To see the new components in your app you'll have to compile it using iOS SDK version 7, fix the warnings/errors you will find to make it work, and submit it.

Is there any thing need to be change or configure when update iOS 5 to iOS 6 to run existing Xcode app?

I have updated the iOS 5 to iOS 6 . Is there need to change or configure any settings to run existing application on the Xcode ?
Well there are a list of deprecated methods which you should view inorder to run your iOS 5 applications in iOS 6. This is because lower version apps do not run in upper versions.
Here check this link I had provided an answer of deprecated methods before :) .
Does Anyone know which methods are Deprecated in IOS 6.0?
Depends on your application, the best for you would be to go through release notes on apples developer site in order to have look at all what you need to change.
And ya on the whole you will definitely need to work out on the rotation API which has been depreciated in IOS6.
If you're using static libs you should check that they have the armv7s slice, otherwise you should force to armv7 only
Also if you want to support iphone5 you'll have to add a default image name it Default-568h#2x.png
And also check that your view displays correctly on a 4 inch screen, if not try playing with your autoresizing masks before going to handle that directly in the code. Of course if you want to support only ios6 you can check out Auto Layout

Storyboards and nibs compatible?

Can I use storyboards for all of my app, and then have one nib that it pushes to, or is the two being used at the same time not possible?
The storyboards and nibs can go together in one app, but if your deployment target is below iOS 5, then it won't work. The storyboards will only work on iOS 5.x.
And of course, you'd need to write code yourself to push a nib.
WWDC 2011 Videos
Session 309 - Introducing Interface Builder Storyboarding
36:00 API
41:00 Adoption (including incremental adoption)
And, as mentioned, it's iOS 5.x and higher only.

Storyboard in IOS 5 SDK but also target IOS 4 /3?

I love the idea of using storyboards, but unfortunately when I try to test this using IOS 4,
I change the deployment target to IOS 4 and I can't compile this anymore.
it said that Storyboards is not supported for IOS 4.3 or later.
So is it useful to use storyboards?
How can I write iPhone apps using storyboards so that they can be compatible with IOS 4?
I don't think that there's a reasonable way of doing it.
You could instantiate your Storyboards programatically (I think) but then you'd need something to fall back on on pre-iOS5 devices. And what would that be? Probably XIBs... which also continue to work on iOS5. You'd end up implementing everything twice. So, as I say, it may be possible but it's probably not practical.