How to use Swift App + (Swift Framework + Objective C static Framework) without warnings

What I am trying to do:

  • Create a swift dynamic framework – Say SwiftDemo.framework
  • Swift.framework depends upon an external Objective-C static framework
    (No source code available) – Say ObjCDemo.framework. This framework has
    it’s module file and placed inside ObjCDemo.framework/Modules/module.modulemap
  • Put this SwiftDemo.framework inside an Swift application. Ideally I would want my swift app to be able to use both SwiftDemo.framework and ObjCDemo.framework without any error or warning.

What I have tried:

  • unexpectedly found nil while unwrapping an Optional value keyboardWillShow
  • matrix multiplication in swift using Accelerate framework 32 bit vs 64 bit
  • Change just Font of AttributedText in Swift
  • In Swift,there's no way to get the returned function's argument names?
  • Make navigation bar transparent regarding below image in iOS 8.1
  • Swift: SKSpriteKit, using Storyboards, UIViewController and UIButton to set in game parameters?
    • Create a swift dynamic framework SwiftDemo.framework

    • Added ObjCDemo.framework in “Linked Frameworks and Libraries”. Put ObjCDemo.frameworks path in “Framework Search Paths” if not added automatically. Access ObjCDemo.framework using “import ObjCDemo”. Build the SwiftDemo.framework. It builds fine, No error, No warning

    • Create a SwiftDemo application.

    • Add SwiftDemo.framework in “Embedded Binaries” section.

    Try to build, below is the error:

    ld: framework not found ObjCDemo for architecture x86_64

    Obviously not able to find the ObjCDemo.framework which is used by SwiftDemo.framework, So next I did:

    • Added ObjCDemo.framework in “Linked Frameworks and Libraries” and accordingly set the “Frameworks Search Paths” of target

    Try to build, No error but this is the console warning I get for every file in ObjCDemo.framework:

    objc[15127]: Class is implemented in both /Users/tarun/Library/Developer/CoreSimulator/Devices/4391A259-64DF-4893-BE09-31B5D2D5BC8C/data/Containers/Bundle/Application/CD896A7B-1868-44D1-BFEA-6CC081AD41DB/ and /Users/tarun/Library/Developer/CoreSimulator/Devices/4391A259-64DF-4893-BE09-31B5D2D5BC8C/data/Containers/Bundle/Application/CD896A7B-1868-44D1-BFEA-6CC081AD41DB/ One of the two will be used. Which one is undefined.

    Obviously these files are duplicated in both SwiftDemo.framework and, So to avoid next I did:

    • Remove ObjCDemo.framework form “Linked Frameworks and Libraries” of target but keep “Frameworks Search Paths” still
      pointing to ObjCDemo.framework path.

    Try to build, No error but this is the compile time warning:

    ld: warning: Auto-Linking supplied ‘…/SwiftDemo/ObjCDemo.framework/ObjCDemo’, framework linker option at …./SwiftDemo/ObjCDemo.framework/ObjCDemo is not a dylib

    No matter what I just couldn’t get pass these errors or warnings. Anyone got any solution to this?