redth-org / BTProgressHUD

Port to Xamarin.iOS of the SVProgressHUD
Other
118 stars 64 forks source link

Namespace change makes it inconvenient to use methods in BTProgressHUD static class #88

Closed marcoburato closed 2 years ago

marcoburato commented 2 years ago

Now that the BigTed namespace has been changed to BTProgressHUD, we can no longer do

BTProgressHUD.Show();

Instead, we must use

BTProgressHUD.BTProgressHUD.Show();

Since the whole point of the BTProgressHUD static class was to make it more convenient to display the hud, this feels like a step backwards.

I'm not sure why the namespace was changed, as it breaks compatibility with previous package versions. Assuming there was a good reason, I suggest renaming the BTProgressHUD class to HUD, so we can do:

HUD.Show();

Cheesebaron commented 2 years ago

Ah! Yes, I see that. I guess that slipped into the code in #83

marcoburato commented 2 years ago

@Cheesebaron I see that you changed the namespace back to BigTed. FYI, if your goal was to revert all breaking changes, then I should point out that there are other issues.

One is that MaskType and ToastPosition enums were moved from the ProgressHud class to first-class citizens in the namespace (commit b32cea6d3665b766eea213590a87e7cdbf3b3a96). To be fair, it was not elegant to have public enums within a class (IMHO, the language should disallow that).

Yet another thing I noticed while trying to update to the latest package is that the signature for BTProgressHUD.ShowErrorWithStatus() (and others) was changed in 7263fd2d24e5fd299871b5720160fca542d1898b and now calls in the form ShowErrorWithStatus("...", 2000) don't compile anymore because MaskType has to be passed in too.

So... I don't know, there were several breaking changes and I'm not sure at this point if it's worth trying to fix everything.

l3ender commented 2 years ago

We had to make minor code updates when upgrading as well, and I think it's related to these changes:

From:

BTProgressHUD.Show(maskType: ProgressHUD.MaskType.Clear);

To:

BTProgressHUD.Show(maskType: MaskType.Clear);

It was a small change to make, but I too would recommend that similar future changes are released in a major version update to follow semver standards.

Thanks for the work on the library!