Skip to content

Commit 01e9c32

Browse files
authored
Migs647/spm how to (#1002)
* Added SPM support in README.md
1 parent d1bf7a4 commit 01e9c32

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,39 @@ Note: Segment _strongly_ recommends that you use a dynamic framework to manage y
6969
github "segmentio/analytics-ios"
7070
```
7171

72+
### Swift Package Manager (SPM)
73+
74+
To add analytics-ios via Swift Package Mangaer, it is possible to add it one of two ways:
75+
76+
#### Xcode
77+
![Xcode Add SPM Package](https://user-images.githubusercontent.com/917994/119199146-69765200-ba3f-11eb-9173-93cfb5f3cabd.png)
78+
79+
![ChoosePackageRepository](https://user-images.githubusercontent.com/917994/119199143-68ddbb80-ba3f-11eb-9bf2-5dc11c208abd.png)
80+
81+
![ChoosePackageOptions](https://user-images.githubusercontent.com/917994/119199139-67ac8e80-ba3f-11eb-9941-fc541030f3df.png)
82+
83+
84+
#### Package.swift
85+
```
86+
import PackageDescription
87+
88+
let package = Package(
89+
name: "MyApplication",
90+
dependencies: [
91+
// Add a package containing Analytics as the name along with the git url
92+
.package(
93+
name: "Segment",
94+
url: "[email protected]:segmentio/analytics-ios.git"
95+
)
96+
],
97+
targets: [
98+
name: "MyApplication",
99+
dependencies: ["Segment"] // Add Analytics as a dependency of your application
100+
]
101+
)
102+
```
103+
Note: Segment recommends that you use Xcode to add your package.
104+
72105
## Quickstart
73106

74107
Refer to the Quickstart documentation at [https://segment.com/docs/libraries/ios/quickstart](https://segment.com/docs/libraries/ios/quickstart/).

0 commit comments

Comments
 (0)