AndyDev
AndyDev

Reputation: 1409

Converting Framework to a Library

I want to use the framework found at the link below within an iOS app. I have it working within the simulator but after some digging it looks like you are unable to use frameworks on devices and especially when distributing through the App Store. Please correct me if I am wrong.

https://github.com/mirek/YAML.framework/

How would I go about converting this framework to a library? I have looked at simply dragging the files from the framework to the app which doesn't work.

Thanks in advance.

Upvotes: 2

Views: 1835

Answers (2)

loretoparisi
loretoparisi

Reputation: 16301

It's super easy.

Give the general iOS static framework structure:

3rdPartyLib.framework
   |---3rdPartyLib -> Versions/Current/3rdPartyLib
   |---Headers
   |---Resources
         |---Info.plist
         |---SomeBundle.bundle
   |---Versions
         |---A
         |---Current -> ./A

You have to

1) Copy the static library file in a new folder

3rdPartyLib.framework/Versions/Current/3rdPartyLib

2) Rename is with .a extension and copy to a new folder

3rdPartyLib/
   |---3rdPartyLib.a

3) Copy all the headers in the folder

3rdPartyLib.framework/Headers

in a new headers folder in the new folder

3rdPartyLib/
   |---Headers/

At this point you should end up with

3rdPartyLib/
       |---3rdPartyLib.a
       |---Headers/

This is your static library that you can use within your app or within another iOS framework to be distributed to other apps.

Upvotes: 2

Ecarrion
Ecarrion

Reputation: 4950

Take a look at this: https://github.com/Ecarrion/YAML.IOS Just grab the YAML.Framework folder

And you actually can use framework, you just can't use dynamic libraries.

Upvotes: 1

Related Questions