跳过正文

Chen

iOS / macOS Developer

I’m Chen, an iOS / macOS developer. I build indie apps, write about Swift and Apple platform development, and occasionally translate great technical articles into Chinese.

Check out my apps or browse my blog posts.

最近的文章

CoreData With CloudKit

·4 分钟
Integrate your codebase with CloudKit is actually a tricky stuff for me since the first impression the CloudKit gave me several years ago is not good. In recent days, I had to cope with this bad feeling (Never mind, CloudKit) in the development of Sideloader.

获取某个 Mac 应用的 BundleID

·1 分钟
我们知道无论是 iOS 还是 macOS 上的应用,其配置信息都是通过 plist 文件组织的,该应用的 BundleID 就藏在这个文件中,通过读取 plist 文件就能够知道其 Bundle ID 以及应用版本号等信息。我们以 App Store.app 为例,其 plist 文件就存储在如下路径,其他应用也是如此。

Swift 中的消息派发

什么是消息派发? # 消息派发,英文名称 Method Dispatch,是指程序在运行过程中调用某个方法的时候决议使用哪个具体指令的过程。消息派发的行为在我们代码中时时刻刻的在发生。了解消息派发的机制对于我们日常写出相对高效的代码也是有利的,日常 Coding 的时候遇到一些派发相关的问题,也能做到心里有数。

Protocol Extension

·2 分钟
Protocol 作为 Swift 生态的最重要的组成部分(没有之一),其搭建起了整个语言生态的各个组成部分。

LetsMove 中的几个点

当我们从网络上下载某个 mac app 之后,一般都会默认在 Downloads 目录里,但是某一些 App 是需要放置到 Application 目录才行,最常见的就是自更新功能是受到当前所处目录的限制的,这时候很多下载到本地的 .app 文件打开之后都会弹出提示框,让用户选择是否移动到 Applications 目录,LetsMove 就是大部分 mac app 参考或者集成的开源库,封装了这套逻辑。

XPC Services

·3 分钟
关于 XPC # 因为最近在做的工作涉及到这一块,就大致的记录一下,针对 XPC 技术也做个总结。

Codable && Tuple

·2 分钟
During my learning of Swift, many interesting things I will find. Codable is one of them. Today, I defined a model with a tuple type, then Xcode told me some error. Codes may like as below. You may want Xcode automatically complete all the codable stuff. However, life is hard. Codes like these can even not be compiled. Xcode will tell you name cannot be synthesize the Person because of the FullName.