It’s been a minute since I’ve created dynamic ones, so I forgot how much bookkeeping can be involved. I wanted a dynamic quick action for each rec

Asking AI to Refactor Swift Code | Swiftjective-C

submited by
Style Pass
2024-04-30 23:30:18

It’s been a minute since I’ve created dynamic ones, so I forgot how much bookkeeping can be involved. I wanted a dynamic quick action for each recently viewed team in Elite Hoops. But, that also means that…

In fact, the last time I wrote Home Scren Quick Actions was for the chapter in my book series. Which, as it were, I leaned upon heavily to implement these. I'm in the middle of releaseing an update for it now, do check it out if you haven't yet. Five books, one price forever.

It’s ugly, but it works. So, I began to wonder — how would AI tools suggest I change it. Below are the results, all given the same prompt.

I’ve found that chatGPT is more verbose in its response. Not only does it write code, but it tries to explain it to you. This code is nice if you’re the type of who believes each function should be a single thing, and not much more. Of all the choices, when I go back and pretty up my code (because we always go back, right?!) — this is probably the closet to how I tend to author it.

The new kid on the block, personifying the “if it’s free you are the product” approach is Meta’s newly minted meta.ai. Here’s how it refactored my code:

Leave a Comment