mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Addressed PR comments
Moved the 'backBarButtonItem' into the BaseVC (and removed it for being duplicated in various view controllers) Removed a redundant line of code
This commit is contained in:
parent
b077061714
commit
110c7bb01a
|
@ -466,11 +466,6 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|||
// MARK: Updating
|
||||
|
||||
func updateNavBarButtons() {
|
||||
// Back button (to appear on pushed screen)
|
||||
let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
||||
backButton.tintColor = Colors.text
|
||||
navigationItem.backBarButtonItem = backButton
|
||||
|
||||
navigationItem.hidesBackButton = isShowingSearchUI
|
||||
|
||||
if isShowingSearchUI {
|
||||
|
@ -478,7 +473,6 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
|
|||
navigationItem.rightBarButtonItems = []
|
||||
}
|
||||
else {
|
||||
navigationItem.hidesBackButton = false
|
||||
navigationItem.leftBarButtonItem = UIViewController.createOWSBackButton(withTarget: self, selector: #selector(handleBackPressed))
|
||||
|
||||
if let contactThread: TSContactThread = thread as? TSContactThread {
|
||||
|
|
|
@ -394,11 +394,6 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, NewConv
|
|||
pathStatusView.pin(.trailing, to: .trailing, of: profilePictureViewContainer)
|
||||
pathStatusView.pin(.bottom, to: .bottom, of: profilePictureViewContainer)
|
||||
|
||||
// Back button (to appear on pushed screen)
|
||||
let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
||||
backButton.tintColor = Colors.text
|
||||
navigationItem.backBarButtonItem = backButton
|
||||
|
||||
// Left bar button item
|
||||
let leftBarButtonItem = UIBarButtonItem(customView: profilePictureViewContainer)
|
||||
leftBarButtonItem.accessibilityLabel = "Settings button"
|
||||
|
|
|
@ -139,9 +139,6 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate {
|
|||
setUpNavBarStyle()
|
||||
setNavBarTitle(NSLocalizedString("vc_settings_title", comment: ""))
|
||||
// Navigation bar buttons
|
||||
let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
||||
backButton.tintColor = Colors.text
|
||||
navigationItem.backBarButtonItem = backButton
|
||||
updateNavigationBarButtons()
|
||||
// Profile picture view
|
||||
let profilePictureTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(showEditProfilePictureUI))
|
||||
|
|
|
@ -46,6 +46,7 @@ class BaseVC : UIViewController {
|
|||
|
||||
internal func setUpNavBarStyle() {
|
||||
guard let navigationBar = navigationController?.navigationBar else { return }
|
||||
|
||||
if #available(iOS 15.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
|
@ -59,6 +60,11 @@ class BaseVC : UIViewController {
|
|||
navigationBar.isTranslucent = false
|
||||
navigationBar.barTintColor = Colors.navigationBarBackground
|
||||
}
|
||||
|
||||
// Back button (to appear on pushed screen)
|
||||
let backButton = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil)
|
||||
backButton.tintColor = Colors.text
|
||||
navigationItem.backBarButtonItem = backButton
|
||||
}
|
||||
|
||||
internal func setNavBarTitle(_ title: String, customFontSize: CGFloat? = nil) {
|
||||
|
|
Loading…
Reference in a new issue