Post

Replies

Boosts

Views

Activity

Reply to Cannot preview SwiftUI
I had this problem when I added a folder and was using the cloud storage. I simply removed the folders added and added them again. Make sure to select both "Create Groups" and "Create Items ..". Usually it is "Create a folder reference" by default. I hope this information can help someone looking for a quick solution.
Dec ’21
Reply to Why does ForEach initialize its Child View twice as much in SwiftUI?
I encountered this problem for a LazyVStack. My solution worked for me. Once you determine that the ForEach is called twice, use some debugging to determine where and why the view may be re-rending twice. Sometimes swift may re-render a view and in this case the ForEach may appear twice inside the VStack, as ForEach acts as its own Collection for views. https://developer.apple.com/documentation/swiftui/foreach As for the debugging part, try putting a .onAppear( //print something and add a break point ){} on the ForEach (Tested), if it is called twice you know that it is re-rendered twice. 1 - see the changes that occur between the first break point and the second break point to see the changes I hope this can help someone else that experiences the same issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’24
Reply to How can you edit the same xcode project from different macs at the same time?
I guess these answers are incorrect. There are platforms that allow editing of the same windows (your IDE) at the same time. Also, you should always be using some type of Git for version tracking. Just do a quick search and you will find a handful of resources out there and some fancy work arounds.
Replies
Boosts
Views
Activity
Nov ’21
Reply to Cannot preview SwiftUI
I had this problem when I added a folder and was using the cloud storage. I simply removed the folders added and added them again. Make sure to select both "Create Groups" and "Create Items ..". Usually it is "Create a folder reference" by default. I hope this information can help someone looking for a quick solution.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Why does ForEach initialize its Child View twice as much in SwiftUI?
I encountered this problem for a LazyVStack. My solution worked for me. Once you determine that the ForEach is called twice, use some debugging to determine where and why the view may be re-rending twice. Sometimes swift may re-render a view and in this case the ForEach may appear twice inside the VStack, as ForEach acts as its own Collection for views. https://developer.apple.com/documentation/swiftui/foreach As for the debugging part, try putting a .onAppear( //print something and add a break point ){} on the ForEach (Tested), if it is called twice you know that it is re-rendered twice. 1 - see the changes that occur between the first break point and the second break point to see the changes I hope this can help someone else that experiences the same issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’24