目录
目录README.md

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

  1. In Xcode, open your project and navigate to FileAdd 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 AsyncButton 🖲️

SwiftUI PhotosPicker 🌇

SwiftUI CachedAsyncImage 🗃️

SwiftUI VerticalTabView 🔝

SwiftUI SharedObject 🍱

关于
59.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号