If you are wondering how to build an iOS video chat app on your own, don’t worry. It’s not a difficult task with ZEGOCLOUD that will make it even easier. In this article, you will learn how to create a video chat app for iOS step-by-step in just a few minutes!
Why ZEGOCLOUD SDK for iOS Video Call
To begin with, let me introduce you to ZEGOCLOUD in case you haven’t come across it before. ZEGOCLOUD is an iOS video call SDK provider that offers developers an easy way to incorporate video call functionality into their iOS applications. It provides high-quality video and audio transmission, ensuring a seamless and immersive iOS app development experience for users.
With ZEGOCLOUD, developers can integrate video call features into their iOS apps without the need for extensive coding expertise. It also supports real-time interactions with up to 50 participants, making it ideal for group video calls. Additionally, it offers a range of features, including screen sharing, whiteboarding, and recording, allowing developers to create customized and engaging video call experiences for their users.
Moreover, ZEGOCLOUD provides a faster and easier way – UIKits is a brand-new pre-built tool and UI Components. Through it, We can complete the development of video calls, live streaming, video conference, and other scenarios within 30 minutes. As shown in the figure, UIKits SDK is responsible for processing audio and video calls for iOS and the logic related to text chat. Include:
- UI and interaction of the calling module
- call status management
- Audio and video data transmission
You only need to implement business-related logic. For example:
- User login registration
- Friends List Management
- Call billing recharge
When to use UIKits SDK
- Testing Tools In the early market research stage, quickly verify customer needs.
- MVP Quickly realizes minimal products, demonstrates market demand, and gains investor trust.
- In-app plugins Added audio and video calling module to improve daily application activities and increase user stickiness.

Moreover, ZEGOCLOUD provides a faster and easier way – UIKits is a brand-new pre-built tool and UI Components by ZEGOCLOUD. Through it, We can complete the development of video calls, live streaming, video conference, and other scenarios within 30 minutes. As shown in the figure, UIKits SDK is responsible for processing audio and video calls and the logic related to text chat. Include:
- UI and interaction of the calling module
- call status management
- Audio and video data transmission
You only need to implement business-related logic. For example:
- User login registration
- Friends List Management
- Call billing recharge
When to use UIKits SDK
- Testing Tools In the early market research stage, quickly verify customer needs.
- MVP Quickly realizes minimal products, demonstrates market demand, and gains investor trust.
- In-app plugins Added audio and video calling module to improve daily application activities and increase user stickiness.
Preparation
- A ZEGOCLOUD developer account — Register
- Xcode 12.3 or later
- Devices with iOS 12.0 or later
- Basic understanding of iOS development
How to Build iOS APP: Video Call Integration Tutorial
Step 1: Create project
We first create a new project through Xcode and an App project through File -> New -> Project -> App.

Step 2: Import SDK
1)Create Podfile
Open Terminal
, navigate to your project’s root directory, and run the pod init
command to create a Podfile
.
pod init

2)Add SDK dependencies
Open the Podfile
file and add the pod 'ZegoUIKitPrebuiltCall'
SDK dependency.

3)Install SDK
Open Terminal
, and execute the pod install
command to install the SDK.
pod install

Step 3: Implement Video Call
After completing the preparatory work, you can start writing code. Use Xcode
to open the FFile with the suffix .xcworkspace
in the project root directory.
Camera & microphone permission application
Before coding, we first register the camera and microphone permission in the info.plist
file.
<key>NSCameraUsageDescription</key>
<string>We require camera access to connect to a call</string>
<key>NSMicrophoneUsageDescription</key>
<string>We require microphone access to connect to a call</string>

Integrate a Call Button
Add a Call
button in Main.storyboard
, and add a button to click event listener in ViewController
.

Add call method
Finally, complete the SDK access in the ViewController
file according to the following four steps.

1) Import the ZegoUIKitPrebuiltCall
and ZegoUIKitSDK
library
import ZegoUIKitPrebuiltCall
import ZegoUIKitSDK
2) Add constant definition
let appID: UInt32 = <#Your App ID#>
let appSign = <#Your App Sign#>
let callID = "callID111"
let userID = "userID" + String(Int.random(in: 0..<1000))
let userName = "User" + String(Int.random(in: 0..<100))
3) Add call logic
private func oneOnOneVideoCall() {
let config: ZegoUIKitPrebuiltCallConfig = ZegoUIKitPrebuiltCallConfig(.oneOnOneVideoCall)
let callVC = ZegoUIKitPrebuiltCallVC(appID, appSign: appSign, userID: userID, userName: userName, callID: callID, config: config)
callVC.modalPresentationStyle = .fullScreen
self.present(callVC, animated: true, completion: nil)
}
4) Call the method implemented in step 3
@IBAction func pressCallButton(_ sender: UIButton) {
oneOnOneVideoCall()
}
Run a demo
1v1 video call UI configuration
The UIKits SDK provides a wealth of custom configuration items, and UI interaction can be quickly modified by setting different parameters.
1V1 video call scene settings can be done through the ZegoLayoutPictureInPictureConfig
configuration item:
1)showMyViewWithVideoOnly
: Whether to display my view when my camera is turned off, displayed by default.
2) isSmallViewDraggable
: Whether the position of the small view in the picture-in-picture layout can be changed by dragging. It’s allowed by default.
3) switchLargeOrSmallViewByClick
: Whether to allow users to click on the small view to switch between large and small view. It’s allowed by default.
private func pictureInPictureLayout() {
// Modify your custom configurations here.
let config: ZegoUIKitPrebuiltCallConfig = ZegoUIKitPrebuiltCallConfig(.oneOnOneVideoCall)
let layout: ZegoLayout = ZegoLayout()
layout.mode = .pictureInPicture
let pipConfig: ZegoLayoutPictureInPictureConfig = ZegoLayoutPictureInPictureConfig()
pipConfig.showMyViewWithVideoOnly = true;
pipConfig.isSmallViewDraggable = true;
pipConfig.switchLargeOrSmallViewByClick = true;
layout.config = pipConfig
config.layout = layout
let callVC = ZegoUIKitPrebuiltCallVC(appID, appSign: appSign, userID: userID, userName: userName, callID: callID, config: config)
callVC.modalPresentationStyle = .fullScreen
self.present(callVC, animated: true, completion: nil)
}
Group Video Call UI configuration
If you are making a group video call application, the Video Call API can configure the group video call UI via ZegoLayoutGalleryConfig.
private func galleryLayout() {
// Modify your custom configurations here.
let config: ZegoUIKitPrebuiltCallConfig = ZegoUIKitPrebuiltCallConfig(.groupVideoCall)
let layout: ZegoLayout = ZegoLayout()
layout.mode = .gallery
let layoutConfig: ZegoLayoutGalleryConfig = ZegoLayoutGalleryConfig()
layoutConfig.addBorderRadiusAndSpacingBetweenView = false;
layout.config = layoutConfig
config.layout = layout
let callVC = ZegoUIKitPrebuiltCallVC(appID, appSign: appSign, userID: userID, userName: userName, callID: callID, config: config)
callVC.modalPresentationStyle = .fullScreen
self.present(callVC, animated: true, completion: nil)
}
Conclusion
ZEGOCLOUD iOS video chat API is designed to be simpler so that we don’t need to spend a lot of time studying the use of APIs and can focus on business logic implementation If you are interested in developing audio and video applications, you can download this article’s sample Demo source code. You can use our Core SDK for requirements such as streaming mix, noise reduction, censorship, etc. For questions, you can always consult us 24h technical support.
Talk to Expert
Learn more about our solutions and get your question answered.