cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Hawkins <>
Subject iOS: Can we clean up the view lifecycle in 2.3?
Date Tue, 06 Nov 2012 18:18:34 GMT
I'd love to see 2.3 be the iOS release where the view lifecycle and
management is cleaned up.

I can create a native application in iOS today using Apple's most basic
template, create a UIViewController subclass from there, programmatically
manage my UIView and UIWebView, get full rotation and status bar
management, and all of this with literally half a dozen lines of custom
code or less.  There's no fussing with autorotation, outside of initial
configuration of supported modes.  There's no managing the status bar when
determining the frame.  There's no setting of the default view's frame at
all, in fact: it defaults to the size of its superview (the UIWindow in
this case), and automatically adjusts to the status bar.  The status bar
rotation is self-managed too.

Conversely, all of these things are custom-managed and complicated in the
CDVViewController and its related counterparts.  And they don't play by the
rules of standard iOS behavior.  You have to employ weird, wonky code to
adjust  the view to be under the status bar...conditionally.  Autorotation
doesn't work if you present a view controller; you have to use wonky code
to reset the parent view controller in its viewWillAppear as well, once the
modal vc has been dismissed.

I don't know if the required manual management of these things is a legacy
of older versions of iOS.  But I know that that requirement is older than
our oldest supported version of iOS.  That stuff is difficult to maintain
and extend, and I'd venture that 80% of it needs to be done away with,

I'll probably save the splash screen for another post, though it's related.
 I turn that thing off by default in every app, because if its tenuous
working condition across CDVViewController deallocations and
re-initializations.  And it's another item whose existence I can't
understand outside of legacy considerations that no longer apply to our
base iOS version.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message