How to use an SPM library in an (Xcode based) iOS project?

I have created a nice little library with SPM ($ swift package init --type=library).
The library includes some utility classes and associated tests.
It works as expected.

Now, I would like to use this library within an iOS application.
AFAIK, SPM doesn't support iOS at the moment.

I am wondering, what is the best way to include my library in the iOS Xcode project/build?

thanks,
-g.

Hi,

swift package has a nice option for that : generate-xcodeproj (not sure about the exact spelling) which generate a proper Xcode project bundle.

You can then reference it from another Xcode project or workspace.

Pierre

···

Le 19 janv. 2017 à 11:22, Georgios Moschovitis via swift-users <swift-users@swift.org> a écrit :

I have created a nice little library with SPM ($ swift package init --type=library).
The library includes some utility classes and associated tests.
It works as expected.

Now, I would like to use this library within an iOS application.
AFAIK, SPM doesn't support iOS at the moment.

I am wondering, what is the best way to include my library in the iOS Xcode project/build?

thanks,
-g.
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

You can then reference it from another Xcode project or workspace.

I am aware of `generate-xcodeproj` but can you provide a link with details about the ‘reference’ part?
As an Xcode newbie, it’s not obvious to me how to do it.

thanks,
George.

Alright.

Typically I create a workspace (menu File > New > Workspace) and add both the app's project and the library project to the workspace (menu File > Add Files).

Then you can follow that guide to embed the framework in the app (which will also link it):

Pierre

···

Le 19 janv. 2017 à 18:44, Georgios Moschovitis <george.moschovitis@icloud.com> a écrit :

You can then reference it from another Xcode project or workspace.

I am aware of `generate-xcodeproj` but can you provide a link with details about the ‘reference’ part?
As an Xcode newbie, it’s not obvious to me how to do it.

thanks,
George.

Thank you, will check it!

George