Single Action Accessory View¶
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
: AFUISingleActionProgressIndicator
used to display progress. Toggle between the states by changing theactionAccessoryType
.button
: AFUISingleActionButton
displayed in theFUISingleActionAccessoryView
. 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'stitleLabel
preferredMaxLayoutWidth
and the button'sisPreservingPreferredMaxLayoutWidth
to set the button's width. Note Developer should changepreferredMaxLayoutWidth
depending on the accessibility text size.actionAccessoryType
: AFUITableViewCellActionAccessoryType
type used to display the button or the different states of theprogressView
. Changing theactionAccessoryType
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")
}
Last update: April 14, 2021