gpt4 book ai didi

ios - 如何将 Cocoapod 导入 App Extension?

转载 作者:搜寻专家 更新时间:2023-10-31 22:19:36 25 4
gpt4 key购买 nike

enter image description here通过 Cocoapods 和桥接头使用 Pinterest 的 iOS SDK,在我的应用程序中运行良好。

在我的项目中创建了新目标 -> Action 扩展。已尝试在 Linked Frameworks and Libraries 中链接 PDK 框架,已尝试在扩展中添加单独的桥接头文件,但 Xcode 崩溃无法找到它......关于如何导入它的任何想法?

播客文件:

platform :ios, '9.0'

pod "PinterestSDK", :git => "git@github.com:pinterest/ios-pdk.git"

pod "PINRemoteImage"

pod "GBDeviceInfo"

pod 'FBSDKCoreKit'



xcodeproj '/Users/garysabo/Dropbox/Xcode Projects/pinFixer2/pinFixer2.xcodeproj'

桥接头:

#import "PinterestSDK.h"
#import "PDKPin.h"
#import "PDKBoard.h"
#import "PDKImageInfo.h"
#import "PDKResponseObject.h"
#import "PDKClient.h"
#import "PDKModelObject.h"
#import "PDKUser.h"

最佳答案

以这个 pod 文件代码为例,这个 pod 文件有 2 个目标应用程序和扩展。

platform :ios, '9.0'
use_frameworks!
workspace 'MyWorkSpaceApp'

target 'MyApp' do

pod 'SwiftyUserDefaults'
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
#pod 'AlamofireNetworkActivityIndicator', '~> 2.0'
#pod "youtube-ios-player-helper", "~> 0.1.6"
#pod 'Alamofire-SwiftyJSON'
pod 'SwiftyJSON', '~> 3.0.0'
#pod 'SlideMenuControllerSwift'
pod 'UIColor_Hex_Swift', '~> 3.0.2'
#pod 'ALLoadingView', :git => 'https://github.com/ALoginov/ALLoadingView.git', :branch => 'swift3'
pod 'SDWebImage', '~>3.8'
#pod 'SwiftSpinner', :git => 'https://github.com/icanzilb/SwiftSpinner.git', :branch => 'swift3'
#pod 'SideMenu'
#pod 'Fabric'
#pod 'Crashlytics'
#pod 'IQKeyboardManagerSwift', '4.0.6'
#pod 'AELog'
#pod 'TestFairy'
#pod "AwesomeCache", "~> 5.0"
#pod 'Deviice'
#pod 'MKDropdownMenu'
#pod "HanekeSwift", :git => 'https://github.com/Haneke/HanekeSwift.git', :branch => 'feature/swift-3'
pod 'OneSignal', '~> 2.4'

post_install do |installer|
puts("Update debug pod settings to speed up build time")
Dir.glob(File.join("Pods", "**", "Pods*{debug,Private}.xcconfig")).each do |file|
File.open(file, 'a') { |f| f.puts "\nDEBUG_INFORMATION_FORMAT = dwarf" }
end
end

target 'MyAppExtension' do
pod 'OneSignal', '~> 2.4'
end

end

希望对你有帮助,祝好

关于ios - 如何将 Cocoapod 导入 App Extension?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42882819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com