If I want to see an alert using Swift I have write about 4 lines of confusing code/syntax in various parts of my code. And that, to me at least, is ridiculous.
Why can't it just be something like this...
alert("Hello World!")
That is obviously a LOT easier. And it takes a lot less time to learn!
So the code would be something like this....
If x = 1 then
alert("Hello World!")
In other words, you don't have to declare or set the state of the alert in terms of it being visible or not.
Because surely an alert should be invisible by default and then, when you type...
alert("Hello World!")`
The alert then becomes visible.
To me writing less code (that's still easy to read and understand) is a no brainer. It's like the "less clicks is better" system used in web design.
And this is just one example!
Today I had to, and struggled to, convert a variable into text (not a string for some reason) just so I could put it in an alert.
Here's some of the code....
.alert(isPresented: $showAlert) {
Alert(title: Text("\(mynumber)"))
That is..... I don't know..... Preposterous?
The objective or programming is to get something done. And the easier it is to do, the more productive we can be. So, again I ask....
Why is Swift's syntax so complex?