kevin-lyn/STPopup

Cannot present the view controller inside the popup modally.

Closed this issue · 5 comments

Ok so within the popup, I want to modally present a view controller. The popup just disappears instead.

Actually scratch that. It presents it full screen (i had the background color of the presented vc as clear so it looked as if the popup just disappeared out nowhere), but I want it to present modally within the popup.

Actually it's not able to present a view controller within a popup.
Can you show me the code you use to present view controller?

Yes sir.
func addTag() {
let tagController = TagSearchController()
self.present(viewControllerToPresent: tagController, animated:true)
}

That method was a target method from a button inside your beloved popup. It just seems to present it modally from the full screen. Would be nice to have it inside the popup!

Use present(viewControllerToPresent:aniamted) to present full screen view modally is expected behavior.
If you wish to show a view inside the popup, I would recommend you to use popupController.pushViewController(_:animated) instead. Just make sure "contentSizeInPopup" of TagSearchController is set before it's pushed to popupController.

Good suggestion. Probably looks better that way.