Skip to content

Commit

Permalink
Update 'README.md'
Browse files Browse the repository at this point in the history
  • Loading branch information
changemin committed Dec 31, 2020
1 parent d96c900 commit 431664e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,16 @@ CMPressableButton(action: { YOUR ACTION }) {
// YOUR VIEW
}.accentColor(_ color: color)
.cornerRadius(_ amount: CGFloat)
.frame(height: CGFloat, width: CGFloat)
.frame(width: CGFloat, height: CGFloat)
.enableHaptic(intensity: UIImpactFeedbackGenerator.FeedbackStyle)
.disableHaptic()
```
* `.accentColor()` : Accent color
* `.cornerRadius()` : Corner Radius of the button
* `.frame()` : Size of the button
* `.enableHaptic()` : Enable haptic effect with insensity(`.heavy`, `.medium`, `.light`, `.rigid`, `.soft`)
* `.disableHaptic()` : Disable haptic effect

## Example
#### 👶 Simple
```Swift
Expand All @@ -76,7 +81,7 @@ struct ContentView: View {
<img src="src/Example-simple-2.png" width="25%">
</p>

### 🛠 Custom Modifier
### 🛠 Custom Modifiers
```Swift
import CMPressableButton

Expand All @@ -87,6 +92,7 @@ struct ContentView: View {
}) {
Text("PUSH ME !").foregroundColor(.white)
}
.enableHaptic(.soft)
.accentColor(.orange)
.cornerRadius(0)
}
Expand All @@ -101,7 +107,7 @@ struct ContentView: View {

## ✅ TODO
- [ ] support variable styles `FlatStyle`, `PushButtonStyle`, etc
- [ ] add haptic feedback
- [x] add haptic feedback

## 📜 License

Expand Down

0 comments on commit 431664e

Please sign in to comment.