Monthly Archives: March 2013

The books that changed my life


My daily bread

Ordering your private world (Gordon MacDonald)
It taught me about time management (self management), what should I pursue, and what was just an illusion of success. Connecting my inner world with god is the most critical part of life.

How to win friends and influence people (Dale Carnegie)
This book asked me to move the focus from myself to other. “Love your neighbor as yourself” is a golden rule.

Thinking fast and slow (Daniel Kahneman)
I used to trust my logical reasoning and intuition, this book changed my view of thinking. I was very impressed by “What you see is all there is”, which told me how naive I was to perceive the world in my own view.


Line height bug of NSAttributed string in UITextView

As mentioned by cocoanetics (I can reproduce it on iPhone 5 with iOS 6.1.2)

Because there is a bug in UITextView, I had no way to adjust the line spacing of text. It should be ok for english, however chinese is not good enough. 


So I had the following trick, 

When user switches to chinese, I set “Euphemia UCAS” as default font, but displays chinese text as normal in UITextView. I found that “line-spacing” will be inherited from “Euphemia UCAS”.



Mobile app should be Native or Web or Hybird ?

Recently, I am working on a “Bible app”, want to share some thoughts.

My goal is to build a Bible app which is fast and easy to navigate, also with note taking function in three months. (Please don’t ask me why build another Bible app… I am really not the type of business man who is good at marketing research)

Native or Web or Hybird ?
This should be the last question , too early to talk about it 😛

Offline capable ? (Yes)
We should be able to read Bible anytime anywhere, offline reading should be a reasonable user’s expectation.

Social or Personal ? (Personal)
Almost everything go social, but it increase the complexity and I will lose the laser focus. (Social network for christian should be a big thing )

Flat or skeuomorphism design ? Flat (almost flat or not skeuomorphism)
Many peoples love it and it is trending, it can also present text in clear way.

Core data or SQLite ? (Core data)
There are note, highlight and history. Core data is really good for CRUD, it can save many lines of code.

Textview or Webview? (Textview)
Most blog readers use webview, HTML handles text render in elegant way, but there are some problems
– It is difficult to do highlight in HTML, many dom object operations.
– Javascript bridge with native code is difficult and messy.
– Slow in old device (Not a big concern…)

The problem of “Native or web or hybird” always bothers me. In user point of view, I love native because it is fast and polished with animation. In developer point of view, web can save time and allow us to focus on important things. It seems hybird is the way to go, don’t need to reinvent HTML and take the advantage of native UI experience.

Finally, I chose native, because it is easy to do highlight in textview. Also with the support of attributed string in iOS 6, it make text formating easier. (There is a bug in rendering attributed string with paragraph attribute I will explain in another article later).

Programmer’s fatal mistake

It was a big mistake that I tried my best to learn and build products without writing any meaningful articles and contributing to open source project.

I got many excuses
– Feel shame of my writing/code
– English is not my native language
– Too busy (I have a full time job)
– No audience

After applied an iOS prototyper job from 37 signals, I got a reply “Not sure right fit” from Jason. It was a reminder that I have to face this problem.

No matter how good or bad I achieved on project, I had no way to tell peoples. It was a fatal mistake and it was too risky for employer too. I decided to start blogging about the development process of my works. And I hope I can contribute some useful codes and tips while I am working on it.