Published On Apr 30, 2023
Go to https://squarespace.com/seanallen to save 10% off your first purchase of a website or domain using code SEANALLEN.
Swift Generics provide a general solution in code that can handle various types. In this video I break down the syntax and use cases for Generics in Swift by going through a number of examples (basic and real life). We talk about protocol conformance and single letter variable names. Then I explain why you should be careful with Generics and not use them everywhere in your code.
This tutorial was created using Xcode 14 and iOS 16.
My iOS Dev Courses:
https://seanallen.teachable.com/
iOS Developer Interview Questions Playlist:
• Swift Interview Tips
Twitter:
Sean Allen - / seanallen_dev
Hired.com:
https://hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
https://gumroad.com/a/762098803
Donny Wals - Combine:
https://gumroad.com/a/909014131
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
https://gumroad.com/a/656585843
#swift #softwaredeveloper #iosdeveloper
Timestamps:
0:00 - What are Generics?
0:31 - Abstract Example - Code Breakdown
2:08 - Basic Example in Code
4:53 - Generics in Swift Language
6:23 - Real Life Example - Generic Network Call
8:20 - The Generic Balancing Act