In windows there is a support for generating Xaml strings at runtime for the UI artefact and use it on the main thread for loading the Xaml strings with properties and creating the UI artefact. Below is a code example for it.
static void createxaml(hstring & str) {
str = LR"(
<Button
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
Name="MyButton"
Content="Click Me"
Width="200"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="18"
FontFamily="Segoe UI"
Foreground="White"
)";
}
{
hstring xaml;
createxaml(xaml);
Button obj = XamlReader::Load(xaml).as<Button>();
}
My question is, Is there similar support available in uikit to create ui instances like UIButton. Is there some native support from apple that allows us to create a button object using an XML like string?
If you'd like us to consider adding the necessary functionality, please file an enhancement request using the Feedback Assistant. If you file the request, please post the Feedback number here so we can make sure it gets routed to the right team.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?