Skip to content

Commit bd7828f

Browse files
authored
Merge pull request #35 from fxm90/feature/version-4
Version 4.0
2 parents 4455b11 + d8728a8 commit bd7828f

245 files changed

Lines changed: 4242 additions & 14718 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/continuous-integration.yml

Lines changed: 41 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,61 @@
22
# continuous-integration.yml
33
# Created by Felix Mau (https://felix.hamburg)
44
#
5-
# Based on:
6-
# - https://docs.github.com/en/actions/quickstart
7-
# - https://futurestud.io/tutorials/github-actions-trigger-builds-on-schedule-cron#schedulegithubactionsusingacron
8-
# - https://about.codecov.io/blog/code-coverage-for-ios-development-using-swift-xcode-and-github-actions/
9-
#
105

116
name: Continuous Integration
127
on:
13-
push:
148
pull_request:
15-
schedule:
16-
# Run workflow every day at midnight.
17-
#
18-
# - Note: "Scheduled workflows run on the latest commit on the default or base branch."
19-
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events
20-
- cron: '0 0 * * *'
21-
22-
# Use latest Xcode version.
23-
#
24-
# Source:
25-
# - https://www.jessesquires.com/blog/2020/01/06/selecting-an-xcode-version-on-github-ci/
26-
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
27-
env:
28-
DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer
29-
30-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
3113
jobs:
32-
# This workflow starts with a job called "build-and-test".
33-
build-and-test:
34-
name: Build & Test
35-
runs-on: macos-12
36-
37-
# Steps represent a sequence of tasks that will be executed as part of the job.
14+
# Lint and Format
15+
# Ensures that the code adheres to the defined style guidelines.
16+
lint-and-format:
17+
runs-on: macos-26
3818
steps:
39-
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
40-
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
41-
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
42-
4319
- name: Check out repository code
44-
uses: actions/checkout@v2
45-
46-
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
47-
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
20+
uses: actions/checkout@v6
4821

49-
- name: Install dependencies
50-
working-directory: ./Example
51-
run: bundle install
22+
- name: Install SwiftFormat via Homebrew
23+
run: brew install swiftformat
5224

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

57-
- name: Execute SwiftLint and treat any formatting errors as real errors.
58-
working-directory: ./Example
59-
run: bundle exec fastlane lint
28+
- name: SwiftFormat
29+
run: make format-check
6030

61-
- name: Execute tests.
62-
working-directory: ./Example
63-
run: bundle exec fastlane tests
31+
- name: SwiftLint
32+
run: make lint
6433

65-
- name: Execute validation Carthage support.
66-
working-directory: ./Example
67-
run: bundle exec fastlane verify_carthage
34+
# Tests
35+
# Ensures that the package compiles and that all tests pass, including code coverage reporting to Codecov.
36+
tests:
37+
runs-on: macos-26
38+
needs: lint-and-format
39+
steps:
40+
- name: Check out repository code
41+
uses: actions/checkout@v6
6842

69-
- name: Execute validation of library.
70-
working-directory: ./Example
71-
run: bundle exec fastlane pod_lint
43+
- name: Execute tests
44+
run: make test
7245

7346
- name: Upload coverage to Codecov
7447
uses: codecov/codecov-action@v4
48+
with:
49+
fail_ci_if_error: true
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
52+
# Build Example Application
53+
# Ensures that the package can be integrated into a real application, to catch any potential issues e.g. with access control.
54+
build-example-application:
55+
runs-on: macos-26
56+
needs: tests
57+
steps:
58+
- name: Check out repository code
59+
uses: actions/checkout@v6
7560

76-
- run: echo "🍏 This job's status is ${{ job.status }}."
61+
- name: Build Example Application
62+
run: make build-example-application

.gitignore

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,8 @@
1-
# OS X
21
.DS_Store
3-
4-
# Xcode
5-
build/
6-
.build/
7-
*.pbxuser
8-
!default.pbxuser
9-
*.mode1v3
10-
!default.mode1v3
11-
*.mode2v3
12-
!default.mode2v3
13-
*.perspectivev3
14-
!default.perspectivev3
2+
/.build
3+
/Packages
154
xcuserdata/
16-
*.xccheckout
17-
profile
18-
*.moved-aside
19-
DerivedData
20-
*.hmap
21-
*.ipa
22-
23-
# Bundler
24-
.bundle
25-
26-
# Add this line if you want to avoid checking in source code from Carthage dependencies.
27-
# Carthage/Checkouts
28-
29-
Carthage/Build
30-
31-
# We recommend against adding the Pods directory to your .gitignore. However
32-
# you should judge for yourself, the pros and cons are mentioned at:
33-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
34-
#
35-
# Note: if you ignore the Pods directory, make sure to uncomment
36-
# `pod install` in .travis.yml
37-
#
38-
39-
# Include `Pods` in repo in order to make symlink `Pods.xcodeproj` work (used for Carthage support).
40-
# Pods/
41-
42-
43-
#
44-
# Fastlane specific
45-
# Based on: https://docs.fastlane.tools/best-practices/source-control/
46-
#
47-
**/fastlane/report.xml
48-
**/fastlane/Preview.html
49-
**/fastlane/screenshots
50-
**/fastlane/test_output
51-
**/fastlane/README.md
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5
1+
6.2

.swiftformat

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# .swiftformat
3+
# Configuration file for SwiftFormat (https://github.com/nicklockwood/SwiftFormat/)
4+
#
5+
# A more detailed documentation of the rules can be found at
6+
# https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md
7+
#
8+
# Created by Felix Mau (https://felix.hamburg)
9+
#
10+
11+
#
12+
# Rules
13+
#
14+
15+
# Allows an empty line before the first `// MARK: -` statement.
16+
--disable blankLinesAtStartOfScope
17+
18+
#
19+
# Rule Configuration
20+
#
21+
--indent 2
22+
--import-grouping testable-last
23+
--wraparguments before-first

.swiftlint.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#
2+
# .swiftlint.yml
3+
# Configuration file for SwiftLint (https://github.com/realm/SwiftLint/)
4+
#
5+
# A more detailed documentation of the rules can be found at
6+
# https://realm.github.io/SwiftLint/rule-directory.html
7+
#
8+
# Created by Felix Mau (https://felix.hamburg)
9+
#
10+
11+
included:
12+
- ./
13+
14+
excluded:
15+
- ".build/**/*"
16+
- Package.swift
17+
18+
opt_in_rules:
19+
- accessibility_label_for_image # Images that provide context should have an accessibility label or should be explicitly hidden from accessibility
20+
- accessibility_trait_for_button # All views with tap gestures added should include the .isButton or the .isLink accessibility traits
21+
- closure_spacing # Closure expressions should have a single space inside each brace.
22+
- contains_over_filter_count # Prefer `contains` over comparing `filter(where:).count` to 0.
23+
- contains_over_filter_is_empty # Prefer `contains` over using `filter(where:).isEmpty`.
24+
- contains_over_first_not_nil # Prefer `contains` over `first(where:) != nil` and `firstIndex(where:) != nil`.
25+
- contains_over_range_nil_comparison # Prefer `contains` over `range(of:) != nil` and `range(of:) == nil`.
26+
- convenience_type # Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation.
27+
- duplicate_imports # Imports should be unique.
28+
- empty_collection_literal # Prefer checking `isEmpty` over comparing collection to an empty array or dictionary literal.
29+
- empty_count # Prefer checking `isEmpty` over comparing count to zero.
30+
- empty_parameters # Prefer `() ->` over `Void ->`.
31+
- empty_string # Prefer checking `isEmpty` over comparing string to an empty string literal.
32+
- empty_xctest_method # Empty XCTest method should be avoided.
33+
- explicit_init # Explicitly calling .init() should be avoided.
34+
- fatal_error_message # A fatalError call should have a message.
35+
- file_header # Header comments should be consistent with project patterns.
36+
- first_where # Prefer using `.first(where:)` over `.filter { }.first` in collections.
37+
- for_where # `where` clauses are preferred over a single `if` inside a `for`.
38+
- force_unwrapping # Force unwrapping should be avoided.
39+
- identical_operands # Comparing two identical operands is likely a mistake.
40+
- implicit_return # Prefer implicit returns in closures, functions and getters.
41+
- is_disjoint # Prefer using `Set.isDisjoint(with:)` over `Set.intersection(_:).isEmpty`.
42+
- last_where # Prefer using `.last(where:)` over `.filter { }.last` in collections.
43+
- legacy_multiple # Prefer using the `isMultiple(of:)` function instead of using the remainder operator (`%`).
44+
- missing_docs # Declarations should be documented.
45+
- modifier_order # Modifier order should be consistent.
46+
- multiline_arguments # Arguments should be either on the same line, or one per line.
47+
- multiline_parameters # Functions and methods parameters should be either on the same line, or one per line.
48+
- operator_usage_whitespace # Operators should be surrounded by a single whitespace when they are being used.
49+
- overridden_super_call # Some overridden methods should always call super
50+
- prefer_self_type_over_type_of_self # Prefer `Self` over `type(of: self)` when accessing properties or calling methods.
51+
- prefer_zero_over_explicit_init # Prefer `.zero` over explicit init with zero parameters (e.g. `CGPoint(x: 0, y: 0)`).
52+
- prohibited_super_call # Some methods should not call super, e.g. `UIViewController.loadView()`.
53+
- redundant_nil_coalescing # nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant.
54+
- toggle_bool # Prefer `someBool.toggle()` over `someBool = !someBool`.
55+
- unavailable_function # Unimplemented functions should be marked as unavailable.
56+
- unused_optional_binding # Prefer `!= nil` over `let _ =`
57+
- void_return # Prefer `-> Void` over `-> ()`.
58+
- weak_delegate # Delegates should be weak to avoid reference cycles
59+
- yoda_condition # The constant literal should be placed on the right-hand side of the comparison operator.
60+
61+
file_header:
62+
required_pattern: |
63+
\/\/
64+
\/\/ SWIFTLINT_CURRENT_FILENAME
65+
\/\/ (GradientLoadingBar|GradientLoadingBarTests|GradientLoadingBarExample)
66+
\/\/
67+
\/\/ Created by .*? on \d{2}\.\d{2}\.\d{2}\.
68+
\/\/ Copyright © \d{4} .*?\. All rights reserved\.
69+
\/\/
70+
71+
line_length: 150
72+
73+
nesting:
74+
type_level:
75+
warning: 3
76+
77+
trailing_comma:
78+
mandatory_comma: true
79+
80+
custom_rules:
81+
comments_space:
82+
name: "Space After Comment"
83+
regex: '(^ *//\w+)'
84+
message: "There should be a space after //."
85+
severity: warning
-60.4 KB
Binary file not shown.

Assets/advanced-example.png

-154 KB
Binary file not shown.
-172 KB
Binary file not shown.

Assets/basic-example.png

-140 KB
Binary file not shown.

0 commit comments

Comments
 (0)