Closed Averethel closed 10 years ago
Hello @clayallsopp I checked your suggestion.
Problem is that in this particular case if I'd do it with on_dismiss lambda argument that I pass as a completion to dismissViewControllerAnimated
in Camera#dismiss
I'd see first the picker disappearing and then the controller that presents a picker which is not exactly the thing we'd like to achieve.
Adding a completion callback is also a good idea though. I'll create another pull request for that.
Sounds good - for clarification, what I suggested should allow you to do the same thing as your PR. ie Camera#dismiss
changes to this:
def dismiss
if @options[:on_dismiss]
@options[:on_dismiss].call(self.picker)
return
end
controller_to_dismiss = self.picker
controller_to_dismiss.dismissViewControllerAnimated(@options[:animated], completion: lambda {})
end
Refactoring done.
Great, thanks!
I feel like
self.picker.presentingViewController.presentingViewController
is too specific for use in most appsperhaps a lambda argument would be possible? ie