luckymarmot/ThemeKit

App Store Rejection

rdmeyers opened this issue · 12 comments

I am not sure how they test apps at Apple, but I have been unable to replicate the scenario they get when testing the Dark Mode option. Maybe the screen shots themselves will give you some insight as to what they might be doing? Or what I can check?

Screenshot 1 has some strange motion looking artifacts:

screenshot1

Screenshot 2 has left some controls in dark mode, while making the tab control blank, etc.

screenshot2

I also don't know how they take screenshots, but if you can't reproduce this, eventually they can be automated. On the screenshots, it looks like it was "in the process" of changing the theme, as some controls are not even drawn, while others appear with a different appearance.

When themes are changed, ThemeKit performs an animation. Maybe the screenshot is automated and is happening during this animation?

I don't have any extra information regarding AppStore approval/rejection, so I suggest you asking them for additional details that could help in understanding the issue and/or reproduce it.

Hope this helps.

I agree, the second screen shot does look as though the theming process ended prematurely. This had me thinking that possibly your recursive function that themes the individual controls may have had an access violation, thus aborting the theming process entirely.

With that thinking, I changed the code from using the universal theming function "setTheme" to instead theming each window individually using "setWindowTheme". Being that I cannot reproduce whatever bug(s) they are finding, I did not initially see any difference. However, theming the windows individually did display a problem when "zooming" the window, namely it lost the theme entirely! Any ideas why that would happen?

Any ideas why that would happen?

Not really :/

I would really recommend asking the team further details by choosing "App Rejection Clarification" on developer.apple.com/contact - hopefully, they will come up with valuable information.

OK, I am going back to global "setTheme" approach since it is certainly easier to implement :-)

Do you see any drawback to me going straight to "makeThemeEffective" and skipping the whole screenshot/animation process? Commenting out that code doesn't appear to cause any adverse effects, but you will know better than me.

Also, I have asked Apple for testing details that I might be able to recreate their screenshot scenario, but honestly I have never had much success with them providing any helpful information. If Purgatory exists, then Apple helped design it!!! ;-)

Do you see any drawback to me going straight to "makeThemeEffective" (...)?

Yes - Please don't call that method directly.
I have just released 1.2.1 which just makes the theme transition animation optional:
ThemeManager.animateThemeTransitions

So you can just set on your code ThemeManager.shared.animateThemeTransitions = false and give it a try.

If Purgatory exists, then Apple helped design it!!! ;-)

😂🤣

I think you need to add this boolean to ThemeManager+ObjectiveC.swift as I cannot access it.

So omitting animation may have help on 10.13, but now they see a similar issue on 10.12:

image

Is it possible I am not including some library that is needed by ThemeKit that would not be available by default in whatever environment they are testing it in?

I cannot access it

Sorry - forgot to add @objc to property declaration. All good now.

Is it possible I am not including some library that is needed by ThemeKit that would not be available by default in whatever environment they are testing it in?

ThemeKit has no 3rd party dependencies - however, they may have a limited environment that could affect this (somehow). I honestly don't know how they are getting those while you can have your app correctly themed... 😔

Hopefully, Apple response will add some more insights on this...

Apple's response is they turn on the dark theme, then start playing around with the app and the theme disappears. No real step-by-step, but it is impossible for me to reproduce even using the app archive under a limited Guest account.

Well taking out the animation has only made the fail look cleaner :-) This screenshot is them simply turning on the dark mode, then turning it off. How is this even possible!!! It looks like the tabs are completely empty as they are just pure white, whereas the comboboxes are still dark, so it seems the theming ended before it got to them.

screenshot4

This screenshot is very similar to screenshot #2 above.

I think it is really important you find a way of reproducing this on your machine. At this point, there's no way of verifying if a "fix" actually fixes it.
If this only happens on macOS 10.12, you could install this OS on VMWare Fusion or on VirtualBox, so you can attempt to reproduce it there. Here's a script for helping with macOS installation on VirtualBox.

On a previous app I've worked (and used ThemeKit), there were some cases where it was necessary to listen for theme changes and make some tweaks/manual changes on some parts of the UI. These could include:

  • for NSViews, manually setting its appearance: view.appearance = [TKThemeManager sharedManager].effectiveThemeAppearance
  • for NSViews, calling view.needsDisplay = true (if using custom drawing (on drawRect:), wiping out any cached drawings before calling this)
  • if CALayers were involved, calling [layer setNeedsDisplay]

You can listen for theme changes, either with KVO or notifications:

  • [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_themeDidChangeNotification:) name:TKThemeManager.didChangeThemeNotification object:nil];
  • KVO on[TKThemeManager sharedManager], key path "effectiveTheme"

Hope this helps.

I cannot fix what I cannot replicate, and guessing where to put your suggestions is not fruitful either, so, unfortunately, I need to abandon theming the app for now.