In WWDC22 on this topic the ppl were saying easy rule: better use some first and if compiler doesn’t like it change to any. I guess in ur examples if Animal doesn’t have Self or associated requirements then u can move to some (so its kinda lightweights the function signature in this case in comparison with generic variant)
I'm glad I found your channel from LinkedIn! Great content, these higher level concepts are so good to know but might get missed by the algorithm. Everyone boost!
Hi Salman, that’s a good question!. This is to make a clear distinction between generic constraints and existential types. I recommend you to check the proposal discussion. I left a link in the description 👍
@@swiftandtips witness table is basically what’s used in dynamic lookup of methods/properties for existential types(protocols). Apple engineers talked about it in wwdc 2016 on performance. Vtable on the other hand is what’s used for classes that support inheritance/polymorphism/dynamic dispatch.
Hi Franklin, that's a good question! I tried using frontend flags in Xcode (enable-explicit-existential-types) but it doesn't work. I will investigate and let you know if I got something. Cheers!
It is so rare when a tutorial is made with so readable examples so I can watch it even on my phone. Thank you!
Thank you very much ☺️
Great video, love the animations and clear explanation
Thank you very much 😄
In WWDC22 on this topic the ppl were saying easy rule: better use some first and if compiler doesn’t like it change to any. I guess in ur examples if Animal doesn’t have Self or associated requirements then u can move to some (so its kinda lightweights the function signature in this case in comparison with generic variant)
You really know what is going on at memory, i am appreciated
Great way to explain any keyword Pitt! Great video
Thank you very much Jesus! 😊
Thanks for your explanation, pretty clear sir!!!!
Nice and clear, thanks
Great video Pete!
Thank you very much Ed! :D
So adding the any keyword will not resolve the performance implications that you’ve talked about?
Hi Mark, No, it just explicitly mark the usage of an existential type, that’s it. 👍
Hi @Hitesh Agarwal, short answer is yes, but also this is to clearly distinguish between opaque types vs existential types.
I'm glad I found your channel from LinkedIn! Great content, these higher level concepts are so good to know but might get missed by the algorithm. Everyone boost!
Thank you very much!!
Well explained! Many thanks!
Well done! Thank you :)
Why are we using any if we dont have any performance ? or just to tell compiler that its existential type.
Hi Salman, that’s a good question!. This is to make a clear distinction between generic constraints and existential types. I recommend you to check the proposal discussion. I left a link in the description 👍
i think it's witness table in this case and not vTable
What’s that Blaze? 😲
@@swiftandtips witness table is basically what’s used in dynamic lookup of methods/properties for existential types(protocols). Apple engineers talked about it in wwdc 2016 on performance.
Vtable on the other hand is what’s used for classes that support inheritance/polymorphism/dynamic dispatch.
I didn’t remember talk. Thanks for the explanation!
love the explanation!
Thank you very much! 😊
is there a way to trigger the warning in swift 5.6?
Hi Franklin, that's a good question! I tried using frontend flags in Xcode (enable-explicit-existential-types) but it doesn't work.
I will investigate and let you know if I got something. Cheers!
The easy way I can tell right now is Swiftlint rule
@@ЭдуардЕленский-н8ч Thanks which rule is it?
Thank you... Can you show more real examples?
Hi Andrej, just use it every time you declare a protocol type in your code, cheers!