ActionCellView - admiral-team/admiralui-ios GitHub Wiki

Class

A view object for present action bar.


Declaration

public class ActionCellView<T>: UIView, AnyAppThemable, UIGestureRecognizerDelegate where T: ListViewCell

Overview

The container to display ActionBar and ListCell.

By default ActionBar is hidden. It is appears by swiping view to the left edge and disappear when swipe to the right edge.

There is two available styles for ActionCellView:

  • default
  • secondary

Live example

Configure a ActionCellView default

/// Create an actions
let actions = [ActionItemBarAction(
    image: Asset.ActionBar.arrowUpOutline.image,
    imageStyle: .primary,
    style: .default,
    handler: {}
),
ActionItemBarAction(
    image: Asset.ActionBar.moreOutline.image,
    imageStyle: .accent,
    style: .default,
    handler: {}
)]

/// Create the ListCell 
let titleListView = TitleLargeSubtitleListView()
titleListView.title = "title"
titleListView.subtitle = "subtitle"
let cardListView = ImageCardListView()
cardListView.cardImage = UIImage()

let swipeView = SubtitleWithImageListView()
swipeView.subtitle = "subtitle"
swipeView.image = UIImage()

let listCell = ListCell(
   leadingView: cardListView,
   centerView: titleListView,
   tralingView: swipeView
)

/// Create an ActionCellView
let actionCellView = ActionCellView(cellView: listCell, style: .default)

Configure a ActionCellView secondary

/// Create an actions
let actions = [ActionItemBarAction(
    image: Asset.ActionBar.arrowUpOutline.image,
    imageStyle: .primary,
    style: .secondary,
    handler: {}
),
ActionItemBarAction(
    image: Asset.ActionBar.moreOutline.image,
    imageStyle: .accent,
    style: .secondary,
    handler: {}
)]

/// Create the ListCell 
let titleListView = TitleLargeSubtitleListView()
titleListView.title = "title"
titleListView.subtitle = "subtitle"
let cardListView = ImageCardListView()
cardListView.cardImage = UIImage()

let swipeView = SubtitleWithImageListView()
swipeView.subtitle = "subtitle"
swipeView.image = UIImage()

let listCell = ListCell(
   leadingView: cardListView,
   centerView: titleListView,
   tralingView: swipeView
)

/// Create an ActionCellView
let actionCellView = ActionCellView(cellView: listCell, style: .default)

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.