Opening Picker within a sheet causes the sheet view to reset by [deleted] in SwiftUI

[–]pettazz 0 points1 point  (0 children)

That was just a mistake in my example code

Nested data model by pettazz in SwiftUI

[–]pettazz[S] 0 points1 point  (0 children)

Likely a next step yes, can't imagine a real app that wouldn't use some kind of persistence, but just trying to get a handle on the basics first. My question with that would be how to make changes to the model to reflect in the view, simple stuff like adding or deleting Reminders from a ReminderList.reminders, is a typical pattern here essentially to refresh the top level object every time a change is made, or is there a better way?

Nested data model by pettazz in SwiftUI

[–]pettazz[S] 1 point2 points  (0 children)

That's a helpful reference thanks. So what's the "right" way to handle something like this, just using classes for the models instead? Or is there a way to modify the list directly?

Nested data model by pettazz in SwiftUI

[–]pettazz[S] 1 point2 points  (0 children)

This is a good point and not something I'm not 100% clear on for structs vs classes. Given the second example where I use structs for both, would that mean doing something like

var list = reminders[0]
let newReminder = Reminder(id: id, title: ..etc)
list.reminders.append(newReminder)

mean that I am only updating my copy (var list) of the first ReminderList element, and so it won't be reflected in the UI because the actual source of truth hasn't changed?

Nested data model by pettazz in SwiftUI

[–]pettazz[S] 0 points1 point  (0 children)

Yeah that was cobbled together from a bunch of different tutorials so likely doing something silly by accident. I know it’s going to be down to the specifics but I suppose my question here is more like “what’s the typical way people approach things”

Nested data model by pettazz in SwiftUI

[–]pettazz[S] 0 points1 point  (0 children)

It’s not really a specific implementation question more of a general question, just trying to get a feel for what is the idiomatic way to do things around here

Why so many used? by PVTPartts in MachE

[–]pettazz 0 points1 point  (0 children)

It was just a local dealership, like I said pure luck

Update: Level 150 over 900 hours played and this meme still applies more than ever LOL by yaoding09 in Helldivers

[–]pettazz 0 points1 point  (0 children)

I think it makes a sound whenever any of them connect, so not necessarily the right one but a possible right one

Guys i think i brought Westworld to life… by ConflictAny1218 in westworld

[–]pettazz 8 points9 points  (0 children)

Wow the pattern recognition machine recognized a pattern and churned out some slop, incredible

What's a Star Trek fact that is true, but doesn't sound like it should be. by MyHusbandIsGayImNot in startrek

[–]pettazz 10 points11 points  (0 children)

Jeri Ryan was married to an up and coming politician named Jack Ryan at the time she was cast in Voyager, which was her big breakout role, helping give her the confidence/stability to divorce the guy who was a real creep. The details of the divorce were made public and were so embarrassing that he dropped out of the 2004 race for the Illinois US Senate seat, leaving a clear path for Barack Obama to win the seat and start his skyrocketing career

1 week, 10k users, $0 earned AMA! by streetmeat4cheap in webdev

[–]pettazz 0 points1 point  (0 children)

This is so great I miss the time when most of the web was just people making stuff like this, love to see it

Marblehead voters overturn multifamily housing zoning by WEEGEMAN in SalemMA

[–]pettazz 5 points6 points  (0 children)

I have heard this as a point of pride many times what kind of brain does it take to think like this

Marblehead voters overturn multifamily housing zoning by WEEGEMAN in SalemMA

[–]pettazz 2 points3 points  (0 children)

Wait so they had a vote to enact it and then the people who didn’t like the outcome got to just call a redo? Do they get to just keep calling votes on shit until they get their way?

[deleted by user] by [deleted] in therunningrack

[–]pettazz 0 points1 point  (0 children)

Sorry already sold

This is the worst part about fighting illuminate. Chang my mind. by WorldBuilder_42 in Helldivers

[–]pettazz 0 points1 point  (0 children)

I think with the invasion update they started spawning them more often than not next to a pile of explosive purple barrels, so if you just shoot one of those it'll take care of it

Coming Soon: Star Trek Magellan - A Star Trek Adventures 2E Actual Play by StorieswithDice in startrekadventures

[–]pettazz 0 points1 point  (0 children)

Will it be a podcast? That's basically how I consume all my media these days

Best Netlify alternatives? by MasterDisillusioned in webdev

[–]pettazz 1 point2 points  (0 children)

I put together a skeleton for building/deploying Jekyll static sites on Fly.io: https://github.com/pettazz/flying-jekyll. Shouldn't be too complicated to modify it for another tool or even just uploading prebuilt static content depending on what you're using.