Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .codecov.yml

This file was deleted.

96 changes: 41 additions & 55 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,61 @@
# continuous-integration.yml
# Created by Felix Mau (https://felix.hamburg)
#
# Based on:
# - https://docs.github.com/en/actions/quickstart
# - https://futurestud.io/tutorials/github-actions-trigger-builds-on-schedule-cron#schedulegithubactionsusingacron
# - https://about.codecov.io/blog/code-coverage-for-ios-development-using-swift-xcode-and-github-actions/
#

name: Continuous Integration
on:
push:
pull_request:
schedule:
# Run workflow every day at midnight.
#
# - Note: "Scheduled workflows run on the latest commit on the default or base branch."
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events
- cron: '0 0 * * *'

# Use latest Xcode version.
#
# Source:
# - https://www.jessesquires.com/blog/2020/01/06/selecting-an-xcode-version-on-github-ci/
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer

# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
push:
branches:
- main
workflow_dispatch:
jobs:
# This workflow starts with a job called "build-and-test".
build-and-test:
name: Build & Test
runs-on: macos-12

# Steps represent a sequence of tasks that will be executed as part of the job.
# Lint and Format
# Ensures that the code adheres to the defined style guidelines.
lint-and-format:
runs-on: macos-26
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

- name: Check out repository code
uses: actions/checkout@v2

- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
uses: actions/checkout@v6

- name: Install dependencies
working-directory: ./Example
run: bundle install
- name: Install SwiftFormat via Homebrew
run: brew install swiftformat

- name: Execute SwiftFormat and treat any formatting errors as real errors.
working-directory: ./Example
run: bundle exec fastlane format
- name: Install SwiftLint via Homebrew
run: brew install swiftlint

- name: Execute SwiftLint and treat any formatting errors as real errors.
working-directory: ./Example
run: bundle exec fastlane lint
- name: SwiftFormat
run: make format-check

- name: Execute tests.
working-directory: ./Example
run: bundle exec fastlane tests
- name: SwiftLint
run: make lint

- name: Execute validation Carthage support.
working-directory: ./Example
run: bundle exec fastlane verify_carthage
# Tests
# Ensures that the package compiles and that all tests pass, including code coverage reporting to Codecov.
tests:
runs-on: macos-26
needs: lint-and-format
steps:
- name: Check out repository code
uses: actions/checkout@v6

- name: Execute validation of library.
working-directory: ./Example
run: bundle exec fastlane pod_lint
- name: Execute tests
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

# Build Example Application
# Ensures that the package can be integrated into a real application, to catch any potential issues e.g. with access control.
build-example-application:
runs-on: macos-26
needs: tests
steps:
- name: Check out repository code
uses: actions/checkout@v6

- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Build Example Application
run: make build-example-application
55 changes: 6 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
# OS X
.DS_Store

# Xcode
build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
/.build
/Packages
xcuserdata/
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# Bundler
.bundle

# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#

# Include `Pods` in repo in order to make symlink `Pods.xcodeproj` work (used for Carthage support).
# Pods/


#
# Fastlane specific
# Based on: https://docs.fastlane.tools/best-practices/source-control/
#
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
**/fastlane/README.md
DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5
6.2
23 changes: 23 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# .swiftformat
# Configuration file for SwiftFormat (https://github.com/nicklockwood/SwiftFormat/)
#
# A more detailed documentation of the rules can be found at
# https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md
#
# Created by Felix Mau (https://felix.hamburg)
#

#
# Rules
#

# Allows an empty line before the first `// MARK: -` statement.
--disable blankLinesAtStartOfScope

#
# Rule Configuration
#
--indent 2
--import-grouping testable-last
--wraparguments before-first
85 changes: 85 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#
# .swiftlint.yml
# Configuration file for SwiftLint (https://github.com/realm/SwiftLint/)
#
# A more detailed documentation of the rules can be found at
# https://realm.github.io/SwiftLint/rule-directory.html
#
# Created by Felix Mau (https://felix.hamburg)
#

included:
- ./

excluded:
- ".build/**/*"
- Package.swift

opt_in_rules:
- accessibility_label_for_image # Images that provide context should have an accessibility label or should be explicitly hidden from accessibility
- accessibility_trait_for_button # All views with tap gestures added should include the .isButton or the .isLink accessibility traits
- closure_spacing # Closure expressions should have a single space inside each brace.
- contains_over_filter_count # Prefer `contains` over comparing `filter(where:).count` to 0.
- contains_over_filter_is_empty # Prefer `contains` over using `filter(where:).isEmpty`.
- contains_over_first_not_nil # Prefer `contains` over `first(where:) != nil` and `firstIndex(where:) != nil`.
- contains_over_range_nil_comparison # Prefer `contains` over `range(of:) != nil` and `range(of:) == nil`.
- convenience_type # Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation.
- duplicate_imports # Imports should be unique.
- empty_collection_literal # Prefer checking `isEmpty` over comparing collection to an empty array or dictionary literal.
- empty_count # Prefer checking `isEmpty` over comparing count to zero.
- empty_parameters # Prefer `() ->` over `Void ->`.
- empty_string # Prefer checking `isEmpty` over comparing string to an empty string literal.
- empty_xctest_method # Empty XCTest method should be avoided.
- explicit_init # Explicitly calling .init() should be avoided.
- fatal_error_message # A fatalError call should have a message.
- file_header # Header comments should be consistent with project patterns.
- first_where # Prefer using `.first(where:)` over `.filter { }.first` in collections.
- for_where # `where` clauses are preferred over a single `if` inside a `for`.
- force_unwrapping # Force unwrapping should be avoided.
- identical_operands # Comparing two identical operands is likely a mistake.
- implicit_return # Prefer implicit returns in closures, functions and getters.
- is_disjoint # Prefer using `Set.isDisjoint(with:)` over `Set.intersection(_:).isEmpty`.
- last_where # Prefer using `.last(where:)` over `.filter { }.last` in collections.
- legacy_multiple # Prefer using the `isMultiple(of:)` function instead of using the remainder operator (`%`).
- missing_docs # Declarations should be documented.
- modifier_order # Modifier order should be consistent.
- multiline_arguments # Arguments should be either on the same line, or one per line.
- multiline_parameters # Functions and methods parameters should be either on the same line, or one per line.
- operator_usage_whitespace # Operators should be surrounded by a single whitespace when they are being used.
- overridden_super_call # Some overridden methods should always call super
- prefer_self_type_over_type_of_self # Prefer `Self` over `type(of: self)` when accessing properties or calling methods.
- prefer_zero_over_explicit_init # Prefer `.zero` over explicit init with zero parameters (e.g. `CGPoint(x: 0, y: 0)`).
- prohibited_super_call # Some methods should not call super, e.g. `UIViewController.loadView()`.
- redundant_nil_coalescing # nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant.
- toggle_bool # Prefer `someBool.toggle()` over `someBool = !someBool`.
- unavailable_function # Unimplemented functions should be marked as unavailable.
- unused_optional_binding # Prefer `!= nil` over `let _ =`
- void_return # Prefer `-> Void` over `-> ()`.
- weak_delegate # Delegates should be weak to avoid reference cycles
- yoda_condition # The constant literal should be placed on the right-hand side of the comparison operator.

file_header:
required_pattern: |
\/\/
\/\/ SWIFTLINT_CURRENT_FILENAME
\/\/ (GradientLoadingBar|GradientLoadingBarTests|GradientLoadingBarExample)
\/\/
\/\/ Created by .*? on \d{2}\.\d{2}\.\d{2}\.
\/\/ Copyright © \d{4} .*?\. All rights reserved\.
\/\/

line_length: 150

nesting:
type_level:
warning: 3

trailing_comma:
mandatory_comma: true

custom_rules:
comments_space:
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //."
severity: warning
Binary file removed Assets/advanced-example--thumbnail.png
Binary file not shown.
Binary file removed Assets/advanced-example.png
Binary file not shown.
Binary file removed Assets/basic-example--thumbnail.png
Binary file not shown.
Binary file removed Assets/basic-example.png
Binary file not shown.
Binary file added Assets/ignoring-safe-area-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/ignoring-safe-area.mov
Binary file not shown.
Binary file added Assets/ignoring-safe-area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/navigation-bar-example--thumbnail.png
Binary file not shown.
Binary file removed Assets/navigation-bar-example.png
Binary file not shown.
Binary file removed Assets/notch-example--thumbnail.png
Binary file not shown.
Binary file removed Assets/notch-example.png
Binary file not shown.
Binary file added Assets/notch-iphone-12-pro-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/notch-iphone-12-pro.mov
Binary file not shown.
Binary file added Assets/notch-iphone-12-pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/notch-iphone-13-pro-max-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/notch-iphone-13-pro-max.mov
Binary file not shown.
Binary file added Assets/notch-iphone-13-pro-max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/relative-to-safe-area-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/relative-to-safe-area.mov
Binary file not shown.
Binary file added Assets/relative-to-safe-area.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Assets/safe-area-example--thumbnail.png
Binary file not shown.
Binary file removed Assets/safe-area-example.png
Binary file not shown.
Empty file removed Cartfile
Empty file.
19 changes: 0 additions & 19 deletions Example/.swiftformat

This file was deleted.

26 changes: 0 additions & 26 deletions Example/.swiftlint.yml

This file was deleted.

Loading
Loading