I'm working on a Xamarin application, which I will at first have working on iOS, but plan to later expand to Android and other mobile platforms.

As such, I'm trying to keep as much common code in PCLs as possible.

My question: what is the best practise - in Xamarin.iOS for now - to initialize any dependent PCL code?

For now I have it in the `RootViewController` inside `ViewDidLoad()`

```
public override void ViewDidLoad()
{
    base.ViewDidLoad();
    _engine = new MyEngine();
    View = new MainView(_engine);
}

```

Is this the right spot? I'd considered putting it in the ctor for the `RootViewController`, but there's a fair bit going on in the initialization code, which thus ran against "don't put heavy duty init code into a constructor".

Things that happen are:

* Load app settings
* If app is run for first time ever, load basic defaults
* Initialise other PCL libraries, such as a TextToSpeech module, a state engine (hence the name of the class above), etc
* Prepare a data grid based on XML or JSON input

Alternately, I though it should possibly go into the `AppDelegate` section, but that didn't sound right.

I'm still fairly new to mobile app dev in general and Xamarin in specific, though I've done C# native code for Windows for years. I just want to make sure I follow best practises, but there doesn't seem to be a "thou shalt" in this case.

Edit: I've extracted the solution based on @wishmaster's suggestions.