honcheng/PaperFoldMenuController — pull request #3 by lxcid (2012-11-16 04:33:48+00:00)
Title: Refactor PaperFoldMenuController to be more IB friendly.

The summary of these changes are as follows:

1. Use weak semantics for subviews. (Inline with generated IB subviews properties semantics)
2. Defers setting up of subviews to `viewDidLoad`. (This helps in making it more IB friendly as IB won't be able to call `initWithMenuWidth:numberOfFolds:`, but if we exposes their properties, we can use user defined runtime attributes to set these value in IB)
3. Introduces `NSNotFound` for `selectedIndex`. (When no view controller is selected, we describe this state as NSNotFound)
4. Rewrote `selectIndex` and `selectedViewController`, making them observable by KVO. (Try to maintains only `selectedIndex` and make `selectedViewController` derives it value from `selectedIndex`)
5. Updates DemoMenuController. (Same as 2, defer setting up of subviews in `viewDidLoad`. We actually have to manually invoke `reloadMenu`)

Cheers!

Signed-off-by: Stan Chang Khin Boon