ActionBar SwiftUI - admiral-team/admiralui-ios GitHub Wiki

Struct

A view object for present action bar.


Declaration

public struct ActionBarView: View

Overview

Swipe action can be displayed when an row on a table view swiped. The action can be displayed right and can be displayed with a custom tint color and a system image. You create a ActionBarView by providing an actions and style

There is two available styles for ActionBarView:

Action Bar - Default:

Action Bar - Secondary

Configure a ActionBarView - Default

For configuration ActionBar Default you must create ActionItemBarAction for presenting in Action bar. After you can configure Action bar with passed actions and .default style.

let actions = [
  ActionItemBarAction(
   image: Image(uiImage: Asset.ActionBar.moreOutline.image),
   imageStyle: .accent,
   handler: {}),
  ActionItemBarAction(
   image: Image(uiImage: Asset.ActionBar.arrowDownOutline.image),
   imageStyle: .accent,
   handler: {}),
  ActionItemBarAction(
   image: Image(uiImage:  Asset.ActionBar.union.image),
   imageStyle: .accent,
   handler: {}),
]
ActionBarView(actions: actions, style: .default)

Configure a ActionBarView - Secondary

For configuration ActionBar Secondary you must create ActionItemBarAction for presenting in Action bar. After you can configure Action bar with passed actions and .secondary style.

let actions = [
   ActionItemBarAction(
     image: Image(uiImage: Asset.ActionBar.union.image),
     imageStyle: .success,
     style: .secondary,
     text: "Text",
     handler: {}
   ),
   ActionItemBarAction(
     image: Image(uiImage: Asset.ActionBar.shape.image),
     imageStyle: .attention,
     style: .secondary,
     text: "Text",
     handler: {}
   )
]
ActionBarView(actions: actions, style: .secondary)

Contribution

You can help us to find bugs or ask us to add features.

  • To start issue please use ready-made templates.
  • To make changes to the repository, you need to create a fork of the project, make changes to the code and create a pull request in our project. You can read more about this in the Github documentation.