Starting a new project recently and:
- Wading in to the SwiftData waters and added saving to a context, and I’m impressed. Gave the app an infinite loop at the view layer and we’ll fix that later.
- Doodled a couple candidates for a development and alternate app icon! Someone has to bring a little culture.
- Just that tiny bit of progress today but the momentum is what’s important.

Little clean-ups and place setting / writing plans for the next improvements:
- Fixed that loop lol
- Switched from dataTask completion handlers to Combine's dataTaskPublisher
- TIL don't use @Model var id because that field name is already taken
- Hm that's weird though, the docs say it's persistentModelId but Xcode 15.0.1 gives me id in the definition.
- developer.apple.com/documentat

Tonight:
- Punting on API client safety, moved initial fetch from .onAppear to .task
- Started building Add[Redacted]View for the most common essential data entry to add a new model (UI first, data later). Forms and pickers!
- Removed unused code
- 🎶 Lots of Avett Brothers and feelings

jack

@j4ck@iosdev.space

Today:
- Added a preview for the first Form view
- Fixed preview for main view (need to add mock user data)
- Writing notes to connect model work with submitting this form
- Took a detour to build out fetching account info and then returned to pre-populate the form
- Hit a 401 when requesting account info
- Figured out I need to use the accessToken from the token body response
- Pre-filled that info on the form
- Display user's name on main page
- Lots more // TODO

November 10, 2023 at 7:16:52 PM

As always, keep a good proxy in your tool kit. I figured out the token issue way faster with Proxyman’s Compose Request tool.

At first I thought it might be cookies but changing those to match between iOS and web behaved the same. Then I realized that working requests on the web were using the accessToken value from the /token body instead of the value returned in the initial /authorize response.

Tonight:
- Added more data types
- Added more Form UI
- Moved Form State vars into actual model
- Picker

I am doing _something_ wrong that's crashing my Previews.

I have an @Observable class Client that accepts SwiftData.ModelContext as various function parameters. Client is passed through @State/.environment(client).

My view will invoke client.doWork(modelContext) and that works well enough when running but something completely implodes in Previews. Doing any access on SwiftData.query and/or this Environment(Client.self) is wrecking this preview.

Elk Logo

Welcome to Elk!

Elk is a nimble Mastodon web client. You can login to your Mastodon account and use it to interact with the fediverse.

Expect some bugs and missing features here and there. Elk is Open Source and we're actively improving it as a community project. Join us and let's build it together!

If you'd like to report a bug, help us testing, give feedback, or contribute, reach out to us on GitHub and get involved.

To boost development, you can sponsor the Team through GitHub Sponsors. We hope you enjoy Elk!

Joaquín Sánchez三咲智子 Kevin DengDaniel RoePatakAnthony FuTAKAHASHI Shuuji

The Elk Team