Skip to content

Double actions, Queue, Custom cells, TextField row with ID

Compare
Choose a tag to compare
@VladK9 VladK9 released this 04 Nov 14:44
· 4 commits to main since this release
  • Added double action items
.init(item: .ActionCell(selection: .multi(isSelected: true,
                                          selectedIcon: UIImage(systemName: "star.slash"), selectedTitle: "Unstar",
                                          defaultIcon: UIImage(systemName: "star"), defaultTitle: "Star")), 
      action: { action in
    if action.isSelected ?? false {
        print("item Unstar")
    } else {
        print("item Star")
    }
}),
  • Add queue (visual settings taken from initial view)
let header = UIFloatMenuHeaderConfig(title: "Activity", showLine: true)
UIFloatMenu.showNext(actions: style_actions, presentation: .center, header: header)
  • Added custom view cell
.init(item: .CustomCell(view: CustomViewRow(title: "Custom rows", subtitle: "View custom rows", icon: UIImage(systemName: "tablecells")!)), action: { _ in
})
  • Find specific TextField row by identifier
// Setup cell
.init(item: .TextFieldCell(placeholder: "Login", identifier: "Login"))

// Delegate
func UIFloatMenuGetTextFieldData(_ rows: [TextFieldRow]) {
    let login = UIFloatMenuHelper.find(rows, by: "Login")
    let password = UIFloatMenuHelper.find(rows, by: "Password")

    print("Login -", login)
    print("Password -", password)
}
  • Show alert
let alert = UIAlertController(title: "Delete", message: "message", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
UIFloatMenuHelper.showAlert(alert)
  • Fixed action completion after tap