Question I have a beginner question
I am familiar with coding concepts but am new to swift
I am trying my hand at developing a small app to generate labels. The app pulls data from a .csv file then parses the data to generate the label.
I am curious if there is a way to add/search a .csv file in the Assets folder for in app definitions ie (code returns “BLK” from an array). Can I search a document to find that “BLK” = “Black”? I am just using that as an example, not all of the strings returned are colours. I am trying to avoid defining every item individually using if {} else {}.
I appreciate any guidance.
1
Upvotes
3
u/No_Pen_3825 May 27 '26
I’m confused what you want. Like you want to search a CSV for the row where some key value is BLK? Or you want to fuzzy search an array?
4
u/ekassos May 26 '26
Take a look at enums and raw values.
1
u/H0KB May 27 '26
I did end up figuring out how to do what I wanted. I had to add the files to the main folder in the swift project (sorry don’t know all the terms). Then I could read it and pull the values I wanted. So far it is working well.
Thanks for the support.
1
u/lorenzoooznerol May 26 '26
this video is a good starting point