ios14

How do I make a clickable pin in SwiftUI's new Map view?

送分小仙女□ 提交于 2020-08-23 09:50:51
问题 I'm using SwiftUI new Map view to display pins for annotations, and would like the pins, when clicked, to display a view for editing the annotation's name and description. I've tried to use MapAnnotation with a view that contains a button with a pin image. The image displays correctly, but the button doesn't work. Is it possible to do this without falling back to a UIViewRepresentable of MKMapView? import SwiftUI import MapKit struct ContentView: View { @State private var showingEditScreen =

How do I make a clickable pin in SwiftUI's new Map view?

◇◆丶佛笑我妖孽 提交于 2020-08-23 09:49:31
问题 I'm using SwiftUI new Map view to display pins for annotations, and would like the pins, when clicked, to display a view for editing the annotation's name and description. I've tried to use MapAnnotation with a view that contains a button with a pin image. The image displays correctly, but the button doesn't work. Is it possible to do this without falling back to a UIViewRepresentable of MKMapView? import SwiftUI import MapKit struct ContentView: View { @State private var showingEditScreen =

How do I make a clickable pin in SwiftUI's new Map view?

谁说我不能喝 提交于 2020-08-23 09:48:37
问题 I'm using SwiftUI new Map view to display pins for annotations, and would like the pins, when clicked, to display a view for editing the annotation's name and description. I've tried to use MapAnnotation with a view that contains a button with a pin image. The image displays correctly, but the button doesn't work. Is it possible to do this without falling back to a UIViewRepresentable of MKMapView? import SwiftUI import MapKit struct ContentView: View { @State private var showingEditScreen =

iOS WidgetKit - Widget Not Getting updated even when UserDefaults are synchronized

被刻印的时光 ゝ 提交于 2020-08-10 01:13:54
问题 I am using XCode 12 beta 2 (iOS 14 Sim) to pass data from my app to the widget using AppContainer. I am using the below code to save data (here String) to app container. let userDefaults = UserDefaults(suiteName: "group.abc.WidgetDemo") userDefaults?.setValue(status, forKey: "widget") userDefaults?.synchronize() And in the Widget.swift file struct Provider: TimelineProvider { @AppStorage("widget", store: UserDefaults(suiteName: "group.abc.WidgetDemo")) var status: String = String() public

All Image/Fast Image in React Native app not working on iOS 14 beta and Xcode 12 beta

匆匆过客 提交于 2020-07-22 06:08:21
问题 I've upgraded my iPhone device to iOS 14 beta and Xcode 12 beta. Then all Image/Fast Image on my React Native project can not show (which work well on previous iOS 13 and Xcode 11.5). 回答1: This is related to https://github.com/SDWebImage/SDWebImage/issues/3040. Simply update SDWebImage in your Podfile or remove Podfile.lock and re-install. 回答2: This is related to https://github.com/SDWebImage/SDWebImage/issues/3040 You can update SDWebImage in your Podfile or simply remove Podfile.lock and re

How to set relative width in a HStack embedded in a ForEach in SwiftUI?

醉酒当歌 提交于 2020-07-22 05:50:27
问题 I wanted to create a list (without using List view) of attributes. Each attribute is a HStack which contains two texts, name and value. I want the name text to have always 30% of the width of the whole HStack and the value text to use the rest of the horizontal space. The height of each attribute depends on the content. I try to accomplish it by having a following view: struct FatherList: View { let attributes: Attributes init(_ attributes: Attributes) { self.attributes = attributes } var

All Image/Fast Image in React Native app not working on iOS 14 beta and Xcode 12 beta

余生长醉 提交于 2020-07-20 10:14:10
问题 I've upgraded my iPhone device to iOS 14 beta and Xcode 12 beta. Then all Image/Fast Image on my React Native project can not show (which work well on previous iOS 13 and Xcode 11.5). 回答1: This is related to https://github.com/SDWebImage/SDWebImage/issues/3040 You can update SDWebImage in your Podfile or simply remove Podfile.lock and re-install. 回答2: This is related to https://github.com/SDWebImage/SDWebImage/issues/3040. Simply update SDWebImage in your Podfile or remove Podfile.lock and re

How to remove List Separator lines in SwiftUI 2.0 in iOS 14

只谈情不闲聊 提交于 2020-07-18 18:04:23
问题 So the question is pretty simple and it's in the title. I want to remove the line separator in SwiftUI iOS 14. Previously, I was using UITableView().appearance().separatorStyle = .none and that used to do the job in iOS 13. Now however, it doesn't work. Any update or idea on how to make it work. Thanks:) 回答1: Here is a demo of possible solution. Tested with Xcode 12b. List { ForEach(0..<3) { _ in VStack { Text("Hello, World!").padding(.leading) } .frame(maxWidth: .infinity, maxHeight: