I'm getting the following error on my circleLayer.strokeEnd line: "Instance member 'sales' cannot be used on type 'ViewController'." Does anyone know why I can't divide an Int by another Int and use it here? (Before this, I had 1.0 in place of "(sales/salesGoal)" and it worked great). This is a very simplified version of the code I'm using.
var sales = 0
var salesGoal = 2
class salesCircleView: UIView {
override init(frame: CGRect) {
circleLayer.strokeEnd = (sales/salesGoal)
}
}
Any help figuring out the correct syntax would be helpful. Thanks!
sales
andsalesGoal
as well as where in the View Controller you try to access them. Also, note that if these variables are declared in the class View Controller they cannot be accessed in a different class (well not without a little work). – Ike10 Jun 21 at 0:17