Рет қаралды 5,447
Generic code enables you to write flexible, reusable functions and types that can work with any type, subject to requirements that you define. You can write code that avoids duplication and expresses its intent in a clear, abstracted manner.
I n this video we are going to take a look at how you can get started writing your own generic, reusable functions.
We will cover the basics before we explore a couple of different, practical examples.
If you want to support my work, you can buy me a coffee :)
ko-fi.com/stewartlynch
******* Download my StewartLynch KZfaq Channel Application - Free **********
stewartlynch.gumroad.com/l/obsjz
Table of Contents:
0:00 Introduction
1:20 The Basics
8:36 Decoding with Generics
15:32 Multiple Protocol Conformance
Starter Project Files:
www.createchsol.com/StarterPro...
Completed Project:
github.com/StewartLynch/Intro...
Other references:
JSON Codable Series
• JSON and Codable Proto...
Access Control in Swift
• Access Control levels ...
Sorted Higher Order Function
• contains, forEach, sorted
Reduce Higher Order Function
• reduce, filter, removeAll
Other References:
Stewart Lynch's KZfaq Channel:
/ stewartlynch
Stewart Lynch on Twitter:
/ stewartlynch
CreaTECH Solutions Website:
www.createchsol.com
Stewart Lynch's GitHub:
github.com/StewartLynch