Creating the connection between Presenter and View
Now we move on to the user interface design and demonstrate how we set up the link between our presenters. Developing the user interface is no different to developing natively for iOS and Android; the only difference with MVP is that we initialize a view with its related presenter in the constructor.
Let's start by adding a new folder to the Chat.iOS
project called Views
, add in a new file called LoginViewController.cs
, and implement the following:
public class LoginViewController : UIViewController, LoginPresenter.ILoginView { #region Private Properties private bool _isInProgress = false; private LoginPresenter _presenter; private UITextField _loginTextField; private UITextField _passwordTextField; ...
Get Xamarin Blueprints now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.