[Solved] Objective C Send Color to Method [closed]

[ad_1] Method should be something like this, -(void)setColor : (UIColor *)myColor{ myView.backgroundColor = myColor; someView.layer.borderColor = myColor.CGColor //etc } Call this method like, [sel setColor : [UIColor redColor]]; //or whatever color you want to set Hope this will help. 🙂 8 [ad_2] solved Objective C Send Color to Method [closed]

[Solved] Using UIColor with CAShapeLayer

[ad_1] First of all the parameters red,green, blue and alpha must be in range from 0.0 to 1.0 Secondly, you must pass the cgColor to CGLayer, e.g. let color = UIColor(red: 57.0/255.0, green: 65.0/255.0, blue: 101.0/255.0, alpha: 1) shapeLayer.fillColor = color.cgColor shapeLayer.strokeColor = color.cgColor [ad_2] solved Using UIColor with CAShapeLayer