├── .github
└── workflows
│ ├── build.yml
│ ├── lint.yml
│ └── release.yml
├── .gitignore
├── Brewfile
├── Brewfile.lock.json
├── CHANGELOG.md
├── Documentation
├── .gitkeep
└── Reference
│ └── ExtensionKit
│ ├── README.md
│ ├── classes
│ └── Subscribers.LimitedSink.md
│ ├── enums
│ ├── CLLocation.GeocodeError.md
│ ├── CLLocationManager.AuthorizationType.md
│ ├── Height.md
│ ├── PrintEvent.md
│ ├── UIImage.ArrowDirection.md
│ └── UIView.GradientLayerChangingDirection.md
│ ├── extensions
│ ├── Array.md
│ ├── Binding.md
│ ├── Bundle.md
│ ├── Button.md
│ ├── CFRunLoopTimer.md
│ ├── CGPoint.md
│ ├── CGRect.md
│ ├── CLLocation.md
│ ├── CLLocationCoordinate2D.md
│ ├── CLLocationManager.md
│ ├── Collection.md
│ ├── Color.md
│ ├── Data.md
│ ├── Date.md
│ ├── FileManager.md
│ ├── GeometryProxy.md
│ ├── Image.md
│ ├── Int.md
│ ├── NSObject.md
│ ├── Publisher.md
│ ├── Publishers.Autoconnect.md
│ ├── RandomAccessCollection.md
│ ├── Shape.md
│ ├── String.Index.md
│ ├── String.md
│ ├── Text.md
│ ├── Timer.md
│ ├── UIApplication.md
│ ├── UIButton.md
│ ├── UIColor.md
│ ├── UIImage.md
│ ├── UITableView.md
│ ├── UIView.md
│ ├── UIViewController.md
│ ├── URL.md
│ ├── UserDefaults.md
│ └── View.md
│ ├── methods
│ ├── +(____).md
│ ├── -(____).md
│ ├── _(____).md
│ ├── dprint(__).md
│ ├── dprint(____).md
│ └── sleep(duration_).md
│ ├── protocols
│ └── TimerStartable.md
│ ├── structs
│ ├── KeyboardInfo.md
│ ├── Notification.KeyboardInfo.md
│ ├── Preview.md
│ ├── Screen.md
│ └── UserDefault.md
│ └── typealiases
│ ├── Subscribers.ReceivedCompletion.md
│ └── Subscribers.ReceivedValue.md
├── Gemfile
├── Gemfile.lock
├── Package.swift
├── README.md
├── Sources
├── .gitkeep
└── ExtensionKit
│ ├── AutoLayout
│ ├── LayoutAnchor.swift
│ ├── LayoutClosure.swift
│ ├── LayoutDimension.swift
│ ├── LayoutOperators.swift
│ ├── LayoutProperty.swift
│ ├── LayoutProxy.swift
│ ├── LayoutSizeDimension.swift
│ └── UIView+Fill.swift
│ ├── Combine
│ ├── Publisher.swift
│ └── Subscriber.swift
│ ├── CoreGraphics
│ ├── CGAffineTransform.swift
│ ├── CGPoint.swift
│ ├── CGRect.swift
│ ├── CGSize+Extensions.swift
│ └── Operators.swift
│ ├── CoreLocation
│ ├── AuthorizationPublisher.swift
│ ├── CLLocation.swift
│ ├── CLLocationCoordinate2D.swift
│ ├── CLLocationManager.swift
│ └── LocationPublisher.swift
│ ├── Foundation
│ ├── Apply.swift
│ ├── Array.swift
│ ├── Bundle.swift
│ ├── CFRunLoopTimer.swift
│ ├── Calendar.swift
│ ├── Collection.swift
│ ├── Data.swift
│ ├── Date.swift
│ ├── DispactQueue.swift
│ ├── FileManager.swift
│ ├── Global.swift
│ ├── Int.swift
│ ├── NSObject.swift
│ ├── Notification.swift
│ ├── RandomAccessCollection.swift
│ ├── String.swift
│ ├── Timer.swift
│ ├── URL.swift
│ └── UserDefaults.swift
│ ├── PropertyWrappers
│ └── UserDefault.swift
│ ├── SwiftUI
│ ├── Array+View.swift
│ ├── Binding.swift
│ ├── Button.swift
│ ├── Color.swift
│ ├── Geometry
│ │ ├── GeometryProxy.swift
│ │ └── RectGetter.swift
│ ├── Image.swift
│ ├── Keyboard
│ │ └── KeyboardInfo.swift
│ ├── MailView.swift
│ ├── MessageView.swift
│ ├── RoundedCorner.swift
│ ├── SafariView.swift
│ ├── Scroll
│ │ └── ScrollViewOffSetReader.swift
│ ├── Shape.swift
│ ├── StoreView.swift
│ ├── Text.swift
│ └── View.swift
│ ├── Transition
│ ├── SharedTransitioning.swift
│ ├── TransitionAnimationController.swift
│ └── TransitionType.swift
│ ├── UIKit
│ ├── CALayer.swift
│ ├── UIApplication.swift
│ ├── UIButton.swift
│ ├── UICollectionReusableView+Extensions.swift
│ ├── UICollectionView+Extensions.swift
│ ├── UIColor.swift
│ ├── UIDevice.swift
│ ├── UIImage.swift
│ ├── UIScreen.swift
│ ├── UITableView.swift
│ ├── UIView.swift
│ ├── UIViewController.swift
│ └── ViewControllerIdentifiable.swift
│ └── Utils
│ ├── Constants.swift
│ ├── PHAsset+Extensions.swift
│ ├── RandomColor.swift
│ └── Then.swift
├── Tests
├── ExtensionKitTests
│ ├── ExtensionKitTests.swift
│ └── XCTestManifests.swift
└── LinuxMain.swift
├── fastlane
├── Fastfile
└── README.md
├── lgtm.sh
├── lint-config.js
└── package.json
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 |
2 | ---
3 | name: Swift build
4 | on:
5 | pull_request:
6 | branches:
7 | - main
8 | types: [ opened, edited, reopened, synchronize ]
9 | paths:
10 | - '**.swift'
11 | jobs:
12 | build:
13 | name: Swift build
14 | runs-on: macos-latest
15 | steps:
16 | - uses: actions/checkout@v2
17 | - name: build
18 | run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios14.0-simulator"
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Commitlint
2 | on:
3 | pull_request:
4 | branches: [ develop, main, release/*, release-* ]
5 | types: [ opened, edited, reopened, synchronize ]
6 |
7 | jobs:
8 | lint:
9 | runs-on: ubuntu-latest
10 | env:
11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 | steps:
13 | - uses: actions/checkout@v2
14 | with:
15 | fetch-depth: 0
16 | - uses: wagoid/commitlint-github-action@v1
17 | with:
18 | configFile: lint-config.js
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 |
2 | name: New Version Release
3 | on:
4 | pull_request:
5 | branches:
6 | - main
7 | types: [closed]
8 | jobs:
9 | template:
10 | if: github.event.pull_request.merged == true
11 | name: New Version Release
12 | runs-on: macos-latest
13 | env:
14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 | steps:
16 | - uses: actions/checkout@v2
17 | with:
18 | ref: main
19 | - name: Version bump & update docs
20 | run: |
21 | brew bundle
22 | npm install
23 | bundle install
24 | ./update.sh
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /.build
3 | /Packages
4 | /*.xcodeproj
5 | xcuserdata/
6 |
7 | .swiftpm/xcode/package.xcworkspace/
8 |
9 | *.xml
10 |
--------------------------------------------------------------------------------
/Brewfile:
--------------------------------------------------------------------------------
1 | brew "sourcedocs"
2 |
--------------------------------------------------------------------------------
/Brewfile.lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "entries": {
3 | "brew": {
4 | "sourcedocs": {
5 | "version": "2.0.1",
6 | "bottle": {
7 | "rebuild": 0,
8 | "root_url": "https://ghcr.io/v2/homebrew/core",
9 | "files": {
10 | "arm64_sonoma": {
11 | "cellar": ":any_skip_relocation",
12 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:5461899a0c97729c247703f45eb98a0cf26fc9939ce50eb6fa9543e9f70c6c62",
13 | "sha256": "5461899a0c97729c247703f45eb98a0cf26fc9939ce50eb6fa9543e9f70c6c62"
14 | },
15 | "arm64_ventura": {
16 | "cellar": ":any_skip_relocation",
17 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:fbe4a3e5c3485101486be0639b81cc4799c2dd7e0edf5f528d32a3c0ca6122fa",
18 | "sha256": "fbe4a3e5c3485101486be0639b81cc4799c2dd7e0edf5f528d32a3c0ca6122fa"
19 | },
20 | "arm64_monterey": {
21 | "cellar": ":any_skip_relocation",
22 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:b8757a91d73d96999da362afbc5a5c42c7be949f562cf5569b2bf24853af6ef9",
23 | "sha256": "b8757a91d73d96999da362afbc5a5c42c7be949f562cf5569b2bf24853af6ef9"
24 | },
25 | "arm64_big_sur": {
26 | "cellar": ":any_skip_relocation",
27 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:1254fb0f47a037f929e579b4a68dd375b0e587d9adb3e876865b6de031d39f46",
28 | "sha256": "1254fb0f47a037f929e579b4a68dd375b0e587d9adb3e876865b6de031d39f46"
29 | },
30 | "sonoma": {
31 | "cellar": ":any_skip_relocation",
32 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:9378990038e4d444ca11820d4e41eee737522dc75b7818d7577f4a612ab18bf1",
33 | "sha256": "9378990038e4d444ca11820d4e41eee737522dc75b7818d7577f4a612ab18bf1"
34 | },
35 | "ventura": {
36 | "cellar": ":any_skip_relocation",
37 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:5cf36d5bfe2a9a2770454f21169e5e9c8a5a6b50525ec0a9418c88180706d40c",
38 | "sha256": "5cf36d5bfe2a9a2770454f21169e5e9c8a5a6b50525ec0a9418c88180706d40c"
39 | },
40 | "monterey": {
41 | "cellar": ":any_skip_relocation",
42 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:974904c0b5b4d0d54fe8392c84fe06b3aa23e47fb76f95579f09e5fc94704d2d",
43 | "sha256": "974904c0b5b4d0d54fe8392c84fe06b3aa23e47fb76f95579f09e5fc94704d2d"
44 | },
45 | "big_sur": {
46 | "cellar": ":any_skip_relocation",
47 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:292dbf6713d17716e685ac74c0e9fdbe07038b95bca36f234a94bfe2fffe5aab",
48 | "sha256": "292dbf6713d17716e685ac74c0e9fdbe07038b95bca36f234a94bfe2fffe5aab"
49 | },
50 | "catalina": {
51 | "cellar": ":any_skip_relocation",
52 | "url": "https://ghcr.io/v2/homebrew/core/sourcedocs/blobs/sha256:56cad5d1e01271614fd93c5ec93b4b7fc7cabb64bef767581bc5ad179ee20a63",
53 | "sha256": "56cad5d1e01271614fd93c5ec93b4b7fc7cabb64bef767581bc5ad179ee20a63"
54 | }
55 | }
56 | }
57 | }
58 | }
59 | },
60 | "system": {
61 | "macos": {
62 | "sequoia": {
63 | "HOMEBREW_VERSION": "4.3.18",
64 | "HOMEBREW_PREFIX": "/opt/homebrew",
65 | "Homebrew/homebrew-core": "api",
66 | "CLT": "16.0.0.0.1.1723780521",
67 | "Xcode": "16.0",
68 | "macOS": "15.1"
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Documentation/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gtokman/ExtensionKit/6198a989e661416a64f7523710bcf07c67e7e2e6/Documentation/.gitkeep
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/README.md:
--------------------------------------------------------------------------------
1 | # Reference Documentation
2 |
3 | ## Protocols
4 |
5 | - [TimerStartable](protocols/TimerStartable.md)
6 |
7 | ## Structs
8 |
9 | - [KeyboardInfo](structs/KeyboardInfo.md)
10 | - [Preview](structs/Preview.md)
11 | - [Screen](structs/Screen.md)
12 | - [UserDefault](structs/UserDefault.md)
13 |
14 | ## Classes
15 |
16 | - [Subscribers.LimitedSink](classes/Subscribers.LimitedSink.md)
17 |
18 | ## Enums
19 |
20 | - [CLLocation.GeocodeError](enums/CLLocation.GeocodeError.md)
21 | - [Height](enums/Height.md)
22 | - [PrintEvent](enums/PrintEvent.md)
23 | - [UIImage.ArrowDirection](enums/UIImage.ArrowDirection.md)
24 | - [UIView.GradientLayerChangingDirection](enums/UIView.GradientLayerChangingDirection.md)
25 |
26 | ## Extensions
27 |
28 | - [Array](extensions/Array.md)
29 | - [Binding](extensions/Binding.md)
30 | - [Bundle](extensions/Bundle.md)
31 | - [Button](extensions/Button.md)
32 | - [CFRunLoopTimer](extensions/CFRunLoopTimer.md)
33 | - [CGPoint](extensions/CGPoint.md)
34 | - [CGRect](extensions/CGRect.md)
35 | - [CLLocation](extensions/CLLocation.md)
36 | - [CLLocationCoordinate2D](extensions/CLLocationCoordinate2D.md)
37 | - [CLLocationManager](extensions/CLLocationManager.md)
38 | - [Collection](extensions/Collection.md)
39 | - [Color](extensions/Color.md)
40 | - [Data](extensions/Data.md)
41 | - [Date](extensions/Date.md)
42 | - [FileManager](extensions/FileManager.md)
43 | - [GeometryProxy](extensions/GeometryProxy.md)
44 | - [Image](extensions/Image.md)
45 | - [Int](extensions/Int.md)
46 | - [NSObject](extensions/NSObject.md)
47 | - [Publisher](extensions/Publisher.md)
48 | - [Publishers.Autoconnect](extensions/Publishers.Autoconnect.md)
49 | - [RandomAccessCollection](extensions/RandomAccessCollection.md)
50 | - [Shape](extensions/Shape.md)
51 | - [String](extensions/String.md)
52 | - [String.Index](extensions/String.Index.md)
53 | - [Text](extensions/Text.md)
54 | - [Timer](extensions/Timer.md)
55 | - [UIApplication](extensions/UIApplication.md)
56 | - [UIButton](extensions/UIButton.md)
57 | - [UIColor](extensions/UIColor.md)
58 | - [UIImage](extensions/UIImage.md)
59 | - [UITableView](extensions/UITableView.md)
60 | - [UIView](extensions/UIView.md)
61 | - [UIViewController](extensions/UIViewController.md)
62 | - [URL](extensions/URL.md)
63 | - [UserDefaults](extensions/UserDefaults.md)
64 | - [View](extensions/View.md)
65 |
66 | ## Typealiases
67 |
68 | - [Subscribers.ReceivedCompletion](typealiases/Subscribers.ReceivedCompletion.md)
69 | - [Subscribers.ReceivedValue](typealiases/Subscribers.ReceivedValue.md)
70 |
71 | ## Methods
72 |
73 | - [+(____)](methods/+(____).md)
74 | - [-(____)](methods/-(____).md)
75 | - [_(____)](methods/_(____).md)
76 | - [_(____)](methods/_(____).md)
77 | - [dprint(____)](methods/dprint(____).md)
78 | - [sleep(duration_)](methods/sleep(duration_).md)
79 |
80 | This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2021-09-20 22:30:24 +0000
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/classes/Subscribers.LimitedSink.md:
--------------------------------------------------------------------------------
1 | **CLASS**
2 |
3 | # `Subscribers.LimitedSink`
4 |
5 | ```swift
6 | class LimitedSink: Subscriber, Cancellable where Failure: Error
7 | ```
8 |
9 | ## Methods
10 | ### `receive(subscription:)`
11 |
12 | ```swift
13 | public func receive(subscription: Subscription)
14 | ```
15 |
16 | #### Parameters
17 |
18 | | Name | Description |
19 | | ---- | ----------- |
20 | | subscription | A subscription that represents the connection between publisher and subscriber. |
21 |
22 | ### `receive(_:)`
23 |
24 | ```swift
25 | public func receive(_ input: Input) -> Subscribers.Demand
26 | ```
27 |
28 | #### Parameters
29 |
30 | | Name | Description |
31 | | ---- | ----------- |
32 | | input | The published element. |
33 |
34 | ### `receive(completion:)`
35 |
36 | ```swift
37 | public func receive(completion: Subscribers.Completion)
38 | ```
39 |
40 | #### Parameters
41 |
42 | | Name | Description |
43 | | ---- | ----------- |
44 | | completion | A `Subscribers/Completion` case indicating whether publishing completed normally or with an error. |
45 |
46 | ### `cancel()`
47 |
48 | ```swift
49 | public func cancel()
50 | ```
51 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/CLLocation.GeocodeError.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `CLLocation.GeocodeError`
4 |
5 | ```swift
6 | enum GeocodeError: Error
7 | ```
8 |
9 | Geocode location `Error`
10 |
11 | ## Cases
12 | ### `invalid(_:)`
13 |
14 | ```swift
15 | case invalid(String)
16 | ```
17 |
18 | ### `empty(_:)`
19 |
20 | ```swift
21 | case empty(String)
22 | ```
23 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/CLLocationManager.AuthorizationType.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `CLLocationManager.AuthorizationType`
4 |
5 | ```swift
6 | enum AuthorizationType: String
7 | ```
8 |
9 | Authorization access level
10 |
11 | ## Cases
12 | ### `always`
13 |
14 | ```swift
15 | case always
16 | ```
17 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/Height.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `Height`
4 |
5 | ```swift
6 | public enum Height: Equatable
7 | ```
8 |
9 | Bottom sheet modal height
10 |
11 | ## Cases
12 | ### `low`
13 |
14 | ```swift
15 | case low
16 | ```
17 |
18 | Third of Screen size
19 |
20 | ### `mid`
21 |
22 | ```swift
23 | case mid
24 | ```
25 |
26 | Half of Screen size
27 |
28 | ### `full`
29 |
30 | ```swift
31 | case full
32 | ```
33 |
34 | Full Screen size
35 |
36 | ### `custom(_:)`
37 |
38 | ```swift
39 | case custom(CGFloat)
40 | ```
41 |
42 | Custom screen size
43 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/PrintEvent.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `PrintEvent`
4 |
5 | ```swift
6 | public enum PrintEvent: String
7 | ```
8 |
9 | Print event type
10 |
11 | ## Cases
12 | ### `e`
13 |
14 | ```swift
15 | case e = "[‼️]"
16 | ```
17 |
18 | Error
19 |
20 | ### `i`
21 |
22 | ```swift
23 | case i = "[ℹ️]"
24 | ```
25 |
26 | Info
27 |
28 | ### `d`
29 |
30 | ```swift
31 | case d = "[💬]"
32 | ```
33 |
34 | Debug
35 |
36 | ### `v`
37 |
38 | ```swift
39 | case v = "[🔬]"
40 | ```
41 |
42 | Verbose
43 |
44 | ### `w`
45 |
46 | ```swift
47 | case w = "[⚠️]"
48 | ```
49 |
50 | Warning
51 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/UIImage.ArrowDirection.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `UIImage.ArrowDirection`
4 |
5 | ```swift
6 | enum ArrowDirection
7 | ```
8 |
9 | ## Cases
10 | ### `up`
11 |
12 | ```swift
13 | case up
14 | ```
15 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/enums/UIView.GradientLayerChangingDirection.md:
--------------------------------------------------------------------------------
1 | **ENUM**
2 |
3 | # `UIView.GradientLayerChangingDirection`
4 |
5 | ```swift
6 | enum GradientLayerChangingDirection
7 | ```
8 |
9 | ## Cases
10 | ### `top`
11 |
12 | ```swift
13 | case top
14 | ```
15 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Array.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Array`
4 | ```swift
5 | public extension Array where Element: Equatable
6 | ```
7 |
8 | ## Properties
9 | ### `removingRepeatElements`
10 |
11 | ```swift
12 | var removingRepeatElements: Array
13 | ```
14 |
15 | Returns an array where repeating elements of the receiver got removed.
16 |
17 | ### `body`
18 |
19 | ```swift
20 | public var body: some View
21 | ```
22 |
23 | Add View conformance to Array where element is View
24 |
25 | ## Methods
26 | ### `remove(_:)`
27 |
28 | ```swift
29 | mutating func remove(_ element: Element) -> Element?
30 | ```
31 |
32 | Removes the given element in the array.
33 |
34 | - Parameter element: The element to be removed.
35 | - Returns: The element got removed, or `nil` if the element doesn't exist.
36 |
37 | #### Parameters
38 |
39 | | Name | Description |
40 | | ---- | ----------- |
41 | | element | The element to be removed. |
42 |
43 | ### `init(_:)`
44 |
45 | ```swift
46 | init(_ dictionary: [String: T])
47 | ```
48 |
49 | Initialize `URLQueryItem from dictionary`
50 | - Parameter dictionary: url parameters
51 |
52 | #### Parameters
53 |
54 | | Name | Description |
55 | | ---- | ----------- |
56 | | dictionary | url parameters |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Binding.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Binding`
4 | ```swift
5 | public extension Binding where Value: Equatable
6 | ```
7 |
8 | ## Methods
9 | ### `onChange(_:)`
10 |
11 | ```swift
12 | func onChange(_ action: @escaping (Value) -> Void) -> Self
13 | ```
14 |
15 | ```
16 | Toggle(
17 | "Foo",
18 | isOn: $foo.onChange {
19 | bar.isEnabled = $0
20 | }
21 | )
22 | ```
23 |
24 | #### Parameters
25 |
26 | | Name | Description |
27 | | ---- | ----------- |
28 | | action | Action to run |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Bundle.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Bundle`
4 | ```swift
5 | public extension Bundle
6 | ```
7 |
8 | ## Properties
9 | ### `versionNumber`
10 |
11 | ```swift
12 | var versionNumber: String
13 | ```
14 |
15 | Version number via - CFBundleShortVersionString
16 |
17 | ### `buildNumber`
18 |
19 | ```swift
20 | var buildNumber: String
21 | ```
22 |
23 | Build number via - CFBundleVersion
24 |
25 | ## Methods
26 | ### `decode(_:fromFile:withExtension:dateDecodingStrategy:keyDecodingStrategy:)`
27 |
28 | ```swift
29 | func decode(
30 | _ type: T.Type,
31 | fromFile file: String,
32 | withExtension `extension`: String? = nil,
33 | dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate,
34 | keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys
35 | ) -> Deferred>
36 | ```
37 |
38 | Load model type from bundle resource
39 | - Parameters:
40 | - type: Type to load
41 | - file: File name
42 | - dateDecodingStrategy: date decoding strategy
43 | - keyDecodingStrategy: key decoding strategy
44 | - Returns: Future
45 |
46 | #### Parameters
47 |
48 | | Name | Description |
49 | | ---- | ----------- |
50 | | type | Type to load |
51 | | file | File name |
52 | | dateDecodingStrategy | date decoding strategy |
53 | | keyDecodingStrategy | key decoding strategy |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Button.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Button`
4 | ```swift
5 | public extension Button where Label == Image
6 | ```
7 |
8 | ## Methods
9 | ### `init(systemName:action:)`
10 |
11 | ```swift
12 | init(systemName: String, action: @escaping () -> Void)
13 | ```
14 |
15 | Initialize button with system image and trailing action
16 | - Parameters:
17 | - systemName: System image name
18 | - action: action
19 |
20 | #### Parameters
21 |
22 | | Name | Description |
23 | | ---- | ----------- |
24 | | systemName | System image name |
25 | | action | action |
26 |
27 | ### `init(imageName:action:)`
28 |
29 | ```swift
30 | init(imageName: String, action: @escaping () -> Void)
31 | ```
32 |
33 | Initialize button with local image and trailing action
34 | - Parameters:
35 | - systemName: System image name
36 | - action: action
37 |
38 | #### Parameters
39 |
40 | | Name | Description |
41 | | ---- | ----------- |
42 | | systemName | System image name |
43 | | action | action |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CFRunLoopTimer.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CFRunLoopTimer`
4 | ```swift
5 | public extension CFRunLoopTimer
6 | ```
7 |
8 | ## Methods
9 | ### `invalidate()`
10 |
11 | ```swift
12 | func invalidate()
13 | ```
14 |
15 | Invalidate CFRunLoopTimer
16 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CGPoint.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CGPoint`
4 | ```swift
5 | public extension CGPoint
6 | ```
7 |
8 | ## Methods
9 | ### `offseted(x:y:)`
10 |
11 | ```swift
12 | func offseted(x: CGFloat = 0.0, y: CGFloat = 0.0) -> CGPoint
13 | ```
14 |
15 | Offset point by new x and y
16 | - Parameters:
17 | - x: x
18 | - y: y
19 | - Returns: new point
20 |
21 | #### Parameters
22 |
23 | | Name | Description |
24 | | ---- | ----------- |
25 | | x | x |
26 | | y | y |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CGRect.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CGRect`
4 | ```swift
5 | public extension CGRect
6 | ```
7 |
8 | ## Properties
9 | ### `topLeft`
10 |
11 | ```swift
12 | var topLeft: CGPoint
13 | ```
14 |
15 | ### `topRight`
16 |
17 | ```swift
18 | var topRight: CGPoint
19 | ```
20 |
21 | ### `topMiddle`
22 |
23 | ```swift
24 | var topMiddle: CGPoint
25 | ```
26 |
27 | ### `bottomLeft`
28 |
29 | ```swift
30 | var bottomLeft: CGPoint
31 | ```
32 |
33 | ### `bottomRight`
34 |
35 | ```swift
36 | var bottomRight: CGPoint
37 | ```
38 |
39 | ### `bottomMiddle`
40 |
41 | ```swift
42 | var bottomMiddle: CGPoint
43 | ```
44 |
45 | ### `leftMiddle`
46 |
47 | ```swift
48 | var leftMiddle: CGPoint
49 | ```
50 |
51 | ### `rightMiddle`
52 |
53 | ```swift
54 | var rightMiddle: CGPoint
55 | ```
56 |
57 | ### `center`
58 |
59 | ```swift
60 | var center: CGPoint
61 | ```
62 |
63 | Center taking size into account
64 |
65 | ### `sameCenterSquare`
66 |
67 | ```swift
68 | var sameCenterSquare: CGRect
69 | ```
70 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CLLocation.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CLLocation`
4 | ```swift
5 | public extension CLLocation
6 | ```
7 |
8 | ## Methods
9 | ### `init(from:)`
10 |
11 | ```swift
12 | convenience init(from coordinate: CLLocationCoordinate2D)
13 | ```
14 |
15 | `CLLocation` from `CLLocationCoordinate2D`
16 | - Parameter coordinate: `CLLocationCoordinate2D`
17 |
18 | #### Parameters
19 |
20 | | Name | Description |
21 | | ---- | ----------- |
22 | | coordinate | `CLLocationCoordinate2D` |
23 |
24 | ### `reverseGeocode()`
25 |
26 | ```swift
27 | func reverseGeocode() -> Deferred>
28 | ```
29 |
30 | Reverse geocode a `CLLocation`
31 | - Parameter location: `CLLocation`
32 | - Returns: Future with Result<[`CLPlacemark`], `GeocodeError`>
33 |
34 | #### Parameters
35 |
36 | | Name | Description |
37 | | ---- | ----------- |
38 | | location | `CLLocation` |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CLLocationCoordinate2D.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CLLocationCoordinate2D`
4 | ```swift
5 | extension CLLocationCoordinate2D: Equatable
6 | ```
7 |
8 | ## Methods
9 | ### `==(_:_:)`
10 |
11 | ```swift
12 | public static func == (lhs: CLLocationCoordinate2D, rhs: CLLocationCoordinate2D) -> Bool
13 | ```
14 |
15 | Equatable coordinates
16 |
17 | ### `encode(to:)`
18 |
19 | ```swift
20 | public func encode(to encoder: Encoder) throws
21 | ```
22 |
23 | Encode a `CLLocationCoordinate2D`
24 | - Parameter encoder: Encoder
25 | - Throws: `EncodingError`
26 |
27 | #### Parameters
28 |
29 | | Name | Description |
30 | | ---- | ----------- |
31 | | encoder | Encoder |
32 |
33 | ### `init(from:)`
34 |
35 | ```swift
36 | public init(from decoder: Decoder) throws
37 | ```
38 |
39 | Decode `CLLocationCoordinate2D` from data
40 | - Parameter decoder: Decoder
41 | - Throws: `DecodingError`
42 |
43 | #### Parameters
44 |
45 | | Name | Description |
46 | | ---- | ----------- |
47 | | decoder | Decoder |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/CLLocationManager.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `CLLocationManager`
4 | ```swift
5 | public extension CLLocationManager
6 | ```
7 |
8 | ## Methods
9 | ### `requestLocationWhenInUseAuthorization()`
10 |
11 | ```swift
12 | func requestLocationWhenInUseAuthorization() -> AnyPublisher
13 | ```
14 |
15 | ```
16 | class LocationStore: ObservableObject {
17 |
18 | @Published var status: CLAuthorizationStatus = .notDetermined
19 | let manager = CLLocationManager()
20 | var cancellables = Set()
21 |
22 | func requestPermission() {
23 | manager
24 | .requestLocationWhenInUseAuthorization()
25 | .assign(to: &$status)
26 | }
27 | }
28 | ```
29 |
30 | ### `requestLocationAlwaysAuthorization()`
31 |
32 | ```swift
33 | func requestLocationAlwaysAuthorization() -> AnyPublisher
34 | ```
35 |
36 | ```
37 | class LocationStore: ObservableObject {
38 |
39 | @Published var status: CLAuthorizationStatus = .notDetermined
40 | let manager = CLLocationManager()
41 | var cancellables = Set()
42 |
43 | func requestPermission() {
44 | manager
45 | .requestLocationWhenInUseAuthorization()
46 | .assign(to: &$status)
47 | }
48 | }
49 | ```
50 |
51 | ### `receiveLocationUpdates(oneTime:)`
52 |
53 | ```swift
54 | func receiveLocationUpdates(oneTime: Bool = false) -> AnyPublisher<[CLLocation], Error>
55 | ```
56 |
57 | ```
58 | class LocationStore: ObservableObject {
59 |
60 | @Published var coordinate: CLLocationCoordinate2D = .zero
61 | let manager = CLLocationManager()
62 | var cancellables = Set()
63 |
64 | func requestLocation() {
65 | manager
66 | .receiveLocationUpdates()
67 | .compactMap(\.last)
68 | .map(\.coordinate)
69 | .replaceError(with: .zero)
70 | .assign(to: &$coordinate)
71 | }
72 | }
73 | ```
74 |
75 | #### Parameters
76 |
77 | | Name | Description |
78 | | ---- | ----------- |
79 | | oneTime | One time location update or constant updates, default: false |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Collection.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Collection`
4 | ```swift
5 | public extension Collection
6 | ```
7 |
8 | ## Methods
9 | ### `distance(to:)`
10 |
11 | ```swift
12 | func distance(to index: Index) -> Int
13 | ```
14 |
15 | Distance to index
16 | - Parameter index: Index
17 | - Returns: Int
18 |
19 | #### Parameters
20 |
21 | | Name | Description |
22 | | ---- | ----------- |
23 | | index | Index |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Color.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Color`
4 | ```swift
5 | public extension Color
6 | ```
7 |
8 | ## Properties
9 | ### `inverted`
10 |
11 | ```swift
12 | var inverted: Color
13 | ```
14 |
15 | Inverse color
16 |
17 | ## Methods
18 | ### `hex(_:alpha:)`
19 |
20 | ```swift
21 | static func hex(_ hex: UInt, alpha: Double = 1) -> Self
22 | ```
23 |
24 | Initialize with HEX
25 | - Parameter hex: HEX UInt value
26 | - Returns: Color
27 |
28 | #### Parameters
29 |
30 | | Name | Description |
31 | | ---- | ----------- |
32 | | hex | HEX UInt value |
33 |
34 | ### `hex(_:alpha:)`
35 |
36 | ```swift
37 | static func hex(_ hex: String, alpha: CGFloat = 1) -> Self
38 | ```
39 |
40 | Initialize with HEX
41 | - Parameter hex: HEX String value
42 | - Returns: Color
43 |
44 | #### Parameters
45 |
46 | | Name | Description |
47 | | ---- | ----------- |
48 | | hex | HEX String value |
49 |
50 | ### `init(hex:)`
51 |
52 | ```swift
53 | init(hex: String)
54 | ```
55 |
56 | Initialize with HEX
57 | - Parameter hex: HEX
58 |
59 | #### Parameters
60 |
61 | | Name | Description |
62 | | ---- | ----------- |
63 | | hex | HEX |
64 |
65 | ### `random(opacity:)`
66 |
67 | ```swift
68 | static func random(opacity: CGFloat = 1.0) -> Color
69 | ```
70 |
71 | Generate a random color
72 | - Parameter opacity: opacity
73 | - Returns: New color
74 |
75 | #### Parameters
76 |
77 | | Name | Description |
78 | | ---- | ----------- |
79 | | opacity | opacity |
80 |
81 | ### `lighten(by:)`
82 |
83 | ```swift
84 | func lighten(by percentage: CGFloat = 30.0) -> Color
85 | ```
86 |
87 | Lighten color
88 | - Parameter percentage: percentage (1 -100), default: 30
89 | - Returns: new color
90 |
91 | #### Parameters
92 |
93 | | Name | Description |
94 | | ---- | ----------- |
95 | | percentage | percentage (1 -100), default: 30 |
96 |
97 | ### `darken(by:)`
98 |
99 | ```swift
100 | func darken(by percentage: CGFloat = 30.0) -> Color
101 | ```
102 |
103 | Darken color
104 | - Parameter percentage: percentage (1 -100), default: 30
105 | - Returns: new color
106 |
107 | #### Parameters
108 |
109 | | Name | Description |
110 | | ---- | ----------- |
111 | | percentage | percentage (1 -100), default: 30 |
112 |
113 | ### `dynamicColor(light:dark:)`
114 |
115 | ```swift
116 | static func dynamicColor(light: UIColor, dark: UIColor) -> Color
117 | ```
118 |
119 | Create a color with a dark and light mode UIColor
120 | - Parameters:
121 | - light: light color
122 | - dark: dark color
123 | - Returns: Color
124 |
125 | #### Parameters
126 |
127 | | Name | Description |
128 | | ---- | ----------- |
129 | | light | light color |
130 | | dark | dark color |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Data.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Data`
4 | ```swift
5 | public extension Data
6 | ```
7 |
8 | ## Properties
9 | ### `hexString`
10 |
11 | ```swift
12 | var hexString: String
13 | ```
14 |
15 | Returns a string of hex value.
16 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Date.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Date`
4 | ```swift
5 | public extension Date
6 | ```
7 |
8 | ## Properties
9 | ### `year`
10 |
11 | ```swift
12 | var year: Int
13 | ```
14 |
15 | Returns the year from the date.
16 |
17 | ### `month`
18 |
19 | ```swift
20 | var month: Int
21 | ```
22 |
23 | Returns month as `Int` starting from `1...12`.
24 |
25 | ### `week`
26 |
27 | ```swift
28 | var week: Int
29 | ```
30 |
31 | Returns week as `Int` starting from 1...52
32 |
33 | ### `weekday`
34 |
35 | ```swift
36 | var weekday: Int
37 | ```
38 |
39 | ### `weekOfMonth`
40 |
41 | ```swift
42 | var weekOfMonth: Int
43 | ```
44 |
45 | ### `day`
46 |
47 | ```swift
48 | var day: Int
49 | ```
50 |
51 | ### `hour`
52 |
53 | ```swift
54 | var hour: Int
55 | ```
56 |
57 | ### `minute`
58 |
59 | ```swift
60 | var minute: Int
61 | ```
62 |
63 | ### `second`
64 |
65 | ```swift
66 | var second: Int
67 | ```
68 |
69 | ### `nanos`
70 |
71 | ```swift
72 | var nanos: Int
73 | ```
74 |
75 | ### `yesterday`
76 |
77 | ```swift
78 | var yesterday: Date
79 | ```
80 |
81 | ### `today`
82 |
83 | ```swift
84 | var today: Date
85 | ```
86 |
87 | ### `tomorrow`
88 |
89 | ```swift
90 | var tomorrow: Date
91 | ```
92 |
93 | ### `dayAfter`
94 |
95 | ```swift
96 | var dayAfter: Date
97 | ```
98 |
99 | ### `dayBefore`
100 |
101 | ```swift
102 | var dayBefore: Date
103 | ```
104 |
105 | ### `isLastDayOfMonth`
106 |
107 | ```swift
108 | var isLastDayOfMonth: Bool
109 | ```
110 |
111 | ### `startOfDay`
112 |
113 | ```swift
114 | var startOfDay: Date
115 | ```
116 |
117 | Start of current day
118 |
119 | ### `endOfDay`
120 |
121 | ```swift
122 | var endOfDay: Date
123 | ```
124 |
125 | End of current day
126 |
127 | ## Methods
128 | ### `adjust(_:offset:)`
129 |
130 | ```swift
131 | func adjust(_ type: Calendar.Component, offset: Int) -> Date
132 | ```
133 |
134 | Offset component by amount
135 | - Parameters:
136 | - type: Component
137 | - offset: Offset to add
138 | - Returns: Date
139 |
140 | #### Parameters
141 |
142 | | Name | Description |
143 | | ---- | ----------- |
144 | | type | Component |
145 | | offset | Offset to add |
146 |
147 | ### `toRelativeFormat(currentDate:numericDates:)`
148 |
149 | ```swift
150 | func toRelativeFormat(
151 | currentDate: Date = Date(),
152 | numericDates: Bool = true
153 | ) -> String
154 | ```
155 |
156 | Get relative String back from Date ex: 1 year ago, 1 month ago ...
157 | - Parameters:
158 | - currentDate: Current Date
159 | - numericDates: Display the numeric value in string ex: 1 year ago vs Last year
160 | - Returns: String
161 |
162 | #### Parameters
163 |
164 | | Name | Description |
165 | | ---- | ----------- |
166 | | currentDate | Current Date |
167 | | numericDates | Display the numeric value in string ex: 1 year ago vs Last year |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/FileManager.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `FileManager`
4 | ```swift
5 | public extension FileManager
6 | ```
7 |
8 | ## Methods
9 | ### `fileSize(atPath:)`
10 |
11 | ```swift
12 | func fileSize(atPath path: String) -> Int
13 | ```
14 |
15 | Size of file at path
16 |
17 | - Parameter path: file path
18 | - Returns: Size in bytes
19 |
20 | #### Parameters
21 |
22 | | Name | Description |
23 | | ---- | ----------- |
24 | | path | file path |
25 |
26 | ### `folderSize(atPath:)`
27 |
28 | ```swift
29 | func folderSize(atPath path: String) -> Int
30 | ```
31 |
32 | Size of folder
33 |
34 | - Parameter path: folder path
35 | - Returns: size in bytes
36 |
37 | #### Parameters
38 |
39 | | Name | Description |
40 | | ---- | ----------- |
41 | | path | folder path |
42 |
43 | ### `directorySize(at:)`
44 |
45 | ```swift
46 | func directorySize(at URL: URL) -> Int
47 | ```
48 |
49 | Size of directory at URL
50 |
51 | - Parameter URL: URL
52 | - Returns: Size in bytes
53 |
54 | #### Parameters
55 |
56 | | Name | Description |
57 | | ---- | ----------- |
58 | | URL | URL |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/GeometryProxy.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `GeometryProxy`
4 | ```swift
5 | public extension GeometryProxy
6 | ```
7 |
8 | ## Properties
9 | ### `safeWidth`
10 |
11 | ```swift
12 | var safeWidth: CGFloat
13 | ```
14 |
15 | Returns the width minus the safeAreaInsets.
16 |
17 | ### `safeHeight`
18 |
19 | ```swift
20 | var safeHeight: CGFloat
21 | ```
22 |
23 | Returns the height minus the safeAreaInsets.
24 |
25 | ### `localFrame`
26 |
27 | ```swift
28 | var localFrame: CGRect
29 | ```
30 |
31 | ### `localWidth`
32 |
33 | ```swift
34 | var localWidth: CGFloat
35 | ```
36 |
37 | ### `localHeight`
38 |
39 | ```swift
40 | var localHeight: CGFloat
41 | ```
42 |
43 | ### `localCenter`
44 |
45 | ```swift
46 | var localCenter: CGPoint
47 | ```
48 |
49 | ### `localTop`
50 |
51 | ```swift
52 | var localTop: CGFloat
53 | ```
54 |
55 | ### `localBottom`
56 |
57 | ```swift
58 | var localBottom: CGFloat
59 | ```
60 |
61 | ### `localLeft`
62 |
63 | ```swift
64 | var localLeft: CGFloat
65 | ```
66 |
67 | ### `localRight`
68 |
69 | ```swift
70 | var localRight: CGFloat
71 | ```
72 |
73 | ### `localDiameter`
74 |
75 | ```swift
76 | var localDiameter: CGFloat
77 | ```
78 |
79 | ### `globalFrame`
80 |
81 | ```swift
82 | var globalFrame: CGRect
83 | ```
84 |
85 | ### `globalWidth`
86 |
87 | ```swift
88 | var globalWidth: CGFloat
89 | ```
90 |
91 | ### `globalHeight`
92 |
93 | ```swift
94 | var globalHeight: CGFloat
95 | ```
96 |
97 | ### `globalCenter`
98 |
99 | ```swift
100 | var globalCenter: CGPoint
101 | ```
102 |
103 | ### `globalTop`
104 |
105 | ```swift
106 | var globalTop: CGFloat
107 | ```
108 |
109 | ### `globalBottom`
110 |
111 | ```swift
112 | var globalBottom: CGFloat
113 | ```
114 |
115 | ### `globalLeft`
116 |
117 | ```swift
118 | var globalLeft: CGFloat
119 | ```
120 |
121 | ### `globalRight`
122 |
123 | ```swift
124 | var globalRight: CGFloat
125 | ```
126 |
127 | ### `globalDiameter`
128 |
129 | ```swift
130 | var globalDiameter: CGFloat
131 | ```
132 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Image.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Image`
4 | ```swift
5 | public extension Image
6 | ```
7 |
8 | ## Methods
9 | ### `init(_:defaultImage:)`
10 |
11 | ```swift
12 | init(_ name: String, defaultImage: String)
13 | ```
14 |
15 | Initialize with a default image
16 | - Parameters:
17 | - name: primary image name
18 | - defaultImage: default image name
19 |
20 | #### Parameters
21 |
22 | | Name | Description |
23 | | ---- | ----------- |
24 | | name | primary image name |
25 | | defaultImage | default image name |
26 |
27 | ### `init(_:defaultSystemImage:)`
28 |
29 | ```swift
30 | init(_ name: String, defaultSystemImage: String)
31 | ```
32 |
33 | Initialize with default system image
34 | - Parameters:
35 | - name: primary image name
36 | - defaultSystemImage: default image name
37 |
38 | #### Parameters
39 |
40 | | Name | Description |
41 | | ---- | ----------- |
42 | | name | primary image name |
43 | | defaultSystemImage | default image name |
44 |
45 | ### `icon(with:)`
46 |
47 | ```swift
48 | func icon(with size: CGSize) -> some View
49 | ```
50 |
51 | Create a resizable image with CGSize
52 | - Parameter size: CGSize
53 | - Returns: View
54 |
55 | #### Parameters
56 |
57 | | Name | Description |
58 | | ---- | ----------- |
59 | | size | CGSize |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Int.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Int`
4 | ```swift
5 | public extension Int
6 | ```
7 |
8 | ## Properties
9 | ### `isOdd`
10 |
11 | ```swift
12 | var isOdd: Bool
13 | ```
14 |
15 | Whether self is an odd number
16 |
17 | ### `isEven`
18 |
19 | ```swift
20 | var isEven: Bool
21 | ```
22 |
23 | Whether self is an even number
24 |
25 | ### `nilIfZero`
26 |
27 | ```swift
28 | var nilIfZero: Int?
29 | ```
30 |
31 | Treats 0 as nil
32 |
33 | ### `string`
34 |
35 | ```swift
36 | var string: String
37 | ```
38 |
39 | Make the number to string
40 |
41 | ### `range`
42 |
43 | ```swift
44 | var range: CountableRange
45 | ```
46 |
47 | Make a range from zero to self
48 |
49 | ### `hours`
50 |
51 | ```swift
52 | var hours: Int
53 | ```
54 |
55 | ### `minutes`
56 |
57 | ```swift
58 | var minutes: Int
59 | ```
60 |
61 | ### `days`
62 |
63 | ```swift
64 | var days: Int
65 | ```
66 |
67 | ### `months`
68 |
69 | ```swift
70 | var months: Int
71 | ```
72 |
73 | ### `years`
74 |
75 | ```swift
76 | var years: Int
77 | ```
78 |
79 | ## Methods
80 | ### `instances(of:)`
81 |
82 | ```swift
83 | func instances(of creation: @autoclosure () throws -> T) rethrows -> [T]
84 | ```
85 |
86 | Return a number of instances
87 |
88 | - Parameter creation: The initialization of the object
89 | - Returns: An array containing the objects
90 |
91 | #### Parameters
92 |
93 | | Name | Description |
94 | | ---- | ----------- |
95 | | creation | The initialization of the object |
96 |
97 | ### `inRange(_:)`
98 |
99 | ```swift
100 | func inRange(_ range: Range) -> Bool
101 | ```
102 |
103 | Return if `self` is in the given range.
104 |
105 | - Parameter range: Target range.
106 | - Returns: `true` if self is in the range, otherwise `false`.
107 |
108 | #### Parameters
109 |
110 | | Name | Description |
111 | | ---- | ----------- |
112 | | range | Target range. |
113 |
114 | ### `times(block:)`
115 |
116 | ```swift
117 | func times(block: () -> Void)
118 | ```
119 |
120 | Calls the given block n number of times.
121 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/NSObject.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `NSObject`
4 | ```swift
5 | public extension NSObject
6 | ```
7 |
8 | ## Properties
9 | ### `className`
10 |
11 | ```swift
12 | var className: String
13 | ```
14 |
15 | Return class name.
16 |
17 | ## Methods
18 | ### `exchangeImplementations(originalSelector:swizzledSelector:)`
19 |
20 | ```swift
21 | class func exchangeImplementations(originalSelector: Selector, swizzledSelector: Selector)
22 | ```
23 |
24 | Exchange two implementations of the given selectors, aka method swizzling.
25 |
26 | - Parameters:
27 | - originalSelector: The original selector.
28 | - swizzledSelector: Another selector.
29 |
30 | #### Parameters
31 |
32 | | Name | Description |
33 | | ---- | ----------- |
34 | | originalSelector | The original selector. |
35 | | swizzledSelector | Another selector. |
36 |
37 | ### `printDeinitMessage()`
38 |
39 | ```swift
40 | final func printDeinitMessage()
41 | ```
42 |
43 | Print the deinitialization message of self.
44 |
--------------------------------------------------------------------------------
/Documentation/Reference/ExtensionKit/extensions/Publisher.md:
--------------------------------------------------------------------------------
1 | **EXTENSION**
2 |
3 | # `Publisher`
4 | ```swift
5 | public extension Publisher
6 | ```
7 |
8 | ## Methods
9 | ### `debug(prefix:function:line:)`
10 |
11 | ```swift
12 | func debug(
13 | prefix: String = "",
14 | function: String = #function,
15 | line: Int = #line) -> Publishers.HandleEvents
16 | ```
17 |
18 | Debug print Publisher events
19 | - Parameters:
20 | - prefix: Prefix on print statement
21 | - function: Function name
22 | - line: Line number
23 | - Returns: Publisher
24 |
25 | #### Parameters
26 |
27 | | Name | Description |
28 | | ---- | ----------- |
29 | | prefix | Prefix on print statement |
30 | | function | Function name |
31 | | line | Line number |
32 |
33 | ### `receiveOnMain()`
34 |
35 | ```swift
36 | func receiveOnMain() -> Publishers.ReceiveOn
37 | ```
38 |
39 | Receive Output value on main thread (DispatchQueue.main)
40 |
41 | ### `sink(result:)`
42 |
43 | ```swift
44 | func sink(result: @escaping ((Result) -> Void)) -> AnyCancellable
45 | ```
46 |
47 | A single value sink function outputs a `Result`
48 | - Parameter result: Result