How to access extension of UIColor in Swift?

后端 未结 9 1509
猫巷女王i
猫巷女王i 2020-12-10 01:15

I am very new to swift and trying to create an extension of UIColor class as

extension UIColor{

    func getCustomBlueColor() -> UIColor {
        retur         


        
9条回答
  •  悲哀的现实
    2020-12-10 02:11

    Get the this extension for customize type UIView

    extension UIColor {
        // Method returns a custom color
        static func rgb(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor {
            return .init(red: blue / 255, green: green / 255, blue: blue / 255, alpha: 1.0)
        }
    }
    

提交回复
热议问题