Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created October 13, 2020 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/d5548e2a5d1c9f0923b1fca8d5f5a918 to your computer and use it in GitHub Desktop.
Save jfversluis/d5548e2a5d1c9f0923b1fca8d5f5a918 to your computer and use it in GitHub Desktop.
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