I am facing an issue on iOS 13 where the UIBarButton
icon does not change when I switch the iOS theme.
I have created two sets of images for dark and light themes and added them to xcassets as shown in the image below.
When I change the theme, the image of that theme doesn't reflect but if I tap on it then it changes.
Steps and screen recording.
- Open VC1 in dark mode
- Switch to light (icon should have black border)
- Switch to dark (no change in icon)
- Change to light (no change in icon)
- Tap on icon, segue to VC2
- VC2 shows its bar button with correct theme icon with black border
- Tap on VC2 bar button
- VC1 shows correct theme icon with black border
I tried creating new bar button and assign same icon without a segue. Icon doesn't change neither when theme changes not when i tap it.
below is screen recording.
What could be the reason?