Skip to content

Commit 271ee87

Browse files
committed
Added README.md
1 parent 51ad44a commit 271ee87

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed

README.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<div align="center">
2+
<h1>Snitch</h1>
3+
4+
<p>
5+
<strong>Access your app's useful information from Home Screen</strong>
6+
</p>
7+
8+
<img src=https://img.shields.io/badge/platform-iOS-lightgrey />
9+
<img src=https://img.shields.io/github/v/release/onl1ner/Snitch />
10+
<img src=https://img.shields.io/github/license/onl1ner/Snitch />
11+
<img src=https://img.shields.io/badge/Swift-5-orange?logo=Swift&logoColor=white />
12+
</div>
13+
14+
## Table of Contents
15+
16+
* [Installation](#installation)
17+
* [Usage](#usage)
18+
* [Quick start](#quick-start)
19+
* [Custom fetchers](#custom-fetchers)
20+
* [Contribution](#contribution)
21+
* [License](#license)
22+
23+
## Installation
24+
25+
**Snitch** is available through [Swift Package Manager](https://github.com/apple/swift-package-manager).
26+
27+
- In Xcode select:
28+
29+
```
30+
File > Swift Packages > Add Package Dependency...
31+
```
32+
33+
- Then paste this URL:
34+
35+
```
36+
https://github.com/onl1ner/Snitch.git
37+
```
38+
39+
## Usage
40+
41+
<img align="right" src="https://github.com/onl1ner/onl1ner/blob/master/Resources/Snitch/Preview.png?raw=true" width="256"/>
42+
43+
### Quick start
44+
45+
To snitch the information just call function `snitch(options:)`:
46+
47+
```swift
48+
Snitch(options: [.size, .version]).snitch()
49+
```
50+
51+
The `.size` and `.version` options are default, so you can omit them:
52+
53+
```swift
54+
Snitch().snitch()
55+
```
56+
57+
### Custom fetchers
58+
59+
You may also want to create your own option and show it on the Home Screen to do that you have to create your own implementation of `Fetcher` protocol. After doing that you could pass it as an option to the `Snitch` through the `init(options:)` initializer:
60+
61+
```swift
62+
Snitch(options: [.custom(CustomFetcher())]).snitch()
63+
```
64+
65+
### Note
66+
67+
After calling `snitch(options:)` function `Snitch` will add Home Screen quick action menu with the information according to the passed options. You may call this function at any point in your app, but the best place to call it is in `sceneWillResignActive(_:)`, because during the transition to a background state is a good time to update any dynamic quick actions, so the system will execute code inside the function right before user returns to the Home Screen.
68+
69+
## Contribution
70+
71+
If you struggle with something feel free to [open an issue](https://github.com/onl1ner/Snitch/issues/new). Pull requests are also appreciated.
72+
73+
## License
74+
75+
**Snitch** is under the terms and conditions of the MIT license.
76+
77+
```
78+
MIT License
79+
80+
Copyright (c) 2022 Tamerlan Satualdypov
81+
82+
Permission is hereby granted, free of charge, to any person obtaining a copy
83+
of this software and associated documentation files (the "Software"), to deal
84+
in the Software without restriction, including without limitation the rights
85+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
86+
copies of the Software, and to permit persons to whom the Software is
87+
furnished to do so, subject to the following conditions:
88+
89+
The above copyright notice and this permission notice shall be included in all
90+
copies or substantial portions of the Software.
91+
92+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
94+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
95+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
96+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
97+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
98+
SOFTWARE.
99+
```

0 commit comments

Comments
 (0)