Introduction to Generics in Swift

  Рет қаралды 5,447

Stewart Lynch

Stewart Lynch

Күн бұрын

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

Пікірлер: 34
@cary98029
@cary98029 3 жыл бұрын
Spending time watching your tutorial videos, multiple times, has become one of my most productive Swift/SwiftUI learning opportunities. All of your videos follow a well-organized progressive learning pattern. They are incredibly helpful and presented so professionally with acknowledgements to other prolific Swift/SwiftUI gurus. You are a Jedi master with respect to learning Swift/SwiftUI! Thanks!
@StewartLynch
@StewartLynch 3 жыл бұрын
Thank you for your thoughtful comment. Much appreciated.
@arkemal
@arkemal Жыл бұрын
This is the best introduction to Generics. Thanks Maestro !
@StewartLynch
@StewartLynch Жыл бұрын
Glad you enjoyed it.
@farishuric4072
@farishuric4072 2 жыл бұрын
Stewart you are a legend! Thank you so much sir for the best tutorials out here. Keep doing the best work kind sir, you rock!
@markrabo
@markrabo 11 ай бұрын
Another great video, thank you. I'll also be watching the one on sorting and access controls.
@grampro8572
@grampro8572 Жыл бұрын
Stewart Lynch you are a Hero!
@sakshipatil9537
@sakshipatil9537 2 жыл бұрын
Great Content, very detailed explaination 🙌. Thank you so much!!!
@cruiseqe2
@cruiseqe2 3 жыл бұрын
Yet another great Explainer video. Love them!
@damaniturner6510
@damaniturner6510 3 жыл бұрын
Just wanna say this video is awesome like your content always is Stewart. Thank you for the well thought out presentation!
@StewartLynch
@StewartLynch 3 жыл бұрын
Thanks. Glad you find them useful
@alexpascal5403
@alexpascal5403 2 жыл бұрын
the decoding part with genetics was awesome! you could have ended the video half way, the genetics part is a slam dunk of an explaination. again, thank you. hopefully Tibitten Balls buys you a coffree soon.
@StewartLynch
@StewartLynch 2 жыл бұрын
Thanks. Glad you enjoyed it.
@andrejkling3886
@andrejkling3886 3 жыл бұрын
Thank you Stewart... excellent lesson
@dhavalnena7386
@dhavalnena7386 2 жыл бұрын
So helpful! Thank you for everything you do :)
@StewartLynch
@StewartLynch 2 жыл бұрын
Happy to help!
@mcaghouse
@mcaghouse 3 жыл бұрын
Great video with detail explanation. Thanks 🙏
@g-3409
@g-3409 3 жыл бұрын
I was hoping for more combine content, preferably with Core Data and nested objects/relations. Feel the previous subject was not finished yet. But great content as usual.
@ShooMPozitiV
@ShooMPozitiV 3 жыл бұрын
It’s very detailed tutorial... step by step! Stewart, it’s great! Tech me!))))
@tripathiprakash22
@tripathiprakash22 2 жыл бұрын
simply awesome :)))))
@Sokrates8
@Sokrates8 3 жыл бұрын
Happy Birthday! ;-)
@andrejkling3886
@andrejkling3886 2 жыл бұрын
Thank you so much one more for great lessons... is it possible to create more videos how work protocols and generic together ?
@StewartLynch
@StewartLynch 2 жыл бұрын
Anything is possible. I will add this request to my list of requests.
@andrejkling3886
@andrejkling3886 2 жыл бұрын
@@StewartLynch thank you so much Stewart
@vamsi3877
@vamsi3877 3 жыл бұрын
Awesome :)
@kslazinski
@kslazinski 3 жыл бұрын
Thanks for this video. I was always wondering what does this T mean 😅
@user-yd9xy3rb4x
@user-yd9xy3rb4x 3 жыл бұрын
I still can't get how you made buttons "< previous", "Home", "Next" ext. and titles without lines like real text. I remember you mentioned it somewhere, but I can't find. How to create my own xplaygroundpage? Could you give me a hint please?
@StewartLynch
@StewartLynch 3 жыл бұрын
Go to the editor menu and choose show raw markup to reveal the markup view instead. If you want to create your own playgrounds with multiple pages like this, just duplicate mine and edit the code. To create a new page, just drag to duplicate
@user-yd9xy3rb4x
@user-yd9xy3rb4x 3 жыл бұрын
You created your gitHub account in 2012, but almost never used it in years. How come?
@StewartLynch
@StewartLynch 3 жыл бұрын
I am not sure what you are referring to here, It may be a secondary account that you are referring to. My main account @StewartLynch is very active. Check it out in the link in the video description.
@tibettenballs4962
@tibettenballs4962 2 жыл бұрын
Great example on how abstract swift can be as a language. very odd dichotomy. its part scripting, part java-esq. still do not like closures.
@StewartLynch
@StewartLynch 2 жыл бұрын
And how powerful a type-safe language can be.
@Kenbomp
@Kenbomp 2 ай бұрын
Generics are what ypu have to do when you dont have smalltalk.
Introductions to Closures in Swift
25:02
Stewart Lynch
Рет қаралды 12 М.
Swift Generics: The Key to Reusable and Flexible Code
23:47
Swift and Tips
Рет қаралды 6 М.
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 38 МЛН
Ouch.. 🤕
00:30
Celine & Michiel
Рет қаралды 26 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 16 МЛН
SwiftUI Property Wrappers
23:20
Stewart Lynch
Рет қаралды 7 М.
Gentle Generics - John Sundell at Hacking with Swift Live 2019
29:27
Introduction to NavigationStack in iOS 16
22:52
Stewart Lynch
Рет қаралды 14 М.
Generics in Swift: Protocols with associated types
15:37
Swift and Tips
Рет қаралды 9 М.
How to use Generics in Swift | Advanced Learning #8
19:24
Swiftful Thinking
Рет қаралды 14 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 13 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
NavigationStack 2: Programmable NavigationPath and DeepLinks
28:37
Stewart Lynch
Рет қаралды 11 М.
low battery 🪫
0:10
dednahype
Рет қаралды 1,8 МЛН
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,4 МЛН
ноутбуки от 7.900 в тг laptopshoptop
0:14
Ноутбуковая лавка
Рет қаралды 3,5 МЛН
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 485 М.