This video is epic, and the fact that I could follow it with a cold is a testament to how clear you are. Thanks a lot! Protocols and extensions are fascinating. I never liked multiple inheritance.
You right Paul - I am studying Swift “just for fun” and when I don’t understand something I push myself to study further saying myself “You will understand later on”))
Hello, struct AAA: Equatable { } Why is not necassary to implement the static func == ? If you look in the Swift Documentationthe static func is REQUIRED.
This video is epic, and the fact that I could follow it with a cold is a testament to how clear you are. Thanks a lot! Protocols and extensions are fascinating. I never liked multiple inheritance.
please more like this. Its so much fun to simplify code after watching your Ideas
You right Paul - I am studying Swift “just for fun” and when I don’t understand something I push myself to study further saying myself “You will understand later on”))
I m doing the same
Hello,
struct AAA: Equatable {
}
Why is not necassary to implement the static func == ? If you look in the Swift Documentationthe static func is REQUIRED.
Swift is able to create one for us automatically, as long as everything inside the struct already conforms to Equatable.
@@twostraws But inside is nothing?How can nothing conforms to Equatable?
Because two objects with nothing to make them different are automatically considered equal.
extension Numeric {
func square() -> some Equatable {
self * self
}
}
The above seems to make the extension more flexible as well...🤷🏿♂️
It IS confusing, but VERY curious part of me wants to know more about the extension
✨
I am a beginner bot I find Protocols and Extensions much more easier than Closures)
👍🏼👍🏼👍🏼