BigZaphod/Chameleon

UISwitch unimplemented

robertchin opened this issue · 4 comments

UISwitch is not implemented. Do you want to use my implementation of RCSwitch? If you pull in some of my classes, you can create a UISwitch subclass of RCSwitchOnOff, and it should work pretty well.

https://github.com/robertchin/rcswitch/blob/master/Classes/RCSwitchOnOff.m

Here's another implementation of UISwitch, we should compare and decide for the best one.

https://github.com/samsoffes/sstoolkit/blob/master/SSToolkit/SSSwitch.h

I'll probably get attacked for saying this...but should UISwitch to fall through to a checkbox? Switches really shouldn't be used on OS X unless they control a background process or large service (see: Time Machine, and Server Preferences). Checkboxes are the native way to control boolean values, and making your preferences in an OS X app with switches would make it feel ported.

Hmm, that's more of a approach thing. I guess there is space for both options, some people will prefer a more complete port, others a simple checkbox. I'd aim for maximum portability, and would add a checkbox-wrapper als one of the AppKit-Extensions.

UINSCellControl was recently added so that AppKit NSCells (such as checkbox) could be used directly if so desired. I think we should implement UISwitch as it is in iOS. Applications wishing to use a more native look for switches could do things another way (in Twitterrific, we went with an all-native prefs window) or use the NSCell wrapper. Additionally, Facetime for OS X uses on/off switches in its preferences UI so even Apple is trying them out on the desktop.