31 posts tagged ‘Swift Programming Language’
Swift Parameterized Testing
Keith Harrison: Swift Testing calls the test function once for each value in the arguments collection. […] If you pass a second argument, Swift Testing generates test cases for all combinations of the two arguments. […] You’re limited to at most two arguments. If you don’t need every combination you can zip the arguments to […]
Swift Concurrency in Real Apps
Bryan Jones: Consider this code, wherein we create a custom NSTableColumn that uses an image instead of a String as its header. Holly Borla posted a fix that special-cases NSObject.init(): Now, overriding NSObject.init() within a @MainActor-isolated type is difficult-to-impossible, especially if you need to call an initializer from an intermediate superclass that is also @MainActor-isolated. […]
Swift Prospective Vision: Accessors
John McCall (forum): However, this approach has significant problems. The biggest is that the get accessor has to return an independent value. If the accessor is just returning a value stored in memory, which is very common for data structures, this means the value has to be copied.[…]This vision document lays out the design space […]
Issues Adopting Swift Testing
I’m in the process of migrating from XCTest to Swift Testing. The basic stuff is pretty easy to translate, and in many cases I don’t even need to change the code inside my test methods. I’ve long been writing what Swift Testing calls expectations in terms of my own helper functions such as eq(), unwrap(), […]
Forked
Drew McCormack (Mastodon): I’m launching a new Swift framework called Forked for working with shared data, both on a single device, and across many.[…]The merging that @ForkedModel provides is pretty powerful. It does property-wise merging of structs, and if you attach the @Merged attribute, you can add your own custom merging logic, or use the […]
Xcode 16.2
Apple (downloads): The Command Line Tools package now supports using the swift test command to build and run package tests written with Swift Testing.[…]Sometimes running parallel Tests on macOS run destinations never finishes.[…]macOS projects that use hardened runtime but no sandboxing may run into timeout errors when attempting to preview if the project is complex […]
Apple’s Use of Swift and SwiftUI in iOS 18
Alexandre Colucci (Mastodon, Hacker News): iOS 18 contains 6800 binaries, up from 6030 in iOS 17. That’s 770 new binaries. […] Unsurprisingly, the number of apps adopting SwiftUI continues to grow this year. Notable mentions include:The new Passwords appThe Siri.app which now uses SwiftUIThe Calculator app, which received a notable overhaulThe new Journal app introduced […]
Swift Proposal: Precise Control Flags Over Compiler Warnings
SE-0443: This proposal suggests adding new options that will allow the behavior of warnings to be controlled based on their diagnostic group.-Werror <group> - upgrades warnings in the specified group to errors-Wwarning <group> - indicates that warnings in the specified group should remain warnings, even if they were previously suppressed or upgraded to errors[…]Thus, for […]