JJActionItem
@objc
@IBDesignable
open class JJActionItem : UIControl
The item view representing an action.
-
The action that is executed when the item is tapped. Default is
nil
.Declaration
Swift
@objc open var action: ((JJActionItem) -> Void)?
Parameters
item
The action item that has been tapped.
-
Calls the action on the action item.
Declaration
Swift
@objc public func callAction()
-
The color of action item circle view. Default is
UIColor.white
.See also
circleView
Declaration
Swift
@IBInspectable public dynamic var buttonColor: UIColor { get set }
-
The color of action item circle view with highlighted state. Default is
nil
.See also
circleView
Declaration
Swift
@IBInspectable public dynamic var highlightedButtonColor: UIColor? { get set }
-
The image displayed by the item. Default is
nil
.See also
imageView
Declaration
Swift
@IBInspectable public dynamic var buttonImage: UIImage? { get set }
-
The tint color of the image view. By default the color of the floating action button is used.
Warning
Only template images are colored.
See also
Declaration
Swift
@IBInspectable public dynamic var buttonImageColor: UIColor { get set }
-
The title label of the item. Can be configured as needed. Read only.
Declaration
Swift
@objc open fileprivate(set) lazy var titleLabel: UILabel { get set }
-
The image view of the item. Can be configured as needed. Read only.
See also
buttonImage
See also
buttonImageColor
Declaration
Swift
@objc open fileprivate(set) lazy var imageView: UIImageView { get set }
-
The background circle of the item. Can be configured as needed. Read only.
See also
buttonColor
See also
highlightedButtonColor
Declaration
Swift
@objc open fileprivate(set) lazy var circleView: JJCircleView { get set }
-
The position of the title label. Default is
.leading
.Declaration
Swift
@objc public dynamic var titlePosition: JJActionItemTitlePosition { get set }
-
The position of the title label. Default is
-1
. WhentitleSpacing
is negative default spacing is used: Default horizontal spacing is12
. Default vertical spacing is4
.Declaration
Swift
@objc public dynamic var titleSpacing: CGFloat { get set }
-
The size of the image view. Default is
(0, 0)
. When imageSize is.zero
the image is shrunken until it fits completely into the circle view. If it already does the actual size of the image is used.Declaration
Swift
@objc public dynamic var imageSize: CGSize { get set }
-
Returns an object initialized from data in a given unarchiver.
Declaration
Swift
public required init?(coder aDecoder: NSCoder)
Parameters
aDecoder
An unarchiver object.
Return Value
self
, initialized using the data in decoder.
-
Tells the view that its superview changed.
Declaration
Swift
override open func didMoveToSuperview()
-
Updates constraints for the view.
Declaration
Swift
override open func updateConstraints()
-
A Boolean value indicating whether the action item draws a highlight.
Declaration
Swift
override open var isHighlighted: Bool { get set }