0

So here is the scenario. I have two Cocoa Touch frameworks lets call it Framework_A and Framework_B and have respective Cocoa Pods for them Pod_A and Pod_B.

Now I want Framework_A to weakly link to Framework_B i.e, If Framework_B is present in the project then call a method of Framework_B.

How can I achieve this? I'm currently using __has_include macro to achieve it as shown below:

#if __has_include(< Framework_B/Framework_B.h>)
    #import <Framework_B/Framework_B.h>
#endif

But this is causing issue while Submitting build to AppStore where it gives the following error:

- ITMS-90562: Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
– ITMS-90562: Invalid Bundle - The app submission can not be successfully recompiled from bitcode due to missing symbols during linking.

This happens when the Framework_B is not present in the project.

Chengappa C D
  • 1,841
  • 1
  • 12
  • 19
  • 1
    Weak linking is a runtime thing where as `__has_include()` is compile-time. Have you read [this](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html)? – trojanfoe Mar 27 '20 at 13:09
  • I'm trying with the help of this doc, will get back on this. Thanks @trojanfoe! – Chengappa C D Mar 27 '20 at 14:17
  • Hi @ChengappaCD, I have a similar situation, does the _weak_linking helps? – Srinivas May 15 '23 at 09:31

0 Answers0