-
Notifications
You must be signed in to change notification settings - Fork 12
Architecture
This is a collection of architectural aspects of version 3 (and up) of iMedia. iMedia 3 underwent a substantial architectural change compared to iMedia 2. This is mostly attributed to the need of supporting the app sandbox and XPC services.
Don't expect this article to be complete by any means.
Due to possibly missing entitlements on the file system (like an iPhoto library located on an external volume) or a requirement to login to a library (like Facebook) iMedia needs the notion of requesting and revoking access to a library.
Classes Involved:
- IMBNodeAccessDelegate protocol
- IMBAccessRightsViewController
- IMBFaceboookAccessController
- IMBNodeViewController
- IMBLibraryController
- Timed out sessions (framework should transparently re-login if possible). How it is done see e.g. -[IMBNodeViewController outlineViewItemWillExpand:]. This mechanism had to be implemented in a way that everything is done in the app process and on the main thread since re-login possibly involves user interface elements (like a login view).
The PhFacebook framework is accessed for Facebook login (IMBFacebookAccessController) and Facebook resource retrieval (IMBFacebookParser). Thus, the PhFacebook object is transfered to the Facebook xpc service (if present) on each request to the Facebook parser.
Event handling in XPC services is done asynchronously (see main() function in SBServiceMain.m)
- Added New method -[IMBIconCache iconForType:highlight:] to conveniently retrieve and cache icons used by framework
- Added "Reload" menu item in icon view contextual menu
- Extended IKImageBrowserDelegate protocol to notify delegate when cell was single-clicked (IMBImageBrowserDelegate informal protocol)
- Did lots of tweaks regarding badges in tree view rows - specifically what action is taken when you click on badge (show error or logout?)
- Generalized -[IMBLibraryController reload] so that you can specify that only filesystem-based libraries are to be reloaded (now applied when mounted volumes change)