Building a control for the iOS camera
Now that we have built the CameraView
object in the Xamarin.Forms
PCL, we are going to build the CustomRenderer
for iOS. Jump into the Camera.iOS project and add a new folder called Renderers
, and then add a new file called CameraiOS.cs
and implement the following private properties:
public sealed class CameraIOS : UIView { #region Private Properties private readonly string _tag; private readonly ILogger _log; private readonly AVCaptureVideoPreviewLayer _previewLayer; private readonly AVCaptureSession _captureSession; private UIView _mainView; private AVCaptureDeviceInput _input; private AVCaptureStillImageOutput _output; private AVCaptureConnection _captureConnection; private AVCaptureDevice _device; private bool _cameraBusy; private bool _cameraAvailable; private float _cameraButtonContainerWidth...