Cannot debug Swift module/framework embedded in Objective-C app

后端 未结 11 1720
悲哀的现实
悲哀的现实 2021-02-01 02:57

Alternative titles (to aid searching)

  • Cannot debug Swift 2.3 framework linked to an Objective-C app in Xcode 8
  • error in auto-import: f
11条回答
  •  难免孤独
    2021-02-01 03:51

    As suggested by Tim https://stackoverflow.com/a/41876400/1840269 the root cause to our problem was a matter of duplicates.

    We had a obj-c wrapper category for SDWebImage that was used from both obj-c and Swift. When Importing the category from Swift everything blew up because of redefinition/duplicate import since the SDWebImage pod already exposed it self as a Swift module.

    The solution? We re-implemented the obj-c category as a Swift extension - and kept using it from both Swift and obj-c by adding @objc in front of the extension and importing the #import "product-Swift.h" file from obj-c.

    And maybe start with checking: https://developer.apple.com/library/content/qa/qa1947/_index.html.

提交回复
热议问题