How can I make a UIPickerView like a UIDatePicker?

Posted by iamthepiguy on Stack Overflow See other posts from Stack Overflow or by iamthepiguy
Published on 2012-06-07T10:24:18Z Indexed on 2012/06/07 10:41 UTC
Read the original article Hit count: 222

Filed under:
|
|

I have a custom UIViewController subclass which acts as Datasource and Delegate for a UIPickerView which I would like to serve two different purposes, as each are simple enough, and don't really warrant separate files. One operation must be as a custom picker, and this works fine. However, for the other operation, I want it to act just like a UIDatePicker.

The problem is, UIDatePicker is a subclass of UIControl, not UIPickerView. Is there any sort of enum value I can set in a method (or other way) that will set the UIPickerView to act as a date picker? Or do I have to make two completely different classes and use them differently (pain in the ass)?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about ios5