使用扩展中的领域 AND pods?

Using realm from an extension AND pods?

我收到来自 xcode 的警告(我正在尝试通过 pods 将领域纳入扩展和我的项目中)应用程序编译正常,扩展给了我.. .

ld: warning: linking against dylib not safe for use in application extensions: /foo/bar/baz/Library/Developer/Xcode/DerivedData/Secretary-gklgwtinpjtwntbnzitbsdzhopid/Build/Products/Debug-iphonesimulator/RealmSwift.framework/RealmSwift ld: warning: linking against dylib not safe for use in application extensions: /foo/bar/baz/Library/Developer/Xcode/DerivedData/Secretary-gklgwtinpjtwntbnzitbsdzhopid/Build/Products/Debug-iphonesimulator/Realm.framework/Realm

有没有办法做到这一点并且仍然使用cocoapods来处理?

这是对 Realm 和 RealmSwift pod 规范的疏忽。我已经在 https://github.com/realm/realm-cocoa/pull/2666 推送了 Realm 的拉取请求,它将在未来的版本中解决这个问题。