Skip to content

Commit d38b9b7

Browse files
committed
Add drop
1 parent a0e4d4d commit d38b9b7

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ let package = Package(
2020
],
2121
dependencies: [
2222
.package(name: "SwiftVB", url: "https://github.com/1998code/SwiftVBKit.git", .upToNextMinor(from: "1.4.0")),
23+
.package(name: "Drops", url: "https://github.com/omaralbeik/Drops.git", .upToNextMinor(from: "1.5.0")),
2324
],
2425
targets: [
2526
.target(
2627
name: "SwiftNEW",
2728
dependencies: [
28-
"SwiftVB"
29+
"SwiftVB",
30+
"Drops"
2931
]),
3032
// .testTarget(
3133
// name: "SwiftNEWTests",

Sources/SwiftNEW/SwiftNEW.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import SwiftUI
66
import SwiftVB
7+
import Drops
78

89
@available(iOS 14, watchOS 7.0, macOS 11.0, *)
910
public struct SwiftNEW: View {
@@ -221,6 +222,16 @@ public struct SwiftNEW: View {
221222
}
222223
}
223224
}
225+
226+
public func showDrop() {
227+
let drop = Drop( title: "Tap here", subtitle: "To see what's New.", icon: UIImage(systemName: "star.fill"),
228+
action: .init {
229+
Drops.hideCurrent()
230+
show = true
231+
},
232+
position: .top, duration: 3.0, accessibility: "Alert: Tap here to see what's New." )
233+
Drops.show(drop)
234+
}
224235
}
225236

226237
// MARK: - Model

0 commit comments

Comments
 (0)