Retire legacy implementations and flatten managed layout
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using UIKit;
|
||||
|
||||
namespace VoiceCat.iOS;
|
||||
|
||||
internal static class UiHelpers
|
||||
{
|
||||
internal static void ShowError(UIViewController owner, Exception exception) => ShowMessage(owner, "VoiceCat", exception.Message);
|
||||
internal static void ShowMessage(UIViewController owner, string title, string message)
|
||||
{
|
||||
UIAlertController alert = UIAlertController.Create(title, message, UIAlertControllerStyle.Alert);
|
||||
alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); owner.PresentViewController(alert, true, null);
|
||||
}
|
||||
|
||||
internal static UITextField Field(string placeholder, bool secure = false)
|
||||
{
|
||||
var field = new UITextField { Placeholder = placeholder, BorderStyle = UITextBorderStyle.RoundedRect,
|
||||
SecureTextEntry = secure, TranslatesAutoresizingMaskIntoConstraints = false };
|
||||
field.AccessibilityLabel = placeholder; return field;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user