4

This walkthrough for MT.D shows a back button on the UIDatePicker that appears when a DateElement is tapped. I'm in an iPad app, and using an MT.D DialogViewController as a subview in an overall UIView. When the date picker slides up I just get the black background with no way to dismiss the picker (no nav bar w/ back button). Same problem exists for the radio group picker. Is this because the dialog view controller is being used as a subview? Any ideas how I might get a nav bar up with a back button using the built-in picker logic?

DennisWelu
  • 788
  • 13
  • 26

1 Answers1

1

You must use the DialogViewController as a child element of a UINavigationController to get the back button. On iPad, you can embed the UINavigationController in a UIPopoverController. Adding the view of a controller into the view of another controller is not considered good design on iOS and won't result in the behavior you expect.

Krumelur
  • 32,180
  • 27
  • 124
  • 263
  • What you say makes sense based on what I'm seeing. And I understand also about the option to embed it in a popover controller. But it seems limiting that you can't embed a DVC type view as a subview, since from the outside looking in its "like" a UITableView which can be embedded. But yeah the controller has all the fancy logic for dealing with the declarative-based view creation I'm sure. Thanks for the info! – DennisWelu Nov 13 '12 at 20:27