iOS 13: Segmented Controller background color issue
While upgrading an app to iOS 13, I encountered weird issue with segmented controller. Setting white as background color for segmented controller wasn’t working. Sadly making changes on storyboard didn’t fix my issue. Segmented controller still had gray background color which is actually background image set by iOS. You will face with this issue if you are trying to set light color as background color.
To solve this issue, i written an extension to create an image with desired color:
To change background color:
If you want to change selected/unselected text color as well:
Edit:
I found another way to implement this: creating extension for segmented controller so all segmented controllers can have same ability. Here is the code:
Happy coding!!