Swift UIAlertController推送导航栏项
UIAlewrtController按下我的导航控制器中的按钮(见图) 执行顺序:Swift UIAlertController推送导航栏项,swift,uinavigationbar,uialertcontroller,Swift,Uinavigationbar,Uialertcontroller,UIAlewrtController按下我的导航控制器中的按钮(见图) 执行顺序: 按下+时,警报控制器激活 选择“采取行动”或“请求行动”时,视图控制器ActionDetialsVC被激活 关于显示ActionDetialsVC 在背面,ActionDetialsVC关闭 主控器返回箭头移动 在上放置断点时: self.present(警报、动画:true、完成:nil) 两个警报处理程序中的第一条Swift指令 在这些断点之间可以看到奇怪的导航后退按钮行为 只有在我的视图中引入警报控制器时才
func addPressed(_ sender: Any) {
let alert = UIAlertController (title: "Add an Action", message: nil, preferredStyle: UIAlertControllerStyle.alert)
let request = UIAlertAction (title: actionType.Request.Str(), style: UIAlertActionStyle.default, handler: {
action in
self.actionTypeTemp = actionType.Request.Str()
self.performSegue(withIdentifier: "segueActionDetailsVC", sender: nil)
} )
let take = UIAlertAction (title: actionType.Take.Str(), style: UIAlertActionStyle.default, handler: {
action in
self.actionTypeTemp = actionType.Take.Str()
self.performSegue(withIdentifier: "segueActionDetailsVC", sender: nil)
} )
let done = UIAlertAction (title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil )
alert.addAction(request)
alert.addAction(take)
alert.addAction(done)
self.present (alert, animated: true, completion: nil)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "segueActionDetailsVC" {
if let destination = segue.destination as? ActionDetailsVC {
if let action = sender as? PActions {
destination.actionToEdit = action
}
else {
if actionTypeTemp == actionType.Request.Str() {
destination.relatedContact = self.contact
destination.title = actionType.Request.Str()
}
else {
destination.relatedContact = self.contact
destination.title = actionType.Take.Str()
}
}
}
}
}
我还没有答案,但是我会考虑使用<代码> .ActudioP> <代码>。警报应该用于,嗯,警报我也不认为这是UIAlertController的故障,但实际上是导航栏上搜索栏的实现。注意,箭头似乎位于导航栏的顶部,搜索BAR的底部还没有答案,但是我会考虑使用<代码> .ActudioP> <代码>。警报应该用于,嗯,警报我也不认为这是UIAlertController的故障,但实际上是导航栏上搜索栏的实现。请注意,箭头似乎位于导航栏顶部和搜索栏底部之间的中心