用Objective-C语言创建了一个项目,后来我在里面使用了Swift。在我的 pod 文件中,我有几个 Objective-C pod。我尝试使用 RxSwift pod,它不允许我使用 Swift pod,而且我不能使用 use_frameworks!
因为我有 Objective-C pod。
platform :ios, '8.0'
# use_frameworks!
target 'MyProject' do
pod 'STPopup'
pod 'AFNetworking', '~> 3.1.0'
pod 'Reachability'
pod 'SVProgressHUD'
pod 'CCHMapClusterController'
pod 'SDWebImage', '~> 3.8.2'
pod 'DateTools'
pod 'Fabric'
pod 'TwitterKit'
pod 'Crashlytics'
pod 'SpinKit', '~> 1.1'
pod 'GPUImage'
pod 'LLSimpleCamera', '~> 5.0'
pod 'MGSwipeTableCell'
pod 'JSONModel'
pod 'ASIHTTPRequest'
pod 'PEPhotoCropEditor', :git => 'https://github.com/luyzdeleon/PEPhotoCropEditor'
pod 'RSKImageCropper', :git => 'https://github.com/luyzdeleon/RSKImageCropper'
pod 'MXParallaxHeader'
pod 'Toast', '~> 3.0'
pod 'TransformerKit'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FRHyperLabel', '~> 1.0.1'
pod 'STTweetLabel', :git => 'https://github.com/pabelnl/STTweetLabel.git', :branch => 'master'
pod 'STTwitter'
pod 'YSTutorialViewController'
pod 'CTAssetsPickerController', :git => 'https://github.com/pabelnl/CTAssetsPickerController', :branch => 'master'
pod 'RDHCollectionViewGridLayout', '~> 1.2'
pod 'AFNetworking+RetryPolicy'
pod 'AWSMobileAnalytics', '~> 2.4'
pod 'CHTCollectionViewWaterfallLayout'
pod 'BBBadgeBarButtonItem'
pod 'FMDB'
pod 'APAddressBook'
pod 'CTVideoPlayerView'
pod 'IBProgressButton'
pod 'VIMVideoPlayer', :git => 'https://github.com/pabelnl/VIMVideoPlayer', :branch => 'master'
pod 'ICGVideoTrimmer'
pod 'CRGradientNavigationBar', :git => 'https://github.com/luyzdeleon/CRGradientNavigationBar', :branch => 'master'
pod 'KILabel', '~> 1.0.1'
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'SwiftTryCatch'
pod 'libPhoneNumber-iOS', '~> 0.8'
pod 'IGListKit'
pod 'SDWebImage-CircularProgressView'
pod 'RxSwift'
end
- 我在使用
use_frameworks!
时出错:
[!] 用 Swift 编写的 Pod 只能作为框架集成;将 use_frameworks!
添加到您的 Podfile 或 target 以选择使用它。使用的 Swift Pod 是:RxSwift
use_frameworks 出错!
:
[!] 无法将以下嵌入式目标与其各自的宿主目标集成(宿主目标是嵌入“子”目标(如框架或扩展)的“父”目标):
- MyProject (true) 和 share (false) 没有同时设置 use_frameworks!。
最佳答案
你可以使用 use_frameworks!
即使你有 Objective-C pod。
关于ios - 如何在 Objective-C 和 Swift 项目中使用 RxSwift?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43961885/