I am trying to add a gradient background to my picker in the same way that I have added a gradient background to my VC.
When I do this via the code below, the gradient is added but the text disappears from view. Although the picker still behaves as if the text is there.
My guess is it's something to do with the .insertSublayer
placing the gradient background over the top off the text.
override func viewDidLoad() {
let background = CAGradientLayer().bespokeColor()
background.frame = self.view.bounds
self.view.layer.insertSublayer(background, at: 0)
let pickerBackground = CAGradientLayer().bespokeColor()
pickerBackground.frame = self.Picker.bounds
self.Picker.layer.insertSublayer(pickerBackground, at: 0)
}
How do I get around this?