Giving Swift a chance

I’ve started learning Swift again. Today, I’ve been playing around with a hello world ContentView. Something like below.

struct ContentView: View {
	@Environment(\.modelContext) private var modelContext
	@Query private var items: [Item]
	var body: some View {
		// stuff
	}
}

I think I finally understand, with clarity, what the property wrappers and key paths are doing. This was the biggest “ugh, that looks strange” feeling that I’ve had in the past. Not anymore. Once I got it, it actually feels just a bit beautiful. I’m almost starting to remember my Java and Spring coding days with all that dependency injection, from 2013.

This entry was posted in Projects and hobbies and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *