I'm currently using "EmptyDataSet_Swift" in my app to handle empty states, but I can't figure out how to use the buttonTitle Function appropriately in order to change the color of the button. Here's a reference to it:
/// Asks the data source for the title to be used for the specified button state.
/// The dataset uses a fixed font style by default, if no attributes are set. If you want a different font style, return a attributed string.
func buttonTitle(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> NSAttributedString?
What I've been able to do is change the title of the text, but when I change the foreground color, I receive an error. Here's my code:
func buttonTitle(forEmptyDataSet scrollView: UIScrollView, for state: UIControl.State) -> NSAttributedString? {
let buttonTitle = "Add a Project"
let buttonTitleAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont(name: "HelveticaNeue-Bold", size: 14),
.foregroundColor: UIColor.green.cgColor
]
let attributedButtonTitle = NSAttributedString(string: buttonTitle, attributes: buttonTitleAttributes)
return attributedButtonTitle
}
and here's a screenshot of the error I receive:

EmptyDataSet_Swift: https://github.com/Xiaoye220/EmptyDataSet-Swift