From 42502fd346a19e98f14e5125e5bef07a9fa2018f Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Wed, 8 Jan 2025 19:50:27 +0100
Subject: [PATCH 01/11] Initial commit
---
.github/ISSUE_TEMPLATE/bug_report.md | 41 ++++++
.github/ISSUE_TEMPLATE/feature_request.md | 11 ++
.github/PULL_REQUEST_TEMPLATE/bug_template.md | 9 ++
.../PULL_REQUEST_TEMPLATE/feature_template.md | 12 ++
.github/dependabot.yml | 34 +++++
.github/workflows/ci.yml | 101 +++++++++++++
.github/workflows/danger.yml | 31 ++++
.swiftformat | 64 +++++++++
.swiftlint.yml | 135 ++++++++++++++++++
.../contents.xcworkspacedata | 7 +
CHANGELOG.md | 2 +
CODE_OF_CONDUCT.md | 74 ++++++++++
CONTRIBUTING.md | 61 ++++++++
Dangerfile | 1 +
Gemfile | 3 +
Makefile | 19 +++
Mintfile | 2 +
Package.swift | 16 +++
README.md | 66 ++++++++-
SEQURITY.md | 7 +
Sources/Transitions/Classes/Transitions.swift | 6 +
Tests/TransitionsTests/TransitionsTests.swift | 8 ++
hooks/pre-commit | 38 +++++
23 files changed, 747 insertions(+), 1 deletion(-)
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
create mode 100644 .github/PULL_REQUEST_TEMPLATE/bug_template.md
create mode 100644 .github/PULL_REQUEST_TEMPLATE/feature_template.md
create mode 100644 .github/dependabot.yml
create mode 100644 .github/workflows/ci.yml
create mode 100644 .github/workflows/danger.yml
create mode 100644 .swiftformat
create mode 100644 .swiftlint.yml
create mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
create mode 100644 CHANGELOG.md
create mode 100644 CODE_OF_CONDUCT.md
create mode 100644 CONTRIBUTING.md
create mode 100644 Dangerfile
create mode 100644 Gemfile
create mode 100644 Makefile
create mode 100644 Mintfile
create mode 100644 Package.swift
create mode 100644 SEQURITY.md
create mode 100644 Sources/Transitions/Classes/Transitions.swift
create mode 100644 Tests/TransitionsTests/TransitionsTests.swift
create mode 100755 hooks/pre-commit
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..8dc7e75
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,41 @@
+---
+name: "🐛 Bug Report"
+about: Report a reproducible bug or regression.
+title: 'Bug: '
+labels: 'bug'
+
+---
+
+
+
+Application version:
+
+## Steps To Reproduce
+
+1.
+2.
+
+
+
+Link to code example:
+
+
+
+## The current behavior
+
+
+## The expected behavior
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..020971e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,11 @@
+---
+name: 🛠 Feature request
+about: If you have a feature request for the transitions, file it here.
+labels: 'type: enhancement'
+---
+
+**Feature description**
+Clearly and concisely describe the feature.
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_template.md b/.github/PULL_REQUEST_TEMPLATE/bug_template.md
new file mode 100644
index 0000000..7d6a149
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/bug_template.md
@@ -0,0 +1,9 @@
+## Bug description
+Clearly and concisely describe the problem.
+
+## Solution description
+Describe your code changes in detail for reviewers. Explain the technical solution you have provided and how it fixes the issue case.
+
+## Covered unit test cases
+- [x] yes
+- [x] no
\ No newline at end of file
diff --git a/.github/PULL_REQUEST_TEMPLATE/feature_template.md b/.github/PULL_REQUEST_TEMPLATE/feature_template.md
new file mode 100644
index 0000000..ab3978b
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE/feature_template.md
@@ -0,0 +1,12 @@
+## Feature description
+Clearly and concisely describe the feature.
+
+## Solution description
+Describe your code changes in detail for reviewers.
+
+## Areas affected and ensured
+List out the areas affected by your code changes.
+
+## Covered unit test cases
+- [x] yes
+- [x] no
\ No newline at end of file
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..57c6f88
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,34 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: /
+ open-pull-requests-limit: 10
+ schedule:
+ interval: daily
+ time: '07:00'
+ timezone: Europe/Berlin
+
+ assignees:
+ - ns-vasilev
+ reviewers:
+ - ns-vasilev
+
+
+ - package-ecosystem: swift
+ directory: /
+ open-pull-requests-limit: 10
+ schedule:
+ interval: daily
+ time: '07:00'
+ timezone: Europe/Berlin
+
+ assignees:
+ - ns-vasilev
+ reviewers:
+ - ns-vasilev
+
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..2794439
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,101 @@
+name: "transitions"
+
+on:
+ push:
+ branches:
+ - main
+ - dev
+ pull_request:
+ paths:
+ - '.swiftlint.yml'
+ - ".github/workflows/**"
+ - "Package.swift"
+ - "Source/**"
+ - "Tests/**"
+
+jobs:
+ SwiftLint:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: GitHub Action for SwiftLint
+ uses: norio-nomura/action-swiftlint@3.2.1
+ with:
+ args: --strict
+ env:
+ DIFF_BASE: ${{ github.base_ref }}
+ iOS:
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.runsOn }}
+ env:
+ DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
+ timeout-minutes: 20
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - destination: "OS=18.1,name=iPhone 16 Pro"
+ name: "iOS 18.1"
+ xcode: "Xcode_16.1"
+ runsOn: macOS-14
+ - destination: "OS=18.0,name=iPhone 16 Pro"
+ name: "iOS 18.0"
+ xcode: "Xcode_16.0"
+ runsOn: macOS-14
+ - destination: "OS=17.5,name=iPhone 15 Pro"
+ name: "iOS 17.5"
+ xcode: "Xcode_15.4"
+ runsOn: macOS-14
+ - destination: "OS=17.0.1,name=iPhone 14 Pro"
+ name: "iOS 17.0.1"
+ xcode: "Xcode_15.0"
+ runsOn: macos-13
+ - destination: "OS=16.4,name=iPhone 14 Pro"
+ name: "iOS 16.4"
+ xcode: "Xcode_14.3.1"
+ runsOn: macos-13
+ steps:
+ - uses: actions/checkout@v3
+ - name: ${{ matrix.name }}
+ run: xcodebuild test -scheme "Transitions" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
+
+ spm:
+ name: ${{ matrix.name }}
+ runs-on: ${{ matrix.runsOn }}
+ env:
+ DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
+ timeout-minutes: 20
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - name: "macOS 14, SPM 6.0.2 Test"
+ xcode: "Xcode_16.1"
+ runsOn: macOS-14
+ - name: "macOS 14, SPM 6.0.0 Test"
+ xcode: "Xcode_16.0"
+ runsOn: macOS-14
+ - name: "macOS 14, SPM 5.9.0 Test"
+ xcode: "Xcode_15.0"
+ runsOn: macos-14
+ - name: "macOS 13, SPM 5.8.1 Test"
+ xcode: "Xcode_14.3.1"
+ runsOn: macos-13
+ steps:
+ - uses: actions/checkout@v3
+ - name: ${{ matrix.name }}
+ run: swift build -c release
+
+ discover-typos:
+ name: Discover Typos
+ runs-on: macOS-13
+ env:
+ DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
+ steps:
+ - uses: actions/checkout@v2
+ - name: Discover typos
+ run: |
+ export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin"
+ python3 -m pip install --upgrade pip
+ python3 -m pip install codespell
+ codespell --ignore-words-list="hart,inout,msdos,sur" --skip="./.build/*,./.git/*"
diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
new file mode 100644
index 0000000..3f63d38
--- /dev/null
+++ b/.github/workflows/danger.yml
@@ -0,0 +1,31 @@
+name: Danger
+
+on:
+ pull_request:
+ types: [synchronize, opened, reopened, labeled, unlabeled, edited]
+
+env:
+ LC_CTYPE: en_US.UTF-8
+ LANG: en_US.UTF-8
+
+jobs:
+ run-danger:
+ runs-on: ubuntu-latest
+ steps:
+ - name: ruby setup
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: 3.1.4
+ bundler-cache: true
+ - name: Checkout code
+ uses: actions/checkout@v2
+ - name: Setup gems
+ run: |
+ gem install bundler
+ bundle install --clean --path vendor/bundle
+ - name: danger
+ env:
+
+ DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
+
+ run: bundle exec danger --verbose
\ No newline at end of file
diff --git a/.swiftformat b/.swiftformat
new file mode 100644
index 0000000..e293a0c
--- /dev/null
+++ b/.swiftformat
@@ -0,0 +1,64 @@
+# Stream rules
+
+--swiftversion 5.3
+
+# Use 'swiftformat --options' to list all of the possible options
+
+--header "\ntransitions\nCopyright © {created.year} Space Code. All rights reserved.\n//"
+
+--enable blankLinesBetweenScopes
+--enable blankLinesAtStartOfScope
+--enable blankLinesAtEndOfScope
+--enable blankLinesAroundMark
+--enable anyObjectProtocol
+--enable consecutiveBlankLines
+--enable consecutiveSpaces
+--enable duplicateImports
+--enable elseOnSameLine
+--enable emptyBraces
+--enable initCoderUnavailable
+--enable leadingDelimiters
+--enable numberFormatting
+--enable preferKeyPath
+--enable redundantBreak
+--enable redundantExtensionACL
+--enable redundantFileprivate
+--enable redundantGet
+--enable redundantInit
+--enable redundantLet
+--enable redundantLetError
+--enable redundantNilInit
+--enable redundantObjc
+--enable redundantParens
+--enable redundantPattern
+--enable redundantRawValues
+--enable redundantReturn
+--enable redundantSelf
+--enable redundantVoidReturnType
+--enable semicolons
+--enable sortImports
+--enable sortSwitchCases
+--enable spaceAroundBraces
+--enable spaceAroundBrackets
+--enable spaceAroundComments
+--enable spaceAroundGenerics
+--enable spaceAroundOperators
+--enable spaceInsideBraces
+--enable spaceInsideBrackets
+--enable spaceInsideComments
+--enable spaceInsideGenerics
+--enable spaceInsideParens
+--enable strongOutlets
+--enable strongifiedSelf
+--enable todos
+--enable trailingClosures
+--enable unusedArguments
+--enable void
+--enable markTypes
+--enable isEmpty
+
+# format options
+
+--wraparguments before-first
+--wrapcollections before-first
+--maxwidth 140
\ No newline at end of file
diff --git a/.swiftlint.yml b/.swiftlint.yml
new file mode 100644
index 0000000..89efd09
--- /dev/null
+++ b/.swiftlint.yml
@@ -0,0 +1,135 @@
+excluded:
+ - Tests
+ - Package.swift
+ - .build
+
+# Rules
+
+disabled_rules:
+ - trailing_comma
+ - todo
+ - opening_brace
+
+opt_in_rules: # some rules are only opt-in
+ - anyobject_protocol
+ - array_init
+ - attributes
+ - closure_body_length
+ - closure_end_indentation
+ - closure_spacing
+ - collection_alignment
+ - conditional_returns_on_newline
+ - contains_over_filter_count
+ - contains_over_filter_is_empty
+ - contains_over_first_not_nil
+ - contains_over_range_nil_comparison
+ - convenience_type
+ - discouraged_object_literal
+ - discouraged_optional_boolean
+ - empty_collection_literal
+ - empty_count
+ - empty_string
+ - empty_xctest_method
+ - enum_case_associated_values_count
+ - explicit_init
+ - fallthrough
+ - fatal_error_message
+ - file_name
+ - file_types_order
+ - first_where
+ - flatmap_over_map_reduce
+ - force_unwrapping
+ - ibinspectable_in_extension
+ - identical_operands
+ - implicit_return
+ - inert_defer
+ - joined_default_parameter
+ - last_where
+ - legacy_multiple
+ - legacy_random
+ - literal_expression_end_indentation
+ - lower_acl_than_parent
+ - multiline_arguments
+ - multiline_function_chains
+ - multiline_literal_brackets
+ - multiline_parameters
+ - multiline_parameters_brackets
+ - no_space_in_method_call
+ - operator_usage_whitespace
+ - optional_enum_case_matching
+ - orphaned_doc_comment
+ - overridden_super_call
+ - override_in_extension
+ - pattern_matching_keywords
+ - prefer_self_type_over_type_of_self
+ - prefer_zero_over_explicit_init
+ - prefixed_toplevel_constant
+ - private_action
+ - prohibited_super_call
+ - quick_discouraged_call
+ - quick_discouraged_focused_test
+ - quick_discouraged_pending_test
+ - reduce_into
+ - redundant_nil_coalescing
+ - redundant_objc_attribute
+ - redundant_type_annotation
+ - required_enum_case
+ - single_test_class
+ - sorted_first_last
+ - sorted_imports
+ - static_operator
+ - strict_fileprivate
+ - switch_case_on_newline
+ - toggle_bool
+ - unavailable_function
+ - unneeded_parentheses_in_closure_argument
+ - unowned_variable_capture
+ - untyped_error_in_catch
+ - vertical_parameter_alignment_on_call
+ - vertical_whitespace_closing_braces
+ - vertical_whitespace_opening_braces
+ - xct_specific_matcher
+ - yoda_condition
+
+force_cast: warning
+force_try: warning
+
+identifier_name:
+ excluded:
+ - id
+ - URL
+
+analyzer_rules:
+ - unused_import
+ - unused_declaration
+
+line_length:
+ warning: 130
+ error: 200
+
+type_body_length:
+ warning: 300
+ error: 400
+
+file_length:
+ warning: 500
+ error: 1200
+
+function_body_length:
+ warning: 30
+ error: 50
+
+large_tuple:
+ error: 3
+
+nesting:
+ type_level:
+ warning: 2
+ statement_level:
+ warning: 10
+
+
+type_name:
+ max_length:
+ warning: 40
+ error: 50
\ No newline at end of file
diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 0000000..919434a
--- /dev/null
+++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..2e9885a
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,2 @@
+# Change Log
+All notable changes to this project will be documented in this file.
\ No newline at end of file
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..56c1661
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,74 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and
+orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting one of the project maintainers https://github.com/orgs/space-code/people. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..104f2b4
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,61 @@
+# Contributing Guidelines
+
+This document contains information and guidelines about contributing to this project.
+Please read it before you start participating.
+
+**Topics**
+
+* [Reporting Issues](#reporting-issues)
+* [Submitting Pull Requests](#submitting-pull-requests)
+* [Developers Certificate of Origin](#developers-certificate-of-origin)
+* [Code of Conduct](#code-of-conduct)
+
+## Reporting Issues
+
+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.
+
+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.
+
+When reporting issues, please fill out our issue template. The information the template asks for will help us review and fix your issue faster.
+
+## Submitting Pull Requests
+
+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.
+
+## Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+- (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
+
+- (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
+
+- (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+- (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.
+
+## Code of Conduct
+
+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.
+
+See [CODE_OF_CONDUCT.md](https://github.com/space-code/transitions/blob/master/CODE_OF_CONDUCT.md) for details.
+
+---
+
+*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](https://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.*
\ No newline at end of file
diff --git a/Dangerfile b/Dangerfile
new file mode 100644
index 0000000..b266982
--- /dev/null
+++ b/Dangerfile
@@ -0,0 +1 @@
+danger.import_dangerfile(github: 'space-code/dangerfile')
\ No newline at end of file
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..20dff64
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem 'danger'
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..de1897f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+all: bootstrap
+
+bootstrap: hook
+ mint bootstrap
+
+hook:
+ ln -sf ../../hooks/pre-commit .git/hooks/pre-commit
+ chmod +x .git/hooks/pre-commit
+
+mint:
+ mint bootstrap
+
+lint:
+ mint run swiftlint
+
+fmt:
+ mint run swiftformat Sources Tests
+
+.PHONY: all bootstrap hook mint lint fmt
diff --git a/Mintfile b/Mintfile
new file mode 100644
index 0000000..e2cdefa
--- /dev/null
+++ b/Mintfile
@@ -0,0 +1,2 @@
+nicklockwood/SwiftFormat@0.52.7
+realm/SwiftLint@0.53.0
\ No newline at end of file
diff --git a/Package.swift b/Package.swift
new file mode 100644
index 0000000..1ca7ccf
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,16 @@
+// swift-tools-version: 6.0
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "transitions",
+ platforms: [.iOS(.v12)],
+ products: [
+ .library(name: "Transitions", targets: ["Transitions"]),
+ ],
+ targets: [
+ .target(name: "Transitions"),
+ .testTarget(name: "TransitionsTests", dependencies: ["Transitions"]),
+ ]
+)
diff --git a/README.md b/README.md
index 6340106..be98aee 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,65 @@
-# transitions
\ No newline at end of file
+transitions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Description
+`transitions` description.
+
+- [Usage](#usage)
+- [Requirements](#requirements)
+- [Installation](#installation)
+- [Communication](#communication)
+- [Contributing](#contributing)
+- [Author](#author)
+- [License](#license)
+
+## Usage
+
+## Requirements
+
+## Installation
+### Swift Package Manager
+
+The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but `transitions` does support its use on supported platforms.
+
+Once you have your Swift package set up, adding `transitions` as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
+
+```swift
+dependencies: [
+ .package(url: "https://github.com/space-code/transitions.git", .upToNextMajor(from: "1.0.0"))
+]
+```
+
+## Communication
+- If you **found a bug**, open an issue.
+- If you **have a feature request**, open an issue.
+- If you **want to contribute**, submit a pull request.
+
+## Contributing
+Bootstrapping development environment
+
+```
+make bootstrap
+```
+
+Please feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request!
+
+## Author
+Nikita Vasilev, nv3212@gmail.com
+
+## License
+transitions is available under the MIT license. See the LICENSE file for more info.
\ No newline at end of file
diff --git a/SEQURITY.md b/SEQURITY.md
new file mode 100644
index 0000000..20dffca
--- /dev/null
+++ b/SEQURITY.md
@@ -0,0 +1,7 @@
+# Reporting Security Vulnerabilities
+
+This software is built with security and data privacy in mind to ensure your data is safe. We are grateful for security researchers and users reporting a vulnerability to us, first. To ensure that your request is handled in a timely manner and non-disclosure of vulnerabilities can be assured, please follow the below guideline.
+
+**Please do not report security vulnerabilities directly on GitHub. GitHub Issues can be publicly seen and therefore would result in a direct disclosure.**
+
+* Please address questions about data privacy, security concepts, and other media requests to the nv3212@gmail.com mailbox.
\ No newline at end of file
diff --git a/Sources/Transitions/Classes/Transitions.swift b/Sources/Transitions/Classes/Transitions.swift
new file mode 100644
index 0000000..5d3a369
--- /dev/null
+++ b/Sources/Transitions/Classes/Transitions.swift
@@ -0,0 +1,6 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+final class Transitions {}
diff --git a/Tests/TransitionsTests/TransitionsTests.swift b/Tests/TransitionsTests/TransitionsTests.swift
new file mode 100644
index 0000000..c3dbba9
--- /dev/null
+++ b/Tests/TransitionsTests/TransitionsTests.swift
@@ -0,0 +1,8 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+import XCTest
+
+final class TransitionsTests: XCTestCase {}
diff --git a/hooks/pre-commit b/hooks/pre-commit
new file mode 100755
index 0000000..956fdcb
--- /dev/null
+++ b/hooks/pre-commit
@@ -0,0 +1,38 @@
+#!/bin/bash
+git diff --diff-filter=d --staged --name-only | grep -e '\.swift$' | while read line; do
+ if [[ $line == *"/Generated"* ]]; then
+ echo "IGNORING GENERATED FILE: " "$line";
+ else
+ mint run swiftformat swiftformat "${line}";
+ git add "$line";
+ fi
+done
+
+LINT=$(which mint)
+if [[ -e "${LINT}" ]]; then
+ # Export files in SCRIPT_INPUT_FILE_$count to lint against later
+ count=0
+ while IFS= read -r file_path; do
+ export SCRIPT_INPUT_FILE_$count="$file_path"
+ count=$((count + 1))
+ done < <(git diff --name-only --cached --diff-filter=d | grep ".swift$")
+ export SCRIPT_INPUT_FILE_COUNT=$count
+
+ if [ "$count" -eq 0 ]; then
+ echo "No files to lint!"
+ exit 0
+ fi
+
+ echo "Found $count lintable files! Linting now.."
+ mint run swiftlint --use-script-input-files --strict --config .swiftlint.yml
+ RESULT=$? # swiftline exit value is number of errors
+
+ if [ $RESULT -eq 0 ]; then
+ echo "🎉 Well done. No violation."
+ fi
+ exit $RESULT
+else
+ echo "⚠️ WARNING: SwiftLint not found"
+ echo "⚠️ You might want to edit .git/hooks/pre-commit to locate your swiftlint"
+ exit 0
+fi
\ No newline at end of file
From d94f5d3d7875098685ad64a259b1f95e405ed09f Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:16:10 +0100
Subject: [PATCH 02/11] Implement the `transitions` package
---
.../UIViewController+CustomTransition.swift | 36 ++++
.../Interfaces/ICoreTransition.swift | 18 ++
.../Interfaces/IInteractiveTransition.swift | 27 +++
.../Classes/CustomTransition.swift | 194 ++++++++++++++++++
Sources/Transitions/Classes/Transitions.swift | 6 -
5 files changed, 275 insertions(+), 6 deletions(-)
create mode 100644 Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
create mode 100644 Sources/Transitions/Classes/Core/Transitions/Interfaces/ICoreTransition.swift
create mode 100644 Sources/Transitions/Classes/Core/Transitions/Interfaces/IInteractiveTransition.swift
create mode 100644 Sources/Transitions/Classes/CustomTransition.swift
delete mode 100644 Sources/Transitions/Classes/Transitions.swift
diff --git a/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
new file mode 100644
index 0000000..6699dc5
--- /dev/null
+++ b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
@@ -0,0 +1,36 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+import UIKit
+
+// MARK: - AssociatedKeys
+
+private enum AssociatedKeys {
+ nonisolated(unsafe) static var customTransitionKey = "CustomAnimationTransitionKey"
+}
+
+public extension UIViewController {
+ /// A custom transition object associated with the view controller.
+ var customTransition: CustomTransition? {
+ get {
+ withUnsafePointer(to: &AssociatedKeys.customTransitionKey) {
+ objc_getAssociatedObject(self, $0) as? CustomTransition
+ }
+ }
+ set {
+ self.customTransition?.owningController = nil
+ transitioningDelegate = newValue
+
+ if let transition = newValue {
+ modalPresentationStyle = .fullScreen
+ self.customTransition?.owningController = self
+ }
+
+ withUnsafePointer(to: &AssociatedKeys.customTransitionKey) {
+ objc_setAssociatedObject(self, $0, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
+ }
+ }
+ }
+}
diff --git a/Sources/Transitions/Classes/Core/Transitions/Interfaces/ICoreTransition.swift b/Sources/Transitions/Classes/Core/Transitions/Interfaces/ICoreTransition.swift
new file mode 100644
index 0000000..be5ba76
--- /dev/null
+++ b/Sources/Transitions/Classes/Core/Transitions/Interfaces/ICoreTransition.swift
@@ -0,0 +1,18 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+import Foundation
+
+/// A protocol defining custom transition animations, ensuring that all methods are executed on the main thread.
+@MainActor
+public protocol ICoreTransition {
+ /// Performs the custom presentation transition.
+ /// Implement this method to define how the view is presented.
+ func performTransition()
+
+ /// Performs the custom dismissal transition.
+ /// Implement this method to define how the view is dismissed.
+ func performDismissTransition()
+}
diff --git a/Sources/Transitions/Classes/Core/Transitions/Interfaces/IInteractiveTransition.swift b/Sources/Transitions/Classes/Core/Transitions/Interfaces/IInteractiveTransition.swift
new file mode 100644
index 0000000..73dc756
--- /dev/null
+++ b/Sources/Transitions/Classes/Core/Transitions/Interfaces/IInteractiveTransition.swift
@@ -0,0 +1,27 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+import Foundation
+
+/// A protocol defining the behavior for interactive transitions, typically used in custom view controller transitions.
+@MainActor
+public protocol IInteractiveTransition {
+ /// Begins the interactive dismissal transition.
+ /// Use this method to initialize the interactive transition process.
+ func beginInteractiveDismissalTransition()
+
+ /// Updates the interactive transition to a specific progress.
+ ///
+ /// - Parameter progress: A value between 0.0 and 1.0 indicating the current progress of the transition.
+ func updateInteractiveTransitionToProgress(progress: CGFloat)
+
+ /// Cancels the interactive transition.
+ /// Use this method to revert any changes made during the transition and restore the original state.
+ func cancelInteractiveTransition()
+
+ /// Completes the interactive transition.
+ /// Use this method to finalize the transition and apply the final state.
+ func finishInteractiveTransition()
+}
diff --git a/Sources/Transitions/Classes/CustomTransition.swift b/Sources/Transitions/Classes/CustomTransition.swift
new file mode 100644
index 0000000..2a76792
--- /dev/null
+++ b/Sources/Transitions/Classes/CustomTransition.swift
@@ -0,0 +1,194 @@
+//
+// transitions
+// Copyright © 2025 Space Code. All rights reserved.
+//
+
+import UIKit
+
+// MARK: - CustomTransition
+
+/// A custom transition class.
+/// Provides functionality for handling custom view controller transitions.
+open class CustomTransition: NSObject, ICoreTransition {
+ // MARK: Properties
+
+ /// The duration of the transition animation, measured in seconds.
+ public let animationDuration: TimeInterval
+
+ /// A flag indicating whether the transition is for presenting (`true`) or dismissing (`false`) a view controller.
+ public private(set) var isPresenting = false
+
+ /// The view controller that is presenting the view controller in the presented parameter.
+ public private(set) weak var presentingViewController: UIViewController?
+ /// The view controller object that is about to be presented onscreen.
+ public private(set) weak var presentedViewController: UIViewController?
+
+ /// The context object containing information about the transition.
+ public private(set) weak var transitionContext: UIViewControllerContextTransitioning?
+ /// This is the target view controller that will be presented after the transition.
+ public private(set) weak var toViewController: UIViewController?
+ /// This is the currently visible view controller before the transition begins.
+ public private(set) weak var fromViewController: UIViewController?
+ /// Determine if the transition is interactive.
+ public private(set) var isInteractive = false
+
+ /// The source view controller.
+ weak var owningController: UIViewController?
+
+ /// The container view serves as the parent view that holds both the from-view and to-view during the transition.
+ public private(set) weak var transitionContainerView: UIView?
+
+ /// An object that drives an interactive animation between one view controller and another.
+ private var interactionController: UIPercentDrivenInteractiveTransition?
+
+ /// This represents the view's transformation state before the transition begins.
+ public private(set) var intitialTransform: CGAffineTransform?
+ /// This represents the view's transformation state after the transition is completed.
+ public private(set) var finalTransform: CGAffineTransform?
+
+ // MARK: Initialization
+
+ /// Initializes a new instance of the `CustomTransition` class.
+ ///
+ /// - Parameter animationDuration: The duration of the transition animation, measured in seconds.
+ public init(animationDuration: TimeInterval) {
+ self.animationDuration = animationDuration
+ }
+
+ // MARK: ICoreTransition
+
+ open func performTransition() {}
+
+ open func performDismissTransition() {}
+
+ // MARK: Public
+
+ open func prepareForTransition(interactive _: Bool) {}
+
+ /// Completes the current transition and cleans up the transition state.
+ ///
+ /// - Parameter completion: An optional closure called with a Boolean value
+ /// indicating whether the transition was successful (`true`) or cancelled (`false`).
+ @MainActor
+ open func completeTransaction(completion: ((Bool) -> Void)? = nil) {
+ guard let transitionContext else {
+ completion?(false)
+ return
+ }
+
+ let isFinished = !transitionContext.transitionWasCancelled
+
+ completion?(isFinished)
+
+ transitionContext.completeTransition(isFinished)
+
+ self.transitionContext = nil
+ presentedViewController = nil
+ presentingViewController = nil
+ }
+
+ // MARK: Private
+
+ private func prepareTransitionParameters() {
+ guard let toViewController,
+ let fromViewController,
+ let transitionContext,
+ let presentingViewController,
+ let presentedViewController
+ else {
+ completeTransaction()
+ return
+ }
+
+ if isPresenting {
+ transitionContainerView?.addSubview(toViewController.view)
+ transitionContainerView?.addSubview(fromViewController.view)
+
+ intitialTransform = presentingViewController.view.transform
+ finalTransform = presentedViewController.view.transform
+
+ presentingViewController.view.frame = transitionContext.initialFrame(for: presentingViewController)
+ } else {
+ transitionContainerView?.addSubview(fromViewController.view)
+ transitionContainerView?.addSubview(toViewController.view)
+
+ intitialTransform = presentedViewController.view.transform
+ finalTransform = presentingViewController.view.transform
+
+ presentingViewController.view.frame = transitionContext.finalFrame(for: presentingViewController)
+ }
+ }
+}
+
+// MARK: IInteractiveTransition
+
+extension CustomTransition: IInteractiveTransition {
+ public func beginInteractiveDismissalTransition() {
+ interactionController = UIPercentDrivenInteractiveTransition()
+ owningController?.dismiss(animated: true)
+ }
+
+ public func updateInteractiveTransitionToProgress(progress: CGFloat) {
+ interactionController?.update(progress)
+ }
+
+ public func cancelInteractiveTransition() {
+ interactionController?.completionSpeed = 0.999
+ interactionController?.cancel()
+
+ interactionController = nil
+ }
+
+ public func finishInteractiveTransition() {
+ interactionController?.finish()
+ interactionController = nil
+ }
+}
+
+// MARK: UIViewControllerAnimatedTransitioning
+
+extension CustomTransition: UIViewControllerAnimatedTransitioning {
+ open func transitionDuration(using _: (any UIViewControllerContextTransitioning)?) -> TimeInterval {
+ animationDuration
+ }
+
+ open func animateTransition(using transitionContext: any UIViewControllerContextTransitioning) {
+ self.transitionContext = transitionContext
+ fromViewController = transitionContext.viewController(forKey: .from)
+ toViewController = transitionContext.viewController(forKey: .to)
+ isInteractive = transitionContext.isInteractive
+ transitionContainerView = transitionContext.containerView
+
+ prepareTransitionParameters()
+
+ prepareForTransition(interactive: isInteractive)
+
+ if isPresenting {
+ performTransition()
+ } else {
+ performDismissTransition()
+ }
+ }
+}
+
+// MARK: UIViewControllerTransitioningDelegate
+
+extension CustomTransition: UIViewControllerTransitioningDelegate {
+ public func animationController(
+ forPresented presented: UIViewController,
+ presenting: UIViewController,
+ source _: UIViewController
+ ) -> (any UIViewControllerAnimatedTransitioning)? {
+ presentingViewController = presenting
+ presentedViewController = presented
+ isPresenting = true
+ return self
+ }
+
+ public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
+ presentingViewController = dismissed
+ presentedViewController = dismissed.presentingViewController
+ isPresenting = false
+ return self
+ }
+}
diff --git a/Sources/Transitions/Classes/Transitions.swift b/Sources/Transitions/Classes/Transitions.swift
deleted file mode 100644
index 5d3a369..0000000
--- a/Sources/Transitions/Classes/Transitions.swift
+++ /dev/null
@@ -1,6 +0,0 @@
-//
-// transitions
-// Copyright © 2025 Space Code. All rights reserved.
-//
-
-final class Transitions {}
From 2f2041676cb9ff48fcbbd286cf60511ef5cd4cc5 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:26:28 +0100
Subject: [PATCH 03/11] Update `CONTRIBUTING.md`
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 104f2b4..d97da7b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -58,4 +58,4 @@ See [CODE_OF_CONDUCT.md](https://github.com/space-code/transitions/blob/master/C
---
-*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](https://elinux.org/Developer_Certificate_Of_Origin) communities. We commend them for their efforts to facilitate collaboration in their projects.*
\ No newline at end of file
+*Some of the ideas and wording for the statements above were based on work by the [Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md) and [Linux](https://elinux.org/Developer_Certificate_Of_Origin) communities.
From 7d0e388a84be5f1f41f766c930a8a8b0f0cf6203 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:26:57 +0100
Subject: [PATCH 04/11] Update `CHANGELOG.md`
---
CHANGELOG.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e9885a..e25c8e4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,2 +1,9 @@
# Change Log
-All notable changes to this project will be documented in this file.
\ No newline at end of file
+All notable changes to this project will be documented in this file.
+
+## [1.0.0](https://github.com/space-code/transitions/releases/tag/1.0.0)
+Released on 2025-01-13.
+
+#### Added
+- Initial release of Transitions.
+ - Added by [Nikita Vasilev](https://github.com/ns-vasilev).
From 9a3c597aff576e8b49fedebac98b626be16aa6e4 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:27:05 +0100
Subject: [PATCH 05/11] Update `README.md`
---
README.md | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/README.md b/README.md
index be98aee..a6b91c5 100644
--- a/README.md
+++ b/README.md
@@ -5,19 +5,10 @@
-
-
-
-
-
-
-
-
-
## Description
-`transitions` description.
+`transitions` is a framework that reduces the hassle of creating custom transitions.
- [Usage](#usage)
- [Requirements](#requirements)
@@ -29,8 +20,25 @@
## Usage
+```swift
+import Transitions
+
+final class ZoomTransition: CustomTransition {
+ // Implementation of the required protocol methods and properties.
+}
+
+let viewController = UIViewController()
+viewController.customTransition = ZoomTransition()
+
+self.present(viewController, animated: true)
+```
+
## Requirements
+- iOS 12.0+
+- Xcode 14.0
+- Swift 5.7
+
## Installation
### Swift Package Manager
@@ -62,4 +70,4 @@ Please feel free to help out with this project! If you see something that could
Nikita Vasilev, nv3212@gmail.com
## License
-transitions is available under the MIT license. See the LICENSE file for more info.
\ No newline at end of file
+transitions is available under the MIT license. See the LICENSE file for more info.
From ccb2569708b66b432f337699bd1810773a0fa1b4 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:27:47 +0100
Subject: [PATCH 06/11] Implement support for Swift 5.7 to 5.10
---
.swiftlint.yml | 6 +++++-
Package@swift-5.10.swift | 16 ++++++++++++++++
Package@swift-5.7.swift | 16 ++++++++++++++++
Package@swift-5.8.swift | 16 ++++++++++++++++
Package@swift-5.9.swift | 16 ++++++++++++++++
5 files changed, 69 insertions(+), 1 deletion(-)
create mode 100644 Package@swift-5.10.swift
create mode 100644 Package@swift-5.7.swift
create mode 100644 Package@swift-5.8.swift
create mode 100644 Package@swift-5.9.swift
diff --git a/.swiftlint.yml b/.swiftlint.yml
index 89efd09..61f8ee3 100644
--- a/.swiftlint.yml
+++ b/.swiftlint.yml
@@ -1,6 +1,10 @@
excluded:
- Tests
- Package.swift
+ - Package@swift-5.10.swift
+ - Package@swift-5.9.swift
+ - Package@swift-5.8.swift
+ - Package@swift-5.7.swift
- .build
# Rules
@@ -132,4 +136,4 @@ nesting:
type_name:
max_length:
warning: 40
- error: 50
\ No newline at end of file
+ error: 50
diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift
new file mode 100644
index 0000000..f4e9555
--- /dev/null
+++ b/Package@swift-5.10.swift
@@ -0,0 +1,16 @@
+// swift-tools-version: 5.10
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "transitions",
+ platforms: [.iOS(.v12)],
+ products: [
+ .library(name: "Transitions", targets: ["Transitions"]),
+ ],
+ targets: [
+ .target(name: "Transitions"),
+ .testTarget(name: "TransitionsTests", dependencies: ["Transitions"]),
+ ]
+)
diff --git a/Package@swift-5.7.swift b/Package@swift-5.7.swift
new file mode 100644
index 0000000..18686ab
--- /dev/null
+++ b/Package@swift-5.7.swift
@@ -0,0 +1,16 @@
+// swift-tools-version: 5.7
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "transitions",
+ platforms: [.iOS(.v12)],
+ products: [
+ .library(name: "Transitions", targets: ["Transitions"]),
+ ],
+ targets: [
+ .target(name: "Transitions"),
+ .testTarget(name: "TransitionsTests", dependencies: ["Transitions"]),
+ ]
+)
diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift
new file mode 100644
index 0000000..0dcccb9
--- /dev/null
+++ b/Package@swift-5.8.swift
@@ -0,0 +1,16 @@
+// swift-tools-version: 5.8
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "transitions",
+ platforms: [.iOS(.v12)],
+ products: [
+ .library(name: "Transitions", targets: ["Transitions"]),
+ ],
+ targets: [
+ .target(name: "Transitions"),
+ .testTarget(name: "TransitionsTests", dependencies: ["Transitions"]),
+ ]
+)
diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift
new file mode 100644
index 0000000..a537060
--- /dev/null
+++ b/Package@swift-5.9.swift
@@ -0,0 +1,16 @@
+// swift-tools-version: 5.9
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "transitions",
+ platforms: [.iOS(.v12)],
+ products: [
+ .library(name: "Transitions", targets: ["Transitions"]),
+ ],
+ targets: [
+ .target(name: "Transitions"),
+ .testTarget(name: "TransitionsTests", dependencies: ["Transitions"]),
+ ]
+)
From dbf8e10fc6ef0b37bafd7ac58b98ad9c5aea0ec4 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:31:23 +0100
Subject: [PATCH 07/11] Update `ci.yml`
---
.github/workflows/ci.yml | 31 ++-----------------------------
1 file changed, 2 insertions(+), 29 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2794439..f7556cb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -57,34 +57,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: ${{ matrix.name }}
- run: xcodebuild test -scheme "Transitions" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
-
- spm:
- name: ${{ matrix.name }}
- runs-on: ${{ matrix.runsOn }}
- env:
- DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
- timeout-minutes: 20
- strategy:
- fail-fast: false
- matrix:
- include:
- - name: "macOS 14, SPM 6.0.2 Test"
- xcode: "Xcode_16.1"
- runsOn: macOS-14
- - name: "macOS 14, SPM 6.0.0 Test"
- xcode: "Xcode_16.0"
- runsOn: macOS-14
- - name: "macOS 14, SPM 5.9.0 Test"
- xcode: "Xcode_15.0"
- runsOn: macos-14
- - name: "macOS 13, SPM 5.8.1 Test"
- xcode: "Xcode_14.3.1"
- runsOn: macos-13
- steps:
- - uses: actions/checkout@v3
- - name: ${{ matrix.name }}
- run: swift build -c release
+ run: xcodebuild test -scheme "transitions" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
discover-typos:
name: Discover Typos
@@ -92,7 +65,7 @@ jobs:
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Discover typos
run: |
export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.11/bin"
From e84fc7b47f625b6d8b02a156bdb254b0cd1fb4ec Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:38:36 +0100
Subject: [PATCH 08/11] Update the `nonisolated` property
---
.../Core/Extensions/UIViewController+CustomTransition.swift | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
index 6699dc5..e333378 100644
--- a/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
+++ b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
@@ -8,7 +8,11 @@ import UIKit
// MARK: - AssociatedKeys
private enum AssociatedKeys {
- nonisolated(unsafe) static var customTransitionKey = "CustomAnimationTransitionKey"
+ #if swift(>=5.9)
+ nonisolated(unsafe) static var customTransitionKey = "CustomAnimationTransitionKey"
+ #else
+ static var customTransitionKey = "CustomAnimationTransitionKey"
+ #endif
}
public extension UIViewController {
From 09b29acbbb0d157fe7957ec004700fc12df71085 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 13 Jan 2025 14:39:17 +0100
Subject: [PATCH 09/11] Bump actions/checkout from 2 to 4 (#1)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/ci.yml | 4 ++--
.github/workflows/danger.yml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f7556cb..df3b1cf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,7 +17,7 @@ jobs:
SwiftLint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/action-swiftlint@3.2.1
with:
@@ -55,7 +55,7 @@ jobs:
xcode: "Xcode_14.3.1"
runsOn: macos-13
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: ${{ matrix.name }}
run: xcodebuild test -scheme "transitions" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1
diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml
index 3f63d38..55a4794 100644
--- a/.github/workflows/danger.yml
+++ b/.github/workflows/danger.yml
@@ -18,7 +18,7 @@ jobs:
ruby-version: 3.1.4
bundler-cache: true
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup gems
run: |
gem install bundler
From 95074463a6585daf8d80048e9563fa70052adc93 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 14:49:46 +0100
Subject: [PATCH 10/11] Update `UIViewController+CustomTransition.swift`
---
.../Core/Extensions/UIViewController+CustomTransition.swift | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
index e333378..4c75e67 100644
--- a/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
+++ b/Sources/Transitions/Classes/Core/Extensions/UIViewController+CustomTransition.swift
@@ -8,7 +8,7 @@ import UIKit
// MARK: - AssociatedKeys
private enum AssociatedKeys {
- #if swift(>=5.9)
+ #if swift(>=5.10)
nonisolated(unsafe) static var customTransitionKey = "CustomAnimationTransitionKey"
#else
static var customTransitionKey = "CustomAnimationTransitionKey"
From ea9248e238fd2e6e95255169b83af1f2e4b5acd5 Mon Sep 17 00:00:00 2001
From: Nikita Vasilev
Date: Mon, 13 Jan 2025 15:03:03 +0100
Subject: [PATCH 11/11] Update `ci.yml`
---
.github/workflows/ci.yml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index df3b1cf..49f5fb9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,10 +38,6 @@ jobs:
name: "iOS 18.1"
xcode: "Xcode_16.1"
runsOn: macOS-14
- - destination: "OS=18.0,name=iPhone 16 Pro"
- name: "iOS 18.0"
- xcode: "Xcode_16.0"
- runsOn: macOS-14
- destination: "OS=17.5,name=iPhone 15 Pro"
name: "iOS 17.5"
xcode: "Xcode_15.4"