✨ Super easy Parallax and Haptic Effect.

Overview

IParallaxAndHapticEffectMain

IParallaxAndHapticEffect

Super easy Parallax and Haptic Effect.
This library helps you easily use the 'Parallax' and 'Haptic' effects.
Customized 3D parallax and haptic effects are provided(High-performance interactive UX/UI).

Version License: MIT Platform Swift 5.0 iOS 13.0+


Table of contents


🚀 How to use IParallax

First of all, you will need to import the IParallaxAndHapticEffect module.

import IParallaxAndHapticEffect

After that, it is necessary to think about which effect to use, the Parallax effect or the Haptic effect.
Each use is very easy.
First, let's look at 3 cases of using the parallax effect. Then think about how to use it for UI/UX later.


The parallax effect can be applied to all objects inherited by 'UIView'.

UIView, UIImageView, UIButton, UIProgressView, UISlider, UISwitch, UIStepper, UITextField, UILabel, UITextView, UITableView, UICollectionView, PickerView, Etc

🪄 Adding imagination can create magical effects.




Examples
IParallaxAndHapticEffect_Example1
IParallaxAndHapticEffect_Example2
IParallaxAndHapticEffect_Example3

1. 📍 IParallaxEffect : One line is everything.

IParallaxEffect, that's all.
This function generates a 'customized parallax effect' on the 'UIView' object. View objects can be added using the array sequence parameter. The power can be adjusted using the power parameter.

IParallaxEffect.shared().setParallax(view: ['1'], axis: ['2'], power: '3')

Parameter '1' view: Your view that wants to apply the effect.

Parameter '2'

axis
.horizontal
.vertical
.multi

Parameter '3'

You can enter the intensity you want to use. (1 ~ 1000)
Here's the recommended intensity!

Power -
30 very slow
60 slow
90 medium
120 fast
150 very fast
180~ SpaceX



🚀 How to use IHapticEffect

First of all, you will need to import the IParallaxAndHapticEffect module.

import IParallaxAndHapticEffect

IHapticEffect basically provides all nine forms of system vibration.
Additionally, try other excellent vibration functions.

1. 📍 IHapticEffect

IHapticEffect, that's all.
Create a vibration with a simple line.
This function generates haptic events of 9 types.

IHapticEffect.shared().setHaptic(type: '1')

Parameter '1'

Haptic Type
.light
.medium
.heavy
.soft
.rigid
.selection
.warring
.success
.error

2. 📍 Dynamic Haptic

2-1. Repeat Haptic

This function generates repetitive haptic events.
The number of iterations can be adjusted using the count parameter('2').

IHapticEffect.shared().setRepeatHaptic(type: '1', count: '2')

2-2. Delay Haptic

This function generates a delayed haptic event.
The delay time can be adjusted using the delay time parameter('2').

IHapticEffect.shared().setDelayHaptic(type: '1', delayTime: '2')

2-3. Custom Haptic

This function generates a customized haptic event.
The power can be adjusted using the power parameter between 0 and 1 (CGFloat: '1').

IHapticEffect.shared().setCustomHaptic(power: '1')

2-4. Presents with Haptic 1

Presents a view controller modally with Normal Haptic (9 types).

present(ViewController, animated: Bool, hapticType: '1', completion: '2')

2-5. Presents with Haptic 2

Presents a view controller modally with Delayed Haptic (9 types).

present(ViewController, animated: Bool, hapticType: '1', delayTime: '2', completion: '3')

2-6. Presents with Haptic 3

Presents a view controller modally with Repeated Haptic (9 types).

present(ViewController, animated: Bool, hapticType: '1', count: '2', completion: '3')

Presents with Haptic(Example)

Alert

let alertVC = UIAlertController(title: "Notice", message: "IParallaxAndHapticEffect", preferredStyle: .alert)
let okAction = UIAlertAction(title: "Ok", style: .default, handler: nil)
alertVC.addAction(okAction)
present(alertVC, animated: true, hapticType: .heavy, count: 2, completion: nil)

Present

guard let vc = self.storyboard?.instantiateViewController(withIdentifier: VC2.identifier) as? VC2 else { return }
present(vc, animated: true, hapticType: .soft)

🛠 Installation

Cocoapods

IParallaxAndHapticEffect is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'IParallaxAndHapticEffect'

Swift Package Manager

Project settings > Package Dependencies > '+' Button > GitHub URL > Add Package
Alternatively, File > Add Packages > Add Package Dependencies.

https://github.com/Omilr/IParallaxAndHapticEffect.git

⚠️ Important

The Parallax & Haptic effect does not work in the simulator.
Therefore, it is recommended to test on a real device.

Contributing

Contributions are always welcome 🎉

Author

Omilr, [email protected]

License

IParallaxAndHapticEffect is available under the MIT license. See the LICENSE file for more info.

You might also like...
🧰 MacOS menubar for easy copy gitmoji

gitmojiBar Introdution 🔍 🧰 MacOS status bar for easy copy gitmoji emoticons, Written in Swift 5.0 Preview 👀 gitmojibar.mov AppStore Requirements gi

🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller  transitions and presentations with the focus on a simple and yet flexible API.
🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.

Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexibl

TTGSnackbar shows simple message and action button on the bottom or top of the screen with multi kinds of animation, which is written in Swift3 and inspired by Snackbar in Android. It also support showing custom view, icon image or multi action button. (Experimental libraries) Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI.
(Experimental libraries) Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI.

UIPresentCoordinator Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI. This library manages items that are

Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date...

Alerts & Pickers Advanced usage of native UIAlertController with TextField, TextView, DatePicker, PickerView, TableView, CollectionView and MapView. F

Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift

CDAlertView is highly customizable alert popup written in Swift. Usage is similar to UIAlertController. Screenshots Animations Usage Basic usage witho

PMAlertController is a great and customizable alert that can substitute UIAlertController
PMAlertController is a great and customizable alert that can substitute UIAlertController

PMAlertController is a small library that allows you to substitute Apple's uncustomizable UIAlertController, with a beautiful and totally customizable

Toasts and popups library written with SwiftUI
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

Releases(0.6.1)
Owner
Hae Chan
Hae Chan
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot

Notice: TSMessages is no longer being maintained/updated. We recommend everyone migrate to RMessage. This repository will be kept as is for those who

Felix Krause 4.9k Dec 31, 2022
[iOS] Easy, customizable notifications displayed on top of the statusbar. With progress and activity. iPhone X ready.

JDStatusBarNotification Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an act

M Emrich 3.8k Dec 27, 2022
Easy Swift UIAlertController

EZAlertController Easy Swift UIAlertController One line setup for all UIAlertControllers Button action with closures instead of selectors Easily custo

Kan Yilmaz 366 Sep 14, 2022
🍞 Loaf is a Swifty Framework for Easy iOS Toasts

Loaf ?? Inspired by Android's Toast, Loaf is a Swifty Framework for Easy iOS Toasts Usage From any view controller, a Loaf can be presented by calling

Mat Schmid 995 Dec 28, 2022
BottomSheet makes it easy to take advantage of the new UISheetPresentationController in SwiftUI with a simple .bottomSheet modifier on existing views.

BottomSheet makes it easy to take advantage of the new UISheetPresentationController in SwiftUI with a simple .bottomSheet modifier on existing views.

Adam Foot 341 Dec 15, 2022
BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.

BottomSheet About BottomSheet BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps. The result can look like this...or completel

Daniel Saidi 174 Jan 2, 2023
A Swift package for iOS/tvOS for easy alert presentation

AlertPresenter Listed on the Swift Package Index and originally posted on my blog. It can be fiddly to handle the presentation of alerts on a specific

Chris Mash 14 Jul 1, 2022
An easy to use UIAlertController builder for swift

LKAlertController An easy to use UIAlertController builder for swift Features Short and simple syntax for creating both Alerts and ActionSheets from U

Lightning Kite 97 Feb 8, 2022
🧰 MacOS menubar for easy copy gitmoji

gitmojiBar Introdution ?? ?? MacOS status bar for easy copy gitmoji emoticons, Written in Swift 5.0 Preview ?? Requirements gitmoji-bar written in Swi

Fernando 17 Sep 8, 2022
Ipraktikum-swift-solutions - The solutions of the easy entrance swift quiz for the IPraktikum

ipraktikum-swift-solutions The solutions of the easy entrance swift quiz for the

Eugenio Berretta 0 Feb 13, 2022