I have a person.3.fill button in the top right corner of my iOS app’s navigation bar, which sometimes appears greyed out as if it has been clicked. The button remains clickable at all times, but the greyed-out appearance happens randomly and looks odd.
Here is a simplified version of my viewDidLoad method:
[![override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor { traitCollection in
switch traitCollection.userInterfaceStyle {
case .dark:
return UIColor(hex: "#021E24")
default:
return .white
}
}
title = "Test App"
navigationItem.leftBarButtonItem = UIBarButtonItem(
image: UIImage(systemName: "line.3.horizontal"),
style: .plain,
target: self,
action: #selector(hamburgerMenuTapped)
)
navigationItem.rightBarButtonItem = UIBarButtonItem(
image: UIImage(systemName: "person.3.fill"),
style: .plain,
target: self,
action: #selector(socialButtonTapped)
)
}
@objc func socialButtonTapped() {
let storeVC = LeaderboardsViewController()
navigationController?.pushViewController(storeVC, animated: true)
}
@objc func hamburgerMenuTapped() {
if isSideMenuOpen {
closeSideMenu()
} else {
openSideMenu()
}
}][1]][1]
Has anyone experienced this issue before? Any ideas on what might be causing this random greying out and how to fix it?
Additional Info:
The button works fine functionality-wise.
The issue is with the visual appearance only.
Thanks in advance for any help!