I am struggling to make AFNetworking to work on my Today Extension.
My app is an Objective-c project with cocoapods (0.39.0), in which I started to migrate some stuff to Swift. I successfully made Swift to work with objective-c and I am using AFNetworking in both Swift and Objective-c code.
I added a Today Extension (made in Swift) and when I try to use Swift classes that use AFNetworking, it complains that no "AFHTTPRequestOperationManager" and other AFNetworking related classes couldn't be found.
I tried different solutions to the Podfile, which currently is configured like this:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
def testing_pods
pod 'Google/Analytics', '~> 1.0.0'
pod 'AFNetworking', '~> 2.6'
pod 'XCDYouTubeKit', '~> 2.4.0'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'Parse'
pod 'ParseUI'
pod 'ParseFacebookUtilsV4'
pod 'ParseTwitterUtils'
end
target '***' do
testing_pods
end
target '***' do
testing_pods
end
target 'todayExtension' do
pod 'AFNetworking', '~> 2.6'
end
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
puts "=== #{target.name}"
if target.name == "AFNetworking"
puts "Setting AFNetworking Macro AF_APP_EXTENSIONS so that it doesn't use UIApplication in extension."
target.build_configurations.each do |config|
puts "Setting AF_APP_EXTENSIONS macro in config: #{config}"
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'AF_APP_EXTENSIONS']
end
end
target.build_configurations.each do |config|
puts "Setting only_active_arch in config: #{config}"
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
I already deleted all pods and workspace and created them again but the problem still the same.
Any suggestion?
Thanks