MVC. I agree separation is not perfect. But should it? Over the years I notice a strive towards company code. Yes, it is more organized and maintainable using some patterns. Yes in time a dev should reach that level. However trying to reach this level too soon will toss people aside in a sector already coping to find sufficiently qualified people. Moreover I am sure many apps are not perfectly code. They are out there, making people a living.
To a learner it's completely irrelevant, yeah. But you said it beautifully separates the V in MVC so I wanted to counterpoint that; While I like UIKit, it's not a great example of textbook MVC. So if you are learning about MVC, the UIKit templates and methodology slightly fights you, with it's own spin on MVC or as I call Apple's system, MVVCS (Model, View, ViewController-Segue)
That is not to say that UIKit's way of doing things can't be great too. It's just not textbook MVC
But sometimes textbook way of doing things aren't the best either. Like Kevlin Henney I am often opposed to Singletons for example - At least in Swift. And by that I mean the classic way of doing singletons.
class Object {
static let instance Object()
}
is fine (simplified, remember to privatise constructor too)
You say SwiftUI is easier to learn. It is not. Try explaining to a noob to get Hello world onto a View. You can not. Sure you can say place Text("Hello world) between these brackets. The student does not understand the surrounding code. Building a simple view requires a thorough understanding of protocols, closures and so on. It creates a hurdle too soon. Some will take it, many will not. I have not run into the dragging part yet watching the Stanford course. Glad it is possible. Must linking gesture behaviors be coded?
Hm. But aren't there equally many things to understand for something like UIKit? To understand how events are captured by the framework and sent down the chain of responsibility for interaction handling you need to understand the Observer pattern for example. There's KVO, Selectors that are Swift-ugly and don't properly get verified at compile time. And you can very easily wind up with a situation where neither the code n'or IB reflect the actual view, because some is made in code and some is made in IB.
I honestly haven't used the "library" much for drag-n-drop SwiftUI views. But it's like "drag in a Button" and it will give you template code blocks that say Button(title) { onClick } or something like that. It still all happens in code, but you can drag and drop and use IB-like stuff and it will update the code for you. You can double-click the button in the view and edit the text, and the code will edit alongside it. You can add padding in the view and the code will get the corresponding padding added in and so on. As Apple themselves put it "It's the simplicity of Interface Builder, but with a single source of truth for your view".
I'm not really sure about gesture recognisers. Can have a look tomorrow.
Don't get me wrong. You obviously are good at coding. I just think it will toughen the experience for many.
Yeah; I mean, I get the feeling neither of us can really speak to the experience of a complete beginner?
In any case, I would never take offence to this. It's an interesting debate/discussion
No matter what I think both SwiftUI and UIKit have their advantages and I'd still say that if you could only learn one, make it UIKit. But learning both is better
