0

I am currently working on an iOS project with external frameworks.

One of those frameworks contains of 5 .framework files.

Here is an exmaple:

core.framework

versionA.core.framework
versionA.resources.framework

versionB.core.framework
versionB.resources.framework

What I need is one framework e.g. umbrellaA.framework containing this

core.framework

versionA.core.framework
versionA.resources.framework

and one framework e.g. umbrellaB.framework containing versionB

core.framework

versionB.core.framework
versionB.resources.framework

Can I use libtool for this or what do I need to combine multiple .framework files into one ùmbrella`?

CW0007007
  • 5,681
  • 4
  • 26
  • 31
Alexander
  • 7,178
  • 8
  • 45
  • 75
  • Please say why you want to do this. – hfossli Jan 28 '14 at 14:17
  • @hfossli I do have a build script and depending on some parameters I either need a reference to versionA or versionB of the framework (completely different internal structure). Now I do not want to manipulate the xcode project file (link binary with libraries). Instead I would link against one "umbrella" file and replace this umbrella file depending on the input parameters. Thought this would probably be easier than changing the xocode project file – Alexander Jan 28 '14 at 14:26
  • Could cocoapods be an option? – hfossli Jan 28 '14 at 19:20
  • Is there any way to use cocoa-pods for packaging multiple frameworks? What I do not want is different targets and I think there would be no other way when using cocoa-pods – Alexander Jan 29 '14 at 09:35
  • Maybe subspecs is appropriate? I don't understand the "different targets" part you are talking about :) – hfossli Jan 29 '14 at 13:35

1 Answers1

2

Could you use cocoapods and subspecs?

Pod::Spec.new do |s|
    s.name         = "Umbrella"
    ...

    s.default_subspec = 'A'

    s.subspec 'A' do |ss|
        ss.frameworks        = '.......'
    end

    s.subspec 'B' do |ss|
        ss.frameworks        = '.......'
    end
end

If someone wants to use the Umbrella.A framework then they refer to it like this in their Podfile

pod 'Umbrella/A'
hfossli
  • 22,616
  • 10
  • 116
  • 130