# Capacitor iOS with SPM doesn't work

**URL:** <https://forum.ionicframework.com/t/capacitor-ios-with-spm-doesnt-work/241784>\
**Category:** Capacitor\
**Created:** [May 16, 2024, 12:12pm UTC](https://forum.ionicframework.com/t/capacitor-ios-with-spm-doesnt-work/241784 "2024-05-16T12:12:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbelyaev](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@bbelyaev](https://forum.ionicframework.com/u/bbelyaev)\
**Post date:** [May 16, 2024, 12:12pm UTC](https://forum.ionicframework.com/t/capacitor-ios-with-spm-doesnt-work/241784/1 "2024-05-16T12:12:50Z")

</div>

Hello, I’m trying to setup a swift package connection via capacitor. How I’m trying to do it:  
At first I decided to just follow the example in order to fully understand the mechanism of how capacitor works. I am creating the code following the capacitor example from this link [Custom Native iOS Code | Capacitor Documentation](https://capacitorjs.com/docs/ios/custom-code) and if I do not add SPM support to the capacitor project then it works fine (here is my repository with a working example - https:// [GitHub - BelyaevAlex/Capacitor\_ios\_CocoaPods](http://github.com/BelyaevAlex/Capacitor_ios_CocoaPods) ), but to connect the Swift package, you need SPM support, in capacitor, as I understand it, it was added from version 6 - [Swift Package Manager | Capacitor Documentation](https://capacitorjs.com/docs/ios/spm) but when I initialize ios project following the example from this link and then I follow exactly the same path as in the example from the first link, the function is not called. What could be the problem? Maybe I’m doing something wrong?
