Dependency Injection in Swift

Опубликовано: 14 Июнь 2026
на канале: Cocoacasts
22,785
398

https://cocoacasts.com
Follow Me on Twitter:   / _bartjacobs  

Many developers cringe when they hear the words dependency injection. It's a difficult pattern and it's not meant for beginners. That's what you are made to believe. The truth is that dependency injection is a fundamental pattern that is very easy to adopt.

My favorite quote about dependency injection is a quote by James Shore. It summarizes much of the confusion that surrounds dependency injection.

"Dependency Injection" is a 25-dollar term for a 5-cent concept. - James Shore

When I first heard about dependency injection, I also figured it was a technique too advanced for my needs at the time. I could do without dependency injection, whatever it was.