Why does MVVMCross view model initialize twice on iOS?
Working on a bug fix in MVVMCross-based mobile application I noticed a strange behavior. The navigation to other view model I put in async Init<TInit>(TInit parameters)
which as executed on the first view model in my app was running twice. After a short debugging session it turned out that MvxViewModel<TInit>
Init()
is called from the view controllers ViewDidLoad()
method. Obviously there was something I was missing in terms of ViewDidLoad()
semantics.