Setting up CocoaLibSpotify correctly?

353 Views Asked by At

I´m using the Spotify API for my new iOS project and just finished the setup, but not sure I did this the right way.

I created a new project and added the CocoaLibSpotify iOS Library.xcodeproj by right clicking my project -> "Add Files...". So the CocoaLibSpotify project is embedded in my own project. I´ve also added it to Target Dependencies and Link Binary with Libraries.

The "Building iOS"-guide tells me to add a couple of frameworks and set some linker flags.

The CocoaLibSpotify project that I embedded already have these frameworks, should I add them to my project as well?

I also try to import CocoaLibSpotify.h by #import "CocoaLibSpotify.h but it does not find the file. #import <CocoaLibSpotify.h> works though.

Which header files should I import to my prjoject? (I can´t seem to find the "include" directory).

2

There are 2 best solutions below

0
On

It looks like you've missed the part of the readme that tells you to add some "Framework Search Paths" settings - you need to add a couple of things to your build settings. Alternatively, just copy the "Empty CocoaLibSpotify Project" sample project, rename it and off you go.

0
On

CocoaLibSpotify is available as a CocoaPod.

Install CocoaPods

Add the following line to your PodFile

pod 'CocoaLibSpotify', '~> 2.4.4'

In Terminal go to your project's root and execute

pod install

Include this header to use CocoaLibSpotify

#import "CocoaLibSpotify.h"

Cocoapods is an easy way to manage dependencies. I have successfully included CocoaLibSpotify in my projects using this method.