问题描述
我想将SwRevealViewController SideMenu单击按钮更改为此按钮,然后再次按下该按钮恢复为正常.怎么可能?我应该在哪里更改SwRevealViewController.m文件中的代码?
I would like to change the SwRevealViewController SideMenu click button to this when I click it and back to normal on pressing it again.How is it possible?Where Should I change the code in SwRevealViewController.m file?
推荐答案
//查看是否加载了此内容
//Swift 4.2
//View Did load add this
// Swift 4.2
func viewDidLoad(){
func viewDidLoad() {
super.viewDidLoad()让leftMenuItem = UIBarButtonItem(image:UIImage(named:"menu"),样式:.plain,目标:recoverViewController,操作:#selector(SWRevealViewController.revealToggle(_ :)))navigationItem.setLeftBarButton(leftMenuItem,animation:true)
super.viewDidLoad() let leftMenuItem = UIBarButtonItem(image: UIImage(named: "menu"), style: .plain, target: revealViewController, action: #selector(SWRevealViewController.revealToggle(_:))) navigationItem.setLeftBarButton(leftMenuItem, animated: true)
}
这篇关于单击更改SwRevealViewController图标图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!