FUISingleActionAccessoryView

public class FUISingleActionAccessoryView : UIView

View component used in FUIObjectTableViewCell. Typically not used directly by developer.

This view appears as the accessoryView to the FUIObjectTableViewCell.

Available:

  • progressView: A FUISingleActionProgressIndicator used to display progres. Toggle between the states by changing the actionAccessoryType.
  • button: A FUISingleActionButton displayed in the FUISingleActionAccessoryView. This button’s width will not exceed 45% of the width of the container. Button height will dynamically resize based on button text. Button text can wrap two lines. Use the button’s titleLabel preferredMaxLayoutWidth and the button’s isPreservingPreferredMaxLayoutWidth to set the button’s width. Note Developer should change preferredMaxLayoutWidth depenedent on the accessibility text size.
  • actionAccessoryType: A FUITableViewCellActionAccessoryType type used to display the button or the different states of the progressView. Changing the actionAccessoryType drives which view is active.

Usage

let singleActionView = FUISingleActionAccessoryView()
singleActionView.actionAccessoryType = .button
singleActionView.button.setTitle("Follow", for: .normal)
singleActionView.button.setTitle("Unfollow", for: .selected)
singleActionView.button.titleLabel?.preferredMaxLayoutWidth = 75
singleActionView.button.isPersistentSelection = true
singleActionView.button.isPreservingPreferredMaxLayoutWidth = true
singleActionView.button.didSelectHandler = { btn in
   print("Button Selected")
}