我使用的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'來關閉你的彈出窗口嗎? –