Here's the code if anyone's interested: gist.github.com/sindresorhus/4 Keep in mind it's just something I quickly hacked together. I could use help in improving the modifier and parameter names.

I also included a "hint" view to guide the user. It's only shown the first two times the app is launched. I made a special ViewModifier that makes it super easy to apply that kind of logic to any view.

Ok, finished it now.

(The "add" window is an ugly modal because of the sheet issues mentioned in earlier tweets).

I might have declared victory too early. The search field now doesn't hide the placeholder text and pressing Esc just hides the X button instead of actually clearing the text. Yay...

I got the idea of wrapping my AppKit sheet in an NSViewRepresentable and that worked, but that led me to yet another SwiftUI bug: It's not currently possible to have multiple `.sheet()` on a view. The workaround is amazing.

So if everything had worked as expected, it would have been an awesome experience and I would have been able to make that view both better and in a much shorter amount of time. Part of this is probably also the fault of me just learning SwiftUI and also lack of learning material.

...just one popover when choosing rename and then dismissing it when "Cance" is pressed. I can only do either.

Because of the problems of using AppKit and SwiftUI sheets in the same window, I decided to use a popover for the rename view instead, but I'm also having problems with that as I need to attach the popover directly to the list row, but I haven't been able to correctly present...

And showing a sheet in SwiftUI on macOS doesn't disable interaction behind it. I manually fixed that though.

I tried using a sheet, but that interfered strangely with a previously shown AppKit sheet. Showing a non-SwiftUI sheet on a window, dismissing it, then showing a SwiftUI sheet, and then dismissing it, suddenly makes the previous non-SwiftUI sheet re-appear.

I had to keep the search part of it in AppKit as SwiftUI could not handle searching thousands of entries. It took seconds between typing each character.

I wanted double-tap to edit, but adding a tap gesture makes reordering not work.

I've been working on a simple dynamic list view where you can reorder, rename, and delete items, and I already have 10+ Feedback Assistant reports I need to file and a lot of open questions.

I've been playing with SwiftUI for the past two days and it's really awesome and also really unfinished and buggy. It's especially unfinished for macOS development (no surprise there). I'm super excited about its future though.

I also sometimes get people withholding stars until they get the feature they want. That’s a good way to make me never implement that feature.

Relevant: twitter.com/jonasdowney/status

This is the kind of “quality” users you get when you make an app free.

Show more
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!