小编kok*_*kun的帖子

如何解决“AddInstanceForFactory:没有为 id <CFUUID 0x600001bef9c0> 注册工厂”错误?

我正在学习https://github.com/LaiFengiOS/LFLiveKit/blob/master/samples/LFLiveKitSwiftDemo/LFLiveKitSwiftDemo/ViewController.swift的作用。

import UIKit
import LFLiveKit

class ViewController: UIViewController, LFLiveSessionDelegate {

  override func viewDidLoad() {
    super.viewDidLoad()

    session.delegate = self
    session.preView = self.view

    self.requestAccessForAudio()
    self.requestAccessForVideo()
    self.view.backgroundColor = UIColor.clear
    self.view.addSubview(containerView)
    containerView.addSubview(stateLabel)
    containerView.addSubview(closeButton)
    containerView.addSubview(beautyButton)
    containerView.addSubview(cameraButton)
    containerView.addSubview(startLiveButton)

    cameraButton.addTarget(self, action:  #selector(didTappedCameraButton(_:)), for: .touchUpInside)
    beautyButton.addTarget(self, action: #selector(didTappedBeautyButton(_:)), for: .touchUpInside)
    startLiveButton.addTarget(self, action: #selector(didTappedCloseButton(_:)), for: .touchUpInside)
  }

  override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
  }

  func requestAccessForAudio() -> Void {
    let status = AVCaptureDevice.authorizationStatus(for: AVMediaType.audio)
    switch status {
    case AVAuthorizationStatus.notDetermined:
      AVCaptureDevice.requestAccess(for: AVMediaType.audio, completionHandler: { ( granted ) in

      }) …
Run Code Online (Sandbox Code Playgroud)

ios swift

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

ios ×1

swift ×1