Show UIDatePicker inside UIPopoverController after rejecting UIKeyboard

I pull my hair out with this.

I have a table inside a popover that allows the user to edit some data. In most of these editable cells, the user needs to enter data from the keyboard, but a UIDatePicker is required. When a UIDatePicker is provided to the user, it moves from the bottom of the pop-up window, capturing the size of the view and performing the animation. However, if this happens after the keyboard is fired, the size of the view will be captured before the popover is reset to return to its original position (i.e., when the popover resizes to normal after being "crushed" at the top of the screen). This leaves the UIDatePicker halfway up the popover.

I tried to add a delay and use UIKeyboardWillHideNotification, but I cannot get this to work.

How can I wait for a popover to complete resizing before grabbing the size of the view and performing the animation?

Update 1

I succeeded, but I will send an answer here only if someone else wants it. Basically, I created the CGRect variable, which is populated with the boundaries of the views when loading the view. Then, instead of capturing the boundaries of the view every time I want to animate a UIDatePicker, I just use the CGRect variable instead.

Update 2

, . , , - popover , (.. ). , , . , popover, , .

?

+3
1

.

popover, , popover, . , - . .

+2

All Articles