2

Notification Center in Sierra has a new, light background colour compared with Yosemite and El Cap. My widget, however, still shows the old, dark style, even when I rebuild with the new SDK.

The view has appearance set to "Inherited (Vibrant Dark)". Changing that to "Aqua" seems to have no effect.

Is it possible to change third party widgets to look the same as Apple's? I notice all the other third party widgets I look the same.

1 Answer 1

4

You need to set the value of NSExtensionPointVersion to 2.0 in your Today extension's Info.plist to get the new appearance:

<key>NSExtension</key>
<dict>
    <key>NSExtensionAttributes</key>
    <dict>
        <key>NSExtensionPointVersion</key>
        <string>2.0</string>
    </dict>
</dict>

The last I checked this was not documented anywhere, but if you create a new Today extension using Xcode 8 it should add this for you, confirming it is the correct approach. (I actually figured it out by inspecting the contents of Apple's own Today extensions.)

One thing worth mentioning is that older versions of macOS will still have the dark appearance, so if your extension is backwards compatible you'll need to adjust your content to suit the background color. In your Today extension's main view controller you can check for the dark appearance like this:

NSString *appearance = self.parentViewController.view.effectiveAppearance.name;
BOOL legacyDarkBackground = ([appearance isEqualToString:NSAppearanceNameVibrantDark]);
1
  • 1
    Thanks. It works. But when I create archive for submission I will get the error: "iTunes Store operation failed. Invalid Info.plist key. The key 'NSExtensionPointVersion' in bundle ***.appex is invalid." How to resolve this? Oct 6, 2016 at 16:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.