FUISingleActionAccessoryView
@MainActor
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: AFUISingleActionProgressIndicatorused to display progress. Toggle between the states by changing theactionAccessoryType.button: AFUISingleActionButtondisplayed 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’stitleLabelpreferredMaxLayoutWidthand the button’sisPreservingPreferredMaxLayoutWidthto set the button’s width. Note Developer should changepreferredMaxLayoutWidthdepending on the accessibility text size.actionAccessoryType: AFUITableViewCellActionAccessoryTypetype used to display the button or the different states of theprogressView. Changing theactionAccessoryTypedrives 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
FUISingleActionProgressIndicatorused to display progress. Toggle between the states by changing theactionAccessoryType.Declaration
Swift
@MainActor lazy public private(set) var progressView: FUISingleActionProgressIndicator { get set } -
A
FUISingleActionButtonused to display progress. Toggle between the states by changing theactionAccessoryType. Use the button’s titleLabelpreferredMaxLayoutWidthand the button’sisPreservingPreferredMaxLayoutWidthto set the button’s width. Note Developer should changepreferredMaxLayoutWidthdepending 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
@MainActor lazy public private(set) var button: FUISingleActionButton { get set } -
A
FUITableViewCellActionAccessoryTypetype used to display the button or the different states of theprogressView. Changing theactionAccessoryTypedrives which view is active and visible.Declaration
Swift
@MainActor public var actionAccessoryType: FUITableViewCellActionAccessoryType { get set }
-
The size of the view - the size reflects the
boundssize.Declaration
Swift
@MainActor public override var intrinsicContentSize: CGSize { get }