To think about what I want to build in SwiftUI!
I know what I had said in the last post. That I’m not ready yet.
SwiftUI is still intimidating for me. I’m hoping that the more I work with it & write about it the better I’ll feel. So here we go.
I remember I had a code challenge, which did not go well. The challenge was something I had done on my own, but it’s something we don’t do every day, parse a CSV file. So what’s going on with that?
CSV is a Comma Separated Value file, looking at it we see a table of usually more than 2 rows
The top row is our ‘key’. Every row under that we have our data.
The data I found is Open Data from New York State, there is tons of different types of data there, the data I want to focus on is around the New York City Subway. Exits & entrances in particular.

This is a small piece of all the data, reflected through Preview on Mac. Below is how it is seen in the file:

Altogether we have 2,121 rows of data. So what?
I want to put it in a List in SwiftUI.
Thinking out loud how to solve this…
Create an ObservableObject Class which will parse the CSV, collect the objects & send them to the view?
I really have no clue, family!
I started just like that, Main Actor Class, conforming to ObservableObject

Now let me drag the file into the project 😅 For reference, my Exit object looks like this

Ok. Originally starting this idea I was going to make this class use Main Actor, ObservableObject, etc.
This quickly became whatever parses CSV in Stack Overflow 😭. Since I was abandoning the idea of the Observable class (for now), I kept thinking how the heck am I going to get this working?
Then I went back to the good old tutorial from Landmarks. They had us parse a JSON file early in the guide, so I left out the JSON part and just broke apart the CSV. I made a gist to share how that would look. Got that result rendering in my Preview pane 👨🍳 + 😘


Not quite a List tho… but now I know I am close
Had a mental block and some challenges at home but I kept plugging at it- then I realized it was so easy!

Next my goal will be to fit this on to the map. Getting this to click feels 🌞 🤗 🍯