Sharing UserDefaults between extensions

前端 未结 5 1777
借酒劲吻你
借酒劲吻你 2020-12-02 18:25

Creating a Today widget and I am using UserDefaults(suiteName:) to persist some data. In the main application I am using UserDefaults.standard(). T

5条回答
  •  旧巷少年郎
    2020-12-02 18:52

    Also make sure you add App Groups to the correct Configuration (Debug, Release). If you add App Groups in Debug for your application target and try to use it in Release config for your extension, then it wont work.

    If you add in Debug config (for app target), then use it in debug config (for extension target)

提交回复
热议问题