6 Followers
72 Following
250 Posts
Husband, CS professor, iOS developer, cyclist, dog lover
blog/websitehttps://dave256apps.com
abouthttps://dave256apps.com/about

Time flies when yer having fun!

Today marks 8 years of Point-Free: hundreds of hours of educational video, dozens of open source projects, and tens of thousands of developers reached.

We couldn’t do it without the support of our community. Here’s to 8 more!
https://www.pointfree.co/blog/posts/199-point-free-turns-8

Point-Free turns 8!

Point-Free turns 8! We’re announcing a live stream and a beta preview of the “Point-Free Way”.

Sometimes our libraries have bugs. We're merely human!

But often we fix bugs and release the fixes in a matter of hours, not months. 😊

https://github.com/pointfreeco/sqlite-data/pull/359

RE: https://hachyderm.io/@pointfreeco/115855236247133990

I can confirm as I provided some information about this bug and it was fixed that day. Thank you!

Four times in four days I've been asked for advice on working with AI-generated Swift code, so here you go – here's a brief article about dubious code I suggest you watch out for, and what to replace it with instead: https://www.hackingwithswift.com/articles/281/what-to-fix-in-ai-generated-swift-code
What to fix in AI-generated Swift code

As AI-assisted coding increases in popularity, here are a handful of things I would suggest you look out for – and what to replace them with instead.

Hacking with Swift
You know what's bothering me for no reason?
Up until 1080p, we referred to video resolutions by their VERTICAL RESOLUTION

426x240 = "240p"
854x480 = "480p"
1280x720 = "720p"
1920x1080 = "1080p"

But then above that, we started using HORIZONTAL resolution, but rounded

7680x4230 = "8K"
3840x2160 = "4K"

And then for everything in between, we just... threw that out?

2560x1440 = "2K/1440p" ???
2772x1272 = "1.5K" ?????????????

Supporting CloudKit sync for SQLite is a daunting task. There are edge cases and nuances to be aware of, and the risk of introducing subtle bugs that cause data loss is very real.

Here’s the most important technique we used to build this feature…

Debugging the library by literally running multiple devices and editing data to see how it synchronizes is an absolute time suck. So we built our own in-memory version of CloudKit containers and databases so that we could interact with “CloudKit” in a testable and controllable manner.

This allowed us to write hundreds of tests for many intricate and subtle syncing situations (and turn bug reports from our beta users into failing tests), all without running on a real device or interacting with CloudKit:

• What happens when two devices edit the same record at the same time?

• What happens when a device receives a child record from CloudKit before it receives the parent record? Can foreign key constraints be enforced?

• What happens if a device receives a record from another device running an older version of the schema? Do we lose that data or can it be preserved until the device upgrades to the new schema?

• What happens on first launch of an existing app that has just added CloudKit synchronization? Can we upload all of the existing, local data to CloudKit?

• What happens to the user’s data when they are logged out of iCloud?

• What happens when a user writes to a shared record for which they do not have permissions?

• What happens when one device adds a child record to a parent record and another device deletes the parent record?

• What happens when a record in a shared zone is moved to another zone? Do all associated descendant get moved to the new zone too?

Whenever we wrote a passing test, we could immediately confirm the fix on-device using the live iCloud servers in place of our in-memory CloudKit.

And to be honestly, this is barely scratching the surface of what problems we came across while working on this and what we needed to write tests for.

See the full test suite here:

https://github.com/pointfreeco/sqlite-data/tree/main/Tests/SQLiteDataTests/CloudKitTests

sqlite-data/Tests/SQLiteDataTests/CloudKitTests at main · pointfreeco/sqlite-data

A fast, lightweight replacement for SwiftData, powered by SQL and supporting CloudKit synchronization. - pointfreeco/sqlite-data

GitHub

I took a moment to update my Swift Concurrency glossary. Refined some commentary, added more links, and updated things for 6.2.

https://www.massicotte.org/concurrency-glossary

A Swift Concurrency Glossary

It would be nice if there was a single place to go to look up all the terms, keywords, and annotations related to Swift concurrency. So here it is. If you notice something I’ve missed, pleased o let me know. Oh and of course, I included some commentary.

massicotte.org

One dumb idea I had (have?) for Alyx was for a chat room to open up once a day so we could all just vibe and talk about what coffee we are drinking.

Definitely a mission-critical feature, I know.

If you are on Tahoe and finding that you're constantly resizing windows accidentally, it's not your fault.

The hysteresis on the double-click detection is much too long - two clicks in the title bar a second apart will trigger the resize, no matter how you've configured your Mouse Double-Click Speed.

It took me several attempts to figure out how to disable this "feature", but here it is:

It takes only these few lines of code to immediately unlock CloudKit synchronization to our local-only reminders app. It just works™, and it's only the tip of the iceberg.

Check it out for yourself!
👉 https://github.com/pointfreeco/sharing-grdb/blob/c92ea7187dae967a3ba3532b155fd0f4e3afa3a6/Examples/Reminders/RemindersApp.swift#L16-L23