From 11825fa01f38cb127aa5569c91eea099136cb23a Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sun, 18 Jan 2026 19:43:18 +0400 Subject: [PATCH] docs: update `README.md` --- CONTRIBUTING.md | 646 +++++++++++++++++++++++++++++++++++++++++++++--- README.md | 298 ++++++++++++++++++++-- 2 files changed, 879 insertions(+), 65 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d97da7b..16fda6f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,61 +1,627 @@ -# Contributing Guidelines +# Contributing to Transitions -This document contains information and guidelines about contributing to this project. -Please read it before you start participating. +First off, thank you for considering contributing to Transitions! It's people like you that make Transitions such a great tool. -**Topics** +## Table of Contents -* [Reporting Issues](#reporting-issues) -* [Submitting Pull Requests](#submitting-pull-requests) -* [Developers Certificate of Origin](#developers-certificate-of-origin) -* [Code of Conduct](#code-of-conduct) +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) + - [Development Setup](#development-setup) + - [Project Structure](#project-structure) +- [How Can I Contribute?](#how-can-i-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Suggesting Features](#suggesting-features) + - [Improving Documentation](#improving-documentation) + - [Submitting Code](#submitting-code) +- [Development Workflow](#development-workflow) + - [Branching Strategy](#branching-strategy) + - [Commit Guidelines](#commit-guidelines) + - [Pull Request Process](#pull-request-process) +- [Coding Standards](#coding-standards) + - [Swift Style Guide](#swift-style-guide) + - [Code Quality](#code-quality) + - [Testing Requirements](#testing-requirements) +- [Community](#community) -## Reporting Issues +## Code of Conduct -A great way to contribute to the project is to send a detailed issue when you encounter a problem. We always appreciate a well-written, thorough bug report. +This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to nv3212@gmail.com. -Check that the project issues database doesn't already include that problem or suggestion before submitting an issue. If you find a match, feel free to vote for the issue by adding a reaction. Doing this helps prioritize the most common problems and requests. +## Getting Started -When reporting issues, please fill out our issue template. The information the template asks for will help us review and fix your issue faster. +### Development Setup -## Submitting Pull Requests +1. **Fork the repository** + ```bash + # Click the "Fork" button on GitHub + ``` -You can contribute by fixing bugs or adding new features. For larger code changes, we recommend first discussing your ideas on our [GitHub Discussions](https://github.com/space-code/transitions/discussions). When submitting a pull request, please add relevant tests and ensure your changes don't break any existing tests. +2. **Clone your fork** + ```bash + git clone https://github.com/YOUR_USERNAME/transitions.git + cd transitions + ``` -## Developer's Certificate of Origin 1.1 +3. **Set up the development environment** + ```bash + # Bootstrap the project + make bootstrap + ``` -By making a contribution to this project, I certify that: +4. **Create a feature branch** + ```bash + git checkout -b feature/your-feature-name + ``` -- (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or +5. **Open the project in Xcode** + ```bash + open Package.swift + ``` -- (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or +## How Can I Contribute? -- (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. +### Reporting Bugs -- (d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. +Before creating a bug report, please check the [existing issues](https://github.com/space-code/transitions/issues) to avoid duplicates. -## Code of Conduct +When creating a bug report, include: + +- **Clear title** - Describe the issue concisely +- **Reproduction steps** - Detailed steps to reproduce the bug +- **Expected behavior** - What you expected to happen +- **Actual behavior** - What actually happened +- **Environment** - iOS version, Xcode version, Swift version +- **Code samples** - Minimal reproducible example +- **Error messages** - Complete error output if applicable + +**Example:** +```markdown +**Title:** Custom transition not triggering on dismissal + +**Steps to reproduce:** +1. Create CustomTransition subclass with custom dismissal animation +2. Assign transition to view controller using customTransition property +3. Present view controller +4. Dismiss view controller + +**Expected:** Custom dismissal animation should play +**Actual:** Default dismissal animation is used instead + +**Environment:** +- iOS 16.0 +- Xcode 15.3 +- Swift 5.10 + +**Code:** +```swift +final class FadeTransition: CustomTransition { + override func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { + super.animateTransition(using: transitionContext) + // Custom animation code + } +} + +let vc = UIViewController() +vc.customTransition = FadeTransition() +present(vc, animated: true) +dismiss(animated: true) // Uses default animation instead of custom +``` +``` + +### Suggesting Features + +We love feature suggestions! When proposing a new feature, include: + +- **Problem statement** - What problem does this solve? +- **Proposed solution** - How should it work? +- **Alternatives** - What alternatives did you consider? +- **Use cases** - Real-world scenarios +- **API design** - Example code showing usage +- **Breaking changes** - Will this break existing code? + +**Example:** +```markdown +**Feature:** Add interactive transition support + +**Problem:** Current implementation doesn't support interactive (gesture-driven) transitions, limiting use cases for custom dismissal gestures. + +**Solution:** Add `InteractiveTransition` protocol and gesture recognizer integration to enable swipe-to-dismiss and other interactive transitions. + +**API:** +```swift +final class SwipeDismissTransition: CustomTransition, InteractiveTransition { + var percentComplete: CGFloat = 0 + + func updateInteractiveTransition(_ percentComplete: CGFloat) { + self.percentComplete = percentComplete + } + + func finishInteractiveTransition() { + // Complete transition + } + + func cancelInteractiveTransition() { + // Cancel and return to original state + } +} + +let vc = UIViewController() +vc.customTransition = SwipeDismissTransition() +vc.customTransition?.enableInteractiveGesture(.swipeDown) +``` + +**Use case:** Modal views that can be dismissed by swiping down, similar to native iOS modal presentations. +``` + +### Improving Documentation + +Documentation improvements are always welcome: + +- **Code comments** - Add/improve inline documentation +- **DocC documentation** - Enhance documentation articles +- **README** - Fix typos, add examples +- **Guides** - Write tutorials or how-to guides +- **API documentation** - Document public APIs + +### Submitting Code -The Code of Conduct governs how we behave in public or in private -whenever the project will be judged by our actions. -We expect it to be honored by everyone who contributes to this project. +1. **Check existing work** - Look for related issues or PRs +2. **Discuss major changes** - Open an issue for large features +3. **Follow coding standards** - See [Coding Standards](#coding-standards) +4. **Write tests** - All code changes require tests +5. **Update documentation** - Keep docs in sync with code +6. **Create a pull request** - Use clear description -See [CODE_OF_CONDUCT.md](https://github.com/space-code/transitions/blob/master/CODE_OF_CONDUCT.md) for details. +## Development Workflow + +### Branching Strategy + +We use a simplified branching model: + +- **`main`** - Main development branch (all PRs target this) +- **`feature/*`** - New features +- **`fix/*`** - Bug fixes +- **`docs/*`** - Documentation updates +- **`refactor/*`** - Code refactoring +- **`test/*`** - Test improvements + +**Branch naming examples:** +```bash +feature/interactive-transitions +fix/dismissal-animation-timing +docs/add-advanced-examples +refactor/simplify-transition-context +test/add-presentation-tests +``` + +### Commit Guidelines + +We use [Conventional Commits](https://www.conventionalcommits.org/) for clear, structured commit history. + +**Format:** +``` +(): + + + +