diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..0c97e22 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +### Summary + + +### Changes Made + + +### Rationale + + +### Testing Performed + + +### Related Issue + + +### Checklist +- [ ] Code follows project formatting standards (2 spaces). +- [ ] Tests pass locally (`swift test`). +- [ ] Documentation updated (if applicable). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3852ee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +# Contributing to AsyncTimeSequences + +Thank you for your interest in contributing to AsyncTimeSequences! We welcome contributions of all kinds, including new features, bug fixes, and improvements to documentation. + +## How to Contribute + +1. **Fork the Repository**: Create your own copy of the repository on GitHub. +2. **Clone Locally**: `git clone https://github.com/Henryforce/AsyncTimeSequences.git` +3. **Create a Branch**: Use a descriptive name for your branch. +4. **Make Changes**: Ensure your code follows the project's formatting standards. +5. **Write Tests**: If you're adding a new feature or fixing a bug, please include tests to verify your changes. +6. **Run Tests Locally**: Ensure all tests pass before submitting your PR. +7. **Submit a Pull Request**: Provide a clear description of your changes and why they are needed. + +## Code Style & Formatting + +Please run the following command on your changes before submitting: + +```bash +swift format . --recursive --in-place +``` + +## License + +By contributing to AsyncTimeSequences, you agree that your contributions will be licensed under the project's [License](LICENSE). diff --git a/Package.swift b/Package.swift index 3af66f8..e5bb10e 100644 --- a/Package.swift +++ b/Package.swift @@ -5,7 +5,7 @@ import PackageDescription let package = Package( name: "AsyncTimeSequences", - platforms: [.iOS(.v13), .macOS(.v13), .watchOS(.v6), .tvOS(.v13)], + platforms: [.iOS(.v13), .macOS(.v13), .watchOS(.v6), .tvOS(.v13), .visionOS(.v1)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( diff --git a/Sources/AsyncTimeSequences/AsyncScheduler/AsyncScheduler.swift b/Sources/AsyncTimeSequences/AsyncScheduler/AsyncScheduler.swift index 1fbaf8f..b3668e0 100644 --- a/Sources/AsyncTimeSequences/AsyncScheduler/AsyncScheduler.swift +++ b/Sources/AsyncTimeSequences/AsyncScheduler/AsyncScheduler.swift @@ -68,7 +68,11 @@ public actor MainAsyncScheduler: AsyncScheduler { after: TimeInterval ) -> Task { return Task { - try? await Task.sleep(for: .seconds(after)) + if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) { + try? await Task.sleep(for: .seconds(after)) + } else { + try? await Task.sleep(nanoseconds: UInt64(after * 1_000_000_000)) + } completedElementIds.insert(currentId) if Task.isCancelled {