Post

Replies

Boosts

Views

Activity

Modern collection view registration with Storyboards?
Can you use modern collection view cell/view registration with custom views designed in a storyboard? I am familiar with putting a custom cell, or reusable view, inside the collection view of the storyboard, and configuring it with constraints and outlets. Then manually dequeueing the cell/view, and configuring the view. How do you do this with the new decoupled methods of cell registration and configuration? For example, if I have the following:         let headerRegistration = UICollectionView.SupplementaryRegistration         <HeaderReusableView>(elementKind: "header") { (supplementaryView, _, indexPath) in             supplementaryView.titleLabel?.text = "foo"         }         self.datasource?.supplementaryViewProvider = { (_, _, index) in             return self.collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration, for: index)         } HeaderReusableView is a UICollectionReusableView that is added to my storyboard, and the titleLabel is added, and hooked up via an outlet. When I run the code, it does not seem to make the connection, and the outlet is nil.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
1.4k
Nov ’21
Code Coverage not showing properly?
I have an old Xcode project that I am adding tests to, and at a high level I see the code coverage percent (the 2.2% number). However, in the detail view, code coverage only shows on the testing bundle, not in the main app bundle. Anyone have any tips on how to fix this?
Replies
3
Boosts
0
Views
171
Activity
Apr ’25
Modern collection view registration with Storyboards?
Can you use modern collection view cell/view registration with custom views designed in a storyboard? I am familiar with putting a custom cell, or reusable view, inside the collection view of the storyboard, and configuring it with constraints and outlets. Then manually dequeueing the cell/view, and configuring the view. How do you do this with the new decoupled methods of cell registration and configuration? For example, if I have the following:         let headerRegistration = UICollectionView.SupplementaryRegistration         <HeaderReusableView>(elementKind: "header") { (supplementaryView, _, indexPath) in             supplementaryView.titleLabel?.text = "foo"         }         self.datasource?.supplementaryViewProvider = { (_, _, index) in             return self.collectionView.dequeueConfiguredReusableSupplementary(using: headerRegistration, for: index)         } HeaderReusableView is a UICollectionReusableView that is added to my storyboard, and the titleLabel is added, and hooked up via an outlet. When I run the code, it does not seem to make the connection, and the outlet is nil.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
2
Boosts
0
Views
1.4k
Activity
Nov ’21
Xcode Cloud Code Coverage?
I could not find mention of code coverage in Xcode cloud? Is it supported now? Or do I need to use local bots to continue to get code coverage reports? Thanks in advance. -pj
Replies
0
Boosts
2
Views
1.2k
Activity
Jul ’21