How to add alert message to a global class

后端 未结 5 1283
刺人心
刺人心 2021-01-26 09:29

I have the following code repeated in many of my view controllers. I would like to refactor it into a global class/view controller. However, I still want it to be s

5条回答
  •  耶瑟儿~
    2021-01-26 10:20

    I like extensions for this.

    If you extend uiviewcontroller you should be able to put this function inside and then you'd be able to call it from any view controller.

提交回复
热议问题