Skip to content

Commit 7a91260

Browse files
committed
Update readme for installations
1 parent cbac21a commit 7a91260

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

README.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,20 @@
99

1010
High percentage of unit test coverage **(~ 90%)**.
1111

12-
**P.S.**: We recommend that you download and study the `Example` project, which is made as one of the examples of using the
12+
**P.S.**: We recommend that you download and study the `Example` project, which is made as one of the usage examples.
1313

14-
#
14+
- [Introduction](#introduction)
15+
- [Features](#features)
16+
- [Requirements](#requirements)
17+
- [Communication](#communication)
18+
- [Migration from 2.0 to 3.0](#migration-from-20-to-30)
19+
- [Installation](#installation)
20+
- [Usage ServiceFactory (English / Русский)](#usage-servicefactory)
21+
- [Usage ServiceProvider (English / Русский)](#usage-serviceprovider)
22+
- [Author](#author)
23+
- [License](#license)
24+
25+
## Introduction
1526

1627
    *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.
1728

@@ -29,20 +40,10 @@
2940

3041
    Вы можете создать свой собственный контейнер для конкретного проекта с учетом его специфики и архитектуры. Один из простых способов создать свой контейнер - это использовать структуру с набором созданных и настроенных заранее сервисов либо их фабрик. А еще лучше - использовать обертку над сервисами (`ServiceProvider`), скрывающую способ создания сервиса - за ранее или по необходимости, а также его зависимости и используемые настройки.
3142

32-
    Для внедрения зависимостей на слое представления можно использовать `ServiceInject`, который только требует создать и зарегистрировать свой контейнер с сервисами, созданный по простым определенным правилам.
43+
    Для внедрения зависимостей на слое представления можно использовать `ServiceInject`, который только требует создать и зарегистрировать свой контейнер с сервисами, созданный по определенным простым правилам.
3344

3445
#
3546

36-
- [Features](#features)
37-
- [Requirements](#requirements)
38-
- [Communication](#communication)
39-
- [Migration from 2.0 to 3.0](#migration-from-20-to-30)
40-
- [Installation](#installation)
41-
- [Usage ServiceFactory (English / Русский)](#usage-servicefactory)
42-
- [Usage ServiceProvider (English / Русский)](#usage-serviceprovider)
43-
- [Author](#author)
44-
- [License](#license)
45-
4647

4748
## Features
4849

@@ -94,21 +95,15 @@ $ gem install cocoapods
9495

9596
> CocoaPods 1.9.0+ is required to build ServiceContainerKit 3.0.0+.
9697
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`:
9899

99100
```ruby
100101
source 'https://github.com/CocoaPods/Specs.git'
101102
platform :ios, '10.0'
102103

103104
target '<Your Target Name>' do
104105
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'
112107
end
113108
```
114109

@@ -118,6 +113,7 @@ Then, run the following command:
118113
$ pod install
119114
```
120115

116+
121117
### Carthage
122118

123119
[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
135131
github "ProVir/ServiceContainerKit" ~> 3.0
136132
```
137133

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+
139137

140138
### Swift Package Manager
141139

@@ -144,22 +142,33 @@ The [Swift Package Manager](https://swift.org/package-manager/) is a tool for au
144142
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`.
145143

146144
```swift
147-
dependencies: [
148-
.package(url: "https://github.com/ProVir/ServiceContainerKit", .upToNextMajor(from: "3.0.0"))
149-
]
145+
let package = Package(
146+
dependencies: [
147+
.package(url: "https://github.com/ProVir/ServiceContainerKit", .upToNextMajor(from: "3.0.0"))
148+
],
149+
targets: [
150+
.target(
151+
dependencies: [
152+
.byName(name: "ServiceContainerKit"),
153+
.product(name: "ServiceInjects", package: "ServiceContainerKit")
154+
]
155+
)
156+
]
157+
)
150158
```
151159

160+
152161
### Manually
153162

154163
If you prefer not to use any of the aforementioned dependency managers, you can integrate ServiceContainerKit into your project manually.
155164

156-
Copy files from directory `Sources` in your project.
165+
Copy files from directory `ServiceContainerKit/Sources` and `ServiceInjects/Sources` in your project.
157166

158167

159168
---
160169

161170

162-
**Note:** To use the library, remember to include it in each file: `import ServiceContainerKit`.
171+
**Note:** To use the library, remember to include it in each file: `import ServiceContainerKit` and `import ServiceInjects`.
163172

164173
The project has a less abstract example of using the library, which can be downloaded separately.
165174

0 commit comments

Comments
 (0)