xcode12

Xcode warning: Immutable property will not be decoded because it is declared with an initial value which cannot be overwritten

╄→尐↘猪︶ㄣ 提交于 2020-12-08 05:26:05
问题 Running Xcode 12, my Swift 5 Xcode project now has warnings whenever a Decodable or Codable type declares a let constant with an initial value. struct ExampleItem: Decodable { let number: Int = 42 // warning } Immutable property will not be decoded because it is declared with an initial value which cannot be overwritten Xcode suggests changing the let to a var : Fix: Make the property mutable instead var number: Int = 42 It also suggests the fix: Fix: Set the initial value via the initializer

Xcode shows “The document had 4 issues that were found and repaired./Multiple resources have the same name: groupTableViewBackgroundColor.” alert

泪湿孤枕 提交于 2020-12-05 10:29:05
问题 If I open one of the storyboards in my Xcode project, I get this alert: The document [storyboard name] had 4 issues that were found and repaired. This may be due to an SCM operation such as merging. Please save the document to fix the issues. Multiple resources have the same name: groupTableViewBackgroundColor. I tried saving the document, but the error kept popping up. What is this and how can I fix this? 回答1: This error looks like to be an Xcode bug, as I cannot recall having merge issues

Selected list row's background remains grey (selected) after navigating back in List (SwiftUI). iOS14 + Xcode12

陌路散爱 提交于 2020-11-30 07:42:30
问题 The selected row remains grey after navigating back from the detail view. Happening both on simulator and real device, only on iOS 14. Does anyone know how to remove it so it behaves the same as on iOS 13 (doesn't remain selected)? This is the only code in the project. (No other navigation's or anything). let items = ["item1", "item2"] struct ContentView: View { var body: some View { NavigationView { VStack { Text("Hello") List(items, id: \.self) { item in NavigationLink(destination: Text

Selected list row's background remains grey (selected) after navigating back in List (SwiftUI). iOS14 + Xcode12

旧时模样 提交于 2020-11-30 07:36:47
问题 The selected row remains grey after navigating back from the detail view. Happening both on simulator and real device, only on iOS 14. Does anyone know how to remove it so it behaves the same as on iOS 13 (doesn't remain selected)? This is the only code in the project. (No other navigation's or anything). let items = ["item1", "item2"] struct ContentView: View { var body: some View { NavigationView { VStack { Text("Hello") List(items, id: \.self) { item in NavigationLink(destination: Text

Selected list row's background remains grey (selected) after navigating back in List (SwiftUI). iOS14 + Xcode12

十年热恋 提交于 2020-11-30 07:35:52
问题 The selected row remains grey after navigating back from the detail view. Happening both on simulator and real device, only on iOS 14. Does anyone know how to remove it so it behaves the same as on iOS 13 (doesn't remain selected)? This is the only code in the project. (No other navigation's or anything). let items = ["item1", "item2"] struct ContentView: View { var body: some View { NavigationView { VStack { Text("Hello") List(items, id: \.self) { item in NavigationLink(destination: Text

SwiftUI | Get current scroll position from ScrollView

有些话、适合烂在心里 提交于 2020-11-27 01:55:53
问题 With the new ScrolLViewReader , it seems possible to set the scroll offset programmatically. But I was wondering if it is also possible to get the current scroll position? It seems like the ScrollViewProxy only comes with the scrollTo method, allowing us to set the offset. Thanks! 回答1: It was possible to read it and before. Here is a solution based on view preferences. struct DemoScrollViewOffsetView: View { @State private var offset = CGFloat.zero var body: some View { ScrollView { VStack {

SwiftUI | Get current scroll position from ScrollView

ぃ、小莉子 提交于 2020-11-27 01:55:39
问题 With the new ScrolLViewReader , it seems possible to set the scroll offset programmatically. But I was wondering if it is also possible to get the current scroll position? It seems like the ScrollViewProxy only comes with the scrollTo method, allowing us to set the offset. Thanks! 回答1: It was possible to read it and before. Here is a solution based on view preferences. struct DemoScrollViewOffsetView: View { @State private var offset = CGFloat.zero var body: some View { ScrollView { VStack {

iPhone is not available. Please reconnect the device. / iOS 14.2 - Xcode 12.1

南笙酒味 提交于 2020-11-24 15:40:57
问题 I just updated my iPhone to iOS 14.2. When I want to launch an app on the device from Xcode, I now keep seing this: I also just updated Xcode to Version 12.1, hoping it would solve the problem, but it doesn't make any difference, I keep getting the same message. Obviously I tried disconnecting and reconnecting the device, but to no avail. I also removed all the data under ~/Library/Developer/Xcode/DerivedData/, but again with no effect. It seems like some other people have had this issue

iPhone is not available. Please reconnect the device. / iOS 14.2 - Xcode 12.1

走远了吗. 提交于 2020-11-24 15:35:06
问题 I just updated my iPhone to iOS 14.2. When I want to launch an app on the device from Xcode, I now keep seing this: I also just updated Xcode to Version 12.1, hoping it would solve the problem, but it doesn't make any difference, I keep getting the same message. Obviously I tried disconnecting and reconnecting the device, but to no avail. I also removed all the data under ~/Library/Developer/Xcode/DerivedData/, but again with no effect. It seems like some other people have had this issue

XCode 12: 'SessionDelegate' has different definitions in different modules

两盒软妹~` 提交于 2020-11-24 08:34:23
问题 Edit: This problem occurs after XCode 12 Beta5. Xcode doesn't allow different modules to define same names (Probably for public classes & protocols). Alamofire and Kingfisher appears to define SessionDelegate at the same time. I'm still trying to find a solution.. I'm implementing iOS 14 Widgets in our application. I have started working with XCode 12 Beta 2 and everthing was compiling fine. When I have updated XCode to XCode 12 Beta 6 , I faced with following error: 'SessionDelegate' has