Skip to content

Commit 9966378

Browse files
committed
doc: add docs
1 parent d47630d commit 9966378

11 files changed

+244
-5
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ Pods/
4141
## Carthage
4242
Carthage/Build
4343

44-
## Jazzy docs
45-
docs/
46-
4744
## Fastlane
4845
fastlane/report.xml
4946
fastlane/Preview.html

Docs/Drop.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Drop
2+
3+
An object representing a drop.
4+
5+
``` swift
6+
public struct Drop
7+
```
8+
9+
## Initializers
10+
11+
### `init(title:subtitle:icon:action:style:duration:)`
12+
13+
Create a new drop.
14+
15+
``` swift
16+
public init(
17+
title: String,
18+
subtitle: String? = nil,
19+
icon: UIImage? = nil,
20+
action: Action? = nil,
21+
style: Style = .top,
22+
duration: Duration = .recommended
23+
)
24+
```
25+
26+
#### Parameters
27+
28+
- title: Title.
29+
- subtitle: Optional subtitle. Defaults to `nil`.
30+
- icon: Optional icon.
31+
- action: Optional action.
32+
- style: Style. Defaults to `Drop.Style.top`.
33+
- duration: Duration. Defaults to `Drop.Duration.recommended`.
34+
35+
## Properties
36+
37+
### `title`
38+
39+
Title.
40+
41+
``` swift
42+
public var title: String
43+
```
44+
45+
### `subtitle`
46+
47+
Subtitle.
48+
49+
``` swift
50+
public var subtitle: String?
51+
```
52+
53+
### `icon`
54+
55+
Icon.
56+
57+
``` swift
58+
public var icon: UIImage?
59+
```
60+
61+
### `action`
62+
63+
Action.
64+
65+
``` swift
66+
public var action: Action?
67+
```
68+
69+
### `style`
70+
71+
Style.
72+
73+
``` swift
74+
public var style: Style
75+
```
76+
77+
### `duration`
78+
79+
Duration.
80+
81+
``` swift
82+
public var duration: Duration
83+
```

Docs/Drop_Action.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Drop.Action
2+
3+
An object representing a drop action.
4+
5+
``` swift
6+
public struct Action
7+
```
8+
9+
## Initializers
10+
11+
### `init(icon:handler:)`
12+
13+
Create a new action.
14+
15+
``` swift
16+
public init(icon: UIImage? = nil, handler: @escaping () -> Void)
17+
```
18+
19+
#### Parameters
20+
21+
- icon: Optional icon image.
22+
- handler: Handler to be called when the drop is tapped.
23+
24+
## Properties
25+
26+
### `icon`
27+
28+
Icon.
29+
30+
``` swift
31+
public var icon: UIImage?
32+
```
33+
34+
### `handler`
35+
36+
Handler.
37+
38+
``` swift
39+
public var handler: () -> Void
40+
```

Docs/Drop_Duration.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Drop.Duration
2+
3+
An enum representing a drop duration on screen.
4+
5+
``` swift
6+
public enum Duration
7+
```
8+
9+
## Enumeration Cases
10+
11+
### `recommended`
12+
13+
Hides the drop after 2.0 seconds.
14+
15+
``` swift
16+
case recommended
17+
```
18+
19+
### `seconds`
20+
21+
Hides the drop after the specified number of seconds.
22+
23+
``` swift
24+
case seconds(TimeInterval)
25+
```

Docs/Drop_Style.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Drop.Style
2+
3+
An enum representing drop presentation style.
4+
5+
``` swift
6+
public enum Style
7+
```
8+
9+
## Enumeration Cases
10+
11+
### `top`
12+
13+
Drop is presented from top.
14+
15+
``` swift
16+
case top
17+
```
18+
19+
### `bottom`
20+
21+
Drop is presented from bottom.
22+
23+
``` swift
24+
case bottom
25+
```

Docs/Drops.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Drops
2+
3+
Drops.
4+
5+
``` swift
6+
public final class Drops
7+
```
8+
9+
## Inheritance
10+
11+
[`AnimatorDelegate`](/AnimatorDelegate)
12+
13+
## Methods
14+
15+
### `show(_:)`
16+
17+
Show a drop.
18+
19+
``` swift
20+
static func show(_ drop: Drop)
21+
```
22+
23+
#### Parameters
24+
25+
- drop: `Drop` to show.
26+
27+
### `hideAll()`
28+
29+
Hide all drops.
30+
31+
``` swift
32+
static func hideAll()
33+
```
34+
35+
### `hideCurrent()`
36+
37+
Hide currently shown drop.
38+
39+
``` swift
40+
static func hideCurrent()
41+
```

Docs/Home.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Types
2+
3+
- [Drops](/Drops):
4+
Drops.
5+
- [Drop.Style](/Drop_Style):
6+
An enum representing drop presentation style.
7+
- [Drop.Duration](/Drop_Duration):
8+
An enum representing a drop duration on screen.
9+
- [Drop](/Drop):
10+
An object representing a drop.
11+
- [Drop.Action](/Drop_Action):
12+
An object representing a drop action.

Docs/_Footer.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generated at 2021-05-05T04:34:09+0200 using [swift-doc](https://github.com/SwiftDocOrg/swift-doc) 1.0.0-beta.6.

Docs/_Sidebar.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<details>
2+
<summary>Types</summary>
3+
4+
- [Drop](/Drop)
5+
- [Drop.Action](/Drop.Action)
6+
- [Drop.Duration](/Drop.Duration)
7+
- [Drop.Style](/Drop.Style)
8+
- [Drops](/Drops)
9+
10+
</details>

Drops.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@
535535
"@executable_path/Frameworks",
536536
"@loader_path/Frameworks",
537537
);
538-
MARKETING_VERSION = 0.2.0;
538+
MARKETING_VERSION = 0.3.0;
539539
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
540540
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
541541
SKIP_INSTALL = YES;
@@ -564,7 +564,7 @@
564564
"@executable_path/Frameworks",
565565
"@loader_path/Frameworks",
566566
);
567-
MARKETING_VERSION = 0.2.0;
567+
MARKETING_VERSION = 0.3.0;
568568
PRODUCT_BUNDLE_IDENTIFIER = com.omaralbeik.drops;
569569
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
570570
SKIP_INSTALL = YES;

Sources/Drops.swift

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ typealias AnimationCompletion = (_ completed: Bool) -> Void
2727

2828
private let sharedInstance = Drops()
2929

30+
/// Drops.
3031
public final class Drops {
3132
private func show(drop: Drop) {
3233
let presenter = Presenter(drop: drop, delegate: self)
@@ -140,14 +141,18 @@ extension Drops: AnimatorDelegate {
140141
}
141142

142143
public extension Drops {
144+
/// Show a drop.
145+
/// - Parameter drop: `Drop` to show.
143146
static func show(_ drop: Drop) {
144147
sharedInstance.show(drop: drop)
145148
}
146149

150+
/// Hide all drops.
147151
static func hideAll() {
148152
sharedInstance.hideAll()
149153
}
150154

155+
/// Hide currently shown drop.
151156
static func hideCurrent() {
152157
sharedInstance.hideCurrent()
153158
}

0 commit comments

Comments
 (0)