Swift 自定义返回按钮

let leftBarBtn = UIBarButtonItem(title: "", style: .plain, target: self,action: #selector(backToPrevious))
        leftBarBtn.image = UIImage(named: "arrow--return")
        self.navigationItem.leftBarButtonItem = leftBarBtn;

实现方法

//返回按钮
    func backToPrevious(){
        self.navigationController?.popViewController(animated: true);
    }

你可能感兴趣的:(Swift 自定义返回按钮)