Search code examples
iosuicollectionviewios-universal-appspringboard

What is the iPhone's "Springboard" view exactly?


My question is, is the default iPhone menu a UIcollection view created with storyboarding, or is there more to its abilities? (in order to avoid emulating its functionality)


Solution

  • If you want to understand SpringBoard's view hierarchy:

    1. Launch the iOS Simulator if it's not already running.
    2. Make sure you're looking at SpringBoard in the simulator.
    3. In Xcode, choose Product > Attach to Process > springboard. The springboard process is way down in the “System” section of the list.
    4. Still in Xcode, choose Product > Debug > Pause.
    5. In Xcode's debug console (where it should show the (lldb) prompt), type po [[UIApp keyWindow] recursiveDescription].

    Voila, you get a printout of SpringBoard's entire on-screen view hierarchy. Mine starts out like this:

    (lldb) po [[UIApp keyWindow] recursiveDescription]
    $0 = 0x0b63abf0 <SBAppWindow: 0xce3ef10; baseClass = UIWindow; frame = (0 0; 320 480); layer = <UIWindowLayer: 0xce3f010>>
       | <SBUIRootView: 0xb162de0; frame = (0 0; 320 480); layer = <CALayer: 0xb162e60>>
       |    | <UIView: 0xb163010; frame = (0 0; 320 480); autoresize = W+H; layer = <CALayer: 0xb1630c0>>
       |    |    | <SBWallpaperView: 0xb1632a0; baseClass = UIImageView; frame = (0 0; 320 480); userInteractionEnabled = NO; layer = <CALayer: 0xb160f70>>
       |    |    |    | <UIImageView: 0xb1610d0; frame = (0 0; 0 0); hidden = YES; userInteractionEnabled = NO; layer = <CALayer: 0xb161130>>
       |    |    |    | <UIImageView: 0xb161160; frame = (0 0; 0 0); hidden = YES; userInteractionEnabled = NO; layer = <CALayer: 0xb163390>>
       |    |    | <SBIconContentView: 0xb163da0; frame = (0 0; 320 480); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0xb163e50>>
       |    |    |    | <UIView: 0xc939710; frame = (0 371; 320 109); opaque = NO; autoresize = W+TM; layer = <CALayer: 0xc939770>>
       |    |    |    |    | <SBDockIconListView: 0xc9381d0; frame = (0 20; 320 89); autoresize = TM; layer = <CALayer: 0xc9382c0>>
    ...