<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>碎片芝士收藏 - 宋明的博客</title><link>https://apolla.cc/posts/tips/</link><description>宋明的博客</description><generator>Hugo 0.170.0 &amp; FixIt v1.0.0-rc.5-mwimukpl</generator><language>zh-cn</language><lastBuildDate>Sun, 10 Mar 2024 09:47:41 +0800</lastBuildDate><atom:link href="https://apolla.cc/posts/tips/index.xml" rel="self" type="application/rss+xml"/><item><title>iOS架构设计!iOS开发包二进制化【.a静态库、.framework(静态库、动态库)、.dyld动态库、XCFameworks等】 - 掘金</title><link>https://apolla.cc/posts/tips/ios%E6%9E%B6%E6%9E%84%E8%AE%BE%E8%AE%A1ios%E5%BC%80%E5%8F%91%E5%8C%85%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%8C%96.a%E9%9D%99%E6%80%81%E5%BA%93.framework%E9%9D%99%E6%80%81%E5%BA%93%E5%8A%A8%E6%80%81%E5%BA%93.dyld%E5%8A%A8%E6%80%81%E5%BA%93xcfameworks%E7%AD%89-%E6%8E%98%E9%87%91/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/ios%E6%9E%B6%E6%9E%84%E8%AE%BE%E8%AE%A1ios%E5%BC%80%E5%8F%91%E5%8C%85%E4%BA%8C%E8%BF%9B%E5%88%B6%E5%8C%96.a%E9%9D%99%E6%80%81%E5%BA%93.framework%E9%9D%99%E6%80%81%E5%BA%93%E5%8A%A8%E6%80%81%E5%BA%93.dyld%E5%8A%A8%E6%80%81%E5%BA%93xcfameworks%E7%AD%89-%E6%8E%98%E9%87%91/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;h2 class="heading-element" id="前言"&gt;&lt;span&gt;前言&lt;/span&gt;&#10; &lt;a href="#%e5%89%8d%e8%a8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;我们之前通过一篇文章在讨论“&lt;code&gt;移动客户端架构设计&lt;/code&gt;的时候，仅是通过&lt;a href="https://juejin.cn/post/7118599362036367391" target="_blank" rel="external nofollow noopener noreferrer"&gt;一篇文章&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;进行了综述。&lt;/p&gt;</description></item><item><title>Apple Configurator 2 之 Web Clips - 简书</title><link>https://apolla.cc/posts/tips/apple-configurator-2-%E4%B9%8B-web-clips-%E7%AE%80%E4%B9%A6/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/apple-configurator-2-%E4%B9%8B-web-clips-%E7%AE%80%E4%B9%A6/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;h2 class="heading-element" id="一apple-configurator-2"&gt;&lt;span&gt;一、Apple Configurator 2&lt;/span&gt;&#10; &lt;a href="#%e4%b8%80apple-configurator-2" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;h3 class="heading-element" id="11-什么是apple-configurator"&gt;&lt;span&gt;1.1 什么是Apple Configurator&lt;/span&gt;&#10; &lt;a href="#11-%e4%bb%80%e4%b9%88%e6%98%afapple-configurator" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://links.jianshu.com/go?to=https%3A%2F%2Fsupport.apple.com%2Fzh-cn%2Fguide%2Fapple-configurator-2%2Fcadf1802aed%2Fmac" target="_blank" rel="external nofollow noopener noreferrer"&gt;关于 Mac 上的 Apple Configurator 介绍&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>cocoapods 安装</title><link>https://apolla.cc/posts/tips/cocoapods-%E5%AE%89%E8%A3%85/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/cocoapods-%E5%AE%89%E8%A3%85/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;一、安装步骤&#10;安装Homebrew &amp;ndash;&amp;gt; 安装rvm &amp;ndash;&amp;gt; 安装ruby -&amp;gt; 安装cocoapods&lt;/p&gt;&#10;&lt;p&gt;二、检查Homebrew或安装&#10;1、查看安装的版本信息&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt;brew --version&#10;&#10;Homebrew 4.0.4-202-gb1ef41c&#10;Homebrew/homebrew-core (git revision fd2e83a24e8; last commit 2023-03-06)&#10;Homebrew/homebrew-cask (git revision c896fe8640; last commit 2023-03-06)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;2、安装Homebrew&#10;方式1：官方提供的安装方法&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt;/bin/bash -c &amp;#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;方式2：使用国内的源进行安装&lt;/p&gt;</description></item><item><title>iOS后台保活</title><link>https://apolla.cc/posts/tips/ios%E5%90%8E%E5%8F%B0%E4%BF%9D%E6%B4%BB/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/ios%E5%90%8E%E5%8F%B0%E4%BF%9D%E6%B4%BB/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;项目内嵌了H5导出的包 但是APP进入后台会导致未加载页面无法响应，故此想到后台保活策略 参考网上教程&lt;a href="https://blog.csdn.net/WangQingLei0307/article/details/112002904" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://blog.csdn.net/WangQingLei0307/article/details/112002904&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;&lt;img loading="lazy" src='https://apolla.cc/images/a989415806124ce1898be19020a17517.png' alt="image.png"&gt;&lt;/p&gt;&#10;&lt;p&gt;首先我们就要在Background Modes把音乐对应权限打开。&lt;/p&gt;&#10;&lt;p&gt;这个权限打开后，我们的工作就已经完成了1/3了&lt;/p&gt;&#10;&lt;p&gt;接下来我就就要在app进入后台的时候开始播放无声音的mp3。&lt;/p&gt;</description></item><item><title>iOS开发之UICollectionViewCompositionalLayout</title><link>https://apolla.cc/posts/tips/ios%E5%BC%80%E5%8F%91%E4%B9%8Buicollectionviewcompositionallayout/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/ios%E5%BC%80%E5%8F%91%E4%B9%8Buicollectionviewcompositionallayout/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;blockquote&gt;&#10;&lt;p&gt;横向滚动+竖向滚动的collectionView iOS13.0开始支持&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;日常开发中最常用的控件莫过于 UITableView 和 UICollectionView，随着应用越来越复杂，以前的 UICollectionViewFlowLayout 布局已经满足不了需求，而自定义布局又过于复杂，所以在 iOS 13 中 Apple 为 UICollectionView 推出了组合布局 UICollectionViewCompositionalLayout，这对于 UICollectionView 是一个全新的升级，它将赋予 UICollectionView 更多的可能性。&lt;/p&gt;</description></item><item><title>Swift 开发者常犯的十大错误</title><link>https://apolla.cc/posts/tips/swift-%E5%BC%80%E5%8F%91%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%8D%81%E5%A4%A7%E9%94%99%E8%AF%AF/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/swift-%E5%BC%80%E5%8F%91%E8%80%85%E5%B8%B8%E7%8A%AF%E7%9A%84%E5%8D%81%E5%A4%A7%E9%94%99%E8%AF%AF/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;&lt;img loading="lazy" src='https://apolla.cc/images/ecd61e61e9a4fe641373f1fcb12c8153.webp' alt="/images/ecd61e61e9a4fe641373f1fcb12c8153.webp"&gt;&lt;/p&gt;&#10;&lt;h3 class="heading-element" id="-错误一"&gt;&lt;span&gt;❌ 错误一&lt;/span&gt;&#10; &lt;a href="#-%e9%94%99%e8%af%af%e4%b8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h3&gt;&lt;blockquote&gt;&#10;&lt;p&gt;没有正确处理可选项。可选项在 Swift 中是一个强大的工具，但是不能正确处理它们 可能会导致运行时崩溃。在展开可选项之前，请确保始终检查 nil 值。 通常用 if-let 或者 guard-let 来检查 nil 值。&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>XCode15与iOS17!17.1 真机测试问题处理_xcode 真机测试</title><link>https://apolla.cc/posts/tips/xcode15%E4%B8%8Eios1717.1-%E7%9C%9F%E6%9C%BA%E6%B5%8B%E8%AF%95%E9%97%AE%E9%A2%98%E5%A4%84%E7%90%86_xcode-%E7%9C%9F%E6%9C%BA%E6%B5%8B%E8%AF%95/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/xcode15%E4%B8%8Eios1717.1-%E7%9C%9F%E6%9C%BA%E6%B5%8B%E8%AF%95%E9%97%AE%E9%A2%98%E5%A4%84%E7%90%86_xcode-%E7%9C%9F%E6%9C%BA%E6%B5%8B%E8%AF%95/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;XCode15与iOS17/17.1 真机测试问题处理，网上相关博客很多，摘录了如下实践后能起作用的地址如下：&#10;&lt;a href="https://www.jianshu.com/p/ed68ea57d667" target="_blank" rel="external nofollow noopener noreferrer"&gt;Xcode 15 报错处理 - 简书&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;&lt;a href="https://blog.csdn.net/ZhaiAlan/article/details/131564174" target="_blank" rel="external nofollow noopener noreferrer"&gt;iOS17版本适配-CSDN博客&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://www.6hu.cc/archives/208992.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;Xcode15适配-六虎&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>从探索到实践，iOS动态库懒加载实录</title><link>https://apolla.cc/posts/tips/%E4%BB%8E%E6%8E%A2%E7%B4%A2%E5%88%B0%E5%AE%9E%E8%B7%B5ios%E5%8A%A8%E6%80%81%E5%BA%93%E6%87%92%E5%8A%A0%E8%BD%BD%E5%AE%9E%E5%BD%95/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/%E4%BB%8E%E6%8E%A2%E7%B4%A2%E5%88%B0%E5%AE%9E%E8%B7%B5ios%E5%8A%A8%E6%80%81%E5%BA%93%E6%87%92%E5%8A%A0%E8%BD%BD%E5%AE%9E%E5%BD%95/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;h2 class="heading-element" id="导读"&gt;&lt;span&gt;导读&lt;/span&gt;&#10; &lt;a href="#%e5%af%bc%e8%af%bb" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;业务功能只增不减，图片已无压缩空间，业务代码无法快速下线，一个历经10年，由2000万条指令、6万多个类构成的APP如何才能在业务迭代过程中实现启动优化与下载优化？&lt;/p&gt;</description></item><item><title>关于 App Store 苹果商店价格的那些事（历上最全版） - 掘金</title><link>https://apolla.cc/posts/tips/%E5%85%B3%E4%BA%8E-app-store-%E8%8B%B9%E6%9E%9C%E5%95%86%E5%BA%97%E4%BB%B7%E6%A0%BC%E7%9A%84%E9%82%A3%E4%BA%9B%E4%BA%8B%E5%8E%86%E4%B8%8A%E6%9C%80%E5%85%A8%E7%89%88-%E6%8E%98%E9%87%91/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/%E5%85%B3%E4%BA%8E-app-store-%E8%8B%B9%E6%9E%9C%E5%95%86%E5%BA%97%E4%BB%B7%E6%A0%BC%E7%9A%84%E9%82%A3%E4%BA%9B%E4%BA%8B%E5%8E%86%E4%B8%8A%E6%9C%80%E5%85%A8%E7%89%88-%E6%8E%98%E9%87%91/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;作者：iHTCboy&lt;/p&gt;&#10;&lt;h3 class="heading-element" id="一前言"&gt;&lt;span&gt;一、前言&lt;/span&gt;&#10; &lt;a href="#%e4%b8%80%e5%89%8d%e8%a8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h3&gt;&lt;p&gt;苹果 2022 年 12 月 6 日宣布 &lt;a href="https://link.juejin.cn/?target=https%3A%2F%2Fdeveloper.apple.com%2Fcn%2Fnews%2F%3Fid%3Dqzex35ch" target="_blank" rel="external nofollow noopener noreferrer"&gt;App Store 定价机制最重大升级，新增 700 个价格点&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;。小编当时的总结和分析：&lt;/p&gt;</description></item><item><title>如何实现 iOS 16 带来的 Depth Effect 图片效果</title><link>https://apolla.cc/posts/tips/%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0-ios-16-%E5%B8%A6%E6%9D%A5%E7%9A%84-depth-effect-%E5%9B%BE%E7%89%87%E6%95%88%E6%9E%9C/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0-ios-16-%E5%B8%A6%E6%9D%A5%E7%9A%84-depth-effect-%E5%9B%BE%E7%89%87%E6%95%88%E6%9E%9C/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;原文链接：&lt;a href="https://juejin.cn/post/7197608023430283319?" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://juejin.cn/post/7197608023430283319?&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 class="heading-element"&gt;&lt;span&gt;&lt;img loading="lazy" src='https://apolla.cc/images/e336e871a4ee473245e74bd4e4ff9faf.webp' alt="/images/e336e871a4ee473245e74bd4e4ff9faf.webp"&gt;&lt;/span&gt;&#10; &lt;a href="#" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;h2 class="heading-element" id="0x01-前言"&gt;&lt;span&gt;0x01 前言&lt;/span&gt;&#10; &lt;a href="#0x01-%e5%89%8d%e8%a8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;iOS 16 系统为我们带来了比较惊艳的桌面锁屏效果：Depth Effect。它可以使用一张普通图片当背景，同时可以在适当的地方遮拦住部分桌面组件，形成一种景深的效果（如下图）。&#10;&lt;img loading="lazy" src='https://apolla.cc/images/8e12c15adf7940938287fda3a66c9392.webp' alt="/images/8e12c15adf7940938287fda3a66c9392.webp"&gt;&lt;/p&gt;</description></item><item><title>用 SwiftUI 实现 AI 聊天对话 app - iChatGPT</title><link>https://apolla.cc/posts/tips/%E7%94%A8-swiftui-%E5%AE%9E%E7%8E%B0-ai-%E8%81%8A%E5%A4%A9%E5%AF%B9%E8%AF%9D-app-ichatgpt/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/%E7%94%A8-swiftui-%E5%AE%9E%E7%8E%B0-ai-%E8%81%8A%E5%A4%A9%E5%AF%B9%E8%AF%9D-app-ichatgpt/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;p&gt;原文链接：&lt;a href="https://juejin.cn/post/7175051294808211512?" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://juejin.cn/post/7175051294808211512?&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;&lt;img loading="lazy" src='https://apolla.cc/images/a329416483353d5a68fbe869682195b3.webp' alt="/images/a329416483353d5a68fbe869682195b3.webp"&gt;&lt;/p&gt;&#10;&lt;h3 class="heading-element" id="一前言"&gt;&lt;span&gt;一、前言&lt;/span&gt;&#10; &lt;a href="#%e4%b8%80%e5%89%8d%e8%a8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h3&gt;&lt;p&gt;关于 ChatGPT 的话题，大家都不陌生，我们直入话题，因为 ChatGPT 目前限制中国访问服务，所以如果直接使用 ChatGPT 网页进行对话，还是不太方便。通过 ChatGPT SessionToken 就可以不限制网络访问，所以大家发挥想象力实现各种的聊天机器人、小程序，而原生 app 可能体验更好！所以就有了 iChatGPT！一款用 SwiftUI 实现的开源 ChatGPT app，欢迎大家关注和提 PR。&lt;/p&gt;</description></item><item><title>云音乐 Swift 混编 Module 化实践</title><link>https://apolla.cc/posts/tips/%E4%BA%91%E9%9F%B3%E4%B9%90-swift-%E6%B7%B7%E7%BC%96-module-%E5%8C%96%E5%AE%9E%E8%B7%B5/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/tips/%E4%BA%91%E9%9F%B3%E4%B9%90-swift-%E6%B7%B7%E7%BC%96-module-%E5%8C%96%E5%AE%9E%E8%B7%B5/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;hr&gt;&#10;&lt;p&gt;title: 云音乐 Swift 混编 Module 化实践&#10;date: 2024-03-10 00:16:26&#10;copyright: false&#10;author: 网易云音乐技术团队&#10;home: &lt;a href="https://juejin.cn/user/4265760847567016/posts" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://juejin.cn/user/4265760847567016/posts&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;origin: juejin&#10;url: &lt;a href="https://juejin.cn/post/7207269389474037817" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://juejin.cn/post/7207269389474037817&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;tag:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;iOS&#10;categories:&#10;description: 图片来自：unsplash.com 本文作者：冰川 背景 云音乐 iOS App 经历多年的迭代，&amp;hellip;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;hr&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;图片来自：&lt;a href="https://unsplash.com" target="_blank" rel="external nofollow noopener noreferrer"&gt;unsplash.com&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;br&gt;&#10;本文作者：冰川&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;h2 class="heading-element" id="背景"&gt;&lt;span&gt;背景&lt;/span&gt;&#10; &lt;a href="#%e8%83%8c%e6%99%af" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;云音乐 iOS App 经历多年的迭代，积累了大量的 Objective-C（以下简称 OC） 代码，目前已经完成主工程壳化，各层组件关系如下：&lt;/p&gt;</description></item><item><title>iOS 获取图片、区域的主色。水印文字颜色处理,主要方法来自其他文档，自己再修改整合</title><link>https://apolla.cc/posts/tips/ios-%E8%8E%B7%E5%8F%96%E5%9B%BE%E7%89%87%E5%8C%BA%E5%9F%9F%E7%9A%84%E4%B8%BB%E8%89%B2%E6%B0%B4%E5%8D%B0%E6%96%87%E5%AD%97%E9%A2%9C%E8%89%B2%E5%A4%84%E7%90%86%E4%B8%BB%E8%A6%81%E6%96%B9%E6%B3%95%E6%9D%A5%E8%87%AA%E5%85%B6%E4%BB%96%E6%96%87%E6%A1%A3%E8%87%AA%E5%B7%B1%E5%86%8D%E4%BF%AE%E6%94%B9%E6%95%B4%E5%90%88/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/tips/ios-%E8%8E%B7%E5%8F%96%E5%9B%BE%E7%89%87%E5%8C%BA%E5%9F%9F%E7%9A%84%E4%B8%BB%E8%89%B2%E6%B0%B4%E5%8D%B0%E6%96%87%E5%AD%97%E9%A2%9C%E8%89%B2%E5%A4%84%E7%90%86%E4%B8%BB%E8%A6%81%E6%96%B9%E6%B3%95%E6%9D%A5%E8%87%AA%E5%85%B6%E4%BB%96%E6%96%87%E6%A1%A3%E8%87%AA%E5%B7%B1%E5%86%8D%E4%BF%AE%E6%94%B9%E6%95%B4%E5%90%88/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;pre&gt;&lt;code&gt;//添加水印&#10;&amp;#43; (UIImage *)getWaterMarkWith:(UIImage *)image waterText:(NSString *)str{&#10;&#10; CGSize imageSize = image.size;&#10; CGFloat imageWidth = imageSize.width;&#10; CGFloat imageHeight = imageSize.height;&#10;&#10; UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);&#10; [image drawAtPoint:CGPointZero];&#10; CGFloat textFont = 10 * ceilf(imageWidth / [UIScreen mainScreen].bounds.size.width);&#10; CGSize perSize = [self getSize:imageWidth font:[UIFont systemFontOfSize:textFont] str:str lineSpace:0];&#10; CGRect rect = CGRectMake(ceilf(imageWidth - perSize.width - 20),&#10; ceilf(imageHeight - perSize.height - 20),&#10; ceilf(perSize.width &amp;#43; 10),&#10; ceilf(perSize.height &amp;#43; 5));&#10;&#10; NSDictionary *colorInfo = [self mostColor:image scale:1 rect:rect];&#10; CGFloat red = [colorInfo[@&amp;#34;red&amp;#34;] floatValue];&#10; CGFloat green = [colorInfo[@&amp;#34;green&amp;#34;] floatValue];&#10; CGFloat blue = [colorInfo[@&amp;#34;blue&amp;#34;] floatValue];&#10; CGFloat alpha = [colorInfo[@&amp;#34;alpha&amp;#34;] floatValue];&#10; BOOL colorDark = [self isDarkColor:[UIColor colorWithRed:red green:green blue:blue alpha:alpha]];&#10; [str drawAtPoint:rect.origin withAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:textFont], NSForegroundColorAttributeName:colorDark ? [UIColor whiteColor] : [UIColor blackColor]}];&#10; image = UIGraphicsGetImageFromCurrentImageContext();&#10; UIGraphicsEndImageContext();&#10;&#10; return image;&#10;}&#10;&#10;// 获取图片、区域的主色&#10;&amp;#43; (NSDictionary *)mostColor:(UIImage *)image scale:(CGFloat)scale rect:(CGRect)rect{&#10;&#10; #if __IPHONE_OS_VERSION_MAX_ALLOWED &amp;gt; __IPHONE_6_1&#10; int bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast;&#10; #else&#10; int bitmapInfo = kCGImageAlphaPremultipliedLast;&#10; #endif&#10; if (scale &amp;lt;= 0.1) {&#10; scale = 0.1;&#10; }else if(scale &amp;gt;= 1){&#10; scale = 1;&#10; }&#10;&#10; if (rect.size.width &amp;gt; 0 &amp;amp;&amp;amp; rect.size.height &amp;gt; 0) {&#10; image = [self cropSquareImage:image rect:rect];&#10; }&#10;&#10; //第一步 先把图片缩小 加快计算速度. 但越小结果误差可能越大&#10; CGSize thumbSize = CGSizeMake([image size].width * scale, [image size].height * scale);&#10; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();&#10; CGContextRef context = CGBitmapContextCreate(NULL,&#10; thumbSize.width,&#10; thumbSize.height,&#10; 8,//bits per component&#10; thumbSize.width*4,&#10; colorSpace,&#10; bitmapInfo);&#10;&#10; CGRect drawRect = CGRectMake(0, 0, thumbSize.width, thumbSize.height);&#10; CGContextDrawImage(context, drawRect, image.CGImage);&#10; CGColorSpaceRelease(colorSpace);&#10;&#10; //第二步 取每个点的像素值&#10; unsigned char* data = CGBitmapContextGetData (context);&#10;&#10; if (data == NULL){&#10; CGContextRelease(context);&#10; return nil;&#10; }&#10;&#10; NSCountedSet *cls = [NSCountedSet setWithCapacity:thumbSize.width*thumbSize.height];&#10;&#10; for (int x=0; x&amp;lt;thumbSize.height; x&amp;#43;&amp;#43;) {&#10; for (int y=0; y&amp;lt;thumbSize.width; y&amp;#43;&amp;#43;) {&#10; int offset = 4*(x*thumbSize.width &amp;#43; y);&#10; int red = data[offset];&#10; int green = data[offset&amp;#43;1];&#10; int blue = data[offset&amp;#43;2];&#10; int alpha = data[offset&amp;#43;3];&#10;&#10; NSArray *clr=@[@(red),@(green),@(blue),@(alpha)];&#10; [cls addObject:clr];&#10; }&#10; }&#10; CGContextRelease(context);&#10;&#10; //第三步 找到出现次数最多的那个颜色&#10; NSEnumerator *enumerator = [cls objectEnumerator];&#10; NSArray *curColor = nil;&#10;&#10; NSArray *MaxColor=nil;&#10; NSUInteger MaxCount=0;&#10;&#10; while ( (curColor = [enumerator nextObject]) != nil ){&#10; NSUInteger tmpCount = [cls countForObject:curColor];&#10; if ( tmpCount &amp;lt; MaxCount ) continue;&#10; MaxCount=tmpCount;&#10; MaxColor=curColor;&#10; }&#10; //返回三色值&amp;#43;透明度&#10; NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0];&#10; [dic setValue:@([MaxColor[0] intValue]/255.0f) forKey:@&amp;#34;red&amp;#34;];&#10; [dic setValue:@([MaxColor[1] intValue]/255.0f) forKey:@&amp;#34;green&amp;#34;];&#10; [dic setValue:@([MaxColor[2] intValue]/255.0f) forKey:@&amp;#34;blue&amp;#34;];&#10; [dic setValue:@([MaxColor[3] intValue]/255.0f) forKey:@&amp;#34;alpha&amp;#34;];&#10; return dic;&#10;}&#10; //裁剪图片&#10; &amp;#43; (UIImage *)cropSquareImage:(UIImage *)image rect:(CGRect)rect{&#10; CGImageRef sourceImageRef = [image CGImage];&#10; CGImageRef newImageRef = CGImageCreateWithImageInRect(sourceImageRef, rect);&#10; UIImage *newImage = [UIImage imageWithCGImage:newImageRef];&#10; return newImage;&#10;}&#10;&#10;&#10; //判断颜色深浅&#10; &amp;#43; (BOOL)isDarkColor:(UIColor *)newColor{&#10; const CGFloat *componentColors = CGColorGetComponents(newColor.CGColor);&#10; CGFloat colorBrightness = ((componentColors[0] * 299) &amp;#43; (componentColors[1] * 587) &amp;#43; (componentColors[2] * 114)) / 1000;&#10; if (colorBrightness &amp;lt; 0.5){&#10; //深色&#10; return YES;&#10; } else{&#10; //浅色&#10; return NO;&#10; }&#10;}&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Runloop实际使用</title><link>https://apolla.cc/posts/tips/runloop%E5%AE%9E%E9%99%85%E4%BD%BF%E7%94%A8/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/tips/runloop%E5%AE%9E%E9%99%85%E4%BD%BF%E7%94%A8/</guid><category domain="https://apolla.cc/categories/%E7%A2%8E%E7%89%87%E8%8A%9D%E5%A3%AB%E6%94%B6%E8%97%8F/">碎片芝士收藏</category><description>&lt;h2 class="heading-element" id="前言"&gt;&lt;span&gt;前言&lt;/span&gt;&#10; &lt;a href="#%e5%89%8d%e8%a8%80" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;Runloop在iOS中是一个很重要的组成部分，对于任何单线程的UI模型都必须使用EvenLoop才可以连续处理不同的事件，而RunLoop就是EvenLoop模型在iOS中的实现。在前面的几篇文章中，我已经介绍了Runloop的底层原理等，这篇文章主要是从实际开发的角度，探讨一下实际上在哪些场景下，我们可以去使用RunLoop&lt;/p&gt;</description></item></channel></rss>