TextureGroup / Texture

Smooth asynchronous user interfaces for iOS apps.
https://texturegroup.org/
Other
8.02k stars 1.29k forks source link

Result of 'collectionNode(_:nodeBlockForItemAt:)' has different optionality than expected by protocol #2015

Open mycroftcanner opened 3 years ago

mycroftcanner commented 3 years ago

Texture's documentation on UICollectionViewCell Interoperability and some of the sample projects suggests changing the return value type of nodeBlockForItemAt and nodeForItemAt to ASCellNodeBlock! and ASCellNode respectively.

It works really well if you want to initialise some nodes such as a ASCollectionNode in the foreground by just routing it to nodeForItemAt.

However it generates the following warnings:

Result of 'collectionNode(_:nodeBlockForItemAt:)' has different optionality than expected by protocol 'ASCollectionDataSource'

Result of 'collectionNode(_:nodeForItemAt:)' has different optionality than expected by protocol 'ASCollectionDataSource'

Is there anyway to silence the warning or change the swift protocols to return an optional?