# How to add local Swift Package as dependency?

**URL:** <https://forums.swift.org/t/how-to-add-local-swift-package-as-dependency/26457>\
**Category:** Using Swift\
**Created:** [June 29, 2019, 4:07pm UTC](https://forums.swift.org/t/how-to-add-local-swift-package-as-dependency/26457 "2019-06-29T16:07:04Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![gwendal.roue](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gwendal.roue/32/13992_2.png) [@gwendal.roue](https://forums.swift.org/u/gwendal.roue)\
**Post date:** [October 20, 2019, 11:49am UTC](https://forums.swift.org/t/how-to-add-local-swift-package-as-dependency/26457/7 "2019-10-20T11:49:28Z")

</div>

> [@Aciid](#):
>
> You can drag the package into a workspace/project to add it as a local package.

> [@S2Ler](#):
>
> Just drag and drop the folder where Package.swift is located too Xcode and then you can link this package to targets. I used this approach many times already without any issues.

I admit some **detailed** how-to would be appreciated. I've been fiddling with Xcode, drag&dropping all that I could reasonably think of, added my local package to the "Link Binary with Libraries" build phase, etc, without any success so far.

My setup:

- xCodeProject.xcodeproj
- xCodeProject
  - AppDelegate.swift
  - ...

- Package
  - Package.swift
  - Sources
    - Product
      - ...

The goal: be able to `import Product` from AppDelegate.swift without "No such module 'Product'" error.

Why? I'm trying to reduce a [bug](https://github.com/groue/GRDB.swift/issues/636) in Xcode 11.2 beta 2, and I'm testing the hypothesis that the bug only happens when some code is imported from a swift package.

Thanks

**Edit** : see solution in the next message.

---

_[View the full topic](https://forums.swift.org/t/how-to-add-local-swift-package-as-dependency/26457)._
