Giulio Bider
Giulio Bider

Reputation: 1406

iOS How to manage different features that requires a 3rd-party framework

I developed an SDK distributed to our publishers as a standard iOS framework. To be as much clear as possibile let's say my SDK is called 'A'. 'A' needs a 3rd-party iOS framework (called 'B') that manages a particular feature. So, for example, I have a class in 'A' like this:

#import <Foundation/Foundation.h>

#import <B/SomeClassOfB.h>

@interface MyClassOfA : NSObject < 'B' Delegate>

Import of 3rd-party framework and my class is conform to a protocol of 'B'

Now, if I have a publisher in the USA that want use this particular feature, I will send to him my framework plus 3rd-party framework, publisher links both of them to his app and everything works. Yeah!!

Now the problem.... if I have a publisher in Europe that don't want use this particular feature, I don't want to send him 3rd-party framework and he doesn't want to add something completely useless to his app. Which is the best way to achieve this problem? How can I build two different frameworks, one with the above class that depends to 'B' and one that ignore it without "comment" code every time?

Thanks

Upvotes: 1

Views: 62

Answers (1)

Elf Sundae
Elf Sundae

Reputation: 1615

You can create another target.

enter image description here

If you just want to distinguish .h or .m files, then create these files with the same filename(or class name) but different filepath, then edit "Target Membership"

enter image description here

enter image description here enter image description here

enter image description here

Upvotes: 2

Related Questions