Post

Replies

Boosts

Views

Activity

Reply to Swift.DecodingError.dataCorrupted and app crash with "The given data was not valid JSON.", underlyingError: Optional(Error Code=3840 "No value"
could you put this code just after "let finalData...". "if let json = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers), let jsonData = try? JSONSerialization.data(withJSONObject: json, options: .prettyPrinted) { print("\n---> response json: " + String(decoding: jsonData, as: UTF8.self)) } else { print("=========> json data malformed") }" and tell us what it produces.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Toggling Values on EnvironmentValue (EditMode)
you could use this one-liner: editMode = editMode == .active ? .inactive : .active
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to SwiftUI MagnificationGesture broken in iPadOS 15?
this Apple example does not work for me as well on ios15. It works if you use Circle() .frame(width: 100, height: 100, alignment: .center) .scaleEffect(magnifyBy) .gesture(magnification)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to SwiftUI - ForEach in List shows the wrong row in detail with iOS 15 but the right one in iOS 14
you have potentially many "sheet(..)" triggered by just one variable "showDetail". I'm amazed you got anything to work. Re-structure your code to trigger only the relevant sheet, when you press the button. For example, using ".sheet(item:...)"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Suppressing verbose console output - SwiftUI / MacOS Monterey
I'll be really interested in a solution. Getting this verbal diarrhea, is really annoying.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Unable to implement `swipeActions`
swipeActions is available for ios15+ and macos12+ only.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to swipeActions on macOS?
works without any problems for me on macos 12.beta (latest), xcode 13.beta, target macos 12.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to HELP SwiftUi fetch api data
what are those, "********", is this something you don't to show or is it you did not bother looking at the documentation to find out what it should be?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to NavigationButton in SwiftUI
it's called a NavigationLink and it works inside a NavigationView. Look it up on the docs for how to use it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to SwiftUI TextField present integer (Int64) for macOS target
you could even just do this: TextField("Sort Order", text: Binding( get: { (account.sortOrder != nil) ? String(account.sortOrder!) : "" }, set: { account.sortOrder = Int64($0.filter { "0123456789".contains($0) }) }) )
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to SwiftUI TextField present integer (Int64) for macOS target
you could try something like this: TextField("Sort Order", text: Binding( get: { (account.sortOrder != nil) ? String(account.sortOrder!) : "" }, set: { if "0123456789".contains($0), let theInt = Int64($0) { account.sortOrder = theInt } else if $0.isEmpty { account.sortOrder = nil } } ) )
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to SwiftUI TextField present integer (Int64) for macOS target
could not understand how to search for your feedback on the apple site. What is the problem with NumberFormatter in a textField? It seems to work for me.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Swift.DecodingError.dataCorrupted and app crash with "The given data was not valid JSON.", underlyingError: Optional(Error Code=3840 "No value"
could you put this code just after "let finalData...". "if let json = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers), let jsonData = try? JSONSerialization.data(withJSONObject: json, options: .prettyPrinted) { print("\n---> response json: " + String(decoding: jsonData, as: UTF8.self)) } else { print("=========> json data malformed") }" and tell us what it produces.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Initialize app with an Async function | SwiftUI
you could try using task, such as .task { await networkController.configureAmplify() }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Beta 3 Swiftui Table Core Data Error
Yeah I see. What an appalling UI. It would not break anyone's back to put a delete button. In Apple's case, a backspace button, to delete the comment or post. Specifically designed to piss people off.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to Beta 3 Swiftui Table Core Data Error
try this: @FetchRequest(entity: TracksAll.entity(), sortDescriptors: []) var data: FetchedResults<TracksAll> @State var sorting: [KeyPathComparator<TracksAll>] = [ .init(\.pfil, order: SortOrder.forward) ]
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21