Getting Started

In your View Controller, load Dyte Meeting view

There are two ways to load view

Create View Programmatically

import UIKit
import DyteSdk;

class ViewController: UIViewController {
    @IBOutlet weak var videoButton: UIButton?
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func joinMeeting(_ sender: Any) {
                    let  config = DyteMeetingConfig();
                config.roomName = "YOUR_ROOM_NAME";
                config.authToken = "YOUR_AUTH_TOKEN";
                let dyteView = DyteMeetingView(frame: CGRect(x: 0, y: 0, width: self.view.bounds.size.width, height:self.view.bounds.size.height ))
                dyteView.delegate = self
                dyteView.tag  = 100
                self.dyteView = dyteView;
                self.view.addSubview(dyteView)
                dyteView.join(config);
    }
    
    fileprivate func onMeetingEnded() {
        if let viewWithTag = self.view.viewWithTag(100) {
            viewWithTag.removeFromSuperview()
        }
    }
}


extension ViewController: DyteMeetingViewDelegate {
    func meetingEnded() {
        DispatchQueue.main.async { [weak self] in
            self?.onMeetingEnded()
        }
    }
}
//Add DyteMeetingViewDelegate in your ViewController.h file
#import "ViewController.h"
@import DyteSdk;

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (IBAction)joinMeeting:(UIButton *)sender {
    DyteMeetingConfig *meetingConfig = [[DyteMeetingConfig alloc] init];
      meetingConfig.roomName = @"YOUR_ROOM_NAME"; //Enter your room name here
      meetingConfig.authToken = @"YOUR_AUTH_TOKEN";
      meetingConfig.width = self.view.frame.size.width;
      meetingConfig.height = self.view.frame.size.height;
      DyteMeetingView *dyteView = [[DyteMeetingView alloc] initWithFrame:CGRectMake(0.0, 0.0, meetingConfig.width, meetingConfig.height)];
      dyteView.delegate = self;
      dyteView.tag = 100;
      [self.view addSubview:dyteView];
      [dyteView join:meetingConfig];
}

- (void)meetingEnded {
  dispatch_async(dispatch_get_main_queue(), ^{
    for (UIView *view in [self.view subviews])
    {
      if (view.tag == 100) {
        [view removeFromSuperview];
      }
    }
  });
}



@end

Using storyboard

  1. Add DyteMeetingView in storyboard
#import "ViewController.h"
@import DyteSdk;

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
      DyteMeetingConfig *meetingConfig = [[DyteMeetingConfig alloc] init];
    meetingConfig.roomName = @"cluttered-vessel";
    DyteMeetingView *dyteMeetingView = (DyteMeetingView *) self.view;
    [dyteMeetingView join:meetingConfig];

}
@end