0

I have a static widget as below and deployed to production.

struct ABCWidget: Widget {
    let kind: String = "xyzWidget"
    var body: some WidgetConfiguration {
           StaticConfiguration(kind: kind, 
}

Now I want to change the kind to "abcWidget" but when I do it, on the upgrade I see a black box for the installed widget. Is there any way to do this change without impacting existing customers.

Thanks!

user1165756
  • 375
  • 3
  • 11
  • There might be other folks who have a better idea about how to do it in Swift than me. But that seems like a basic versioning problem. And versioning is a pain. If you want to change a software interface, and you already have people depending on the old interface... you have to have 2 versions. Old version, and new version. Once your logs show people have upgraded off the version that used old version then you can retire old version. Unfortunately... changing to lowercase is your new version. – Nicholas Rees Feb 03 '21 at 19:48
  • I want to change the let kind: String = "xyzWidget" to "abcWidget". Not the ABCWidget struct. – user1165756 Feb 03 '21 at 20:43
  • Doh. Misread it. – Nicholas Rees Feb 03 '21 at 21:37

1 Answers1

0

No, there’s no way to “upgrade” your existing users to a bee widget or widget configuration.

That said, the “kind” string isn’t visible to your users so it doesn’t matter what it is. Just leave the old string.

Adam
  • 4,405
  • 16
  • 23
  • It's not visible.. but I want to add some generic method for usage of every widget, so I have to do it.. Thanks! – user1165756 Feb 08 '21 at 15:56