package Ġ${ _ PLACE HOLDER _ PACKAGE _ NAME } Ċ Ċ import Ġapple . NSObject Ċ import Ġapple . foundation . NSDictionary Ċ import Ġapple . u ikit .* Ċ import Ġapple . u ikit . c . UIKit Ċ import Ġapple . u ikit . protocol . UI Application Delegate Ċ import Ġapple . u ikit . protocol . UIS plit ViewController Delegate Ċ import Ġorg . moe . nat j . general . Pointer Ċ import Ġorg . moe . nat j . general . ann . Register On Startup Ċ import Ġorg . moe . nat j . objc . ann . Selector Ċ import Ġ${ _ PLACE HOLDER _ PACKAGE _ NAME }. ui . Detail ViewController Ċ Ċ @ Register On Startup Ċ class ĠMain Ġprotected Ġconstructor ( peer : ĠPointer ) Ġ: ĠNSObject ( peer ), ĠUI Application Delegate , ĠU IS plit ViewController Delegate Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġwindow : ĠUI Window ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun Ġapplication Did Finish Launch ing WithOptions ( application : ĠUI Application ?, Ġlaunch Options : ĠNS Dictionary < *, Ġ* >? ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsplit ViewController Ġ= Ġthis . window !!. root ViewController () Ġas ĠU IS plit ViewController ĊĠĠĠĠĠĠĠ Ġval Ġnavigation Controller Ġ= Ġsplit ViewController . view Controllers (). last Object () Ġas ĠU IN avigation Controller ĊĠĠĠĠĠĠĠ Ġnavigation Controller . top ViewController (). navigation Item (). set Left Bar Button Item ( split ViewController . displayMode Button Item ()) ĊĠĠĠĠĠĠĠ Ġsplit ViewController . set Delegate ( this ) ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Window ( value : ĠUI Window ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġwindow Ġ= Ġvalue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġwindow (): ĠUI Window ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwindow ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsplit ViewController Collapse Secondary ViewController On to Primary ViewController ( split ViewController : ĠU IS plit ViewController ?, Ġsecondary ViewController : ĠUI ViewController ?, Ġprimary ViewController : ĠUI ViewController ?): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( secondary ViewController Ġis ĠU IN avigation Controller Ġ&& ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsecondary ViewController . top ViewController () Ġis ĠDetail ViewController Ġ&& ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( secondary ViewController . top ViewController () Ġas ĠDetail ViewController ). detail Item Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠReturn ĠYES Ġto Ġindicate Ġthat Ġwe Ġhave Ġhandled Ġthe Ġcollapse Ġby Ġdoing Ġnothing ; Ġthe Ġsecondary Ġcontroller Ġwill Ġbe Ġdiscarded . ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġfalse ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ@ Jvm Static Ġfun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠUI Kit . UI Application Main ( 0 , Ġnull , Ġnull , ĠMain :: class . java . getName ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ@ Selector (" alloc ") ĊĠĠĠĠĠĠĠ Ġ@ Jvm Static Ġexternal Ġfun Ġalloc (): ĠMain ĊĠĠĠ Ġ} Ċ } Ċ