Skip to content
Commit dd1341ec authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Add initInternal to ViewController.

ViewController's init method was not ideal to override. On the one hand,
if you put a call super.init() first your onViewAttach method is called
before you're subclass's init.

Further, if you put your own code befer super.init(), you are still left
with the problem that your init is not automatically idempotent, and
multiple calls to #init() could result in multiple executions of your
code unless you handle it yourself.

With this change, #initInternal() is introduced, giving ViewControllers
a place to put their run-once code such that it runs before any
view-attachment callbacks are fired.

Fixes: 171472009
Test: manual
Change-Id: I2e284024c82e3f7c7b6f29f22a1ffa3c8aae9fcb
parent 311a1510
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment