From c0200fb47cad3b22d017af68f6ac11b57b8634be Mon Sep 17 00:00:00 2001 From: Foti Dim Date: Sun, 6 Aug 2023 21:38:15 +0300 Subject: [PATCH] Update readme --- README.md | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0b43496..157630a 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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( @@ -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.