I am trying to create an extension for UIFont
. But that show error describe below
Method 'fontWithName(_:size:)' with Objective-C selector 'fontWithName:size:' conflicts with previous declaration with the same Objective-C selector
Extension class code:
import UIKit
import Foundation
extension UIFont {
class func fontWithName(fontName: String, size fontSize: CGFloat) -> UIFont {
return UIFont(name: fontName, size: fontSize + 5)!
}
}