UserLocationButton
open class UserLocationButton : FUIMapToolbarButton, UIGestureRecognizerDelegate
FUIMapToolbarUserLocationButton
is a subclass of FUIMapToolbarButton
. This button centers on the user’s location for a given map with region
Example Initialization and Configuration:
let toolbar = FUIMapToolbar(mapView: mapView)
let locationButton = FUIMapToolbarUserLocationButton(mapView: self.mapView)
toolbar.items = [locationButton]
-
The map view which zoom extent button is attached to.
Declaration
Swift
public weak var mapView: UIView? { get set }
-
A convenience inititalizer that instantiates the
FUIMapToolbarUserLocationButton
with a frame of zero and sets the mapView and region to find the user’s location.Declaration
Swift
public convenience init(mapView: UIView, region: MKCoordinateRegion? = nil)
Parameters
mapView
The
MKMapView
used to center on user locationregion
The
MKCoordinateRegion
that shows the latitude and longitude delta of user’s location -
This method allows the
didPan
gesture to be recognized alongside the default gesture recognizers onMKMapView
Declaration
Swift
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool