use objc::runtime::Object;
use objc::{class, msg_send, sel, sel_impl};
use objc_id::Id;
use crate::foundation::{id, NSString};
#[derive(Debug)]
pub struct Notification(pub Id<Object>);
impl Notification {
pub fn new(title: &str, body: &str) -> Self {
let title = NSString::new(title);
let body = NSString::new(body);
Notification(unsafe {
let content: id = msg_send![class!(UNMutableNotificationContent), new];
let _: () = msg_send![content, setTitle: title];
let _: () = msg_send![content, setBody: body];
Id::from_ptr(content)
})
}
}