FUIMapToolbarButton
open class FUIMapToolbarButton : FUIButton
FUIMapToolbarButton
inherits from the FUIButton class and appears within the FUIMapToolbar
.
- Each
FUIMapToolbarButton
has its ownisDarkMode
flag to determine its color attributes. isDarkMode
flag is determined by the color scheme of the button.- Height and width are both set to 44
- Images should be set to 28 by 28 icons. Icons will be centered within the button.
- didSelectHandler can be set to add custom functionality on tap
Usage:
let toolbar = FUIMapToolbar(mapView: self.mapView)
let settingsButton = FUIMapToolbarButton()
settingsButton.isPersistentSelection = true
settingsButton.setImage(FUIIconLibrary.system.information.withRenderingMode(.alwaysTemplate), for: .normal)
settingsButton.didSelectHandler = { [weak self] button in
DispatchQueue.main.async {
let settings = DevMapSettingsViewController()
settings.dismissButton = button
let navController = UINavigationController(rootViewController: settings)
if !(UIDevice.current.userInterfaceIdiom == .phone) {
settings.modalPresentationStyle = .formSheet
navController.modalPresentationStyle = .formSheet
self.present(navController, animated: true, completion: nil)
} else {
navController.modalPresentationStyle = .overFullScreen
let dismissClosure: (() -> Void)? = { [weak self] in
self.dismiss(animated: true, completion: nil)
}
settings.dismissClosure = dismissClosure
self.present(navController, animated: true, completion: nil)
}
}
}
toolbar.items = [settingsButton]
Notes
FUIMapToolbarButton
for custom variantsSee
See provided default variants:FUIMapToolbarSettingsButton
, FUIMapToolbarUserLocationButton
, FUIMapToolbarZoomExtentButton
, and FUIMapToolbarLegendButton
See
SeeFUIMapToolbarSettingsButton
documentation for supplementary DevMapSettingsViewController
class
-
The color scheme of the button
Declaration
Swift
public var colorScheme: FUIBackgroundColorScheme { get set }
-
A convenience initializer for the
FUIMapToolbarButton
. Instantiates with a frame of zero.Declaration
Swift
public convenience init()