CocoaPods方式使用SnapKit

通过CocoaPods安装

初始化

进入工程更目录执行命令,生产Podfile文件

pod init

打开Podfile 文件

vim Podfile

编辑

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

target 'Aider' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'SnapKit','~> 3.0' #增加此行
  # Pods for Aider

end

运行CocoaPods install 命令

leishendeMBP:Aider leishen$ pod install
Analyzing dependencies
Downloading dependencies
Installing SnapKit (3.2.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `Aider.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Automatically assigning platform ios with version 10.3 on target Aider because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

到此,不出意外的话,你已经将SnapKit集成到你的项目中了。

重新打开项目

项目名称.xcworkspace

相关文章

软件简介:蓝湖辅助工具,减少移动端开发中控件属性的复制和粘...
现实生活中,我们听到的声音都是时间连续的,我们称为这种信...
前言最近在B站上看到一个漂亮的仙女姐姐跳舞视频,循环看了亿...
【Android App】实战项目之仿抖音的短视频分享App(附源码和...
前言这一篇博客应该是我花时间最多的一次了,从2022年1月底至...
因为我既对接过session、cookie,也对接过JWT,今年因为工作...