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 progres. 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’s titleLabelpreferredMaxLayoutWidth
and the button’sisPreservingPreferredMaxLayoutWidth
to set the button’s width. Note Developer should changepreferredMaxLayoutWidth
depenedent 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")
}
-
A
FUISingleActionProgressIndicator
used to display progress. Toggle between the states by changing theactionAccessoryType
.Declaration
Swift
lazy public private(set) var progressView: FUISingleActionProgressIndicator { get set }
-
A
FUISingleActionButton
used to display progress. Toggle between the states by changing theactionAccessoryType
. Use the button’s titleLabelpreferredMaxLayoutWidth
and the button’sisPreservingPreferredMaxLayoutWidth
to set the button’s width. Note Developer should changepreferredMaxLayoutWidth
dependent on the accessibility text size.Design Language specifications:
- The 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.
Declaration
Swift
lazy public private(set) var button: FUISingleActionButton { get set }
-
A
FUITableViewCellActionAccessoryType
type used to display the button or the different states of theprogressView
. Changing theactionAccessoryType
drives which view is active and visible.Declaration
Swift
public var actionAccessoryType: FUITableViewCellActionAccessoryType { get set }