Today we go over what protocol extensions are, how they work, and why they are so powerful, using Swift 4. First we go over the general structure of creating a protocol extension that extends the functionality of multiple objects. Next, we dive into overriding the default functionality of the protocol extension. Lastly, we cover how you can combine multiple protocols into a single protocol.
Apple itself has stated that Swift is meant to be a protocol oriented programming language. Once you can grasp the usefulness of Swift protocols and their extensions, you'll be able to see how they can solve your coding problems and will probably change the way you write your code in general. Lastly, you'll have a full understanding of how to implement your protocol extensions across different data mode types.
Some othe points that get covered are Swift Declare Class Func in Protocol, Why must a protocol operator be implemented as a global function, Is this a correct use of using protocols and delegate pattern in Swift, how to create delegates in swift, Usage of protocols as array types and function parameters in swift.
The finished project is available to any students of the free YouTube On my website. Make sure you enroll today:
https://www.kiloloco.com/p/youtube
If you have any questions or comments about the tutorial, or want to suggest a video to make, feel free to leave a comment below, or reach out to me on Twitter:
https://twitter.com/kilo_loco
If you found this tutorial helpful, make sure to subscribe to the channel for more great tutorials.
Protocol Extensions | Swift Language Basics | Swift 4, Xcode 9 camera iphone 8 plus apk
Không có nhận xét nào:
Đăng nhận xét