How to create an iOS Time Picker programmatically?

Miles Works picture Miles Works · Jul 18, 2013 · Viewed 12k times · Source

I have a tiny little problem.

I'd like to implement the time picker like:

http://i.stack.imgur.com/G7ja3.png

This screen grab is from iOS 6's day notifications of DO NOT DISTURB

My question is how to do it ?

Any ideas ????

Are there any tutorials/resources online that you folks could suggest as how to do this ?

[edited] I should have mentioned that this for an iPhone not an iPad....

Thanks.

Answer

CaptJak picture CaptJak · Jul 18, 2013

Yes.

Just create another view controller with the Time/DatePicker and whatever else you want in it. Use a modal Popover segue connected to your button and use the fixed size option to set the correct size that you want.

Good example here.

Let me know if you need more data.