惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Securelist
The Cloudflare Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
S
Schneier on Security
L
LangChain Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
T
Tenable Blog
B
Blog RSS Feed
V
Visual Studio Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
T
The Exploit Database - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
W
WeLiveSecurity
I
InfoQ
The Hacker News
The Hacker News
雷峰网
雷峰网
月光博客
月光博客
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
Hacker News: Ask HN
Hacker News: Ask HN
T
Threat Research - Cisco Blogs
GbyAI
GbyAI
The Last Watchdog
The Last Watchdog
P
Privacy International News Feed
Cyberwarzone
Cyberwarzone
S
SegmentFault 最新的问题
L
Lohrmann on Cybersecurity
人人都是产品经理
人人都是产品经理
V
V2EX
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Cybersecurity and Infrastructure Security Agency CISA
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Troy Hunt's Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
Microsoft Azure Blog
Microsoft Azure Blog

jobcher on 打工人日志

2023-12-21 打工人日报 2023-12-20 打工人日报 2023-12-19 打工人日报 2023-12-18 打工人日报 2023-12-17 打工人日报 2023-12-16 打工人日报 2023-12-15 打工人日报 2023-12-14 打工人日报 2023-12-13 打工人日报 2023-12-12 打工人日报 2023-12-11 打工人日报 2023-12-10 打工人日报 2023-12-09 打工人日报 2023-12-08 打工人日报 2023-12-07 打工人日报 2023-12-06 打工人日报 2023-12-05 打工人日报 2023-12-04 打工人日报 2023-12-03 打工人日报 2023-12-02 打工人日报 2023-12-01 打工人日报 2023-11-30 打工人日报 2023-11-29 打工人日报 2023-11-28 打工人日报 2023-11-27 打工人日报 2023-11-26 打工人日报 2023-11-25 打工人日报 2023-11-24 打工人日报 2023-11-23 打工人日报 2023-11-22 打工人日报 2023-11-21 打工人日报 2023-11-20 打工人日报 2023-11-19 打工人日报 2023-11-17 打工人日报 2023-11-16 打工人日报 2023-11-15 打工人日报 2023-11-14 打工人日报 2023-11-13 打工人日报 2023-11-12 打工人日报 2023-11-11 打工人日报 2023-11-10 打工人日报 2023-11-09 打工人日报 2023-11-08 打工人日报 2023-11-07 打工人日报 2023-11-06 打工人日报 2023-11-05 打工人日报 2023-11-04 打工人日报 2023-11-03 打工人日报 2023-11-02 打工人日报 2023-11-01 打工人日报 2023-10-31 打工人日报 2023-10-30 打工人日报 2023-10-29 打工人日报 2023-10-28 打工人日报 2023-10-27 打工人日报 2023-10-26 打工人日报 2023-10-25 打工人日报 2023-10-24 打工人日报 2023-10-23 打工人日报 2023-10-22 打工人日报 2023-10-21 打工人日报 2023-10-20 打工人日报 2023-10-19 打工人日报 2023-10-18 打工人日报 2023-10-17 打工人日报 2023-10-16 打工人日报 2023-10-15 打工人日报 2023-10-14 打工人日报 2023-10-13 打工人日报 2023-10-12 打工人日报 2023-10-11 打工人日报 2023-10-10 打工人日报 2023-10-09 打工人日报 2023-10-07 打工人日报 2023-10-06 打工人日报 2023-10-05 打工人日报 2023-10-04 打工人日报 2023-10-03 打工人日报 2023-10-02 打工人日报 2023-10-01 打工人日报 2023-09-30 打工人日报 2023-09-29 打工人日报 2023-09-28 打工人日报 2023-09-27 打工人日报 2023-09-26 打工人日报 2023-09-25 打工人日报 2023-09-24 打工人日报 2023-09-23 打工人日报 2023-09-22 打工人日报 2023-09-21 打工人日报 2023-09-20 打工人日报 2023-09-19 打工人日报 2023-09-18 打工人日报 2023-09-17 打工人日报 2023-09-16 打工人日报 2023-09-15 打工人日报 2023-09-14 打工人日报 2023-09-13 打工人日报 2023-09-12 打工人日报 2023-09-11 打工人日报
CocoaPods 安装及碰到问题
2023-07-31 · via jobcher on 打工人日志

背景

CocoaPods 是OS X和IOS 下的第三类库管理工具,通过CocoaPods工具我们可以为项目添加被称为Pods的依赖库

检查环境

ruby -v
gem -v

出现异常问题

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin22/rbconfig.rb:21: warning: Insecure world writable dir /opt/homebrew/bin in PATH, mode 040777

该警告信息表明在你的PATH环境变量中包含了一个“不安全可写”(Insecure world writable)的目录/opt/homebrew/bin。这可能会导致潜在的安全问题。
为了解决这个警告,你需要修复/opt/homebrew/bin目录的权限,以使其不再被标记为“不安全可写”。

解决问题

chmod 755 /opt/homebrew/bin
chmod 755 /opt/homebrew
chmod 755 /opt/homebrew/sbin

安装cocoapods

输入安装命令

1sudo gem install cocoapods

出现异常问题

ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory. /Library/Ruby/Site/2.6.0/rubygems/installer.rb:714:in verify_gem_home' /Library/Ruby/Site/2.6.0/rubygems/installer.rb:904:in pre_install_checks' ……

macOS 系统中,系统的Ruby目录通常是受保护的,并且普通用户没有对这些目录进行写操作的权限。为了解决这个问题,你应该避免在系统级别的Ruby目录中进行Gem的安装。相反,你应该使用用户级别的Gem安装目录。

解决方案

1mkdir -p ~/.gem/ruby/2.6.0
2export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH"
3source ~/.bash_profile
1gem cocoapods install --user-install

第三方库

在iOS开发中,有许多常用的框架和库,用于加速应用程序的开发和提供各种功能。以下是一些常用的iOS开发框架和库:

  1. UIKit:UIKit是iOS开发的核心框架,它提供了构建用户界面和处理用户交互的基本组件,如视图(UIView)、控制器(UIViewController)、按钮(UIButton)、标签栏(UITabBarController)等。
  2. SwiftUI:SwiftUI是一种较新的声明性用户界面框架,它使您可以使用Swift代码轻松构建用户界面,并自动处理界面状态的变化。它为多平台开发(iOS、iPadOS、macOS、watchOS)提供了便捷的方式。
  3. Core Data:Core Data是Apple提供的数据持久化框架,用于在iOS应用程序中管理数据模型、数据存储和数据查询。
  4. Core Animation:Core Animation是处理iOS界面动画的底层框架,可以实现各种动画效果,包括平移、旋转、缩放和淡入淡出等。
  5. Alamofire:Alamofire是一个优秀的网络请求库,它简化了在iOS应用程序中进行HTTP请求的过程,支持多种请求方式和参数编码。
  6. Kingfisher:Kingfisher是一个流行的图像加载和缓存库,它能够异步加载网络上的图片,并且可以自动进行内存和磁盘缓存。
  7. Firebase:Firebase是谷歌提供的一组云服务,包括实时数据库、身份验证、云存储、推送通知等功能,用于简化iOS应用程序的后端开发。
  8. SwiftyJSON:SwiftyJSON是一个简单易用的JSON解析库,用于在iOS应用程序中解析和处理JSON数据。
  9. MapKit:MapKit是iOS提供的地图显示框架,可以在应用程序中集成地图、标记、路线等地理位置功能。
  10. CoreDataKit:CoreDataKit是一个便捷的Core Data封装库,简化了Core Data的使用和管理。

这只是iOS开发中的一小部分常用框架和库,还有很多其他优秀的开源库可供选择,根据您的应用程序需求,选择适合的框架和库可以加快开发速度并提供更好的用户体验。

初始化项目

在xcode中创建项目,进入xcode根目录

编写Podfile

 1# Uncomment the next line to define a global platform for your project
 2# platform :ios, '9.0'
 3
 4target 'demo' do ### app名称
 5  # Comment the next line if you don't want to use dynamic frameworks
 6  use_frameworks!
 7
 8  # Pods for demo
 9  pod 'SWXMLHash' ### 添加的依赖
10  pod "ViewAnimator" ### 添加的依赖
11
12  target 'demoTests' do
13    inherit! :search_paths
14    # Pods for testing
15  end
16
17  target 'demoUITests' do
18    # Pods for testing
19  end
20
21end

安装依赖