Closed petero-dk closed 8 years ago
Apologies for the delay in getting around to looking at this.
So as I understand it this will toggle between the overrides being applied every time the app is run. Is that the intention?
I could see that an explicit setting in an environment variable might be useful:
SIMULATOR_STATUS_MAGIC_APPLY_OVERRIDES = YES
or
SIMULATOR_STATUS_MAGIC_APPLY_OVERRIDES = NO
Or something like that, but I'm not sure a toggle is that useful. If it's a toggle you need, can you explain how it's working for you please?
Thanks!
Hi Dave
It might work with the explicit environment variable, and how I would set them during our testing.
What we do now is compile with the "toggle enabled" and then run automated screenshot scripts based on UI tests.
Before running the UI tests we launch the statusmagic which will automatically enable the status magic, Then we run our UI tests and grab all of our screenshots Then we run status magic again to reset the status bar.
The apply overrides might actually be better if it would ensure that the magic has been applied.
Does this make any sense to any one else but me?
(I do not think I have written magic in such a serious context so many times before)
(I do not think I have written magic in such a serious context so many times before)
Haha yes :)
It's not something I'd use myself (I'd integrate the library and just call it from code) but I can see a case for it. I'd merge the PR if it was explicit. I think that makes much more sense.
Fyi: It is for this project we use it: https://github.com/ecomerc/xscreenshot
Specifically here: https://github.com/ecomerc/xscreenshot/blob/master/Source/iOS/StatusMagic.cs and here: https://github.com/ecomerc/xscreenshot/blob/master/Source/iOS/iOSHelpers.cs#L65
The problem is that I cannot (perhaps I am not that smart) integrate the project into my Xamarin projects.
Ill see if I can make it explicit, and do a PR for that
Sounds good. I'm going to close this one, just reference a link to this when you submit the new PR.
When working with Xamarin based apps and wanting to script the screenshots it is much easier to launch the SimulatorStatusMagic as a standalone app instead of changing the compilation process of the original app.
Hence the need for SimulatorStatusMagic to auto enable and disable the overrides.