SwiftUI:按钮不可点击

我在ViewController中有一个子子视图,名为menuHostingController,但是其按钮不可单击。 “菜单”是swiftUI结构。此结构已经在按钮中包含操作,并且一直起作用,直到我将Menu添加为子视图为止。怎么了?先感谢您。

var menuHostingController: UIHostingController<Menu>! 
var isMove = false

func configureMenuHostingController() {

        if menuHostingController == nil {
            menuHostingController = UIHostingController(rootView: Menu())
            view.addSubview(menuHostingController.view)
            addChild(menuHostingController)

            menuHostingController.view.translatesAutoresizingMaskIntoConstraints = false
            NSLayoutConstraint.activate([
                ...//constraints
            ])
        }
    }

func showMenuHostingController(shouldMove: Bool) {

        if shouldMove {
            // show menu
            UIView.animate(withDuration: 0.5,delay: 0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0, options: .curveEaseIn, animations: {
                self.view.frame.origin.x = self.view.frame.width - 140
            })

        } else {
            // disable menu
            UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: .curveEaseOut, animations: {
                self.view.frame.origin.x = 0
            })
        }
    }

@objc func toggleMenu() {
        configureMenuHostingController()
        isMove = !isMove
        showMenuHostingController(shouldMove: isMove)
    }

image