Check package repo »
Report Bug
·
Request Feature
Simple "editActionsForRowAt" functionality, written on SWIFTUI Can be applied without list to every view.
var leftActions = [
Action(title: "Note", iconName: "pencil", bgColor: .note, action: {}),
Action(title: "Edit doc", iconName: "doc.text", bgColor: .edit, action: {}),
Action(title: "New doc", iconName: "doc.text.fill", bgColor: .done, action: {}),
]
SwipeableView(content: {
Text("Swipe to see actions")
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.gray)
},
leftActions: Example.leftActions,
rightActions: Example.rightActions,
rounded: false) // there are two styles
.frame(height: 90)
Create object of SwManager
var container = SwManager()
Create arrays with actions:
var leftActions = [
Action(title: "Note", iconName: "pencil", bgColor: .note, action: {}),
Action(title: "Edit doc", iconName: "doc.text", bgColor: .edit, action: {}),
Action(title: "New doc", iconName: "doc.text.fill", bgColor: .done, action: {}),
]
static var rightActions = [
Action(title: "Delete", iconName: "trash", bgColor: .delete, action: {})
]
SwipeableView usage:
SwipeableView(content: {
// Your view content here
},
leftActions: Example.leftActions,
rightActions: Example.rightActions,
rounded: false)
.frame(height: 90)
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Ilya Mikhailov - @mix_off - [email protected]
Project Link: https://github.com/mroffmix/SwipebleView