mirror of
https://github.com/samsonjs/NotificationSmuggler.git
synced 2026-04-27 14:57:38 +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
|
### Post a notification
|
||||||
|
|
||||||
|
```swift
|
||||||
|
NotificationCenter.default.smuggle(SomeNotification(answer: 42))
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
NotificationCenter.default.post(.smuggle(SomeNotification(answer: 42)))
|
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
|
### 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:
|
When you're integrating this using SPM on its own then add this to the list of dependencies your Package.swift file:
|
||||||
|
|
||||||
```swift
|
```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.
|
and then add `"NotificationSmuggler"` to the list of dependencies in your target as well.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue