{"id":20236,"date":"2018-01-19T14:57:31","date_gmt":"2018-01-19T19:57:31","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20236"},"modified":"2018-01-19T14:57:31","modified_gmt":"2018-01-19T19:57:31","slug":"simplifying-swift-framework-development","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/01\/19\/simplifying-swift-framework-development\/","title":{"rendered":"Simplifying Swift Framework Development"},"content":{"rendered":"<p><a href=\"https:\/\/davedelong.com\/blog\/2018\/01\/19\/simplifying-swift-framework-development\/\">Dave DeLong<\/a>:<\/p>\n<blockquote cite=\"https:\/\/davedelong.com\/blog\/2018\/01\/19\/simplifying-swift-framework-development\/\">\n<p><code>@_exported<\/code> will make an <code>import<\/code>-ed module visible to the <em>entire<\/em> module into which its been imported. This means you don&rsquo;t have to <code>import Dependency<\/code> in every file you need it. You just <code>@_exported<\/code> that dependency once, and you&rsquo;re good to go in any file in that module.<\/p>\n<p>[&#8230;]<\/p>\n<p>Second, I define a <code>public<\/code> constant that is the name of the framework, and whose value is the <code>Bundle<\/code> for that framework. I use the class-based look up (ie, find the bundle that declares this class), because it&rsquo;s one of the few convenient <code>Bundle<\/code> initializers that doesn&rsquo;t return a <code>Bundle?<\/code>, and thus I don&rsquo;t have to deal with unwrapping. And then I use a special marker class for making that lookup resilient in the face of other functionality changes.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Dave DeLong: @_exported will make an import-ed module visible to the entire module into which its been imported. This means you don&rsquo;t have to import Dependency in every file you need it. You just @_exported that dependency once, and you&rsquo;re good to go in any file in that module. [&#8230;] Second, I define a public [&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":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","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":[4],"tags":[31,30,71,901],"class_list":["post-20236","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-ios","tag-mac","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20236","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=20236"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20236\/revisions"}],"predecessor-version":[{"id":20237,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20236\/revisions\/20237"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}