Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorenzofiamingo/swiftui-map-item-picker
https://github.com/lorenzofiamingo/swiftui-map-item-picker
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lorenzofiamingo/swiftui-map-item-picker
- Owner: lorenzofiamingo
- License: mit
- Created: 2022-02-25T14:42:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T13:06:11.000Z (9 months ago)
- Last Synced: 2024-10-30T17:15:14.435Z (2 months ago)
- Language: Swift
- Size: 18.6 KB
- Stars: 26
- Watchers: 2
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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](https://developer.apple.com/documentation/swiftui/view-presentation).
```swift
import SwiftUI
import MapItemPickerstruct 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
1. In Xcode, open your project and navigate to **File** β **Add Packages...**
2. Paste the repository URL (`https://github.com/lorenzofiamingo/swiftui-map-item-picker`) and click **Next**.
3. Click **Finish**.
4. Add the `NSLocationWhenInUseUsageDescription` key to your app's Info.plist## Other projects
[SwiftUI VariadicViews π₯](https://github.com/lorenzofiamingo/swiftui-variadic-views)
[SwiftUI AsyncButton π²οΈ](https://github.com/lorenzofiamingo/swiftui-async-button)
[SwiftUI PhotosPicker π](https://github.com/lorenzofiamingo/swiftui-photos-picker)
[SwiftUI CachedAsyncImage ποΈ](https://github.com/lorenzofiamingo/swiftui-cached-async-image)
[SwiftUI VerticalTabView π](https://github.com/lorenzofiamingo/swiftui-vertical-tab-view)
[SwiftUI SharedObject π±](https://github.com/lorenzofiamingo/swiftui-shared-object)