How to add / use default icons to navigation bar

后端 未结 3 637
迷失自我
迷失自我 2020-12-31 07:42

I want to use some of default iOS icons i.e.

in navigation bar.
Basically I don\'t know how to call image of that item (directly from native library - I kno

3条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 07:49

    In swift 4.3

    let btnRefresh = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.refresh, target: self, action: #selector(targeted function to invoke))
    
       //If you want icon in left side
        navigationItem.leftBarButtonItem = btnRefresh
    
       //If you want icon in right side
        navigationItem.rightBarButtonItem = btnRefresh
    

提交回复
热议问题