Skip to content

Commit bda2bf1

Browse files
updated docs from main repo
1 parent 37a55e1 commit bda2bf1

14 files changed

+268
-155
lines changed
857 KB
Loading
55.8 KB
Loading
1.27 MB
Loading
1.47 MB
Loading
1.33 MB
Loading

docusaurus/docs/iOS/assets/spm-00.png

-865 KB
Binary file not shown.

docusaurus/docs/iOS/assets/spm-01.png

-212 KB
Loading

docusaurus/docs/iOS/assets/spm-02.png

-84.9 KB
Loading
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
title: Integration
3+
---
4+
5+
# Integration
6+
7+
To integrate Stream Chat in your app, you can use one of the following dependency managers:
8+
9+
- [**Swift Package Manager**](#swift-package-manager)
10+
- [**CocoaPods**](#cocoapods)
11+
- [**Carthage**](#carthage)
12+
13+
We also provide pre-built XCFramework support, read more [here](#xcframeworks).
14+
15+
### Swift Package Manager
16+
17+
Open your `.xcodeproj`, select the option "Add Package..." in the File menu, and paste the URL for the library you want to integrate:
18+
19+
- For the LLC (**StreamChat**) use:
20+
- `https://github.com/getstream/stream-chat-swift`
21+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
22+
- `https://github.com/getstream/stream-chat-swift`
23+
- For the SwiftUI components (**StreamChatSwiftUI**, which depends on **StreamChat**) use:
24+
- `https://github.com/getstream/stream-chat-swiftui`
25+
26+
<details><summary>➤ Do you want to use <b>XCFrameworks</b>? (Click to read more)</summary>
27+
<p>
28+
29+
:::caution
30+
Our XCFrameworks are built with **Swift 5.5**. In order to use them you need **Xcode 13** or above
31+
:::
32+
33+
You can learn more about [our Module Stable XCFrameworks here](#xcframeworks)
34+
35+
- For the LLC (**StreamChat**) use:
36+
- `https://github.com/getstream/stream-chat-swift-spm`
37+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
38+
- `https://github.com/getstream/stream-chat-swift-spm`
39+
40+
</p>
41+
</details>
42+
43+
44+
After introducing the desired url, Xcode will look for the Packages available in the repository and automatically select the latest version tagged. Press next and Xcode will download the dependency.
45+
46+
![Screenshot shows an Xcode screen selecting a dependency version and an Xcode screen downloading that dependency](../assets/spm-01.png)
47+
48+
Based on the repository you select you can find 3 different targets: StreamChat, StreamChatUI and StreamChatSwiftUI.
49+
50+
- If you want to use the UIKit components, select **StreamChatUI**.
51+
- If you want to use the SwiftUI components, select **StreamChatSwiftUI**.
52+
- If you don't need any UI components, select **StreamChat**.
53+
54+
![Screenshot shows an Xcode screen with dependency targets to be selected](../assets/spm-02.png)
55+
56+
After you press finish, it's done!
57+
58+
:::caution
59+
Because StreamChat SDKs have to be distributed with its resources, the minimal Swift version requirement for this installation method is 5.3. If you need to support older Swift version, please install it using CocoaPods.
60+
:::
61+
62+
_More information about Swift Package Manager [can be found here](https://www.swift.org/package-manager/)_
63+
64+
### CocoaPods
65+
66+
In your project's `Podfile`, add one of these options
67+
68+
- For the LLC (**StreamChat**) use:
69+
- `pod 'StreamChat', '~> 4.0.0'`
70+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
71+
- `pod 'StreamChatUI', '~> 4.0.0'`
72+
- For the SwiftUI components (**StreamChatSwiftUI**, which depends on **StreamChat**) use:
73+
- `pod 'StreamChatSwiftUI', '~> 4.0.0'`
74+
75+
<details><summary>➤ Do you want to use <b>XCFrameworks</b>? (Click to read more)</summary>
76+
<p>
77+
78+
:::caution
79+
Our XCFrameworks are built with **Swift 5.5**. In order to use them you need **Xcode 13** or above
80+
:::
81+
82+
You can learn more about [our Module Stable XCFrameworks here](#xcframeworks)
83+
84+
- For the LLC (**StreamChat**) use:
85+
- `pod 'StreamChat-XCFramework', '~> 4.6.0'`
86+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
87+
- `pod 'StreamChatUI-XCFramework', '~> 4.6.0'`
88+
89+
</p>
90+
</details>
91+
92+
Example: If you want to use the UIKit components, it should look similar the snippet below.
93+
94+
```ruby
95+
target 'MyProject' do
96+
use_frameworks!
97+
98+
# Pods for MyProject
99+
pod 'StreamChatUI', '~> 4.0.0'
100+
end
101+
```
102+
103+
StreamChatUI and StreamChatSwiftUI pod will automatically include the StreamChat dependency. If you want just the StreamChat dependency, without the UI components, use StreamChat as shown above.
104+
105+
Now that we’ve modified our Podfile, let’s go ahead and install the project dependencies via the terminal with one simple command:
106+
107+
```bash
108+
pod install --repo-update
109+
```
110+
111+
The above command will generate the **MyProject.xcworkspace** file automatically.
112+
113+
With our workspace now containing our Pods project with dependencies, as well as our original project, let’s go ahead and move over to Xcode to complete the process.
114+
115+
_More information about CocoaPods [can be found here](https://cocoapods.org/)._
116+
117+
### Carthage
118+
119+
In your project's `Cartfile`, add one of these options
120+
121+
- For the LLC (**StreamChat**) use:
122+
- `github "getstream/stream-chat-swift" ~> 4.6.0`
123+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
124+
- `github "getstream/stream-chat-swift" ~> 4.6.0`
125+
126+
:::note
127+
Our SwiftUI components library is not yet available using Carthage, please use Swift Package Manager or CocoaPods.
128+
:::
129+
130+
131+
<details><summary>➤ Do you want to use <b>XCFrameworks</b>? (Click to read more)</summary>
132+
<p>
133+
134+
:::caution
135+
Our XCFrameworks are built with **Swift 5.5**. In order to use them you need **Xcode 13** or above
136+
:::
137+
138+
You can learn more about [our Module Stable XCFrameworks here](#xcframeworks)
139+
140+
- For the LLC (**StreamChat**) use:
141+
- `binary "https://raw.githubusercontent.com/GetStream/stream-chat-swift/main/StreamChatArtifacts.json" ~> 4.6`
142+
- For the UIKit components (**StreamChatUI**, which depends on **StreamChat**) use:
143+
- `binary "https://raw.githubusercontent.com/GetStream/stream-chat-swift/main/StreamChatArtifacts.json" ~> 4.6`
144+
145+
</p>
146+
</details>
147+
148+
Now that we’ve modified our Cartfile, let’s go ahead and install the project dependencies via the terminal with one simple command:
149+
150+
```bash
151+
carthage update --use-xcframeworks
152+
```
153+
154+
This command will create pre-built XCFrameworks built from our source code. You now need to add those to your project.
155+
156+
Open the `Carthage/Build` folder that has been created in the root of your project, and drag and drop the frameworks you want to use. Those should be added to the "Frameworks, Libraries, and Embedded Content" section under General settings:
157+
158+
![Screenshot shows XCFrameworks being draged into Xcode](../assets/carthage-drag.png)
159+
160+
Make sure you select **Embed & Sign** under "Embed" options if you are adding Stream libraries to an app target. If not, use **Do Not Embed**
161+
162+
![Screenshot shows Embed and Sign being the option selected](../assets/carthage-embed-and-sign.png)
163+
164+
_More information about Carthage [can be found here](https://github.com/Carthage/Carthage)._
165+
166+
## XCFrameworks
167+
168+
In an effort to have [**Module Stability**](https://www.swift.org/blog/library-evolution/), we have started distributing **pre-built XCFrameworks** starting ***4.6.0***
169+
170+
:::info
171+
Our XCFrameworks are built with Swift 5.5. In order to use them you need Xcode 13 or above.
172+
:::
173+
174+
An **XCFramework** is a package that contains binaries for multiple architectures/platforms, but only the particular slice of that package required for your architecture/platform will be used.
175+
176+
**Benefits of XCFrameworks:**
177+
- Conveniently import a single package
178+
- Supports all platforms and architectures (We support iOS in StreamChatUI and iOS/macOS in StreamChat)
179+
- No more fat binaries. No more architectures stripping
180+
181+
> Does this mean that from now on, I will need to import Stream manually?
182+
183+
**No**, [all the known dependency managers support this format](#), and this most likely happens without you even noticing.
184+
185+
186+
**Module Stability:**
187+
188+
While ABI Stability was allowing us to have code written with different Swift versions in the same runtime, Module Stability enables us to use a library built in a particular version of the compiler running in a different version of the compiler (Think of a framework that is built using Swift X to work on an app built with Swift X+1).

docusaurus/docs/iOS/basics/overview.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ We suggest using either [`StreamChatUI`](./uikit) or [`StreamChatSwiftUI`](./swi
3333
You can use this library to develop OSX application by using the `StreamChat` framework
3434
:::
3535

36-
### Dependencies
36+
### Dependencies
3737

3838
This SDK tries to keep the list of external dependencies to a minimum, these are the dependencies currently used:
3939

@@ -54,6 +54,11 @@ This SDK tries to keep the list of external dependencies to a minimum, these are
5454

5555
- [Starscream](https://github.com/daltoniam/Starscream) to handle WebSocket connections
5656

57+
:::note
58+
Starting **4.6.0**, and in order to improve the developer experience, dependencies are hidden inside our libraries.
59+
(Does not apply to StreamChatSwiftUI's dependencies yet)
60+
:::
61+
5762
## Upgrade and Versioning Strategy
5863

5964
The StreamChat Swift SDK adheres to the [semantic versioning](https://semver.org/) rules.
@@ -69,6 +74,8 @@ Occasionally, the SDK can include visual changes (whitespace, color changes, siz
6974

7075
You should either use a fixed version, or an optimitistic operator (a.k.a. squiggly arrow), with **all three versions specified**.
7176

77+
Eg. with CocoaPods:
78+
7279
```ruby
7380
pod 'StreamChat', '~> 4.0.0'
7481
```

0 commit comments

Comments
 (0)