神刀安全网

Some notes for Charts

Minimum deployment target of Charts is iOS8.0.

Cocoapods-1.0.0 tips.

  • Add use_frameworks! for iOS 8+;
  • Specify a target for each pod.

eg. if before you had your Podfile written like this:

pod 'Alamofire', '~> 3.1.4' pod 'SwiftyJSON', '~> 2.3.2' 

just change it to

target "TargetName" do     pod 'Alamofire', '~> 3.1.4'     pod 'SwiftyJSON', '~> 2.3.2' end 

Bridging between Objective-C and Swift.

  • In fact, after installing Charts with Cocoapods and building .xcworkspace , it automatically generates Charts-Swift.h file, which you can use directly in you .m file with #import <Charts/Charts-Swift.h> .(Here my project is OC-based.)
  • Check some build settings and parameters:
    • Product Module Name: yourProject
    • Defines Module: YES
    • Embedded Content Contains Swift: YES
    • Install Objective-C Compatibility Header: YES
    • Objective-C Bridging Header: $(SRCROOT)/Sources/SwiftBridging.h

Here’s step by step integration for Xcode between Objc and Swift in project .

However, I failed to use OC framework in Swift-based project with Cocoapods and still couldn’t tell why. I’ll add it later if I make it.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Some notes for Charts

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址