新项目如何添加CocoaPods并生成Podfile文件

1. 打开命令行,进入到项目根目录

cd /Users/apple/develop/ios/ios-fruit_vegetable_charge_account

2. 执行 pod init命令

pod init

3. 上一步执行完成之后,在项目的根目录下会生成一个Podfile文件,打开这个文件添加一个依赖

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ios-fruit_vegetable_charge_account' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ios-fruit_vegetable_charge_account
  
  
  
  # 在这个位置添加新的依赖
  #提供类似Android中的更高级的布局框架
  #https://github.com/youngsoft/TangramKit
  pod 'TangramKit'

  
  

  target 'ios-fruit_vegetable_charge_accountTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ios-fruit_vegetable_charge_accountUITests' do
    # Pods for testing
  end
  
  

end

4. 上一步执行完成之后,在项目的根目录下会生成一个ios-fruit_vegetable_charge_account.xcworkspace文件和Pods目录,关掉项目,双击ios-fruit_vegetable_charge_account.xcworkspace这个文件,打开项目就算完成了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容