Wildsparrow's journal (monthly challenges)

It’s time for a short update:

  • Adding stocks is working
  • Removing stocks is working, unfortunately I can only remove the latest item I added, not the one the user is tapping on. I tried a similar approach as the .onDelete() function in a list view, but with no success. So, after several failed attempts, I decided that for this challenge (and as this is the second app I write by myself in SwiftUI), the user can only delete the latest entry. But he/she gets a nice alert pop-up to see (AlertX, version 1.2.1 GitHub - neel-makhecha/AlertX: A library for SwiftUI to create custom alerts with different appearances and animations. ), including the name of the item he/she is about to remove (he/she can also cancel the request). So basically, I delete the array from the ending, always the last item is removed.

Big kudos to Alpha Vantage → I wrote an email to them, asking to increase the API requests/minute for this challenge and they did within 2-3 hours!

So, the two bonus challenges are still open: No duplicate in the stock array and storing the array in the user data.
Afterwards, I’ll create a video of my solution :slight_smile:

1 Like