2016-08-18 68 views
0
func presentPicker(sender: UIButton) { 
    let vc = LASignPickerViewController(nibName: nil, bundle: nil) 
    let navBar = LANavigationController(rootViewController: vc) 

    presentViewController(navBar, animated: true, completion: nil) 
} 

func dismiss(sender: UIButton) { 
    dismissViewControllerAnimated(true, completion: nil) 
} 

提交作品正常,解雇也一样。 但在解散主视图后,所有视图在1秒后消失。查看的内容在解散后消失

只剩下背景颜色。

Main View Controller

UPDATE

在调试视图层次没事! 和工作 - 幻灯片和按钮触摸。

?????

+0

它的工作原理相同(假,完成:无)? – Sofeda

+0

@SMi,不,但消失更快。 –

+0

你想要这个吗?因为你的问题在1秒后消失。 – Sofeda

回答

0

如果直接dismissViewControllerAnimated调用没有任何对象,它将解雇主视图

所有视图解雇任何视图,你需要编写视图,然后调用dismissViewControllerAnimated方法

像解雇的警报 alert.dismissViewControllerAnimated(true, completion: nil)

0

试试这个

self.dismissViewControllerAnimated(true, completion: nil) 
+0

nop :(第一视图控制器为空 –

+0

你在这里做了什么LANavigationController(rootViewController:vc)? – Sofeda

+0

添加导航控制器到视图 –

0

为了呈现一个视图控制器:

let LASignPickerViewControllerObj= self.storyboard?.instantiateViewControllerWithIdentifier("LASignPickerViewControllerIdentifier") as? LASignPickerViewController 

self.navigationController?.presentViewController(LASignPickerViewControllerObj!, animated: true) 

弹出一个视图控制器:

如果使用dismissViewControllerAnimated
[self dismissViewControllerAnimated:YES completion:nil]; 
+0

推送工作正常,但我需要礼物。 –