Using @available with stored properties

后端 未结 2 1067
北荒
北荒 2021-02-11 17:46

I have an app that uses local notifications and supports iOS 10. I am trying to add iOS 9 support which requires me to use the old location notification API. I am trying to use

2条回答
  •  既然无缘
    2021-02-11 18:14

    @available could be used around a whole class or one or more functions, but not for properties.

    Regarding your UNUserNotificationCenter usage, current returns a singleton that never changes, so why not just remove the center constant, and just use UNUserNotificationCenter.current() where center is used?

提交回复
热议问题