Open Source Updates for Swift Projects - Issue #10

Welcome to the 10th issue of the bi-weekly newsletter “Open Source Updates for Swift Projects”. Learn about new projects and innovations of popular projects that help you as a Swift / iOS developer.

Today's issue introduces dependency-free Swift packages that are fairly new.

I’d love your input and suggestions to include in this newsletter. Please share them with me via email.

Avoid printing secrets with this property wrapper

swift-secrecy is a dependency-free Swift package that introduces the @Secret property wrapper with its custom CustomStringConvertible / CustomDebugStringConvertible implementation to avoid leaking secrets when using print()

Getting OS name and version in Swift

OSInfo is a dependency-free, cross-platform Swift Package to report the operating system name and version on which the app is running

Key Aspects:

  • a cross-platform API that works for iOS, iPadOS, watchOS, tvOS, macOS, Mac Catalyst, Linux and Windows

  • a universal API so that you don't need to worry about the various underlying APIs (UIDevice vs. WKInterfaceDevice vs. ProcessInfo)

  • Dealing with the fact that iOS Apps on Mac and Mac Catalyst deal with two versions, the macOS version the app is running on (or targeting) and the iOS (support) version that macOS version corresponds with.

  • The package's default behavior is to obtain the underlying macOS version while still having the option to get the "iOS support version" if desired.

Easy creation of About Screens in SwiftUI

Diligence is a dependency-free Swift package that provides a SwiftUI API to describe and build "About Screens" for macOS and iOS apps.

Mock away in your unit tests with MockingKit

MockingKit is a dependency-free, Swift-based mocking library that makes it easy to mock protocols and classes, for instance when unit testing or mocking not yet implemented functionality.

MockingKit lets you register function results, call functions and inspect recorded calls.

MockingKit doesn't put any restrictions on your code or require you to structure it in any way. You don't need any setup or configuration. Just create a mock and you're good to go.