iOS Pod Install Gcm and Pnchartswift

iOS pod install gcm and pnchartswift

Unfortunately it is not possible to mix static and dynamic libraries, it's all-or-nothing.

Instead I will suggest you to make use of of the original Obj-C version PNChart, which would solve your issue using GCM.

That means your podfile would look similar to the following:

pod "PNChart"
pod "Google/CloudMessaging"

The only thing you have to do differently when importing the PNChart is to add a briding header importing these libraries. This will make them available anywhere in the code. It would look something like the following:

#import <PNChart.h>
#import <Google/CloudMessaging.h>

UPDATE 1:

Answered OP's question about how to identify static/dynamic.


As a rule of thumb:

  • All dependencies written in Swift are dynamic frameworks.
  • All dependencies written in Obj-C are static libraries.

Apple doesn't let you build static libraries that contain Swift, so the first statement will always be true. The second statement is a bit more complicated, since Apple has previously built a lot of dynamic internal frameworks in Obj-C. This possibility has not been available to third-party developers until iOS 8 (same time as Swift was released), so don't expect any new frameworks written in Obj-C to be dynamic since they might as well be written in Swift.

Right now we are simply in a stage of "limbo" when switching between the two languages. In 1-2 years then hopefully the majority of all third-party dependencies will be written in Swift and we don't have to worry about things like static/dyanmic.

If you are interested, then you can read more about it on the official CocoaPods blog post for release 0.36.

Getting GoogleAnalytics CocoaPod to work in a Swift project

There now exists a Swift version of Google Analytics. I've used it in a couple of projects:

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


Related Topics



Leave a reply



Submit