Post

Replies

Boosts

Views

Activity

Reply to SwiftData: Unable to delete (Xcode 16)
Here's the entire code: import SwiftData struct ChatHistory: View { @Environment(\.modelContext) var modelContext // Sort SwiftData list by DATE: @Query(sort: \SwiftDatabase.date, order: .reverse, animation: .spring) private var chatLog: [SwiftDatabase] @Environment(\.dismiss) var dismiss @State private var actTxt: String = "" @State private var btnDel = false var body: some View { PullDownToDismiss() NavigationStack { List { ForEach(chatLog) { show in HStack { // Show Date of Chat: Text("\(show.date.formatted(date: .numeric, time: .omitted))") .foregroundStyle(Color.init(uiColor: .secondaryLabel)) .font(.system(size: 18, weight: .regular)) Text("\(show.actTxt ?? "----")") .foregroundStyle(Color.init(uiColor: .label)) .font(.system(size: 22, weight: .bold)) .navigationTitle("Chat Log") .navigationBarTitleDisplayMode(.inline) .swipeActions(allowsFullSwipe: true) { Button("Delete", systemImage: "trash", role: .destructive) { } } } }.onDelete(perform: deleteLog) } } } public func deleteLog(_ indexSet: IndexSet) { for index in indexSet { let chat = chatLog[index] modelContext.delete(chat) // do { // try modelContext.save() // // } catch { // // print("Error saving: \(error)") // // } } } }
Jun ’24
Reply to SwiftUI: Extra line in NavigationStack
The 2 NavigationTitles are for the listView and then the DetaiView. The data.name is coming from an array thats in another Swift file. Its where the information is coming from. I did not know about pasting code with the Paste and Match style. I'll remember that for the next time. Here's a screen shot of the previous screen before the original one. Thanks.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22
Reply to App Store description for iCloud
It was my understanding that we weren't allowed to mention any Apple Copyrighted services in our app descriptions (I got reminded of that a few years ago).
Replies
Boosts
Views
Activity
2w
Reply to Using Previews causes a system crash on Xcode 26 Beta 4 and MacOS 26 Beta 4
Glad to see I'm not the only one with this problem.
Replies
Boosts
Views
Activity
Jul ’25
Reply to Xcode 26 Beta 4 crashes on closing of project
Yes, I do too. The only way I can exit Xcode is by doing a killall Xcode in the Terminal. Dan Uff
Replies
Boosts
Views
Activity
Jul ’25
Reply to WeatherKit suddenly returning JWT errors - no changes
All seems to be fine here - Pennsylvania, USA.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Xcode 16 and installing IOS apps
Thanks for your response. It’s with different apps. The update completes to 100%. I just never had this message so many times before. Thanks.
Replies
Boosts
Views
Activity
Jan ’25
Reply to LaunchScreen not working in Xcode 16 RC
That's what I ended up doing. Thanks for the response.
Replies
Boosts
Views
Activity
Dec ’24
Reply to SwiftData: Unable to delete (Xcode 16)
Glad to see I'm not the only one. Thank you!
Replies
Boosts
Views
Activity
Jun ’24
Reply to SwiftData: Unable to delete (Xcode 16)
Here's the entire code: import SwiftData struct ChatHistory: View { @Environment(\.modelContext) var modelContext // Sort SwiftData list by DATE: @Query(sort: \SwiftDatabase.date, order: .reverse, animation: .spring) private var chatLog: [SwiftDatabase] @Environment(\.dismiss) var dismiss @State private var actTxt: String = "" @State private var btnDel = false var body: some View { PullDownToDismiss() NavigationStack { List { ForEach(chatLog) { show in HStack { // Show Date of Chat: Text("\(show.date.formatted(date: .numeric, time: .omitted))") .foregroundStyle(Color.init(uiColor: .secondaryLabel)) .font(.system(size: 18, weight: .regular)) Text("\(show.actTxt ?? "----")") .foregroundStyle(Color.init(uiColor: .label)) .font(.system(size: 22, weight: .bold)) .navigationTitle("Chat Log") .navigationBarTitleDisplayMode(.inline) .swipeActions(allowsFullSwipe: true) { Button("Delete", systemImage: "trash", role: .destructive) { } } } }.onDelete(perform: deleteLog) } } } public func deleteLog(_ indexSet: IndexSet) { for index in indexSet { let chat = chatLog[index] modelContext.delete(chat) // do { // try modelContext.save() // // } catch { // // print("Error saving: \(error)") // // } } } }
Replies
Boosts
Views
Activity
Jun ’24
Reply to List with Sections output weird results?
Sorry, here it is:
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to SwiftUI: Extra line in NavigationStack
The 2 NavigationTitles are for the listView and then the DetaiView. The data.name is coming from an array thats in another Swift file. Its where the information is coming from. I did not know about pasting code with the Paste and Match style. I'll remember that for the next time. Here's a screen shot of the previous screen before the original one. Thanks.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Unable to delete devices from my account
You can only do that once a year after your membership renews. Dan Uff
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcodes files gone missing
Try this: Close Xcode. Reboot the Mac. Reload Xcode. Reload project. BUT before trying to run it, clear project files. If it still shows red files, look for those files manually in the Finder or recreate them. Dan Uff
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to New to Swift. Need help mapping class files to JSON
Logon to YouTube. There are plenty of videos on the correct way to do JSON in Swift. [https://www.youtube.com/results?search_query=json+and+swift)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Having trouble with first time Mac App's Quit Function
I've figured it out. Thanks.
Replies
Boosts
Views
Activity
Aug ’22
Reply to Apple WeatherKit Attribution Question
How I read the WeatherKit docs., the  Weather Logo must come from the attribution URL, and be on the main view controller period. No other way to do it. But I am even having problems getting that far. Dan Uff
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’22