AFAIK The entire logic of the video is still correct only that after Swift 2.2 : The `typealias` in Protocols has changed to `associateType`. Meaning at this 2:53 it should be `associatedType Food`
Is there a way to use something like this to work around the issue that protocols can't be equatable as well? Maybe the problem is, that I try to use Swift's protocols like other language's interfaces (e.g. C#), but it just is something different here. Just drives me nuts. Can't be so difficult -.- The only thing I came up with, was type erasure. But then in the end the actual type is still not Equatable, and when using it as Equatable, I lose the actual type. 0_o Or am I just doing it completely wrong :-| I love Swift, but never got my head around protocols (especially PATs), they just feel so (sry) crippled, when coming from e.g. C#. PS: really awesome talk (in all this frustration I almost forget to mention)
Best talk ever. Really amazing. Thank you for uploading this!
As of Swift 5.1 we now have *opaque types* (some Protocol) which allows the use of a *protocol with associated types or Self as a type* .
AFAIK The entire logic of the video is still correct only that after Swift 2.2 : The `typealias` in Protocols has changed to `associateType`. Meaning at this 2:53 it should be `associatedType Food`
Is there a way to use something like this to work around the issue that protocols can't be equatable as well? Maybe the problem is, that I try to use Swift's protocols like other language's interfaces (e.g. C#), but it just is something different here. Just drives me nuts. Can't be so difficult -.-
The only thing I came up with, was type erasure. But then in the end the actual type is still not Equatable, and when using it as Equatable, I lose the actual type. 0_o
Or am I just doing it completely wrong :-|
I love Swift, but never got my head around protocols (especially PATs), they just feel so (sry) crippled, when coming from e.g. C#.
PS: really awesome talk (in all this frustration I almost forget to mention)
Crusty would not be impressed by the number of camera angles.
I wish I had seen this the day it was published, hahaha