{"id":153,"date":"2017-07-05T14:21:43","date_gmt":"2017-07-05T19:21:43","guid":{"rendered":"https:\/\/chibicode.org\/?p=153"},"modified":"2017-07-05T14:21:43","modified_gmt":"2017-07-05T19:21:43","slug":"a-note-on-the-swift-4-package-manager-syntax","status":"publish","type":"post","link":"https:\/\/chibicode.org\/?p=153","title":{"rendered":"A note on the Swift 4 Package Manager Syntax"},"content":{"rendered":"<p>I ran into some issues setting up a new Swift 4 project from Swift Package Manager. Specifically, my <code>main.swift<\/code> file couldn&#8217;t import the dependencies I specified in my <code>Package.swift<\/code> file. It turns out, you have to import your dependencies in the root <code>dependencies:<\/code> section, then refer to them by module name in the <code>targets()<\/code> portion of the package.<\/p>\n<p>[gist d63d61ffaf8d7a73b174cc1f1801c8eb]<\/p>\n<p>Omitting the declaration in your target means the module won&#8217;t be available to your app and your <code>import<\/code> statements will generate compiler errors for nonexistent modules.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran into some issues setting up a new Swift 4 project from Swift Package Manager. Specifically, my main.swift file couldn&#8217;t import the dependencies I specified in my Package.swift file. It turns out, you have to import your dependencies in the root dependencies: section, then refer to them by module name in the targets() portion &hellip; <a href=\"https:\/\/chibicode.org\/?p=153\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;A note on the Swift 4 Package Manager Syntax&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chibicode.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=153"}],"version-history":[{"count":5,"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/chibicode.org\/index.php?rest_route=\/wp\/v2\/posts\/153\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/chibicode.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chibicode.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chibicode.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}