{"id":22931,"date":"2018-09-28T15:54:49","date_gmt":"2018-09-28T19:54:49","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=22931"},"modified":"2018-10-02T14:32:12","modified_gmt":"2018-10-02T18:32:12","slug":"photokits-core-data-model","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/09\/28\/photokits-core-data-model\/","title":{"rendered":"PhotoKit&rsquo;s Core Data Model"},"content":{"rendered":"<p><a href=\"https:\/\/oleb.net\/2018\/photos-data-model\/\">Ole Begemann<\/a>:<\/p>\n<blockquote cite=\"https:\/\/oleb.net\/2018\/photos-data-model\/\">\n<p>In my quest to understand the Photos framework better (especially its performance characteristics), I wanted to inspect its data model. I found a file named <code>PhotoLibraryServices.framework\/photos.momd\/photos-10.0.mom<\/code> deep in the bowels of the Xcode 10.0 app bundle[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>A <code>.mom<\/code> file is a <em>compiled<\/em> Core Data model. Xcode can&rsquo;t open this directly, but it can <em>import<\/em> one into another Core Data model. Follow these steps to view the model in Xcode[&#8230;]<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/bwebster\/status\/1045689101075111937\">Brian Webster<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/bwebster\/status\/1045689101075111937\"><p>The Mac version of Photos doesn&rsquo;t use Core Data, but instead a custom SQLite database format that originated in Aperture. Looks like a similar number of tables\/entities though.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/bgannin\/status\/1045704150795911168\">Brian Ganninger<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/bgannin\/status\/1045704150795911168\">\n<p>That&rsquo;s correct (former UI engineer here ) The Aperture database format served as the basis for the shared library format between Aperture &amp; iPhoto. That library format was then evolved for Photos library and cloud integration.<\/p>\n<\/blockquote>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2018\/08\/22\/the-history-of-aperture\/\">The History of Aperture<\/a>.<\/p>\n\n<p id=\"photokits-core-data-model-update-2018-10-02\">Update (2018-10-02): <a href=\"https:\/\/twitter.com\/_inside\/status\/1045758495390388224\">Guilherme Rambo<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/_inside\/status\/1045758495390388224\">\n<p>The Core Data model used by &ldquo;Find My Friends&rdquo;.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Ole Begemann: In my quest to understand the Photos framework better (especially its performance characteristics), I wanted to inspect its data model. I found a file named PhotoLibraryServices.framework\/photos.momd\/photos-10.0.mom deep in the bowels of the Xcode 10.0 app bundle[&#8230;] [&#8230;] A .mom file is a compiled Core Data model. Xcode can&rsquo;t open this directly, but it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-09-28T19:54:51Z","apple_news_api_id":"54d11060-706b-4d1e-9963-1806ffd2776b","apple_news_api_modified_at":"2018-10-02T18:32:17Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AVNEQYHBrTR6ZYxgG_9J3aw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[],"tags":[109,31,1610,1203,927,71],"class_list":["post-22931","post","type-post","status-publish","format-standard","hentry","tag-coredata","tag-ios","tag-ios-12","tag-photokit","tag-photos-app","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=22931"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22931\/revisions"}],"predecessor-version":[{"id":22949,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22931\/revisions\/22949"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=22931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=22931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=22931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}