Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
igooor-bb committed Oct 28, 2022
1 parent 836d25e commit 816e431
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GreedyKit is a set of ready-to-use components written in Swift for preventing se
- [Requirements](#requirements)
- [Installation](#installation)
- [Swift Package Manager](#swift-package-manager)
- [CocoaPods](#cocoapods)
- [Usage](#usage)
- [UIKit](#uikit)
- [GreedyImageView](#greedyimageview)
Expand All @@ -33,21 +34,29 @@ I once had the task of preventing the capture of locally recorded video, however

### Swift Package Manager

One way to install GreedyKit is the Swift Package Manager (SPM). To do this, simply add a dependency to your `Package.swift` file:

```swift
dependencies: [
.package(url: "https://github.com/igooor-bb/GreedyKit.git", from: "0.1.0")
]
```

Alternatively, you can use Swift Package Manager to install GreedyKit using Xcode:
You can use Swift Package Manager to install GreedyKit using Xcode:

1. Open your project in Xcode
2. Open "File" -> "Add Packages..."
3. Paste the repository URL: <https://github.com/igooor-bb/GreedyKit>
4. Click "Next" a couple of times and finish adding

### CocoaPods

You can use [CocoaPods](http://cocoapods.org/) to install `GreedyKit` by adding following lines to your `Podfile`:

```ruby
target 'ApplicationName' do
pod 'GreedyKit'
end
```

Then just write the command in the terminal to install:

```bash
pod install
```

## Usage

After you have installed the package, import it into the project in the usual way:
Expand All @@ -62,7 +71,7 @@ The package includes two separate but similar components for displaying **images

#### GreedyImageView

To add an image in UIKit that can be hidden, you have to use the `GreedyImageView` wrapper around your image:
To add an image in UIKit that can be hidden, you can use the `GreedyImageView` wrapper around your image:

```swift
// Create image view similar to the regular UIView.
Expand Down Expand Up @@ -109,7 +118,7 @@ The image is very simple. You just need to create a `GreedyImage` element with a

```swift
VStack {
GreedyImage(uiImage, preventsCapture: true)
GreedyImage(uiImage, preventsCapture: true)
}
```

Expand All @@ -119,7 +128,7 @@ Creating a video player is also easy. You just need to create a `GreedyPlayer` e

```swift
VStack {
GreedyPlayer(player: avPlayer, preventsCapture: true)
GreedyPlayer(player: avPlayer, preventsCapture: true)
}
```

Expand Down

0 comments on commit 816e431

Please sign in to comment.