Use weak semantics for subviews. (Inline with generated IB subviews properties semantics)
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)
Introduces NSNotFound for selectedIndex. (When no view controller is selected, we describe this state as NSNotFound)
Rewrote selectIndex and selectedViewController, making them observable by KVO. (Try to maintains only selectedIndex and make selectedViewController derives it value from selectedIndex)
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 khinboon@gmail.com
The summary of these changes are as follows:
viewDidLoad
. (This helps in making it more IB friendly as IB won't be able to callinitWithMenuWidth:numberOfFolds:
, but if we exposes their properties, we can use user defined runtime attributes to set these value in IB)NSNotFound
forselectedIndex
. (When no view controller is selected, we describe this state as NSNotFound)selectIndex
andselectedViewController
, making them observable by KVO. (Try to maintains onlyselectedIndex
and makeselectedViewController
derives it value fromselectedIndex
)viewDidLoad
. We actually have to manually invokereloadMenu
)Cheers!
Signed-off-by: Stan Chang Khin Boon khinboon@gmail.com