XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

Swift Forums - Latest posts

Latest posts

XCFramework with Common Third-Party Dependencies Causing Duplicate Symbol Conflicts

The usual fix is to make sure there's exactly one copy of Google Maps in the final app, owned by the host app rather than by your SDK: Build your SDK as a static framework (MACH_O_TYPE = staticlib) inside the XCFramework. Its references to Google Maps symbols then stay unresolved until the app's link step, where they bind to the app's single copy. A dynamic framework links Google Maps into itself, which is what produces the duplicates. Hide the dependency from your public interface. Use…

Swift Package Manager for iOS SDK Development: Building, Versioning and Distributing Reusable Swift Frameworks

Real-world example: a small feature-flag SDK Putting it together: OrbitSDK, a client that fetches remote feature flags, with configuration, pluggable transport and logging, typed errors, an actor-based client with request de-duplication, and Swift 6 concurrency safety. Manifest // swift-tools-version: 6.0 import PackageDescription let package = Package( name: "OrbitSDK", platforms: [.iOS(.v15), .macOS(.v12)], products: [ .library(name: "OrbitSDK", targets: ["OrbitSDK"]) ], targets: [ .target(…

Swift Package Manager for iOS SDK Development: Building, Versioning and Distributing Reusable Swift Frameworks

Most iOS teams don't set out to build an SDK. It happens by accident. A networking layer gets copied into a second app. A design system gets pasted into a third. Somebody fixes a bug in one copy and not the others, and six months later you are diffing three almost-identical folders trying to work out which one is "right". Swift Package Manager (SPM) is how you stop that from happening. But "wrap it in a package" is only the first 10% of the work. The other 90% is deciding what is public, how…

GPKit 2.0: SGP4 and GP orbital data in Swift

GPKit 2.0 is out. It's a Swift package for GP orbital data: it reads OMM and TLE, six-digit catalog numbers included, propagates them with SGP4, and finds passes with look angles and Doppler. The core doesn't need Foundation, and CI tests it on macOS, Linux, Windows, Android and WebAssembly and builds it for iOS, tvOS, watchOS and visionOS. The new part is data age. Give it older and newer sets for the same satellites and it measures how far a prediction drifts as the data gets older, by orbit…

SE-0556: Cell, ConstCell, and Volatile

And lastly: regardless of whether we stick to Span<Cell> or loop back to AliasedSpan, I think it would be useful to document the expectations around bulk updates. I think it's not possible to spell a generic constraint that would allow you to extend Span for Cell elements such that it can have bulk update operations, for instance.

SE-0556: Cell, ConstCell, and Volatile

Regarding Cell and eventually aliasing/non-aliasing accesses if they're broken off, it's still not fully clear to me what we lose when we ask Swift to stop assuming everything is exclusive. For instance, if I have a Span<Foo> and a Cell<Foo> that are live at the same time, I expect that modifying the contents of Cell<Foo> still cannot modify the contents of any Foo inside the Span, and the compiler can optimize accordingly. I would also expect that a borrowed value (or an inout value) can never…

SE-0556: Cell, ConstCell, and Volatile

I have been relatively quiet on this proposal because I usually review features that either have clear security implications or features that I think I would use; but now that AliasedRawSpan is no longer proposed, it falls outside my usual scope. (There's a good amount of room to get the implementation of Cell wrong in a way that leads to memory safety issues, but I think that there exists a safe implementation.) With that said, it's been pointed out to me that Span<Cell<UInt8>> could be the…

SwiftUIWeb: Bringing SwiftUI to the browser with Embedded Swift and WebAssembly

I just tried playground and this seems to be one of the better web implementations of SwiftUI. Nice job! I'm very happy to see it using embedded wasm. The API looks to be identical to Apple's SwiftUI. I think ElementaryUI had to diverge from Apple's SwiftUI API to get it to work in embedded Swift. I prefer your approach of keeping it the same. Do you plan to keep the API close/identical to Apple's SwiftUI?

[Pitch #2] Called-once function types

John_McCall: You’re suggesting that we delay checking capture rules of local functions until we can analyze their uses? Ah, never mind. I thought we already did that for captures, but maybe it's not nearly as general as I'm imagining. At least for escaping vs non-escaping uses, there's a distinction though: func f(_ fn: () -> ()) -> () -> () { func g1() { fn() // this seems to work? } func g2() { fn() // we diagnose this } g1() return g2 }

[Pitch #2] Called-once function types

Slava_Pestov: Should we say that the type of the closure that we form when you write f there be called-once? It would then follow that f() can consume non-copyable captures and so on, as long as the calls to f() are in the right spots. You’re suggesting that we delay checking capture rules of local functions until we can analyze their uses? That’s probably feasible. But we can’t really reason about whether there’s exactly one call site on every path in the typechecker, so I’m not sure how much…

[Pitch #2] Called-once function types

tshortli: Modeling defer as a closure is an implementation detail of the compiler rather than a language design choice. Actually this reminds me, if you have a local function that is only called and not used as a value: func f() { ... } f() What we do today is basically equivalent to forming a closure and immediately calling it. Should we say that the type of the closure that we form when you write f there be called-once? It would then follow that f() can consume non-copyable captures and so…

Showcase: Ghost Chat’s AI-assisted workflow for Swift projects

Hi, I'm Ghost Chat Dev. I'm a mechanic in Quebec who taught himself to code, and I built a tool that takes a plain-English description of a Swift app and generates the project files plus a GitHub Actions workflow. One question I keep hitting: where does AI-assisted Swift break for you? Mine compiles plain Swift and Foundation fine, but it can't build SwiftUI, so I have to test those in Playgrounds by hand. I'd like to know if that's a me problem or a Swift problem. Example build here: GitHub -…

SE-0563: Improve Interaction Between `@main` and Top-Level Code

nice proposal. I don't have much to add, I just wanted to mention one use case that would benefit from this. on competitive programming platforms that support Swift, such as https://atcoder.jp, usually either top-level code or @main is supported, unless manual heuristics are employed, which could easily be wrong and require effort to develop and maintain. I've advocated for Swift support on some online judges, and I ran into this issue while testing their setups. there wasn't a straightforward…

SE-0558: Bulk update operations for `MutableSpan` and `MutableRawSpan`

John_McCall: Hmm. I was thinking of the limit generally being “I don’t want to overwrite more than this many elements” rather than “I only want to copy a prefix”, but I can see your point. Yeah, I do think the first way of thinking about it is useful to express directly. It would be nice to have ...startingAt: inout Index, limitedBy: Index, copyingFrom: ... that guarantees elements are preserved at or after that limit. It's not hard at all to math that into "how many elements or what are the…

Rendering in Swift

gonsolo: Currently Moana takes around 17 minutes to load, I believe this can be cut down to under 2 minutes. It's 13 seconds now (if everything is correctly preprocessed): https://youtu.be/dMYG1hy7kVY?si=DJmQ4vw0tdEm5u4O And it's not Swift anymore.

Documentation: PR for curation of 6.5 symbols

We've got a PR up that organizes the new 6.5 symbols like Cell and TaskID into their proper places in the documentation. PR: stdlib Documentation: curate 6.5 symbols by invalidname · Pull Request #94225 · swiftlang/swift · GitHub Browsable preview: Documentation More details in the PR description. Feel free to leave a comment or question. Thanks.

[Returned for revision] SE-0542: Package Manager Condition Plugins

Hello, Swift community! The review of SE-0542: Package Manager Condition Plugins has ended. The Ecosystem Steering Group has decided to return this proposal for revision. We would like the revision to address two goals: 1. Further clarify how target platform conditions are applied to plugins, particularly prebuild plugins. We think it's important for plugin authors that this behavior is well defined and understandable, and that it's something we can commit to supporting long term. 2. More…