| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
Distributed under the MIT License. See LICENSE for more information.
Ilya Mikhailov - @mix_off - mihailoov@gmail.com
Project Link: https://github.com/mroffmix/SwipebleView
| Back | FazBrowse Home | New Git URL |