UnbluUiButton

@IBDesignable
@objc
open class UnbluUiButton : UIControl

Button to control the visibility of the unblu UI. While the UI is visible, the superview of this button is overlayed with a semi transparent overlay. When the overlay or the button is pressed, the UI will close again.

If there are new messages and the ui is not displayed, the button displays a badge in its upper right corner with the number of unread messages.

This button is visible as soon as the unblu visitor/agent api is initialized.

The button can be used programmatically or via the interface builder (create a view and set its class to UnbluUiButton).

The button can be placed automatically or absolute. If it is constructed with only a size or empty constructor, it places itself into the lower right corner of its superview.

  • The icon which is displayed to open the unblu ui

    Declaration

    Swift

    @IBInspectable
    open var openUiIcon: UIImage { get set }
  • The icon which is displayed to close the unblu ui

    Declaration

    Swift

    @IBInspectable
    open var closeUiIcon: UIImage { get set }
  • The color of the icon on the button

    Declaration

    Swift

    @IBInspectable
    open var iconColor: UIColor { get set }
  • The color of the button

    Declaration

    Swift

    @IBInspectable
    open var buttonColor: UIColor { get set }
  • This is overriden to prevent setting the background color. Only the buttonColor is accepted

    Declaration

    Swift

    open override var backgroundColor: UIColor? { get set }
  • The color of the overlay which is placed over the superview. If it should be semi transparent, the color needs to define an alpha component

    Declaration

    Swift

    @IBInspectable
    open var overlayColor: UIColor { get set }
  • If the button is placed automatically, this value defines the space between the right border of the superview and the button

    Declaration

    Swift

    @IBInspectable
    open var paddingRight: CGFloat { get set }
  • If the button is placed automatically, this value defines the space between the lower border of the superview and the button

    Declaration

    Swift

    @IBInspectable
    open var paddingBottom: CGFloat { get set }
  • Defines the corner radius of the button. If the value is smaller 0, the radius is set to the half width/height (smaller value is used). Default is -1

    Declaration

    Swift

    @IBInspectable
    open var fixedCornerRadius: CGFloat { get set }
  • Color of the badge for the number of unread messages

    Declaration

    Swift

    @IBInspectable
    open var notificationBadgeColor: UIColor { get set }
  • If true the UI is maximized when the call UI is shown. This means the button is overlayed by the unblu UI for this moment (it does not change the top margin). This setting has no effect if the button is created with a fix frame. Default is true

    Declaration

    Swift

    @IBInspectable
    open var autoMaximizeOnCallUiVisible: Bool { get set }
  • Color of the badge text for the number of unread messages

    Declaration

    Swift

    @IBInspectable
    open var notificationBadgeTextColor: UIColor { get set }
  • Undocumented

    Declaration

    Swift

    open override var isHidden: Bool { get set }
  • The number of messages

    Declaration

    Swift

    public private(set) var unreadMessagesCount: Int { get set }
  • Constructs the button with a default size. It is placed in the lower right corner of its superview with the defined padding.

    Declaration

    Swift

    public convenience init()
  • Constructs the button with the given size. It is placed in the lower right corner of its superview with the defined padding.

    Declaration

    Swift

    public init(size: CGFloat)

    Parameters

    size

    The size of the button

  • Constructor used by storyboard

    Declaration

    Swift

    required public init?(coder aDecoder: NSCoder)
  • Constructs the button with a defined size and position.

    Declaration

    Swift

    public override init(frame: CGRect)

    Parameters

    frame

    The frame into which the button is placed

  • Draws the button into the given rect. It should not be called directly.

    Declaration

    Swift

    override open func draw(_ rect: CGRect)

    Parameters

    rect

    The rectangle into which the ui is drawn

  • Undocumented

    Declaration

    Swift

    deinit
  • Function called by interface builder, when he creates the ui in the editor. Not needed for productive code.

    Declaration

    Swift

    open override func prepareForInterfaceBuilder()