I'm trying to create a circle using CGPoint and CGFloat. But I want the circle to be different in siz based on which device is used. I changed all my Size classes to reflect the sizes I want and I was hoping, it would recognise that but it doesn't.
WhiteBar is a UIView within my main view that I created using SB and to test that my view is changed in the size class, I set a background color and saw its set as I want it
my print line shows me the smallest width and height
@IBOutlet var WhiteBar: UIView!
var WhiteCircle = CAShapeLayer()
WhiteCircle.strokeColor = UIColor.whiteColor().CGColor
WhiteCircle.fillColor = UIColor.clearColor().CGColor
WhiteCircle.lineWidth = 15
WhiteCircle.strokeStart = 0
WhiteCircle.strokeEnd = 1
let WhiteCenterPoint = CGPoint (x: WhiteBar.bounds.width / 2, y: WhiteBar.bounds.height / 2)
let WhiteCircleRadius : CGFloat = (WhiteBar.bounds.height / 2 - WhiteCircle.lineWidth / 2)
println(WhiteBar.bounds.width) // outputs the smallest size of all my size classes
println(WhiteBar.bounds.height) // outputs the smallest size of all my size classes
var WhiteCirclePath = UIBezierPath(arcCenter: WhiteCenterPoint, radius: WhiteCircleRadius, startAngle: CGFloat(-0.5 * M_PI), endAngle: CGFloat(1.5 * M_PI), clockwise: true)
WhiteCircle.path = WhiteCirclePath.CGPath
WhiteBar.layoutIfNeeded()
WhiteBar.layer.addSublayer(WhiteCircle)
EDIT: It seems the size is set based on the w: Any h: Any size class.
Thanks in advance, Ace