You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Dependency Inversion Principle (DIP from SOLI**D**)* allows you to create classes as independent as possible between each other. But developing the services using Dependency Injection, you are faced with the difficulty - how and where to set up services and communications, and how to provide these services to instances that are created during the application process, usually a presentation layer.
17
28
@@ -29,20 +40,10 @@
29
40
30
41
Вы можете создать свой собственный контейнер для конкретного проекта с учетом его специфики и архитектуры. Один из простых способов создать свой контейнер - это использовать структуру с набором созданных и настроенных заранее сервисов либо их фабрик. А еще лучше - использовать обертку над сервисами (`ServiceProvider`), скрывающую способ создания сервиса - за ранее или по необходимости, а также его зависимости и используемые настройки.
31
42
32
-
Для внедрения зависимостей на слое представления можно использовать `ServiceInject`, который только требует создать и зарегистрировать свой контейнер с сервисами, созданный по простым определенным правилам.
43
+
Для внедрения зависимостей на слое представления можно использовать `ServiceInject`, который только требует создать и зарегистрировать свой контейнер с сервисами, созданный по определенным простым правилам.
33
44
34
45
#
35
46
36
-
-[Features](#features)
37
-
-[Requirements](#requirements)
38
-
-[Communication](#communication)
39
-
-[Migration from 2.0 to 3.0](#migration-from-20-to-30)
> CocoaPods 1.9.0+ is required to build ServiceContainerKit 3.0.0+.
96
97
97
-
To integrate ServiceContainerKit (without Injects) into your Xcode project using CocoaPods, specify it in your `Podfile`:
98
+
To integrate ServiceContainerKit into your Xcode project using CocoaPods, specify it in your `Podfile`:
98
99
99
100
```ruby
100
101
source 'https://github.com/CocoaPods/Specs.git'
101
102
platform :ios, '10.0'
102
103
103
104
target '<Your Target Name>'do
104
105
pod 'ServiceContainerKit', '~> 3.0'
105
-
end
106
-
```
107
-
108
-
If you also need to use ServiceInject and EntityInject, then use:
109
-
```ruby
110
-
target '<Your Target Name>'do
111
-
pod 'ServiceContainerKit/Injects', '~> 3.0'
106
+
pod 'ServiceInjects', '~> 3.0'
112
107
end
113
108
```
114
109
@@ -118,6 +113,7 @@ Then, run the following command:
118
113
$ pod install
119
114
```
120
115
116
+
121
117
### Carthage
122
118
123
119
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
@@ -135,7 +131,9 @@ To integrate ServiceContainerKit into your Xcode project using Carthage, specify
135
131
github "ProVir/ServiceContainerKit" ~> 3.0
136
132
```
137
133
138
-
Run `carthage update` to build the framework and drag the built `ServiceContainerKit.framework` into your Xcode project.
134
+
Run `carthage update` to build the framework and drag the built `ServiceContainerKit.framework` and `ServiceInjects.framework` into your Xcode project.
135
+
136
+
139
137
140
138
### Swift Package Manager
141
139
@@ -144,22 +142,33 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for au
144
142
Once you have your Swift package set up, adding ServiceContainerKit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
0 commit comments