FloatingButton

@objc(MBFloatingButton)
open class FloatingButton : Button

A rounded button with an icon that is designed to float above NavigationMapView.

  • The default size of a floating button.

    Declaration

    Swift

    public static let buttonSize: CGSize
  • Return a FloatingButton with given images and size.

    Declaration

    Swift

    public class func rounded<T: FloatingButton>(image: UIImage? = nil,
                                                 selectedImage: UIImage? = nil,
                                                 size: CGSize = FloatingButton.buttonSize,
                                                 type: UIButton.ButtonType = .custom,
                                                 imageEdgeInsets: UIEdgeInsets = .zero,
                                                 cornerRadius: CGFloat = FloatingButton.buttonSize.width / 2.0) -> T

    Parameters

    image

    The UIImage of this button.

    selectedImage

    The UIImage of this button when selected.

    size

    The size of this button, or FloatingButton.buttonSize if this argument is not specified.

    type

    UIButton type. Defaults to .custom.

    cornerRadius

    Corner radius of the button.

    imageEdgeInsets

    Effective drawing rectangle for the button image.

    Return Value

    FloatingButton instance.