Signal-iOS/SignalUI/ViewControllers/Recipient Picker/RecipientPickerContainerViewController.swift
Max Radermacher 1ea74d9266 Fix recipient picker nav bar when theme changes
On iOS 16, the nav bar itself is transparent, so the container view
controller’s background is visible. The color of that view wasn’t being
updated, which resulted in the nav bar appearing the wrong color.

A few view controllers worked around this by manually updating just the
background color to the same value used by the table view. It seems
cleaner to re-apply the overall styling when the theme changes.
2022-10-19 13:20:00 -07:00

32 lines
815 B
Swift

//
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import Foundation
open class RecipientPickerContainerViewController: OWSViewController {
public let recipientPicker = RecipientPickerViewController()
private var didApplyTheme = false
public override func applyTheme() {
super.applyTheme()
if didApplyTheme {
recipientPicker.applyTheme(to: self)
}
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
recipientPicker.applyTheme(to: self)
didApplyTheme = true
}
public override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
recipientPicker.removeTheme(from: self)
didApplyTheme = false
}
}