Krumelur
Krumelur

Reputation: 33068

MonoTouch.Dialog: embed view of another UIViewController into a ViewElement?

I have a view controller that manages a four digit PIN pad. This controller is used to access my app.

However, I would like to use the same PIN pad when changing the PIN. The controller to change the PIN is a MT.DialogViewController with one section and one row, namely a ViewElement. That ViewElement holds the view of the PIN pad controller. This kind of works, but ViewWillAppear etc aren't called reliably. I have also tried to use UIViewController containment by calling (in the MT.Dialog c'tor) addChildViewController, then add the ViewElement and then call didMoveToParentViewController. Still, I'm getting problems upon rotation and the VieWill/Did*() methods aren't called. Is there a solution for this (either clean or dirty, I don't care)?

Upvotes: 0

Views: 158

Answers (1)

benhorgen
benhorgen

Reputation: 1975

Can you re-factor the PIN pad from a ViewController to a UIView (and then stick the UIView containing the PIN pad back into the UIViewController)?

Doing so should let you put the PIN pad UIView inside a ViewElement, which I suspect will result in improved rendering on Orientation changes and consistent ViewDid/Will method calls.

Upvotes: 1

Related Questions