|
Paul says:" So, how does the word |
|
It doesn't. The With
|
|
This is explained very well in this chapter on Opaque Types: https://docs.swift.org/swift-book/LanguageGuide/OpaqueTypes.html |
|
Abdo asks:
Consider an adventure game where you have a door that only Wizards can walk through. But in this game, players have modified their Wizards.
You and I can recognize these are both wizards. However the Swift compiler sees these as complex wizard types. gandalf is a The compiler sees these as two different Types. In the game, you might have hundreds of wizards with many, many variations. In game logic, this would be a nightmare to keep track of. Instead, you inform the door that after all the modifications have been applied, you only care that only |
|
|
|
@Obelix |
|
Abdo asks:
Aye! That's what @rooster said! And @twoStraws in the video noted by @Nigel. @rooster shows an actual example of a complex view. It hurts my eyes just trying to interpret it. Can you understand what Type this view is? It's a button, with some padding, and a background color. Wait. It also has a rounded rectangle clip shape, with some Text. It looks like the whole thing is in a VStack? No wait, is the Text in the button? or in the VStack?? This shows that we are not equipped to interpret the exact type of a Instead of trying to code and understand the final
I hope I said the same thing by using an abstract (wizard and door) example. |
|
@Obelix
Actually, I find it much easier to understand a difficult concept if the other person used metaphors and examples. I wish Paul would do that more. |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.