10s of How to use …

1. Error Handling?


A safe net when something goes south. I do find this gives a better context in error handling and better readability.

What is try! and try?

Use try! when you need to ensure your app always succeed as in won’t throw an error, but when it really does, your app shouldn’t work.

try! before the expression to disable error propagation and wrap the call in a runtime assertion that no error will be thrown. If an error actually is thrown, you’ll get a runtime error.

try? to handle an error by converting it to an optional value. If an error is thrown while evaluating thetry? expression, the value of the expression is nil

from Apple

Continue reading “10s of How to use …”


ECSlidingViewController for sidebar

Nowadays even though Apple does not really support sidebars as they encourage tab instead but a lot of apps still prefer to use this approach. There are a lot sidebar libraries in cocoapods but in the end I choose:


ECSlidingViewController is a view controller container that manages a layered interface. The top layer anchors to the left or right side of the container while revealing the layer underneath it. This is most commonly known as the “Side Menu”, “Slide Out”, “Hamburger Menu/Drawer/Sidebar”, etc…


*image source here*

Continue reading “ECSlidingViewController for sidebar”

Realm Limitations

Realm Limitations

Realm is still in its development phase where it have its limitations but somehow after I’m getting more and more familiar with Realm, some essentials must have issues in Realm are still unavailable today (23May2015). Therefore at current stage I might need to use some outsider extension on Realm for my needs.

For my early post on Realm, please refer here.

Example table scheme:



Continue reading “Realm Limitations”

New Choice for Mobile Database? Realm

New Choice for Mobile Database? Realm

Realm is a mobile database that functioned similar to SQLite and Coredata. It supports iOS and Android platforms. (Yay)

Why Realm? Realm VS Coredata 

From Realm VP Product, Tim Anglade

  1. Realm is much easier to use — equivalent Realm apps will save you literally thousands of lines of code and weeks of work. We were surprised the advantage was so big, but it came up consistently in user interviews.

  2. Consistent view across threads — accessing Realm from a background thread looks the same as accessing Realm from the UI thread (see docs). there is no need to maintain multiple contexts and merge them manually, no inconsistent views, and no headaches trying to reconcile your data. It just works™; the only limitation, as of realm-cocoa 0.90, is that object instances cannot be passed across threads, but this is actually something that will be relaxed in an upcoming release

  3. Much faster — 2–30x faster depending on the operation, and much much faster in others. If you look on Twitter, you’ll see people report similar speedups in their apps.

  4. Built-in encryption — AES256+SHA2 encryption with a moderate performance hit of ~10%.

  5. Support available — while there is obviously a wealth of SO questions and articles written about Core Data, there simply is no vendor you can turn to for quick, official responses to questions, bugfixes or feature requests. In comparison, the entire team at Realm is available daily, and support is our #1 priority above all else. We are available on the following channels, and you can see our response times for yourself: on Github,StackOverflowTwitteremail or in person

Now to be clear there are things Core Data has that Realm doesn’t:

  • Stronger battle-testing. Core Data runs on SQLite, probably one of the most heavily tested open-source pieces of software ever. Realm has been running in production since 2012, and is now deployed on literally millions of devices, with no major known bugs at this time, but we are still pre-1.0 software, with a long way to go to achieve the same stability.
  • Tons of small features that we are working tirelessly to add every week — you can always find an up-to-date list on Github

****I am going to use Realm for my project soon so I’ll update further if I encounter any problems or confusions in the future. The followings are my own notes from their documentation site as I learn things through writing things down so things are pretty similar.****

Continue reading “New Choice for Mobile Database? Realm”

[Library] iOS-Charts

[Library] iOS-Charts



This library is used to display various of charts and graphs and presents data with beautiful graphics.

If you failed to run the demo project, please check if your Xcode is 6.3 (latest to date 20 April 2015). The framework is written in Swift so you will need to have a bridging header to use in Obj-C project.


  • Xcode 6.3 / Swift 1.2
  • iOS 7.0 (Drag .swift files to your project)
  • iOS 8.0 (Use as a Framework)

Continue reading “[Library] iOS-Charts”