File: Platform\iOS\Extensions\LabelExtensions.cs
Web Access
Project: src\src\Controls\src\Core\Controls.Core.csproj (Microsoft.Maui.Controls)
#nullable disable
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Internals;
using ObjCRuntime;
using UIKit;
 
namespace Microsoft.Maui.Controls.Platform
{
	public static class LabelExtensions
	{
		public static void UpdateText(this UILabel platformLabel, Label label)
		{
			switch (label.TextType)
			{
				case TextType.Html:
					platformLabel.UpdateTextHtml(label);
					break;
 
				default:
					if (label.FormattedText != null)
						platformLabel.AttributedText = label.ToNSAttributedString();
					else
					{
						if (platformLabel.AttributedText is not null)
						{
							platformLabel.AttributedText = null;
						}
 
						platformLabel.Text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
					}
					break;
			}
		}
	}
}