viewDidLoad of UISplitViewController in second tab called after applicationDidEnterBackground

Originator:daniel.kloeck
Number:rdar://51112884 Date Originated:24.05.2019
Status:Open Resolved:
Product:iOS + SDK Product Version:
Classification: Reproducible:Always
 
The attachment can be found here: https://github.com/dkk/splitView_in_tabBar_BUG_EXAMPLE

Area:
UIKit

Summary:
Starting from a project that is the template of the "Tabbed App", with a UISplitViewController as the second tab.

When you enter the app, the first tab will be shown. When you click on the home button, moving the app to the background state, the second tab's viewDidLoad gets called.

you will find an example project attached


Steps to Reproduce:
1. Download the app from the attachment
2. Compile using a simulator with model "iPad Pro (9.7-inch)" and iOS version "12.2"
3. Start the app. You should see "FirstViewController loaded" in the console
4. Press the home button. You will see following output:
```
applicationDidEnterBackground(_:)
SecondViewController viewDidLoad called
```
which means that the app has moved to the background and then the second view controller was loaded


Expected Results:
when you press the home button, the second tab's view should not get loaded and the output should be:
```
applicationDidEnterBackground(_:)
```

Actual Results:
when you press the home button, the second tab's view gets loaded and the output is:
```
applicationDidEnterBackground(_:)
SecondViewController viewDidLoad called
```


Version/Build: all I tried, which were:
iPad model MK9N2FD/A
iOS 12.1.4 (16D57)
--
Simulator iPad Pro (9.7 inch)
iOS 12.2


Configuration:
Not relevant

Comments

Response by Apple Developer Relations

This issue behaves as intended.

We are now closing this bug report.

If you have questions about the resolution, or if this is still a critical issue for you, then please update your bug report with that information.

Please be sure to regularly check new Apple releases for any updates that might affect this issue.

By daniel.kloeck at May 29, 2019, 3:27 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!