Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fotiDim committed Aug 6, 2023
1 parent 40500fe commit c0200fb
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gesturedeck is the low-level API that allows you to build custom functionalities

### Getting Started with Gesturedeck

To integrate Gesturedeck into your iOS app, you must add the Gesturedeck framework to your project. You can easily do that using Swift Package Manager (SPM). Through Xcode, go to Package Dependencies, click `+`` and simply use the URL of this repo. SPM will fetch and add the framework automatically.
To integrate Gesturedeck into your iOS app, you must add the Gesturedeck framework to your project. You can easily do that using Swift Package Manager (SPM). Through Xcode, go to `Package Dependencies`, click `+` and simply use the URL of this repo. SPM will fetch and add the framework automatically.

After adding the framework, follow the steps below to integrate it with your app.

Expand Down Expand Up @@ -109,29 +109,37 @@ var body: some Scene {
}
```

### Listen to Individual Gestures
### Gesture Actions

To listen to individual gestures, you can use the properties `tapAction`, `swipeRightAction`, `swipeLeftAction`, `panAction`, and `longPressAction` in GesturedeckMedia's constructor.
While you can initialize Gesturedeck without any arguments, no action will be executed upon performing a gesture. To set the action for a specific gesture, you can use the arguments `tapAction`, `swipeRightAction`, `swipeLeftAction`, `panAction`, and `longPressAction` in Gesturedeck's constructor or set them afterwards.

```swift
gesturedeckMedia.tapAction = { /* Handle tap gesture here */ }
gesturedeckMedia.swipeRightAction = { /* Handle swipe right gesture here */ }
gesturedeckMedia.swipeLeftAction = { /* Handle swipe left gesture here */ }
gesturedeckMedia.panAction = { /* Handle pan gesture here */ }
gesturedeckMedia.longPressAction = { /* Handle long press gesture here */ }
gesturedeck.tapAction = { /* Handle tap gesture here */ }
gesturedeck.swipeRightAction = { /* Handle swipe right gesture here */ }
gesturedeck.swipeLeftAction = { /* Handle swipe left gesture here */ }
gesturedeck.panAction = { /* Handle pan gesture here */ }
gesturedeck.longPressAction = { /* Handle long press gesture here */ }
```

For detailed API reference, visit [Gesturedeck API Reference](https://navideck.github.io/Gesturedeck-iOS/documentation/gesturedeckios/gesturedeck/).

## GesturedeckMedia - Media Controls

GesturedeckMedia is a specialized implementation built on top of Gesturedeck, tailored specifically for media apps. It provides default gesture actions that can be customized to suit your app's requirements.
GesturedeckMedia is a specialized implementation built on top of Gesturedeck, tailored specifically for media apps. It provides default gesture actions that can be customized to suit your app's requirements.

You can initialize GesturedeckMedia without any arguments and have **start/stop**, **skip next/previous** and **volume up/down** work out of the box. Note that due to iOS limitations, skip next/previous only works for the system media player.

### Getting Started with GesturedeckMedia

To use GesturedeckMedia for showing media controls UI, follow these steps:

1. Initialize `GesturedeckMedia` with `GesturedeckMediaOverlay`:
1. Initialize `GesturedeckMedia`

```swift
let gesturedeckMedia = GesturedeckMedia()
```

or initialize `GesturedeckMedia` with `GesturedeckMediaOverlay` and actions:

```swift
let gesturedeckMedia = GesturedeckMedia(
Expand All @@ -158,6 +166,25 @@ Please note that you need to replace `YOUR_TOP_ICON`, `YOUR_ICON_TAP`, `YOUR_ICO

For detailed API reference, visit [GesturedeckMedia API Reference](https://navideck.github.io/Gesturedeck-iOS/documentation/gesturedeckios/gesturedeckmedia/).

## Objective-C
Gesturedeck is fully compatible with `Objective-C`. When using `Objective-C` you can instantiate Gesturedeck or GesturedeckMedia using:

```objective-c
@import GesturedeckiOS;
```

and

```objective-c
Gesturedeck *gesturedeck = [[Gesturedeck alloc] init];
```

or

```objective-c
GesturedeckMedia *gesturedeckMedia = [[GesturedeckMedia alloc] init];
```

## Free to Use
Gesturedeck SDK is free to use, providing you with the full functionality of the SDK without any time limitations. You are welcome to integrate it into both personal and commercial projects. When using Gesturedeck SDK for free, a watermark will be presented during runtime. It is strictly prohibited to hide, remove, or alter in any way the watermark from the free version of Gesturedeck SDK.

Expand Down

0 comments on commit c0200fb

Please sign in to comment.