This was an awesome deep-dive into CoreData and like Scott below I am actually getting it and believe that I could take this project, use it as an example and create my own CoreData app! Very well done Nick!
Magical! Not only how the app works but your teachings. I am actually starting to think ahead of what you are about to do if that makes sense. Only thing I would change is I think the Edit Portfolio should follow the custom color themes as white looks a little out of place to me. Also the white checkmark on save. Maybe either follow the theme or turn it green. Off topic... Even though I don't understand everything because I am just an expert beginner, I think some of the changes/additions to SwiftUI/Xcode that is coming soon looks pretty awesome!
I just skipped core data videos. I used array of dictionary and user defaults to store user holdings. I will dive core data later. Thanks for awesome videos
Hello, really nice work! I was wondering if it would be better to show the checkmark after we validate that the save successed and not just after 2 seconds from the button click. Maybe we can also add error handling at this case
awesome vid! I struggled with decimal separator because my decimal keypad uses "," instead of "." but i managed it! If you had similar problem: You have to use Double(quantityText.replacingOccurences(of: ",", with ".")) in 3 places: 1 and 2: Within logic inside the SAVE BUTTON (opacity and creating an amount to save into Core Data) 3: In getCurrentValue() where you are making a double of text from texfield
could only be added in one place in the TextField: .onChange(of: quantityText) { newValue in quantityText = newValue.replacingOccurrences(of: ",", with: ".") } ...and placeholder shows the same - "Ex. 1.4"
Hi Nick! Can’t say thank you enough for you’re dedication and great teaching skills. Thank you for this series, sensei. I have a couple of doubts. 1. Shouldn’t you put the self.getPortfolio() (line 25 @22:26) call inside an else after the if statement? I’m asking because if there’s an error trying to load Core Data you will always try to get the portfolio even if an error occurred. 2. I noticed that the row number of the coin portfolio list is not independent, it currently shows the row number assigned to the coin in the coin list. Shouldn’t show the coin portfolio list their rows numbering independently? In other words, start in 1 and increase as coins are added to the portfolio. 3. I have a quality assurance (QA) profile and I’m concerned what can happen if you leave the Quantity text field empty and click the SAVE button. Wouldn’t it be more practical for the users to be able to remove a coin from their portfolio by just leaving this field empty instead of explicitly placing zero (0)?
Hey Bryan! Great questions honestly. I will try to answer them the best I can... 1. You can definitely do this. However, if the Core Data doesn't load, the getPortfolio() will fail anyway. So there isn't any difference really lol 2. That could be a great UI! I left it as is, because I'd rather see the coin's market cap ranking than it's rank in my portfolio. But you're making your own version so that could be a cool alternative. 3. That's a good recommendation haha. I don't think it would be hard to update the logic for that either!
Hello Nick, I just debugged the update function in the PortfolioDataService for about 3 hours and it just doesn't update the UI on the list when showing the list of portfolio coins. deleting works, adding works, but updating doesn't change the number of my holdings until I stop and restart the app which means that it's saved to core data but the update function is just not getting it updated even though I tried debugging in the map sink function and it shows the correct number which means that the portfoliocoins in the HomeViewModel is updating but for the life of me I can't figure out why the UI is not updating accordingly.
Hi Yasser, It's hard to debug based on the comment. I would guess you mistyped something in the course. You can find the full source code on my github to compare code: github.com/SwiftfulThinking or join our Discord and post some code: discord.gg/vhKKyYTGDb
@@seunghyunkim6285 you could add manual Equatable to Coin to fix animation .none. Delete that and change animation to .animation(.none, value: selectedCoin?.id)
Hey Nick, thanks for the amazing playlist. I have a question: Why do you not using returning functions with for example CoreData, and instead call all the functions everytime you save?
Nick, Hi there, love your content, very impressive teaching tecnics you have there. My friend i wanted to tell you about a problem, if you create a new holding, and after that you wanted to decrece it by -1... it get deleted...
Hello my Portfolio view is not dismissing ... Any idea ? I am calling the XMarkButton where we defined an environment Object and called dismiss in the action closure of the button
Hi ibrahim! We didn't do that in this course but you can update your CoreData entity to save an array of data within it as well. Within the array you could include past transactions.
This was an awesome deep-dive into CoreData and like Scott below I am actually getting it and believe that I could take this project, use it as an example and create my own CoreData app! Very well done Nick!
Magical! Not only how the app works but your teachings. I am actually starting to think ahead of what you are about to do if that makes sense. Only thing I would change is I think the Edit Portfolio should follow the custom color themes as white looks a little out of place to me. Also the white checkmark on save. Maybe either follow the theme or turn it green.
Off topic... Even though I don't understand everything because I am just an expert beginner, I think some of the changes/additions to SwiftUI/Xcode that is coming soon looks pretty awesome!
Hi Nick, can you tell me the difference (advantages and disadvantages) between Core Data and SwiftData?
I just skipped core data videos. I used array of dictionary and user defaults to store user holdings. I will dive core data later. Thanks for awesome videos
Hello, really nice work!
I was wondering if it would be better to show the checkmark after we validate that the save successed and not just after 2 seconds from the button click. Maybe we can also add error handling at this case
awesome vid! I struggled with decimal separator because my decimal keypad uses "," instead of "." but i managed it!
If you had similar problem:
You have to use Double(quantityText.replacingOccurences(of: ",", with ".")) in 3 places:
1 and 2: Within logic inside the SAVE BUTTON (opacity and creating an amount to save into Core Data)
3: In getCurrentValue() where you are making a double of text from texfield
could only be added in one place in the TextField:
.onChange(of: quantityText) { newValue in
quantityText = newValue.replacingOccurrences(of: ",", with: ".")
}
...and placeholder shows the same - "Ex. 1.4"
Hi Nick! Can’t say thank you enough for you’re dedication and great teaching skills. Thank you for this series, sensei.
I have a couple of doubts.
1. Shouldn’t you put the self.getPortfolio() (line 25 @22:26) call inside an else after the if statement? I’m asking because if there’s an error trying to load Core Data you will always try to get the portfolio even if an error occurred.
2. I noticed that the row number of the coin portfolio list is not independent, it currently shows the row number assigned to the coin in the coin list. Shouldn’t show the coin portfolio list their rows numbering independently? In other words, start in 1 and increase as coins are added to the portfolio.
3. I have a quality assurance (QA) profile and I’m concerned what can happen if you leave the Quantity text field empty and click the SAVE button. Wouldn’t it be more practical for the users to be able to remove a coin from their portfolio by just leaving this field empty instead of explicitly placing zero (0)?
Hey Bryan! Great questions honestly. I will try to answer them the best I can...
1. You can definitely do this. However, if the Core Data doesn't load, the getPortfolio() will fail anyway. So there isn't any difference really lol
2. That could be a great UI! I left it as is, because I'd rather see the coin's market cap ranking than it's rank in my portfolio. But you're making your own version so that could be a cool alternative.
3. That's a good recommendation haha. I don't think it would be hard to update the logic for that either!
Hello Nick, I just debugged the update function in the PortfolioDataService for about 3 hours and it just doesn't update the UI on the list when showing the list of portfolio coins. deleting works, adding works, but updating doesn't change the number of my holdings until I stop and restart the app which means that it's saved to core data but the update function is just not getting it updated even though I tried debugging in the map sink function and it shows the correct number which means that the portfoliocoins in the HomeViewModel is updating but for the life of me I can't figure out why the UI is not updating accordingly.
Hi Yasser, It's hard to debug based on the comment. I would guess you mistyped something in the course. You can find the full source code on my github to compare code: github.com/SwiftfulThinking or join our Discord and post some code: discord.gg/vhKKyYTGDb
@@SwiftfulThinking thanks a ton
Hi. I have a same problem like you. Did you find a solution about it?
@@seunghyunkim6285 you could add manual Equatable to Coin to fix animation .none. Delete that and change animation to .animation(.none, value: selectedCoin?.id)
Hi Nick, would this setup with a dataService and publisher/subscriber with SwiftData instead of CoreData?
CoreData > SwiftData
Hey Nick, thanks for the amazing playlist. I have a question:
Why do you not using returning functions with for example CoreData, and instead call all the functions everytime you save?
Nick, Hi there, love your content, very impressive teaching tecnics you have there. My friend i wanted to tell you about a problem, if you create a new holding, and after that you wanted to decrece it by -1... it get deleted...
Hello my Portfolio view is not dismissing ... Any idea ? I am calling the XMarkButton where we defined an environment Object and called dismiss in the action closure of the button
Hi Nick, like magic as always.
Thanks again Charlie
Is there a plan to move this part of the course to SwiftData in the future?
Spectacular video!
Thanks James
Would you recommend having a folder with some Swift files that you can use over and over or is it better to just keep typing things out to not forget?
I think having a folder or cheat sheet is fine as long as you actually understand the code you’re going to be copy and pasting 😂
Can you explain how to add more than one transaction to the same currency?
Because I couldn't figure out how to add with this many things
Hi ibrahim! We didn't do that in this course but you can update your CoreData entity to save an array of data within it as well. Within the array you could include past transactions.
@@SwiftfulThinking Thank you for yoru reply 🙏🏻
@@SwiftfulThinking I didn't know hot to do it , can you explain to me how?
We don't deserve you Nick 🙏