#SwiftLang
Interoperability: Swift’s Super Power by Saleem Abdulrasool
https://iosdevweekly.com/issues/629#AjvP3Sj
Nimble 13 RC 1 has been released! There are quite a few breaking changes here, notably the `Predicate` APIs have been renamed to `Matcher` (there are typealiases to make migrating easier).
Also, Nimble 13 adds support for Windows!
I'd love feedback on this before the actual release!
I am loving the ability to show category and subsystem in the #Xcode 15 console window.

Bezel by Mathijs Kadijk and @tomlokhorst
https://iosdevweekly.com/issues/629#6kTbR0b
Found a fun little bug the other day in MapKit.
If you create a MKLocalPointsOfInterestRequest with a negative radius the constructor returns nil but the swift declaration does not expect an optional response.
Passing this to MKLocalSearch results in a crash.
![let pointRequest = MKLocalPointsOfInterestRequest(
center: point.coordinate,
radius: radius
)
pointRequest.pointOfInterestFilter = .init(
excluding: [
.airport,
.evCharger,
.gasStation,
.stadium
]
)
let search = MKLocalSearch(request: pointRequest)](https://assets.toot.cafe/cache/media_attachments/files/111/167/618/215/920/639/small/ac30fe7afc421fba.png)
Meet with Apple Experts
https://iosdevweekly.com/issues/629#o7r1ziM
Thanks to this week’s sponsor, Stream. Stream makes it easy for you to seamlessly integrate real-time experiences into your application. Check out our Swift tutorial to learn how you can get started adding in-app messaging or video to your apps!
https://cur.at/Fg7RaTj
Did you miss Friday’s issue? I started with some words on the Settings app, and how I like the new Action Button settings screen.
https://iosdevweekly.com/issues/629#start
Debugging Improvements in Swift 5.9
Swift structured concurrency 101 question: is using an actor (i.e. calling an async actor method that reads and modifies the actor's own properties) across multiple concurrent Tasks considered unsafe? #Swift #SwiftLang
Short post with a few examples of use cases for Swift 5.9's new Parameter Packs feature https://paul-samuels.com/blog/2023/09/29/swift-parameter-packs/
iOS Dev Weekly, Issue 629 is out. Happy Friday, everyone! 🚀
https://iosdevweekly.com/issues/629#start
Issue #56 of iOS Code Review Newsletter has just reached 2800+ inboxes 💌🚀 Read it and subscribe to future ones here: https://ioscodereview.com/issues/56/ #SwiftLang #iOSDev
My app @stempel on macOS 14 Sonoma does not work in iCloud Drive anymore, it worked fine on Ventura. If anyone from Apple is reading this, could you please take a look at FB13109005 (FIFinderSync not calling menu(for menuKind: FIMenuKind) when secondary-clicking in Finder)?
Basically custom Finder Extensions don’t work anymore in iCloud Drive – where I have all my data. The app I wrote for myself out of love does not work anymore – this is heart breaking.
#IndieDev #MacDev #SwiftLang

Hmm, don’t remember seeing this discussion line on the menuWillOpen docs and it seems Sonoma doesn’t like you populating menu’s as they open.
Repeated clicking (5x) on my menubar menu causes the width to get progressively smaller.
Wrapping my menu population in an DispatchQueue.main.async fixed it.
A search on GitHub shows so many projects populating their menu's without the async so putting this out there.
#MacDev #SwiftLang

Has anyone found a good Codable lib that reads and writes raw bytes to file, currently I have gone down the path of creating my own `UnsafeCodable` that operates on raw pointers.

Check out this week’s featured jobs from iOS Dev Jobs.
https://iosdevweekly.com/issues/628#jobs
#Swift #SwiftLang #iOSDev #MacDev #iOSDevJobs #SwiftJobs #SwiftLangJobs
Considering adding a platform? A word of caution by @thatvirtualboy
https://iosdevweekly.com/issues/628#elm88qf
@kharrison This can be hard to do on pre-existing projects with years of code. So what I like to do is create a new framework or package and migrate code over with this setting enabled. Gradually all code is organized into modules which can build with the strict build requirements. #SwiftLang
Now you can use Swift to script games built with Godot. https://youtu.be/C7KZxlcLCg4?si=6Ps4TN8tYyDchDuA #SwiftLang #Godot #GameDev
Release Note Highlighting in Sparkle v2.5 by @ctietze and @Cykelero
https://iosdevweekly.com/issues/628#dd9i6vy
Inline Snapshot and Macro Testing by @mbrandonw and @stephencelis
https://iosdevweekly.com/issues/628#5OqvD9q
Migrating Ice Cubes to the Observation framework by @dimillian
https://iosdevweekly.com/issues/628#yOE8RrN
Core Data Lab and SwiftData
https://iosdevweekly.com/issues/628#dkjmSvm
Swift 5.9 Released
https://iosdevweekly.com/issues/628#mliEfOq
Thanks to this week’s sponsor, Essential Developer. If you're a mid/senior iOS developer looking to improve both your skills and salary level, join this free online crash course. It’s available only for a limited time, so get it now.
https://cur.at/UyEkwiN
Did you miss Friday’s issue? I started with some words on Apple's new Swift testing framework.
https://iosdevweekly.com/issues/628#start
Is someone using #SwiftLint as a plugin in Swift packages with #Xcode 15? On Xcode Cloud I get this weird error messages…

Immerhin noch Platz 9 beim #SwiftLang Quiz der @macoun 😁
Aber eine gute Bandbreite an Fragen!

I‘m an environmental #physicist by training, but after three years of parental leave I started a new job as a consulting software #developer. I work(ed) with a lot of different technologies: #swiftlang, #java, #csharp, #cplusplus, #angular, #perl, … My preferred computing platform is the #Mac.
In my spare time I love to play #tabletopgames of all kinds: #boardgames, #cardgames, #miniature games and #rpg’s. When I‘m by myself I also enjoy #sologames or (mostly) older #videogames.
iOS Dev Weekly, Issue 628 is (finally!) out. Happy Friday, everyone! 🚀
https://iosdevweekly.com/issues/628#start
Really nice live-coding example of building a cute #swiftlang macro. I especially enjoyed the thinking out loud and iteration getting it working first then tidier and tidier. https://youtu.be/zeB-kmb74FY
Are you interested in cross-compiling your #SwiftLang apps to #Linux? We've got some great news for you! https://forums.swift.org/t/announcing-swift-sdk-generator/67409
Fantastic post from The Browser Company on interoperability being #SwiftLang’s superpower: https://browsercompany.substack.com/cp/137231709
Check out this week’s featured jobs from iOS Dev Jobs.
https://iosdevweekly.com/issues/627#jobs
#Swift #SwiftLang #iOSDev #MacDev #iOSDevJobs #SwiftJobs #SwiftLangJobs
The Mobile System Design Book by @tjeerdintveen
https://iosdevweekly.com/issues/627#qi0sq3s
Should you focus on a big launch? by @mattiem
https://iosdevweekly.com/issues/627#u2FBcST
ExampleKit by Topher Hickman
https://iosdevweekly.com/issues/627#sTdYtRX
Generated Asset Catalog Symbols in Objective-C by @jordanmorgan
https://iosdevweekly.com/issues/627#UGr6Hi1
Building a Live Activity by Marco Guerrieri
https://iosdevweekly.com/issues/627#1FsIoT0
Working With UIViewRepresentable by @chris
https://iosdevweekly.com/issues/627#TM2cTzC
Introducing swiftly by the SSWG
https://iosdevweekly.com/issues/627#5a90SeG
Didn’t have the details of a #SwiftUI grid exactly right on Friday (exhausting week), so I left it until this morning. Fifteen minutes with the (interactive with code generation!) Eager Grid builder here not only solved that problem, but showed an optimization I’d missed.
Heads up: the JSONEncoder in iOS 17/Swift 5.9 now encodes with keys in random order. Even though JSON has an arbitrary key order, object encoding used to produce a stable ordering. Not anymore.
Swift concurrency API is contiguous. In order to solve MainActor warnings now I have to update upstream project (that doesn't need Swift concurrency) to start using it, in order to use another framework that requires Swift concurrency. #swiftlang
Turning on strict concurrency checking for all targets in a Swift package: https://useyourloaf.com/blog/strict-concurrency-checking-in-swift-packages/ #iOSDev #SwiftLang
I am unreasonably excited about this #SwiftLang pitch for generalized tuple conformances, built on top of parameter packs. Hashable tuples here we come!!!
https://forums.swift.org/t/pitch-user-defined-tuple-conformances/67154
#SwiftLang SE-0408 "Pack iteration" is under review now! This proposal makes it possible to use Swift's for..in loop with parameter packs in an obvious and powerful way. We'd love your input over at https://forums.swift.org/t/review-se-0408-pack-iteration/67152
I find this pattern works really well when you need a task that only runs when a View is on screen and the app is in the foreground, for example to drive an animation.
When the task's `id` parameter changes, a new task will be created and the previous one will be canceled.
So if we choose `scenePhase` as an `id`, we’ll get a new task for every phase. All we need to do is terminate all of them except the `.active` ones.
Who wears it better? #swiftlang
(isLetter || isNumeric) or CharacterSet.alphanumeric?
While CharacterSet is clearly documented, the Character.isNumber is not clear whether these are equivalents.
🧑💻⁉️ Please make your voice heard in the #Swift Server Working Group developer survey. Please do so, even if you don‘t use #SwiftOnServer today. We would love to understand your reasons.
Another consequence of Twitter’s rebranding disaster: VoiceOver will read the standalone string “X” as “Cap[ital] X”, so you need to fix that every time :/
The Swift Server Workgroup has released a community survey to help inform its decision making process. If you are working in Server Side Swift please take part. https://forums.swift.org/t/sswg-community-survey-2023/67084 #SwiftLang #ServerSideSwift
#SwiftLang was always meant to scale down to extremely resource-constrained environments, so it’s really cool to see people starting to make it happen. https://forums.swift.org/t/embedded-swift/67057
The review for a minor improvement to #SwiftLang member macros is still ongoing and could use YOUR input: https://forums.swift.org/t/se-0407-member-macro-conformances/66951
Figured out my “app that worked in 13.4.1 but not 13.5” issue, related to what didn’t throw, but now does. (Hasty fix for Sonoma last week.)
In a FileManager extension function:
try removeItem(at: url)
…didn’t throw if the item didn’t exist (at least not in app’s narrow use case), but does in 13.5. Clearly more correct now.
Obvious workarounds:
* change try to try? (chose this one since app is not interested if it’s there)
* see if the file exists first
Can a Swift async method return multiple results over time? Different types, so I don’t think I can use AsyncSequence? Something like (pseudocode)
let (showProgress: async Bool, result: async MyThing) = await doSomethingLengthy()
if await showProgress {
showProgressScreen()
}
processResult(await result)
?
doSomethingLengthy() would guarantee that doProgress is fulfilled before result, in case that helps.
Or must it be a 2-method delegate?
Working with Notification objects from a `.notifications(named: …)` AsyncSequence in Swift concurrency without warnings is tricky. I took a run at wrapping the API here:
https://gist.github.com/PadraigK/c6d1bae4337d12508dea8d37cacdf3cc
This gives a really nice call site that returns exactly the data you want, but it does require a bit of boilerplate for each notification name + payload.
Little update, I swear it’s still on target but, taking a minute to get Swift to talk to an Arduino board.
https://www.whynotestflight.com/excuses/can-i-open-a-serial-port-with-swift-part-i/
Closed out a #SwiftLang bug filed on June 6, 2014: “Add a macro system to Swift” ;)
Anyone have any experience with implementing `AppIntents` @Parameter resolvers? https://developer.apple.com/documentation/appintents/resolvers I'm about to drop software dev over this stuff, ugh. How do I wire a custom resolver to this:
@Parameter(title: "", resolvers: ???)
var something: SomeEntity
Some Apple frameworks are a "d-light", this is one of them (as in "light on docs", i.e. actually usable ones). Apple should start spending a few million USD per year on several dozen technical writers.
#Swiftlang question: Did somebody already build an AsyncStream that works on Observable, and emits on every change?
I’d love to add properties in an extension to an @Observable Swift class; these properties are backed by UserDefaults.
This means:
- It needs to work without adding a stored property to the object
- It should call access() and withMutation() correctly
- This includes announcing mutation if the underlying UserDefaults change
- All this should be wrapped in a Macro or PropertyWrapper or something that makes it easy to use.
As usual, the #swiftlang naming makes it IMPOSSIBLE to google anything. 🤮
I never actually did this, so let’s give it a try.
17 years in #teaching, mainly computer science and sometimes mathematics at the high school level. Very grateful for what I’ve learned from so many dedicated and creative professionals. My students learn #SwiftLang and we do a lot of #iOSDev.
4 years in software before that, mainly #webdev with #PHP and writing a lot of XSLT. 😬
Doing my best to be a good father and spouse.