我使用的PopupDialog
库,并有一个按钮,拍了拍负载时的弹出如下图所示的代码:如何打开视图控制器时,弹出是开放的 - 迅速3
// Create the dialog
let popup_around_me = AroundMePopUpViewController(nibName: "popup_around_me", bundle: nil)
popup_around_me.gh = self.getJobByLatitude(latitude: marker.position.latitude)
let popup = PopupDialog(viewController: popup_around_me, buttonAlignment: .horizontal, transitionStyle: .bounceDown, gestureDismissal: true)
present(popup, animated: true, completion: nil)
//print("marker.position.latitude: \(marker.position.latitude)")
在我的弹出有是两个打开控制器的按钮。
因为我使用导航栏,我想我应该先关闭弹出窗口然后打开我的控制器。不这样做我的导航栏不加载。
但我不知道这是否是正确的做法。 如果没关系,我该怎么办(关闭弹出窗口并打开控制器)?
我的按钮功能:
func cliclOnContent(tapGestureRecognizer: UITapGestureRecognizer)
{
print("job id: \(self.gh.id)")
//below codes not load my navigation.
// let vc = self.storyboard!.instantiateViewController(withIdentifier: "ContentAJobViewController") as! ContentAJobViewController
// vc.job_id = self.gh.id
// self.navigationController?.pushViewController(vc, animated: true)
// let storyboard = UIStoryboard(name: "Main", bundle: nil)
// let controller = storyboard?.instantiateViewController(withIdentifier: "ContentAJobViewController") as! ContentAJobViewController
// controller.job_id = self.gh.id
// self.present(controller, animated: true, completion: nil)
}
你能提供一个参考(链接)到你正在使用的'PopupDialog'吗? –
https://github.com/Orderella/PopupDialog –
你可以尝试使用'popup.tapButtonWithIndex'来关闭你的弹出窗口吗? –