Getting GoogleAnalytics CocoaPod to work on Swift project

I have a Swift project that includes some Swift CocoaPods and it works well. However, now I want to add a module GoogleAnalytics

that has no Swift version but only supports Objective-C, this is how my Subfile looks like:

source 'https://github.com/CocoaPods/Specs.git'                                  
platform :ios, '8.0'                                                             
use_frameworks!                                                                  

target 'MyApp' do                                                             
  pod 'MEViewExtensions', '~> 0.2'                                               
  pod 'SwiftColors', '~> 0.2'                                                    
  pod 'GradientView', '~> 2.0'                                                   
  pod 'GoogleAnalytics', '~> 3.12'                                               
end

      

Once installed, containers GoogleAnalytics

do not get their own structure in the Pods project like others. I tried to import it like a structure, for example:

import GoogleAnalytics

      

This does not work. I have also tried the bridging header like this:

#ifndef MyApp_Bridging_Header_h
#define MyApp_Bridging_Header_h

#import <GoogleAnalytics/GAI.h>

#endif

      

This doesn't work either. Can anyone please help?

+3


source to share


1 answer


There is currently a Swift version of Google Analytics. I've used it in several projects:



pod 'Google/Analytics', '~> 1.3'

      

+4


source







All Articles