I'm kind of stuck trying to understand .self
in swift, always I register a custom cell in an collectionView or an tableView I have to register like customCollectionViewCell.self
but why not for example customCollectionViewCell()
?
I've tried in the playground to type String.self
in a var to see what happens and it give me no errors but when I try to give it a value it give me the following error
Cannot assign value of type 'String' to type
String.Type
what does it mean?