Skip to content

Commit

Permalink
Update Swift collection view interop example (#1837)
Browse files Browse the repository at this point in the history
* Update uicollectionviewinterop.md
  • Loading branch information
drinkius authored May 26, 2020
1 parent 74fd8f3 commit f0c0fae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/_docs/uicollectionviewinterop.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ For this example, the data source method `collectionNode:nodeBlockForItemAtIndex
</pre>

<pre lang="swift" class = "swiftCode hidden">
// Click the "Edit on GitHub" button at the bottom of this
// Setting the return type to implicitly unwrapped optional
// helps overcome compiler error when trying to return nil
func collectionNode(_ collectionNode: ASCollectionNode,
nodeBlockForItemAt indexPath: IndexPath) -> ASCellNodeBlock! {
return optionalNode
}

// Click the "Edit on GitHub" button at the bottom of this
// page to contribute the swift code for this section. Thanks!
</pre>
</div>
Expand Down

0 comments on commit f0c0fae

Please sign in to comment.