Skip to content

Instantly share code, notes, and snippets.

@jfversluis

jfversluis/OtpEntryRenderer.cs Secret

Created Oct 13, 2020
Embed
What would you like to do?
using System;
using iOSOTPEntrySample;
using iOSOTPEntrySample.iOS;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(OtpEntry), typeof(OtpEntryRenderer))]
namespace iOSOTPEntrySample.iOS
{
public class OtpEntryRenderer : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0) && Control != null)
{
Control.TextContentType = UITextContentType.OneTimeCode;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.