![]() Name the text field ‘userIdTextField’ and click Connect. In the Main.storyboard on the left, control+click on the text field and drag your mouse to the ViewController.swift class to insert the IBOutlet variable. Next, we will add variables for the text field and button that is connected to the weak var userIdTextField: weak var authenticateButton: UIButton! At the top, select the Main.storyboard option and select ViewController.swift to change files. When looking at the Main.storyboard file, open an editor to the right (click on the square icon with the pipe | and plus + symbols). Next, we will edit the ViewController.swift class so that when a user ID is entered into the text field and the sign-in button is clicked, the user is authenticated with Sendbird Calls. Double click the button to edit the text to say ‘Sign In’.Ģ. Drag the button onto the view, next to the text field. ![]() Select the + icon in the top right again and search for a Button. Show the Attributes inspector and edit the Placeholder to say ‘User ID’. Drag it into the top center half of the view. Select the + icon in the top right and search for a Text Field. When you select the Main.storyboard file, you should see the View Controller Scene by default. In Main.storyboard, add a text field for entering the user id and a sign-in button.ġ. Comment out the placeholder text ‘code’ since we will implement this function a bit later. ![]() Select Fix to automatically add the SendBirdCallDelegate protocol to the AppDelegate that implements the didStartRinging(_ call: DirectCall) function. Xcode may show you a warning that Argument type ‘AppDelegate’ does not conform to expected type ‘SendBirdCallDelegate’, followed by a ‘Fix’ option. Do this by adding your Sendbird application ID and configuring Sendbird Calls for your app. In the AppDelegate.swift file, import Sendbird Calls and update the didFinishLaunchingWithOptions method. This will make it possible to build and run the app later.ģ. For this tutorial, you can skip adding any background mode operations.Īfter installation and SDK configuration, be sure to close any current Xcode sessions and use the `ScreenShare.xcworkspace` file for this project from now on. This will walk you through all of the SDK installation and ist file configuration necessary for this application to enable the microphone and camera. ![]() Follow the Getting started and Configuring the application for the SDK sections on the Sendbird Calls iOS SDK Readme.md page on GitHub. Xcode will automatically create your application with the AppDelegate.swift, ViewController.swift, and the Main.storyboard files that we will be editing in this tutorial.Ģ. Name your app ScreenShare, set the Interface to Storyboard, and select Swift as the language: Create a new Xcode app, configure and import Sendbird Calls In our case, the keyboard gets resigned.Step 1. doneButtonAction() - this is a function that triggers when the user presses the keyboard Done button.In other words, use this function to customize the toolbar. You can name the button however you want, and you can add multiple buttons (depending on your needs). Inside the toolbar, we create a UIBarButtonItem. addDoneKeyboardButton() - creates the keyboard done button using UIToolbar.I think that the snippet is self-explanatory, but I will walk you through the functions… How to add the Keyboard Done Button import Foundation import UIKit extension UITextFieldĬreate an extension called UITextField+Extensions.swift, and copy-paste this snippet above. NOTE: This screenshot shows you more attributes, but you need to pay attention only to the Done Accessory.
0 Comments
Leave a Reply. |