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

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 solved Objective C Send Color to Method [closed]

[Solved] Using UIColor with CAShapeLayer

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 solved Using UIColor with CAShapeLayer