Setting up MVVMCross with iOS
Now we move over to the iOS project. For each platform, we must implement a Setup
class that will be used to instantiate the MvxApplication
class. Add a new class called IosSetup
and implement the following:
public class IosSetup : MvxIosSetup { public IosSetup(MvxApplicationDelegate applicationDelegate, UIWindow window) : base(applicationDelegate, window) { } protected override IMvxApplication CreateApp() { return new App(); } protected override IMvxTrace CreateDebugTrace() { return new DebugTrace(); } }
Firstly, we must include a constructor that takes in an MvxApplicationDelegate
and UIWindow
; these will be passed into the base on instantiation. We also have two functions that are overriden as part of the MvxIosSetup
object.
Start with the CreateApp
function. All we are doing here is instantiating the MvxApplication
class that we implemented...