SwiftUI MapItemPicker 🗺️
MapItemPicker
is a location picker sheet. Currently supports only iOS and Mac Catalyst.
Usage
MapItemPicker
has similar same API and behavior as other Presentation Modifiers.
import SwiftUI
import MapItemPicker
struct ContentView: View {
@State private var showingPicker = false
var body: some View {
Button("Choose location") {
showingPicker = true
}
.mapItemPicker(isPresented: $showingPicker) { item in
if let name = item?.name {
print("Selected \(name)")
}
}
}
}
Installation
- In Xcode, open your project and navigate to File → Add Packages…
- Paste the repository URL (
https://github.com/lorenzofiamingo/swiftui-map-item-picker
) and click Next.
- Click Finish.
- Add the
NSLocationWhenInUseUsageDescription
key to your app’s Info.plist
Other projects
SwiftUI AsyncButton 🖲️
SwiftUI PhotosPicker 🌇
SwiftUI CachedAsyncImage 🗃️
SwiftUI VerticalTabView 🔝
SwiftUI SharedObject 🍱
SwiftUI MapItemPicker 🗺️
MapItemPicker
is a location picker sheet. Currently supports only iOS and Mac Catalyst.Usage
MapItemPicker
has similar same API and behavior as other Presentation Modifiers.Installation
https://github.com/lorenzofiamingo/swiftui-map-item-picker
) and click Next.NSLocationWhenInUseUsageDescription
key to your app’s Info.plistOther projects
SwiftUI AsyncButton 🖲️
SwiftUI PhotosPicker 🌇
SwiftUI CachedAsyncImage 🗃️
SwiftUI VerticalTabView 🔝
SwiftUI SharedObject 🍱