In this video, we’ll be diving into the world of opaque types in Swift! If you’re a Swift developer, you know how important it is to have a good understanding of the type system. Opaque types are a new feature introduced in Swift 5.1 and offer a powerful way to handle complex types in a more abstract and flexible manner.
We’ll be starting from the basics and covering what opaque types are, how they work, and why they’re so useful. You’ll learn how to create your own opaque types and how to use them in your own code. We’ll also explore some real-world examples of where opaque types can be used to simplify your code and make it more maintainable.
Whether you’re a seasoned Swift developer or just starting out, this video will give you a comprehensive understanding of opaque types and how to use them effectively in your own projects. So, sit back, relax, and join us on this journey to unlock the full potential of opaque types in Swift!
Don’t forget to like and subscribe for more awesome Swift tutorials
💻 Source Code:
🎥 Subscribe for more:
😎 Like my teaching style? Check out some of my most popular courses!
👉🏼 Connect (personal LinkedIn)
🚀 Follow on LinkedIn
** Popular Series
Building Instagram:
Building TikTok:
SwiftUI for Beginners:
** Get Skillshare free for 2 Months and learn iOS
** Manage all your investments from app earnings on Betterment!
** Grow your own Youtube tech channel with TubeBuddy:
#swift #iOSDeveloper #xcode
Watch more new videos about iOS Academy | Synthesized by Mindovermetal English
Follow for more https://linkedin.com/in/afrazsiddiqui
nice
Nice! I like the clear explanations and focus on a specific topic in digestible time.
Thanks for this video, can you make a video on the problem with using any rather than some
So the main idea of some is making type erasing easier, isn’t it? But not using diff types in typealias since it will likely brake the execution
I have read somewhere that in future swift versions there will be compiler warning when you are using protocol types (ex. in method params, inits, etc.) you should specify keyword any. This warning is a result of dispatch types and it helps helps the developer understand performance degradation.
So we can use generics while using protocols.
Example:
protocol MyProtocol {}
1. func doSomething(message: MyProtocol) {}
2. func doSomething<T>(message: T) where T: MyProtocol {}
3. func doSomething(message: some MyProtocol) {}
This looks like the same, but it isn't. 2nd and 3rd do the same thing using static dispatch, unlike 1st, that uses dynamic dispatch.
So, the question is, if I'm correct, do you know about it and should we use some keyword to all protocol types even without associated types?
appreciate 🎉