---
title: "init(_:action:)"
framework: corelocationui
role: symbol
role_heading: Initializer
path: "corelocationui/locationbutton/init(_:action:)"
---

# init(_:action:)

Creates a location button with the specified title and action.

## Declaration

```swift
nonisolated init(_ title: LocationButton.Title? = .currentLocation, action: @escaping () -> Void)
```

## Parameters

- `title`: The text that the button displays. For possible values, see doc://com.apple.CoreLocationUI/documentation/CoreLocationUI/LocationButton/Title.
- `action`: The action that initiates every time the user taps the button.

## See Also

### Creating a location button

- [LocationButton.Title](corelocationui/locationbutton/title.md)
