Post

Replies

Boosts

Views

Activity

ScrollView Bug - hides images, but on in List
Very strange scroll view bug.When my subView called CardView is inside the List... images show fine. But when I use ScrollView instead of List (because I need to remove dividers and next arrow), than images dont display (just giant blue tint overlay) Seems like SWIFTUI is full of bugs or something.// BUG HERE - IMAGES NOT SHOWN, JUST GIANT BLUEScrollView() { ForEach(clients, id: \.id) { client in NavigationLink( destination: AuditsList() ) { CardView(image: "richmond", category: client.name, heading: client.addressLine1, author: client.addressLine2) } // end vstack } }.navigationBarTitle(Text("Select Customer")) }// SHOWS IMAGES OKList() { ForEach(clients, id: \.id) { client in NavigationLink( destination: AuditsList() ) { CardView(image: "richmond", category: client.name, heading: client.addressLine1, author: client.addressLine2) } // end vstack } }.navigationBarTitle(Text("Select Customer")) }For reference CardView:struct CardView: View { var image: String var category: String var heading: String var author: String var body: some View { VStack { Image(image) .frame(minWidth: 0, maxWidth: .infinity, maxHeight: 100) .aspectRatio(contentMode: .fit) //.resizable() HStack { VStack(alignment: .leading) { Text(heading) .font(.title) .fontWeight(.black) .foregroundColor(.primary) .lineLimit(3) Text(category) .font(.caption) .foregroundColor(.secondary) Text(author) .font(.caption) .foregroundColor(.secondary) } .layoutPriority(100) Spacer() } .padding() } .cornerRadius(10) .overlay( RoundedRectangle(cornerRadius: 10) .stroke(Color(.sRGB, red: 150/255, green: 150/255, blue: 150/255, opacity: 0.1), lineWidth: 1) ) .padding([.top, .horizontal]) } } struct CardView_Previews: PreviewProvider { static var previews: some View { CardView(image: "richmond", category: "701 East Byrd Street", heading: "Federal Reserver Bank of Richmond", author: "Richmond VA 23219") } }
1
0
1.2k
Mar ’20
UICollectionView Crash in canBecomeFocused (apple TV)
From crash logs it crashes on canBecomeFocused. But nothing else is in the log. Anyone ran into this? Is there something that's glaring and obvious? Crashed: com.apple.main-thread 0 libswiftUIKit.dylib 0x1e58f73a8 IndexPath.section.getter + 152 1 Family Trivia 0x100e2b694 (Missing) 2 Family Trivia 0x100e29c5c (Missing) 3 UIKitCore 0x1f80b0100 -[UICollectionView _cellCanBecomeFocused:] + 208 4 UIKitCore 0x1f80c011c -[UICollectionViewCell canBecomeFocused] + 132 5 UIKit 0x1ea8eee70 -[UICollectionViewCellAccessibility canBecomeFocused] + 48 6 UIKitCore 0x1f8310fac _UIFocusItemCanBecomeFocusedAndChildrenAreNotFocused + 48 7 UIKitCore 0x1f8310a7c __UIFocusItemIsFocusedOrFocusableInFocusSystem + 72 8 UIKitCore 0x1f8310970 _UIFocusItemIsFocusedOrFocusable + 92 9 UIKitCore 0x1f82483a4 -[UIViewController _canRestoreFocusAfterTransitionToItem:] + 184 10 UIKitCore 0x1f8168670 -[UINavigationController _canRestoreFocusAfterTransitionToRecalledItem:inViewController:] + 84 11 UIKitCore 0x1f81687f0 -[UINavigationController _overridingPreferredFocusEnvironment] + 224 12 UIKitCore 0x1f831ec24 __125-[_UIDeepestPreferredEnvironmentSearch _overridingPreferredFocusEnvironmentForPreferredEnvironment:visitedFocusEnvironments:]_block_invoke + 116 13 UIKitCore 0x1f830d188 _UIFocusEnvironmentEnumerateAncestorEnvironments + 124 14 UIKitCore 0x1f831ea30 -[_UIDeepestPreferredEnvironmentSearch _overridingPreferredFocusEnvironmentForPreferredEnvironment:visitedFocusEnvironments:] + 208 15 UIKit 0x1ea9761cc -[_UIDeepestPreferredEnvironmentSearchAccessibility _overridingPreferredFocusEnvironmentForPreferredEnvironment:visitedFocusEnvironments:] + 96 16 UIKitCore 0x1f831e2f0 -[_UIDeepestPreferredEnvironmentSearch deepestPreferredFocusableItemForEnvironment:withRequest:] + 640 17 UIKitCore 0x1f835d05c -[UIFocusUpdateContext _updateDestinationItemIfNeeded] + 232 18 UIKitCore 0x1f835ce54 -[UIFocusUpdateContext _destinationItemInfo] + 28 19 UIKitCore 0x1f835cd30 -[UIFocusUpdateContext nextFocusedItem] + 24 20 UIKitCore 0x1f834f9d0 -[UIFocusSystem updateFocusIfNeeded] + 192 21 UIKitCore 0x1f834f2d8 __37-[UIFocusSystem _requestFocusUpdate:]_block_invoke + 36 22 UIKitCore 0x1f8c157dc -[_UIAfterCACommitBlock run] + 64 23 UIKitCore 0x1f87f74a8 _runAfterCACommitDeferredBlocks + 296 24 UIKitCore 0x1f87e7808 _cleanUpAfterCAFlushAndRunDeferredBlocks + 200 25 UIKitCore 0x1f8816f60 _afterCACommitHandler + 76 26 CoreFoundation 0x1cdfdc2cc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 27 CoreFoundation 0x1cdfd69b0 __CFRunLoopDoObservers + 604 28 CoreFoundation 0x1cdfd6ef8 __CFRunLoopRun + 960 29 CoreFoundation 0x1cdfd6600 CFRunLoopRunSpecific + 572 30 GraphicsServices 0x1d0aef598 GSEventRunModal + 160 31 UIKitCore 0x1f87e8b98 -[UIApplication _run] + 1060 32 UIKitCore 0x1f87ee148 UIApplicationMain + 164 33 Family Trivia 0x100e1e470 (Missing) 34 libdyld.dylib 0x1cda6a5fc start + 4
1
0
597
Apr ’21