I'm currently trying to override the systemFontOfSize method of UIFont to return my custom font with the given font size. My code currently looks like this:
extension UIFont
{
class func systemFontOfSize(fontSize: CGFloat) -> UIFont
{
return UIFont(name: "HelveticaNeue", size: 10)!
}
}
However, I am unable to override that method. When using the code shown above, I get the following error:
"Method 'systemFontOfSize' with Objective-C selector 'systemFontOfSize:' conflicts with previous declaration with the same Objective-C selector"
When adding override, the error is that the method is not overriding anything. Does anyone know how to fix this issue?