iOS : How to reference a music background from a singleton class?

前端 未结 3 1434
闹比i
闹比i 2020-12-22 08:53

I have done a singleton class called MyBgMusic.h & MyBgMusic.m. How to reference that singleton class to my SecondViewController or the rest of the XIB.

Here is

3条回答
  •  半阙折子戏
    2020-12-22 09:21

    In SecondViewController you should call [[MyBgMusic sharedInstance] toggleMusic];in the IBAction when you want to toggle music. Just as you used self.player.

提交回复
热议问题