Swift: Dependency Injection Tutorial (2022) – iOS

Опубликовано: 27 Август 2021
на канале: iOS Academy
35,257
960

In this video we take a practical look at dependency injection in Swift by using protocols. Dependency Injection is a powerful pattern to build scalable large applications with decoupled logic. It allows objects to use common functionality in an agnostic way; such that one object does not know where the functionality comes from. We'll be working in Xcode 12 and Swift 5 to demonstrate this with multiple targets.

💻 Source Code:   / iosacademy  
🎥 Subscribe for more: https://www.youtube.com/iOSAcademy?su...
😎 Like my teaching style? Check out some of my most popular courses! https://courses.iosacademy.io

** Popular Series
Building Instagram: https://courses.iosacademy.io/p/build...
Building TikTok:    / @iosacademy  
SwiftUI for Beginners: https://ios-academy.teachable.com/p/s...

** Get Skillshare free for 2 Months and learn iOS
https://www.skillshare.com/r/user/afraz

** Manage all your investments from app earnings on Betterment!
https://bit.ly/3eBwlI9

** Grow your own Youtube tech channel with TubeBuddy:
https://www.tubebuddy.com/iosacademy

*Timestamps*
0:00 Swift Dependency Injection
0:49 Create Project
1:50 Create Button
3:24 Create Xcode Target
4:28 Create API Caller
6:17 Create New Target
9:39 Decode API Response
10:40 Create Protocol
13:19 Pass Dependency
18:00 Finalize Data
19:30 Set Up TableView
22:05 Dependency Injection Review
24:14 Wrap Up / Outro

#swift #dependency #iOS