Re: Rotary knob with table-like momentum

2017-01-23 Thread Jens Alfke

> On Jan 22, 2017, at 6:27 PM, Eric Dolecki  wrote:
> 
> Does anyone have a control (knob) that you can turn with a horizontal swipe, 
> but snaps to detents.

Check on https://www.cocoacontrols.com  … they 
have links to thousands of iOS (and macOS) open-source controls and views. If 
there isn’t something exactly right, there may be a similar control you can 
fork and adapt.

(I’m guessing the momentum feature won’t be common, because these rotary 
controls are often used for making precise adjustments to things like audio 
effects, where the user would not appreciate it if the control kept moving 
after they let go of it.)

—Jens
___

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

Re: Rotary knob with table-like momentum

2017-01-23 Thread Eric E. Dolecki
Thanks for the project. It doesn't contain momentum or rubber-banding
though. Right now I have tapping on the left or right to + or - the
value and animates the knob. You can also kind of throw it - I translate
velocity to a number of steps to move, and it animates appropriately (with
no rubber-banding). I don't have smooth scrolling on a slow uipangesture.
Hmm.

On Sun, Jan 22, 2017 at 11:49 PM Graham Cox  wrote:

>
> > On 23 Jan 2017, at 1:27 PM, Eric Dolecki  wrote:
> >
> > Hey all,
> > Does anyone have a control (knob) that you can turn with a horizontal
> swipe, but snaps to detents.
>
>
> I’m attaching a project I made for Mac a while back that does this sort of
> thing.
>
> It’ll need adapting to iOS, but shouldn’t be too hard. Hope you find it
> useful.
>
> —Graham
>
>
___

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

Re: Rotary knob with table-like momentum

2017-01-22 Thread Quincey Morris
On Jan 22, 2017, at 18:27 , Eric Dolecki  wrote:
> 
> Does anyone have a control (knob) that you can turn with a horizontal swipe, 
> but snaps to detents. It doesn't travel 360 degrees, but you can throw it and 
> it rubber bands at its minimum or maximum detent values. I can't seem to get 
> my head around getting all of it and I'm frustrated. An example range would 
> be 0-15 with 8 degrees between each detent value. So throw, slow turning, 
> both with snapping to avoid value (always an Int).
> The knob will be quite large so the snapping will make sense. 

The snapping behavior seems like an independent problem — once you’ve decided 
where the continuous motion would end, you can apply the snapping decision.

The throwing part probably requires knowing the acceleration of the finger 
movement, and I don’t think there’s any existing API that will give this to 
you. You would have to track the touches as reported to you over time, using 
the positional differences to estimate a velocity, and using velocity 
differences to estimate an acceleration, and then apply a heuristic to decide 
whether an acceleration exceeds a threshold for recognition as a “throw”.

However, given that your range of values is small (the table-view throwing has 
to deal with both short and long tables), you might be able to get away with a 
UIPanGestureRecognizer, if you aren’t going to require circular motion of the 
touches. It reports the velocity of the gesture, and you could try using a 
velocity threshold instead of an acceleration threshold — a fast movement 
throws to the extreme values, a slower movement tracks the finger — perhaps in 
conjunction with a minimum distance requirement.

Circular rubber banding is likely something you’re going to have to invent for 
yourself. You’re probably going to have to look up a formula for spring 
dampening to get it to look natural, and implement a custom animation timing 
curve.

___

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

Rotary knob with table-like momentum

2017-01-22 Thread Eric Dolecki
Hey all,
Does anyone have a control (knob) that you can turn with a horizontal swipe, 
but snaps to detents. It doesn't travel 360 degrees, but you can throw it and 
it rubber bands at its minimum or maximum detent values. I can't seem to get my 
head around getting all of it and I'm frustrated. An example range would be 
0-15 with 8 degrees between each detent value. So throw, slow turning, both 
with snapping to avoid value (always an Int).
The knob will be quite large so the snapping will make sense. 
Even a stupid just rotating UIView box with the behavior example would be much, 
much appreciated!!! Doing this in Swift FYI. 
Eric

Get Outlook for iOS
___

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