lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

51112884: viewDidLoad of UISplitViewController in second tab called after applicationDidEnterBackground #21279

Open openradar-mirror opened 5 years ago

openradar-mirror commented 5 years ago

Description

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

- Product Version: Created: 2019-05-24T18:02:44.554593 Originated: 2019-05-24T00:00:00 Open Radar Link: http://www.openradar.me/51112884