Fantastic explanation! I installed an app on my iPad called Unwrap. It’s made by Paul Hudson. Anyone that’s searching UA-cam for SwiftUI has heard of him. Anyway, the app is a great tool for testing your knowledge but not so great at teaching. I bombed the sets and dictionary part! I just didn’t get it. After watching this video it became perfectly clear to me how these things operate. Great lessons Nick!
Hey man, almost through all of these videos. One thing I noticed is that the likes are dropping each video I go further into the playlist. While that's likely because people are giving up, I found myself forgetting to like a video before moving on. Maybe inject in the middle of the video a reminder to like the video and I believe you'll get more.
Hey Nick! In your postArray vs. postDict example, how come the dictionary item is an optional that needs to be unwrapped but not the array item? Can't they both potentially be empty?
That’s what I was trying to explain here… accessing keys in a dictionary will return nil if there is no value.. but accessing indexes in an array will crash if there is no item!
Can we have a dictionary with Key and value both as Integers. I am working on an app that can keep a log of show seasons and different episodes. I am trying to persist number of episodes for a particular season using dictionary. so I am doing something like seasonInfo = [1:4, 2:3, 3:2] where for season 1 there are 4 episodes, season 2 there are 3 episodes and so on. If this is a bad approach what option do you recommend?
You can, but more likely your seasons have an ID from your data model or database. So then you’d want to do [seasonId : count] of [String:Int]. This is the most common approach
Hello Nick, I've been watching you for years, and hope you can help. There is large data in a single array/Entity : eg. EmployeeEntity [person, country, city, street, number] The data can have multiple people in one house. GroupBy:House[country, city, street, number] How do you match two people that may live in the same house. Example match/fetch all the [John & Susan] that live in the same House[ ]. There may be no matches for this couple but these two names could be found at in one matching House [ ] or in many houses.
Fantastic explanation! I installed an app on my iPad called Unwrap. It’s made by Paul Hudson. Anyone that’s searching UA-cam for SwiftUI has heard of him. Anyway, the app is a great tool for testing your knowledge but not so great at teaching. I bombed the sets and dictionary part! I just didn’t get it. After watching this video it became perfectly clear to me how these things operate. Great lessons Nick!
At 16:15 why do you need to have the if statement there? Can't you just say let item = postArray[1] to get the same thing?
because if that value does not exist app will crash so with if its the best practice
Hey man, almost through all of these videos. One thing I noticed is that the likes are dropping each video I go further into the playlist. While that's likely because people are giving up, I found myself forgetting to like a video before moving on. Maybe inject in the middle of the video a reminder to like the video and I believe you'll get more.
Thank you Nick! Now I understand dictionaries a little more 🕺
Hey Nick! In your postArray vs. postDict example, how come the dictionary item is an optional that needs to be unwrapped but not the array item? Can't they both potentially be empty?
That’s what I was trying to explain here… accessing keys in a dictionary will return nil if there is no value.. but accessing indexes in an array will crash if there is no item!
@@SwiftfulThinking Ahhh right, didn't make the connection there. Thank you!
fantatic. Goat lectures in swift history
Can we have a dictionary with Key and value both as Integers. I am working on an app that can keep a log of show seasons and different episodes. I am trying to persist number of episodes for a particular season using dictionary. so I am doing something like seasonInfo = [1:4, 2:3, 3:2] where for season 1 there are 4 episodes, season 2 there are 3 episodes and so on. If this is a bad approach what option do you recommend?
You can, but more likely your seasons have an ID from your data model or database. So then you’d want to do [seasonId : count] of [String:Int]. This is the most common approach
Hello Nick, I've been watching you for years, and hope you can help. There is large data in a single array/Entity : eg. EmployeeEntity [person, country, city, street, number] The data can have multiple people in one house. GroupBy:House[country, city, street, number] How do you match two people that may live in the same house. Example match/fetch all the [John & Susan] that live in the same House[ ]. There may be no matches for this couple but these two names could be found at in one matching House [ ] or in many houses.
What is the difference between
var wordCounts: [String: Int] = [:] and
var wordCounts: Set = [:] ?
Thanks 😊