How to change Edit/Done button title in UINavigationBar

前端 未结 3 2295
执念已碎
执念已碎 2021-02-20 06:26

If Editing mode is enabled for the tableview it shows a button titled Edit, when pressing it it changes the title to done

i was wondering if there is a way to change the

3条回答
  •  悲哀的现实
    2021-02-20 07:01

    Here is the method to change it for Swift

    override func setEditing (editing:Bool, animated:Bool)
    {
        super.setEditing(editing,animated:animated)
        if (self.editing) {
            self.editButtonItem().title = "Editing"
        }
        else {
            self.editButtonItem().title = "Not Editing"
        }
    }
    

提交回复
热议问题