Can I use iCloud to sync the NSUserDefaults plist file

后端 未结 3 1491
鱼传尺愫
鱼传尺愫 2020-12-05 11:16

I was wondering if it was possible to use iCloud to sync an app\'s preferences file between devices. The preference file I am talking about is the com.domain.appname.plist f

3条回答
  •  天命终不由人
    2020-12-05 11:49

    Similar to MKiCloudSync, I also have a library on GitHub called SDCloudDefaults. Rather than sync automatically, there's a new object that you use instead of NSUserDefaults that saves to both iCloud and NSUserDefaults. This means you can decide which elements are stored locally and which are stored in the cloud.

    (I found MKiCloudSync after I'd implemented it. I think it's clever but I don't want to sync everything to iCloud so my solution still works better for me.)

提交回复
热议问题