Skip to content

BrowserViewController view hierarchy

Sophie edited this page Nov 3, 2026 · 1 revision

BrowserViewController is the central view controller that ties down a good chunk of our UI elements on screen. There’s one BrowserViewController per UIWindow. This means unless you’re on iPad, there’s only one BrowserViewController.

image

BrowserViewController view hierarchy (source)

BrowserViewController

Since the BrowserViewController is always in the view hierarchy, we cannot rely on its view controller life cycle methods (such as viewWillAppear, viewWillDisappear and so on). It’s the ContentContainer that swaps it’s content to show either the homepage or the web view. Note that the web view is always kept in the view hierarchy as it doesn’t render properly otherwise (IMO this should be investigated at some point in time to determine if there’s a workaround there, this is just historical knowledge and not a solid conclusion at this point in time).

Homepage

The homepage should always be removed and added back to the view hierarchy, as we can’t otherwise rely on the view controller life cycle methods (such as viewWillAppear, viewWillDisappear and so on). Historically, there was a point in time before coordinators where we couldn’t rely on the homepage lifecycle methods, and it was very painful to manage the view life cycle manually.

Clone this wiki locally