3

I have a UIWebView and I'd like to use the internal datepicker on iOS that is used when I have the <input type=date> tag.

I have some UIViews in iOS that I want to modify based on if that input changes.

How do I detect this change? I'm hoping there is a delegate I can use but based on my research, that doesn't seem possible.

David Ansermot
  • 6,052
  • 8
  • 47
  • 82

2 Answers2

2

If I understand you correctly, you want to catch datepicker value changed event? If it is, you can simply create IBAction method and connect it to datepicker valueChanged event in interface builder.

  • I don't think this works for UIWebViews. How do you get an IBAction for a datepicker that doesn't exist yet? It won't exist until you click on an input field in the UIWebView. – Raymond Array Wang Oct 01 '14 at 07:14
  • after showing datepicker call [picker addTarget:self action:@selector(dofreakysheet) forControlEvents:UIControlEventValueChanged] – Dmitry Vorobyov Oct 01 '14 at 08:18
2

This may can help you

Invoke native date picker from web-app on iOS/Android

There are some plugins that simulates the uidatepicker style in javascript.

Community
  • 1
  • 1
Mikel Sanchez
  • 2,870
  • 1
  • 20
  • 28