davedelong/DDHotKey

Singleton hotkey center?

tonyxiao opened this issue · 2 comments

I'm thinking of extending DDHotKey to add a singleton DDHotKeyCenter, and I just want to understand the rationale of not having a singleton center in the first place. Is it thread-safety or other concern?

IIRC, the rationale was that it didn't need to be, but I don't think there's a fundamental issue with it not being a singleton. Semantically, it would probably be cleaner.

DDHotKeyCenter is now a singleton. Existing code which does [[DDHotKeyCenter alloc] init] will still work properly (and will return the singleton instance).