Check your user control, I tried to bring it as close as possible to the design of the Activity application, and everything is configured.
https://github.com/maxkonovalov/MKRingProgressView
The basic idea of the algorithm is quite simple.
:

Photoshop . : https://github.com/maxkonovalov/MKGradientView.

CGContextSaveGState(ctx)
CGContextAddPath(ctx, arcPath)
CGContextClip(ctx)
CGContextDrawImage(ctx, gradientRect, gradientImage)
CGContextRestoreGState(ctx)
:

, .
CGContextSetShadow(ctx, offset, shadowRadius)
CGContextAddPath(ctx, shadowPath)
CGContextSetFillColorWithColor(ctx, shadowColor)
CGContextFillPath(ctx)

CGContextSaveGState(ctx)
CGContextAddPath(ctx, circlePath)
CGContextClip(ctx)
CGContextRestoreGState(ctx)
:
