Profile
Back to NewsBack
GitHub Trending 2 min
Reader Mode
younatics/PowerMode: 🎶 PowerMode in iOS!

younatics/PowerMode: 🎶 PowerMode in iOS!

10 hours ago

🎶 PowerMode in iOS!

Swift Package Manager</a> CocoaPods</a> !iOS 13.0+ Swift 6.0</a> License: MIT</a>

!Shake_SparkAction_UITextView

| 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

Import PowerMode, 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'

References

Please tell me or make pull request if you use this library in your application :)

Author

younatics Twitter

License

PowerMode is available under the MIT license. See the LICENSE file for more info.
Our Related Projects
Farm Fresh Kikapu

An e-commerce platform for farm-fresh produce - an online st...

View Project
Chat with me