Building the CustomImageRenderers

We are going to start with the iOS implementation of the CustomImage. Inside the Renderers folder, add a new folder called CustomImage, add a new file called CustomImageRenderer.cs, and implement the following:

public class CustomImageRenderer : ViewRenderer<CustomImage, UIView> 
    { 
        #region Private Propertie 
 
        private readonly string _tag; 
 
        private ILogger _log; 
 
        private UIImageView _imageView; 
 
        private int _systemVersion = Convert.ToInt16 (UIDevice.CurrentDevice.SystemVersion.Split ('.') [0]); 
 
        #endregion 
 
        #region Constructors 
 
        public CustomImageRenderer() 
        { 
            _log = IoC.Resolve<ILogger>(); 
            _tag = string.Format("{0} ", GetType()); 
        } 
 
        #endregion 
} 

Looking at our private properties, we have the logging objects again, an integer ...

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.