I have one Broad cast I want to add UIImage as Icon and add Name for Showing I find this code but How can I use it
here is code I found it but how can I add the icon and app name ?
[func loadBroadcastingApplicationInfo(completion handler: @escaping (String, String, UIImage?) -> Void)][1]
My be it is use full something like this
extensionContext?.loadBroadcastingApplicationInfo (completion: {
(bundleID, displayName, appIcon) in
but I don't know how to use it.
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)
}
I used somthinglike this
extensionContext?.loadBroadcastingApplicationInfo (completion: {
(bundleID, displayName, appIcon) in
if let icon = appIcon {
}
DispatchQueue.main.async {
if (displayName != "") {
}
}
})