mirror of
https://github.com/samsonjs/NotificationSmuggler.git
synced 2026-03-25 08:25:48 +00:00
0.2.0
This commit is contained in:
parent
1257fa1771
commit
f7c096ae62
1 changed files with 8 additions and 2 deletions
10
Readme.md
10
Readme.md
|
|
@ -30,11 +30,17 @@ The `Smuggled` protocol provides static `notificationName` and `userInfoKey` pro
|
|||
|
||||
### Post a notification
|
||||
|
||||
```swift
|
||||
NotificationCenter.default.smuggle(SomeNotification(answer: 42))
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```swift
|
||||
NotificationCenter.default.post(.smuggle(SomeNotification(answer: 42)))
|
||||
```
|
||||
|
||||
This automatically sets the `.name`, `userInfo`, and optionally `.object` for the notification.
|
||||
Both automatically set the `.name`, `userInfo`, and optionally `.object` for the notification.
|
||||
|
||||
### Observe and extract contraband
|
||||
|
||||
|
|
@ -66,7 +72,7 @@ When you're integrating this into an app with Xcode then go to your project's Pa
|
|||
When you're integrating this using SPM on its own then add this to the list of dependencies your Package.swift file:
|
||||
|
||||
```swift
|
||||
.package(url: "https://github.com/samsonjs/NotificationSmuggler.git", .upToNextMajor(from: "0.1.2"))
|
||||
.package(url: "https://github.com/samsonjs/NotificationSmuggler.git", .upToNextMajor(from: "0.2.0"))
|
||||
```
|
||||
|
||||
and then add `"NotificationSmuggler"` to the list of dependencies in your target as well.
|
||||
|
|
|
|||
Loading…
Reference in a new issue