Skip to content

erichoracek/MainOffender

 
 

Repository files navigation

Build Status Platforms Documentation

MainOffender

A tiny package with utilities to help with Swift Concurrency

You can also just copy-paste the stuff you need into your project if you aren't into taking on the dependency. I won't be offended (ha!).

Features:

  • MainActor.runUnsafely for MainActor.assumeIsolated with lower OS version requirements.
  • DispatchQueue.mainActor for a DispatchQueue proxy that is @MainActor-compatible
  • OperationQueue.mainActor for an OperationQueue proxy that is @MainActor compatible
  • UnsafeBlockOperation for BlockOperation without Sendable checking
  • Additions to OperationQueue to submit blocks directly without Sendable checking
  • addUnsafeObserver(forName:object:queue:using:) for NotificationCenter

Installation

dependencies: [
    .package(url: "https://github.com/ChimeHQ/MainOffender", from: "0.1.0")
]

Contributing and Collaboration

I'd love to hear from you! Get in touch via mastodon, an issue, or a pull request.

I prefer collaboration, and would love to find ways to work together if you have a similar project.

I prefer indentation with tabs for improved accessibility. But, I'd rather you use the system you want and make a PR than hesitate because of whitespace.

By participating in this project you agree to abide by the Contributor Code of Conduct.

About

Utilities for transitioning to Swift Concurrency

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%