Protocol Extension

Protocol 作为 Swift 生态的最重要的组成部分(没有之一),其搭建起了整个语言生态的各个组成部分。 相对于继承而言,Protocol 的几个比较直观的优势: 无需

LetsMove 中的几个点

当我们从网络上下载某个 mac app 之后,一般都会默认在 Downloads 目录里,但是某一些 App 是需要放置到 Application 目录才行,最常见的就是自更新功能是受到当前所处目录的限制的

XPC Services

关于 XPC 因为最近在做的工作涉及到这一块,就大致的记录一下,针对 XPC 技术也做个总结。 XPC 是 macOS 上一种进程间通信的技术统称,其使得我们可以将 Mac 应用的功能

Codable && Tuple

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.

How to generate a NSViewController without a Nib?

In the last days, I created all the ViewControllers through the storyboard or the Nib (for views). Today, when I created a demo project without any Nib file, the ViewController did not show as I expected. WTF, Can you believe that? I cannot even create a ViewController now. There exist some differences between iOS and macOS. iOS In the previous development on the iOS platform, create a ViewController, specifically UIViewController instance, is dead simple as below.