On Jan 18, 2017, at 12:55 , Eric E. Dolecki <edole...@gmail.com> wrote:
> 
> When one swipes, it will rotate the control and change the value. I'm just
> trying to get the drawing correct. Should the dial be a UIView with its
> layer cornerRadius set so it's round, and then create a shape layer with my
> path and then add that to the dial's sublayer?

You’re trying to address a number of separate issues promiscuously, and that’s 
making a fairly straightforward task seem harder.

— You need a custom UIView, and normally that’s going to be rectangular. (The 
shape of the UIView itself is only an issue if hit testing is an issue.)

— You draw the view’s contents in its “draw(_:)” or “-[drawRect:]” method, 
according to the language.

— In your draw method, you construct a UIBezier path, and then stroke that path 
to make it visible. In your example code, you wouldn't want to fill the path.

— You need to add any needed behavior for touching or manipulating the view, 
when appropriate. This might be done with gesture recognizers, or by overriding 
the “touchesBegan” family of UIResponder methods.

That’s it.

Everything else you might do (non-rectangular view, using CoreAnimation, etc) 
is a refinement you can come back to, if you’re not satisfied by the way the 
simplistic view appears or behaves.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to