I have a view controller where a UISwitch is used to enable resp. disable a UISlider:
class ViewController: UIViewController {
...
@IBOutlet weak var slider: UISlider!
@IBAction func doToggle(_ sender: UISwitch) {
slider.isEnabled = sender.isOn
}
...
}
When doToggle is executed and slider.isEnabled is set to false the slider cannot be moved anymore which is expected behavior. Unexpectedly though, any blue color left to the knob remains unchanged and the slider looks as if it were still enabled.
I can only force the color change by adding an explicit call to setNeedsLayout().
@IBAction func doToggle(_ sender: UISwitch) {
slider.isEnabled = sender.isOn
slider.setNeedsLayout()
}
I am now wondering whether this a bug. Note that enabling / disabling a UIButton immediately also gives visual feedback that the button is enabled resp. disabled and there is no need to call setNeedsLayout().
Any insights are highly appreciated.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm running Monterey 12.6 on Intel and suddenly I get in Software Update the message "An update is available for your Mac - Command Line Tools beta 3 for Xcode 14.1" although I do not have installed any Xcode 14.1 beta version on this Mac.
Two questions:
Does anyone know why this is happening in the first place?
Should I ignore this update or is it safe to proceed?
The documentation for NSString.localizedUserNotificationString(forKey:arguments:) says that “If a string resource corresponding to the specified key cannot be found, the returned string is empty.”. In reality however it appears that the “forKey” parameter is returned in such a case and not an empty string. This behavior is actually the useful behavior. Am I missing something?
I am struggling to change the tint of the back button in an UINavigationItem. In iOS 18.6 it looks like this
while on iOS 26 the same looks like this
I can live without the Dictionary but I'd like to get the blue color back.
In viewDidLoad() I have tried
navigationItem.backBarButtonItem?.tintColor = .link
but this did not work since navigationItem.backBarButtonItem is nil. My second attempt was
navigationController?.navigationBar.tintColor = .link
but this didn't work either.
I have even set the Global Tint to Link Color
but this had no effect either.
Does anyone have an idea how to change the tint of the back button in an UINavigationItem on iOS 26?