-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings/tests with recent macOS and add more generics annotations #75
Conversation
…OS 10.9 and higher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't run anything, but changes look fine!
No objections! |
… in sync while using multiple store instances
Oops, I didn't run the tests with -DSANDBOXED=1 last time, so I also applied changes from PR #74 on top. In
For me, it means |
@ericwa Any comments on my latest changes before I merge? |
No special comments, looks fine. |
Warnings were caused by Apple deprecating more APIs starting from macOS 10.9.
Test failure was caused by the default color space on macOS being changed from 'generic' (aka
NSCalibratedRGBColorSpace
) to 'sRGB'. I'm not sure in which version that was changed, but the change I made is backward-compatible, so it shouldn't matter. Here is the failing test ouput:The new generics annotations allow to call more CoreObject APIs from Swift without casting.
For sanboxed apps on macOS, posting distributed notifications containing a user info dictionary (and also registering for distributed notifications without targeting a specific object) causes sandboxing violations:
My solution to this is to use a custom distribution center that does nothing when sandboxing is enabled. The previous solution introduced for iOS doesn't work, because NSDistributedNotificationCenter is a public API on macOS unlike iOS, so the compiler ignores the compatibility alias.