🎶 PowerMode in iOS!
| Spark action | Shake action | | :----------: | :----------: | | !SparkAction_UITextField | !ShakeAction_UITextField | | !SparkAction_UITextView | !ShakeAction_UITextView |
Requirements
PowerMode requires Swift 6.0 and iOS 13.0+. It supports Swift Package Manager and CocoaPods.
Usage
ImportPowerMode, then use PowerModeTextView or PowerModeTextField. Done!
import PowerMode
let textView = PowerModeTextView(frame: .zero, textContainer: nil)
let textField = PowerModeTextField(frame: .zero)
Use pmTextViewDelegate or pmTextFieldDelegate for delegate.
textView.pmTextViewDelegate = self
textField.pmTextFieldDelegate = self
You can also configure the properties listed below on PowerMode.
PowerMode.sparkColors = [.systemPink, .systemBlue]
PowerMode.isSparkActionEnabled = true
PowerMode.isShakeActionEnabled = true
PowerMode.shakeTranslationX = 0
PowerMode.shakeTranslationY = 2
Spark action Property
| Property | Type | Default |
| -------- | ---- | ------- |
| PowerMode.isSparkActionEnabled | Bool | true |
| PowerMode.sparkColors | [UIColor] | [UIColor.black] |
Shake action Property
| Property | Type | Default | | -------- | ---- | ------- | |PowerMode.isShakeActionEnabled | Bool | true |
| PowerMode.shakeTranslationX | CGFloat | 0 |
| PowerMode.shakeTranslationY | CGFloat | 2 |
Installation
Swift Package Manager
In Xcode, choose File ▸ Add Package Dependencies… and enter:
https://github.com/younatics/PowerMode.git
Or add it to your Package.swift:
dependencies: [
.package(url: "https://github.com/younatics/PowerMode.git", from: "1.0.0")
]
CocoaPods
pod 'PowerMode', '~> 1.0.0'