Swift学习笔记(四):绑定点击方法

80 阅读1分钟

绑定点击方法

let tap = UITapGestureRecognizer(target: self, action: #selector(gotoGoodsDetail))

view.addGestureRecognizer(tap)


@objc func gotoGoodsDetail() {

        let vc = GoodsDetailViewController()

        vc.goodsId = goodsId

        vc.hidesBottomBarWhenPushed = true

        navigationController?.pushViewController(vc, animated: true)

    }