i want to extend UIColor. But when i call the method then i get error. Here how i extend
and how i call it
but here it wants me to enter a parameter.
Am i doing something wrong ?
Code:
import Foundation
import UIKit
extension UIColor {
func theMainColor() -> UIColor {
return UIColor(red: 224, green: 0, blue: 30, alpha: 1.0)
}
}
and how i call it
Code:
self.view.backgroundColor = UIColor.theMainColor()
but here it wants me to enter a parameter.
Am i doing something wrong ?