<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Yingqwq的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Yingqwq</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Yingqwq]]></copyright><item><title><![CDATA[Mac 安装CocoaPods报错解决 :Ignoring ffi-1.13.1 because its extensions are not built.]]></title><link>https://blog.youkuaiyun.com/Yingqwq/article/details/120517594</link><guid>https://blog.youkuaiyun.com/Yingqwq/article/details/120517594</guid><author>Yingqwq</author><pubDate>Mon, 27 Sep 2021 21:30:05 +0800</pubDate><description><![CDATA[不知道是不是更新了macOS Big Sur的原因，终端安装不了cocoapods，会报如下错误。

终端报错信息：


Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1


经过一番搜索，有一篇优快云给出了一个解决方法，在终端输入代码段：


xcode-select --install

但是在输完后我发现要下载一个下载时间长达50个小时的Xcode Comm]]></description><category></category></item><item><title><![CDATA[Swift 洗牌shuffle cards]]></title><link>https://blog.youkuaiyun.com/Yingqwq/article/details/120322919</link><guid>https://blog.youkuaiyun.com/Yingqwq/article/details/120322919</guid><author>Yingqwq</author><pubDate>Thu, 16 Sep 2021 10:03:29 +0800</pubDate><description><![CDATA[在swift 4.2+中提供了shuffle（）和shuffled（）


let x = [1, 2, 3].shuffled()
// x == [2, 3, 1]

let fiveStrings = stride(from: 0, through: 100, by: 5).map(String.init).shuffled()
// fiveStrings == ["20", "45", "70", "30", ...]

var numbers = [1, 2, 3, 4]
numbers.shu]]></description><category></category></item><item><title><![CDATA[swift 数组popLast ()和removeLast()使用时的区别]]></title><link>https://blog.youkuaiyun.com/Yingqwq/article/details/120305120</link><guid>https://blog.youkuaiyun.com/Yingqwq/article/details/120305120</guid><author>Yingqwq</author><pubDate>Wed, 15 Sep 2021 11:33:30 +0800</pubDate><description><![CDATA[刷leetcode的时候遇到了这个问题，随手记录一下：

Array.popLast()返回一个 option 值，意味着如果数组为空，会返回一个nil，需要用if let option=option或option来取值；

而 Array.removeLast() 直接返回数组的最后一个值，如果为nil，程序崩溃。

当不需要返回值时，popLast() 需要@discardableResult，而removeAll()已经是discardable的。
...]]></description><category></category></item></channel></rss>