shaundon,
@shaundon@mstdn.social avatar

I'm adding a watchOS app for SalaryPig. How do people generally share UserDefaults with the watch? I'm tempted to use CloudKit because that way I can also sync settings with iPadOS, but I've never used it before and am scared

zachsimone,
@zachsimone@mastodon.social avatar

@shaundon I moved some stuff from user defaults to this just to be able to share with the watch https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore

swiftly,

@zachsimone @shaundon I am having a nightmare trying to use userDefaults to share data between my app and a widget. Could this be used instead?

shaundon,
@shaundon@mstdn.social avatar

@swiftly @zachsimone I reckon you could, but sharing between app and widget should work no problem if you're making use of app groups: https://michael-kiley.medium.com/sharing-object-data-between-an-ios-app-and-its-widget-a0a1af499c31

zachsimone,
@zachsimone@mastodon.social avatar

@shaundon @swiftly +1 to app groups for getting user defaults shared with widgets. Once it's setup it works well. The iCloud stuff is overkill, unless you are expecting to have to share it with a watch app at some point.

MuseumShuffle,
@MuseumShuffle@mastodon.social avatar

@zachsimone @shaundon @swiftly Shaun shared the exact blog post I followed to set up app groups for my widgets! 😂

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • cubers
  • osvaldo12
  • JUstTest
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • megavids
  • anitta
  • provamag3
  • lostlight
  • All magazines