-
I'm trying to use SCContentSharingPicker, but I don't understand how to use it. I tried this code use use cidre::sc;
pub struct SCKitPickerObserverInner {}
cidre::define_obj_type!(
SCKitPickerObserver,
SCKitPickerObserverInner,
PICKER_OBSERVER
);
impl cidre::sc::content_sharing_picker::Observer for SCKitPickerObserver {
fn picker_did_cancel_for_stream(
&mut self,
picker: &mut sc::ContentSharingPicker,
stream: Option<&sc::Stream>,
) {
}
#[inline]
fn picker_did_update_with_filter_for_stream(
&mut self,
picker: &mut sc::ContentSharingPicker,
filter: &sc::ContentFilter,
stream: Option<&sc::Stream>,
) {
println!("Picker did update with filter: {:?}", filter);
}
#[inline]
fn picker_start_did_fail_with_err(&mut self, err: &ns::Error) {}
}
let mut picker = cidre::sc::ContentSharingPicker::shared();
let observer = SCKitPickerObserver::with(SCKitPickerObserverInner {});
picker.add_observer(observer.as_ref());
picker.set_active(true);
picker.present(); When I picked the window to be recorded, nothing was displayed. |
Beta Was this translation helpful? Give feedback.
Answered by
yury
Apr 26, 2025
Replies: 2 comments
-
Hello, Added sc-picked example for you. It is not obvious and not documented yet, but for implementing objc protocols you have to implement Impl traits and impl_ functions. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kusaanko
-
Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Added sc-picked example for you.
It is not obvious and not documented yet, but for implementing objc protocols you have to implement Impl traits and impl_ functions.