Post

Replies

Boosts

Views

Activity

Reply to How to diagnose infinite layout loop
Paired it down a little smaller: `import Foundation import SwiftUI import PlaygroundSupport PlaygroundPage.current.setLiveView(ContentView()) struct ContentView: View { @State var position: Double = 50 var body: some View { VStack(spacing: 0) { Color.red.frame(width: 500, height: position) PaneDivider(position: $position) Color.blue }.frame(width: 500, height:500) } } struct PaneDivider: View { @Binding var position: Double var body: some View { Rectangle().fill(Color.yellow).frame(height: 8) .gesture(DragGesture() .onChanged { position += $0.translation.height if position < 0 { position = 0 } }) } }`
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to How to diagnose infinite layout loop
Using .location in the stack coordinate space instead of .translation avoids the problem, whatever it was. The following works as desired with no infinite loop. import Foundation import SwiftUI import PlaygroundSupport PlaygroundPage.current.setLiveView(ContentView()) struct ContentView: View { @State var position: Double = 50 var body: some View { VStack(spacing: 0) { Color.red.frame(width: 500, height: position) PaneDivider(position: $position) Color.blue } .frame(width: 500, height:500) .coordinateSpace(name: "stack") } } struct PaneDivider: View { @Binding var position: Double var body: some View { Color.yellow.frame(height: 8) .gesture( DragGesture(minimumDistance: 1, coordinateSpace: .named("stack")) .onChanged { position = max(0, $0.location.y) } ) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Xcode 13 compiling error - corrupted ModuleCache.noIndex - Xcode 12 working fine
I am also experiencing this bug every time I change between debug/release or between macOS/iOS targets in my project. Neither Clean Build Folder, nor deleting Derived Data nor just deleting ModuleCache.noIndex helps. The steps above do fix the compilation, until the next time I change targets or debug/release. I'm on macOS 12.3 and Version 13.3 (13E113) now with no improvement. Do you have a FB number for this?
Mar ’22
Reply to Xcode 13 compiling error - corrupted ModuleCache.noIndex - Xcode 12 working fine
In my case, I had added a path to my copy of /Libraries/pybind to the project’s Header Search Paths, and the pybind headers have files complex.h and attr.h which conflict with usr/include. When Xcode tried building Darwin, using Header Search Paths it got the wrong version of the files and failed: removing the search path temporarily allowed Darwin to build and be cached. I worked around the problem in my project by removing pybind from my Header Search Paths entirely, adding those header files to the project, and enabling Use Header Maps so my code using pybind could find them. (Renaming those two header files would work, too, if I wanted to edit the library source code.)
Mar ’22
Reply to Code 173 no longer triggers receipt generation
I'm seeing this again now on macOS 12.3.1. After exit(173), macOS brings up the system dialog for app store credentials, then fails with the message "the application is damaged and needs to be redownloaded from the AppStore" for my Xcode builds, and also for my archived TestFlight builds. Until recently, it would fetch the _MASReceipt automatically without a dialog. Does anyone know what might have changed? Whether this is something I broke? Something on Apple's end? Something in my system? Logging in and out of the app store, rebooting, have no effect.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’22
Reply to SwiftUI View, Open Recent, Revert and Share menus vanish when animating
Never mind. After reducing it to a small sample app, I realized I was calling a mutating func on Document in the animation, which explains the behavior.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to How to diagnose infinite layout loop
Paired it down a little smaller: `import Foundation import SwiftUI import PlaygroundSupport PlaygroundPage.current.setLiveView(ContentView()) struct ContentView: View { @State var position: Double = 50 var body: some View { VStack(spacing: 0) { Color.red.frame(width: 500, height: position) PaneDivider(position: $position) Color.blue }.frame(width: 500, height:500) } } struct PaneDivider: View { @Binding var position: Double var body: some View { Rectangle().fill(Color.yellow).frame(height: 8) .gesture(DragGesture() .onChanged { position += $0.translation.height if position < 0 { position = 0 } }) } }`
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How to diagnose infinite layout loop
FB9812157
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to How to diagnose infinite layout loop
Using .location in the stack coordinate space instead of .translation avoids the problem, whatever it was. The following works as desired with no infinite loop. import Foundation import SwiftUI import PlaygroundSupport PlaygroundPage.current.setLiveView(ContentView()) struct ContentView: View { @State var position: Double = 50 var body: some View { VStack(spacing: 0) { Color.red.frame(width: 500, height: position) PaneDivider(position: $position) Color.blue } .frame(width: 500, height:500) .coordinateSpace(name: "stack") } } struct PaneDivider: View { @Binding var position: Double var body: some View { Color.yellow.frame(height: 8) .gesture( DragGesture(minimumDistance: 1, coordinateSpace: .named("stack")) .onChanged { position = max(0, $0.location.y) } ) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to In SwiftUI, any way to intercept each character entered in a TextField?
Also, I need to detect typing delete into an empty SwiftUI TextEditor. Since that does not change the value, it will not trigger onChange(of:).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13 compiling error - corrupted ModuleCache.noIndex - Xcode 12 working fine
I am also experiencing this bug every time I change between debug/release or between macOS/iOS targets in my project. Neither Clean Build Folder, nor deleting Derived Data nor just deleting ModuleCache.noIndex helps. The steps above do fix the compilation, until the next time I change targets or debug/release. I'm on macOS 12.3 and Version 13.3 (13E113) now with no improvement. Do you have a FB number for this?
Replies
Boosts
Views
Activity
Mar ’22
Reply to Xcode 13 compiling error - corrupted ModuleCache.noIndex - Xcode 12 working fine
In my case, I had added a path to my copy of /Libraries/pybind to the project’s Header Search Paths, and the pybind headers have files complex.h and attr.h which conflict with usr/include. When Xcode tried building Darwin, using Header Search Paths it got the wrong version of the files and failed: removing the search path temporarily allowed Darwin to build and be cached. I worked around the problem in my project by removing pybind from my Header Search Paths entirely, adding those header files to the project, and enabling Use Header Maps so my code using pybind could find them. (Renaming those two header files would work, too, if I wanted to edit the library source code.)
Replies
Boosts
Views
Activity
Mar ’22
Reply to Code 173 no longer triggers receipt generation
I'm seeing this again now on macOS 12.3.1. After exit(173), macOS brings up the system dialog for app store credentials, then fails with the message "the application is damaged and needs to be redownloaded from the AppStore" for my Xcode builds, and also for my archived TestFlight builds. Until recently, it would fetch the _MASReceipt automatically without a dialog. Does anyone know what might have changed? Whether this is something I broke? Something on Apple's end? Something in my system? Logging in and out of the app store, rebooting, have no effect.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to Mac App Store Sandbox Test -> App is Damaged..
I'm seeing this same failure now on macOS 12.3.1 with Xcode 13.3.1. Is there anything I can do for it on my end besides reporting to Apple?
Replies
Boosts
Views
Activity
Apr ’22
Reply to NSCursor reset to arrow in macOS SwiftUI app
Previous thread on the same issue: https://stackoverflow.com/questions/61984959/swiftui-system-cursor/67851290#67851290
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to TestFlight app processing
23 hours and counting.... (on Sunday 19 June 2022)
Replies
Boosts
Views
Activity
Jun ’22
Reply to verify receipt failed with 21002,use "latest_receipt" from last success verify
Me, too, same problem with existing app.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Per-vertex color. in a custom RealityKit mesh? (macOS)
I've been unsuccessful so far. If anyone has gotten RealityKit to handle a vertexColor buffer to work, please provide some more details.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to How to programmatically open a new document in a DocumentGroup-based visionOS app?
Thank you. FB16514556.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’25