Machine Learning in iOS

Part 1: Freud the Swift ML Library

Part 2: Core ML, Shazam for Images

Pt. 1: Freud the Swift ML Library

Freud is a Swift (3) machine-learning library dedicated to Sigmund Freud. This Library is implemented under the ‘Ego’ philosophy.

The ego attempts to mediate between id and reality.

Swift has been my favorite programming language of all time since the day Apple released it and playing with Swift is my daily joy. Last year when I was browsing GitHub I came across this project Swift AI by Collin Hundley and decided to try it out because everyone is crazy about it. Later I found out that Swift AI is in Swift 2.2 and by then Swift 3 had been out for months already. I could not compile it of course.

Continue reading “Machine Learning in iOS”

Logic of Peek and Pop in 3D Touch

Logic of Peek and Pop in 3D Touch


In 2015 Apple introduced 3D Touch. Before that there was already Force Touch on Apple Watch and MacBook Pro. Although both “touch” are techniques that make the touchscreen force-sensitive, 3D Touch on iPhone 6s / 7 are in a way of a higher dimension. 3D Touch is sensitive to continuous force changes, while Force Touch is discrete. With 3D Touch coming with new iOS devices, UIKit evolved too. A new way of interaction was introduced, which we’re going to talk about, that is, Peek and Pop.

Continue reading “Logic of Peek and Pop in 3D Touch”

Daedalus, A MineSweeper Game Built w/ Qt


A MineSweeper Game built with Qt


Build & Run

  • Qt 5.7 or later
  • C++ 11
  • macOS Sierra (Build Target is currently macOS and if you want to run it on Windows or Linux, just modify the .pro file a little bit)

About Daedalus

Daedalus is a MineSweeper game. People have been playing MineSweeper for ages. Most people believe that Microsoft created it while actually it dates back to the 1960s. After years of evolution, the MineSweeper in Windows 10 App Store has got a completely new look, however its rules remain the same:

Continue reading “Daedalus, A MineSweeper Game Built w/ Qt”

Swifty-Klotski – an iOS Game w/ AI Built In


A Klotski game with a powerful searching AI built in, completely implemented in Swift.

About Klotski

Klotski (华容道 in Chinese), is a sliding block puzzle with special layouts of 10 different blocks and the aim of Klotski is to move a specific block, aka, CaoCao, to some predefined location.

We built Swifty-Klotski in which an AI can automatically search for feasible solutions to a layout.

Continue reading “Swifty-Klotski – an iOS Game w/ AI Built In”





Continue reading “一种孤独(零)”

Brainfuq, a Brainfuck Interpreter

Brainfuq, an interpreter for the language Brainfuck built with ANTLR

Build & Run

There are currently no ready-to-use executable binary now but it’s coming soon.

  • Download jars of ANTLR 4 and Commons IO and add them to your Java $CLASSPATH
  • git clone
  • cd Brainfuq && javac *.java and then you’re good to go.
  • Use the convinient scripts to run our interpreter: brainfuck to interpret a brainfuck file, and brainfucki to enter the magnificent Brainfuck REPL.

There are a few interesting demos in ./BrainfuckDemo/, and you can just try them out.

Continue reading “Brainfuq, a Brainfuck Interpreter”

iOS 组暑假学习计划

Study Guide for the iOS team @twtstudio in the summer of 2016

暑假的学习主要集中在新语言、iOS SDK 的学习、已有项目的阅读

  • Swift 3.0
  • 「微北洋」 /「 问津」 源代码
  • KVO
  • M-V-C
  • 3rd-Party Repositories on GitHub

Swift 3.0

Swift 是 Apple 为了取代 Objective-C 而开发的语言,不同于 Objective-C,Swift 是完全开源的,目前可以在 OS X 和 Linux 内核操作系统中编译与运行。「微北洋」与「问津」目前都在逐渐转向 Swift 开发。Swift 实战演练将是我们暑假学习计划的核心。

Continue reading “iOS 组暑假学习计划”

超级磁场怪 / Super BT (1)






Continue reading “超级磁场怪 / Super BT (1)”