On watchOS I draw a circle using the following code:
// Create a graphics context
UIGraphicsBeginImageContext(CGSize.init(width: 18.0, height: 18.0))
let context = UIGraphicsGetCurrentContext()
// Draw a circle
let rect = CGRect.init(x: 1.0, y: 1.0, width: 16.0, height: 16.0)
let border = UIBezierPath(ovalIn: rect)
border.lineWidth = 1.0
UIColor.white.setStroke()
border.stroke()
// Convert to UIImage
let cgimage = context!.makeImage();
let uiimage = UIImage(cgImage: cgimage!)
// End the graphics context
UIGraphicsEndImageContext()
The circle is drawn, but it looks ugly, as if there were a Moire pattern, see picture, left of the "XX" text:
It should be possible to avoid this pattern and draw a clean circle, since the time is also displayed clearly. But how?