2

在此处输入图像描述我有一个广播我想将 UIImage 添加为 Icon 并添加 Name for Showing 我找到了这段代码,但我该如何使用它

这是我找到的代码,但是如何添加图标和应用程序名称?

[func loadBroadcastingApplicationInfo(completion handler: @escaping (String, String, UIImage?) -> Void)][1]

我是用这样的东西

 extensionContext?.loadBroadcastingApplicationInfo (completion: {  
            (bundleID, displayName, appIcon) in 

但我不知道如何使用它。

 override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        UIScreen.main.addObserver(self, forKeyPath: "captured", options: .new, context: nil)
        }

let broadcastPickerView = RPSystemBroadcastPickerView(frame: CGRect(x:0, y: 0, width: btnRS.frame.width, height: btnRS.frame.height))
    broadcastPickerView.translatesAutoresizingMaskIntoConstraints = false
    if let button = broadcastPickerView.subviews.first as? UIButton {
        button.imageView?.tintColor = UIColor.white

    }


    btnRS.addSubview(broadcastPickerView)
    broadcastPickerView.tintColor = .yellow
    broadcastPickerView.backgroundColor = .clear
    broadcastPickerView.showsMicrophoneButton = true

    btnRS.titleEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)


}

我用过类似的东西

   extensionContext?.loadBroadcastingApplicationInfo (completion: {  
            (bundleID, displayName, appIcon) in  
            if let icon = appIcon {  


            }  
            DispatchQueue.main.async {  
                if (displayName != "") {  

                }  


            }  

        })
4

0 回答 0