iOS Chat SDK Setup Confused about something? Let us know how we can improve: Submit

To get started with the iOS Swift Chat SDK, create a new Swift project in Xcode 11 with a “Single View App” template using the project name ChatDemo.

Select Storyboard in the User Interface options.

Close the Xcode project for now. We will use Cocoapods dependency manager to setup Stream Chat, which will generate Xcode workspace file for our project.

Open a terminal and navigate to your project path:

cd ~/path/to/my/projects/ChatDemo/

CocoaPods

For this tutorial we are going to use CocoaPods as dependency manager.

You can also install the SDK with Cartage or with Swift Package Manager

If you do not currently have CocoaPods installed, you can do so by running the following command:

sudo gem install cocoapods

Please note that if you already have CocoaPods installed, make sure you run the most recent version or you may receive errors later on in the development process.

sudo gem update cocoapods

Now that you are in your project directory and have ensured that CocoaPods is installed, let’s go ahead and install the Swift Chat SDK.

Initialize CocoaPods and create a Podfile:

pod init

Open the generated Podfile and modify the contents of the file with the following snippet:

platform :ios, '11.0' target 'ChatDemo' do use_frameworks! pod 'StreamChat', '~> 2.2' end

Now that we’ve modified our Podfile, let’s go ahead and install the project dependencies via the terminal with one simple command:

pod install --repo-update

The above command will generate the ChatDemo.xcworkspace file automatically.

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.