Post

Replies

Boosts

Views

Activity

Reply to GeometryReader problem
It turns out that the problem isn't with GeometryReader, it's with LazyVGrid. I'm not clear on why, but my grid with 5 columns doesn't always report the same size. I can make it work by adding a 6th column that doesn't get used in the view. Very odd.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’24
Reply to GeometryReader problem
The error I'm getting: Thread 1: Fatal error: <UpdateCoalescingCollectionView 0x3037efc30> is stuck in a recursive layout loop. This can happen when self-sizing views do not return consistent sizes, or the collection view's frame/bounds/contentOffset is being constantly adjusted. To debug this issue, check the Console app for logs in the "UICollectionViewFeedbackLoopDebugger" category. Collection view: <SwiftUI.UpdateCoalescingCollectionView: 0x156f96a00; baseClass = UICollectionView; frame = (0 0; 852 149); clipsToBounds = YES; autoresiz
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’24
Reply to Cannot add build in Distribution
I found this on Stack Overflow: *** SO *** Info.plist is not visible as a separate file until you add non-standard values to it Do you see the Info.plist in your project? Do you see the values of it reflected under [Blue Project Icon in Project Navigator] -> Targets -> [Your Target Name] -> Info? Did you try to add a custom value to it? (this will trigger it to become visible) See: https://stackoverflow.com/a/67896587/2804585 *** end SO *** Maybe you're thinking it's solved? Think again! Now it reports no errors or warnings on appstoreconnect, but it still won't let me add the build to my submission, so I can't add for review!
Dec ’24
Reply to Infinite view loop
I have to say that this is yet another serious flaw in the Swift framework. You have to write your code on the assumption that the initializer for a view may be called multiple times, but this is highly inefficient and it causes a problem where you can easily have race conditions. I see no way to have nested models where an item can link to an array of items, for example, because that requires a query in an initializer that can create an infinite loop. Combined with Xcode's terrible debugging, this is infuriating.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to Infinite view loop
It looks like SwiftUI is pre-drawing the navigation links when the screen is loaded, and since one of those links is to the same screen with (usually) a different item, it gets repeated infinitely. If anyone knows how to stop that without having to use a nearly identical view, please post it here.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to Infinite view loop
I thought that I'd solved it by changing the AddItemView toolbar to this: .toolbar { Button("Save") { let tmp = Item(name: name, parent: itemParent) if self.itemParent == nil { context.insert(tmp) } else { itemParent?.children.append(tmp) } try? context.save() dismiss() } } That works for the first layer, which is why the image below has items B and C, but clicking on them causes another infinite loop, this time with the SubItemView calling itself.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24