https://github.com/orchetect/otoperations
Useful Swift NSOperation and NSOperationQueue subclasses
https://github.com/orchetect/otoperations
ios ios-swift macos nsoperation nsoperationqueue operation operationqueue operations swift swift-5 swift-5-5 tvos watchos
Last synced: 3 months ago
JSON representation
Useful Swift NSOperation and NSOperationQueue subclasses
- Host: GitHub
- URL: https://github.com/orchetect/otoperations
- Owner: orchetect
- License: mit
- Created: 2022-02-14T22:23:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-27T22:36:03.000Z (6 months ago)
- Last Synced: 2025-03-29T23:32:11.160Z (3 months ago)
- Topics: ios, ios-swift, macos, nsoperation, nsoperationqueue, operation, operationqueue, operations, swift, swift-5, swift-5-5, tvos, watchos
- Language: Swift
- Homepage:
- Size: 297 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# OTOperations
[](https://github.com/orchetect/OTOperations/actions/workflows/build.yml) [](https://developer.apple.com/swift)  [](https://developer.apple.com/swift) [](https://github.com/orchetect/OTOperations/blob/main/LICENSE)
Useful `NSOperation` (`Operation`) and `NSOperationQueue` (`OperationQueue`) subclasses for Swift.
Scalable, thread-safe, and automatically fully progress-reporting for nested child operations.
- Foundational
- `BasicOperation` and `BasicAsyncOperation`
- Closure-based
- `ClosureOperation` and `AsyncClosureOperation`
- `InteractiveClosureOperation` and `InteractiveAsyncClosureOperation`
- Thread-safe atomic mutability
- `AtomicBlockOperation`## Installation: Swift Package Manager (SPM)
### Dependency within an Application
1. Add the package to your Xcode project using Swift Package Manager
- Select File → Swift Packages → Add Package Dependency
- Add package using `https://github.com/orchetect/OTOperations` as the URL.
2. Import the module in your *.swift files where needed.
```swift
import OTOperations
```### Dependency within a Swift Package
1. In your Package.swift file:
```swift
dependencies: [
.package(url: "https://github.com/orchetect/OTOperations", from: "2.0.0")
],
```
2. Using `internal import` prevents the methods and properties in `OTOperations` from being exported to the consumer of your SPM package.```swift
internal import OTOperations
```## Documentation
Most methods are implemented as category methods so they are generally discoverable.
All methods have inline help explaining their purpose and basic usage examples.
## Author
Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself [@orchetect](https://github.com/orchetect).
## License
Licensed under the MIT license. See [LICENSE](https://github.com/orchetect/OTOperations/blob/master/LICENSE) for details.
## Contributions
Bug fixes and improvements are welcome. Please open an issue to discuss prior to submitting PRs.