When I try presenting the modal controller right from the table view controller (could be a normal view controller as well), it appears behind the tab bar and looks quite ugly as I'm using a blur effect on it. I am using a navigation controller because I need to have a bar at the top and, after research, found that's the best way to do it.
I have found that doing something like:
self.parent?.parent?.present(ModelViewController(), animated: true, completion: nil)
when wanting to present the modal controller works. However, I imagine this isn't very safe. What is the correct way of doing this?
答案 0 :(得分:0)
为了让ModalViewController显示在标签栏前面,其modalPresentationStyle
必须设置为overFullScreen
。因此,例如在初始化ModalViewController时:
self.modalPresentationStyle = .overFullScreen
(Swift 3语法)