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.

一道 Swift Quiz

这两天在 Twitter 上看到一道题目,主要是考察 overload 和 type(of:) 的知识点,本文仅做记录,关于 MetaType 会单独写一篇文章来总结。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // Swift Quiz class

关于 Library 和 Framework

Library 和 Framework 的概念大家应该脑海里都有一些,本文旨在讲述下基本概念,没有对每个字节都了如指掌。关于基本的编译过程在 Build Process 一文中也大概讲述了一些。 在链接

Build Process

编程语言的处理过程大致会有五个阶段,其每个阶段均有对应的工具: 预处理器 Preprocessor 编译器 Compiler 汇编器 Assembler 链接器 Linker 加载器 Loader 我们以一个简单的源文件,来看看具体这