mamot.fr is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mamot.fr est un serveur Mastodon francophone, géré par La Quadrature du Net.

Server stats:

3.1K
active users

#swiftlang

27 posts12 participants1 post today

Reminder that SwiftPM package manifests are Swift code, so you can write loops etc. in them. I use this in some of my packages to enable the same upcoming language features for all targets. Example: gist.github.com/ole/c0f4de915a

This isn’t particularly useful for complex projects where you might want to migrate to Swift 6 mode module-by-module, but for small and simple packages it’s usually easy to stay on the cutting edge of Swift. #SwiftLang

Introducing a new open-source #Swift package that I've been working on for 8 months! Say hello 👋 to #ErrorKit – a set of APIs that simplify #ErrorHandling in Swift 6. Built to be actually helpful, not only for large teams but also for #IndieDev's like myself. And boy have I documented it! 💯

Please check it out & give it a ⭐️ on GitHub: #iOSDev #SwiftLang
github.com/FlineDev/ErrorKit

Simplified error handling with built-in user-friendly messages for common errors. Fully localized. Community-driven. - FlineDev/ErrorKit
GitHubGitHub - FlineDev/ErrorKit: Simplified error handling with built-in user-friendly messages for common errors. Fully localized. Community-driven.Simplified error handling with built-in user-friendly messages for common errors. Fully localized. Community-driven. - FlineDev/ErrorKit

Periodic reminder that `Task.detached` is semantically equivalent to `DISPATCH_BLOCK_DETACHED`. e.g. it opts out of automatic priority propagation, task locals, cancellation, etc…

So far 100% of the time I've mentioned this the response has been "what's DISPATCH_BLOCK_DETACHED?", which should give you an idea of how rare uses of `Task.detached` should be.

As the docs say: "Don’t use a detached task if it’s possible to model the operation using structured concurrency features"

For macOS logging I'm trying to use the recommended bundle ID as the OSLog subsystem, so I use the following code snippet. But it seems like I might as well hardcode the subsystem since bundleIdentifier might be nil. Is there a better way to get the bundle ID (or PRODUCT_NAME) in code?

extension Logger {
static let subsystem = Bundle.main.bundleIdentifier ?? "org.foo.MyApp"
}