I had been using following code to change text color of items which I add in UIActionSheet.:
- (void)willPresentActionSheet:(UIActionSheet *)act
I have same task and I've made this hack today, dirty, but it works
class CustomAlertViewController: UIAlertController {
internal var cancelText: String?
private var font: UIFont? = UIFont(name: "MuseoSansCyrl-500", size: 12)
override func viewDidLoad() {
super.viewDidLoad()
self.view.tintColor = UIColor.blackColor()
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
self.findLabel(self.view) //if you need ios 9 only, this can be made in viewWillAppear
}
func findLabel(scanView: UIView!) {
if (scanView.subviews.count > 0) {
for subview in scanView.subviews {
if let label: UILabel = subview as? UILabel {
if (self.cancelText != nil && label.text == self.cancelText!) {
dispatch_async(dispatch_get_main_queue(),{
label.textColor = UIColor.redColor() //for ios 8.x
label.tintColor = UIColor.redColor() //for ios 9.x
})
}
if (self.font != nil) {
label.font = self.font
}
}
self.findLabel(subview)
}
}
}
}