{"id":23865,"date":"2019-01-07T16:57:07","date_gmt":"2019-01-07T21:57:07","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=23865"},"modified":"2019-01-07T17:02:29","modified_gmt":"2019-01-07T22:02:29","slug":"swift-import-declarations","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/01\/07\/swift-import-declarations\/","title":{"rendered":"Swift Import Declarations"},"content":{"rendered":"<p><a href=\"https:\/\/nshipster.com\/import\/\">Mattt Thompson<\/a>:<\/p>\n<blockquote cite=\"https:\/\/nshipster.com\/import\/\">\n<p>Import declarations have a form that can specify individual structures, classes, enumerations, protocols, and type aliases as well as functions, constants, and variables declared at the top-level:<\/p>\n<pre>import &lt;#kind#&gt; &lt;#module.symbol#&gt;<\/pre>\n<p>Here, <code>kind<\/code> can be any of the following keywords[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>In practice, isolating imported declarations and submodules doesn&rsquo;t confer any real benefit beyond signaling programmer intent. Your code won&rsquo;t compile any faster doing it this way. And since most submodules seem to re-import their umbrella header, this approach won&rsquo;t do anything to reduce noise in autocomplete lists.<\/p>\n<\/blockquote>\n<p>If you gave up after finding that <code>import Module.Class<\/code> doesn&rsquo;t work, you actually can do it with <code>import class Module.Class<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mattt Thompson: Import declarations have a form that can specify individual structures, classes, enumerations, protocols, and type aliases as well as functions, constants, and variables declared at the top-level: import &lt;#kind#&gt; &lt;#module.symbol#&gt; Here, kind can be any of the following keywords[&#8230;] [&#8230;] In practice, isolating imported declarations and submodules doesn&rsquo;t confer any real benefit beyond [&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":"2019-01-07T21:57:09Z","apple_news_api_id":"5262d8c9-99c5-48cf-b423-6c9a05ce16e7","apple_news_api_modified_at":"2019-01-07T22:02:33Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AUmLYyZnFSM-0I2yaBc4W5w","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":[46,71,901],"class_list":["post-23865","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/23865","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=23865"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/23865\/revisions"}],"predecessor-version":[{"id":23878,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/23865\/revisions\/23878"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=23865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=23865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=23865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}