Posts

Post not yet marked as solved
10 Replies
Same error. Xcode Version 14.0 (14A309), Apple M1 iMac (24-inch, M1, 2021) with macOS 12.6 (21G115). Feedback FB11598250 filed, including code, screenshots, and diagnostics. Preview did work at one time, but now it's this: RemoteHumanReadableError: Failed to launch widget extension ================================== |  RemoteHumanReadableError |   |  NSError: Error Domain=CHSErrorDomain Code=1300 "(null)" ================================== |  MessageSendFailure: Message send failure for <ServiceMessage 151: relaunch>
Post not yet marked as solved
157 Replies
You'll want to make sure you're using a port that supports an external display. On the m1 iMacs, for example, there are 4 USB-C ports, but only two are marked for display, and the other two do not work for an external monitor.
Post marked as solved
4 Replies
I'm getting this error relative to PlaygroundSupport: Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.5 compiler I've brought the compiler in from Swift.org, and set it as the toolchain in Xcode. Any ideas how I can upgrade the module / what I've forgotten to do?
Post not yet marked as solved
4 Replies
Apologies for the lack of formatting. I expected leading spaces would do it.
Post marked as solved
6 Replies
So I've done this (killall prefds as well as explicitly killing the cfprefsd root and user process). I'm working with an iOS app I've ported to mac via catalyst, and I cannot get rid of the messages.2020-01-07 16:56:48.238531-0800 NetProbe[68038:5897039] [User Defaults] Couldn't write values for keys ( ApplicationAccessibilityEnabled ) in CFPrefsPlistSource&lt;0x600002c13b00&gt; (Domain: com.apI get the message for each preference read or write. The app is sandboxed, but has read/write access for both user selected file and downloads folder. What do I need to do?
Post not yet marked as solved
2 Replies
This works: GeometryReader {container in VStack { Text("Swift") .frame(width: container.size.width) .background(Color.green) Text("UI") .frame(width: container.size.width) .background(Color.red) } }You have to have the .frame lines before the background ones.
Post marked as solved
9 Replies
Exactly parallels what I see. When you say incorrect use of @Binding, what do you mean? (In my case, the trigger to disaster involves a @State fed into another view, so there may be similarities).
Post marked as solved
9 Replies
I'm building a form with a button that brings up a modal sheet. I found that if I modify one of the form's @State variables in the dismiss closure of the .sheet, SourceKitService goes nuts. Specifically, it consumes memory without limit - I've seen over 90 GB in activity monitor - and does not terminate once it's in that state even if Xcode will. I've also seen a few zombies named swift hang around. I don't think (in my case) that the issue is complexity of the form, as it's divided into sections and no section has more than 4 elements; no element has more than three views in it. I can print the content of the var in the dismiss closure and all is copacetic, but even something as benign as thatvar = [] leads to disaster.My guess is that the type system is stuck in a loop, but all I really know is that by starting to comment things out I finally isolated the chunk that triggers the problem. Watching for processes running away with memory usage in activity monitor was the best tool I had to know if I was on the path to success or not.I filed feedback demonstrating the problem. If you can isolate the trigger, you might want to do so too. Maybe just in any case file one.
Post not yet marked as solved
1 Replies
I can offer this expanding on what you ask.When using the EditButton(), I don't see how the tutorial intends for the ProfileSummary to ever be dismissed, nor for how the updated (or not) profile be incorporated into the running app. Some significant linkage seems missing from the architecture of the tutorial.So, rather than the EditButton and the corresponding HStack, I'm trying using a NavigationView, but I can't get it right on passing back the changed / unmodified values. I'm not using a view that displays the existing values and offers an Edit button; instead I'm planning on the usual Cancel/Done setup and only an editor view.I have this code:struct SettingsHost: View { @ObservedObject var truth: Truth @Binding var showingSettings: Bool @State var savedSettings = SettingsValues() @State var draftSettings = SettingsValues() func performCancel() { self.draftSettings = self.savedSettings self.truth.settings = AppSettings(settings: self.savedSettings) self.$showingSettings.value.toggle() } func performDone() { self.savedSettings = self.draftSettings self.truth.settings = AppSettings(settings: self.draftSettings) self.$showingSettings.value.toggle() } var body: some View { return NavigationView { SettingsEditor(settings: $draftSettings) .font(.caption) .navigationBarTitle(Text("Settings")) .navigationBarItems(leading: Button(action: performCancel, label: {Text("Cancel")}), trailing: Button(action: performDone, label: {Text("Done")})) } .padding() } }In there, SettingsValues is a struct that mirrors the vars in AppSettings (a class); AppSettings persists itself to the UserDefaults.The SettingsHost views and disappears as I expect (there's a.sheet(isPresented: $showingSettings, onDismiss: {self.$showingSettings.value = false})attached to a surrounding NavigationView; a button in there turns on showingSettings.What I can't make work is whether the edited SettingsValues or the unmodified ones are present when showingSettings gets turned off. Specifically, whether I hit Done or Cancel, the modified values are what come up the next time I open SettingsHost -- the Cancel button doesn't work.
Post marked as solved
13 Replies
I have the same concern, having duly crammed parameter passes everywhere.Moreover, at one time this all worked well using BindableObject on the class and @ObjectBinding on the objective truth objects. When beta 5 arrived, I converted to ObservableObject, Identifiable and @ObservedObject. Having done that, the views no longer update. I've verified the external events happen, the objective truth variable changes, and the willChange.send() fires, but the views remain unsullied by any updates.My other two big gripes are (1) live views are missing, and (2) I can discover no apparent SwiftUI way to respond to orientation changes.