为什么 Cocoapods 1.5 支持编译静态库之后大家这么高兴?

昨天在 Twitter 上看到 TualatriX 说把私有库都通过 Cocoapods 编译成静态库之后很爽, 就有点好奇到底是爽在哪里. 于是去搜了一下, 原来是前段时间(大半年前吧…), Cocoapods 发布了 1.5 的 release note, 宣布支持 Swift 静态库编译. 并且文中提到了对于担心动态二进制文件影响应用启动速度的人来说, 这是个了不起的更新. jh 那又是为什么 App 使用静态库会比动态库有更快的启动速度呢? 又跑去搜了一下官方文档. 打开 Dynamic Library Programming Topics 开头就看到: This article introduces dynamic libraries and shows how using dynamic libraries instead of static libraries reduces both the file size and initial memory footprint of the apps that use them. 这篇文章主要介绍了动态库, 并且展示了通过使用动态库而不是静态库, 是如何缩减了应用的大小和初始内存空间的. ┻━┻ (ヽ(`Д ́)ノ( ┻━┻ 这和说好的不一样啊? ...

December 27, 2018