use objc::{msg_send, sel, sel_impl};
use crate::{
object,
objective_c_runtime::{
macros::interface_impl,
traits::{FromId, PNSObject},
},
};
use super::NSLayoutConstraint;
object! {
unsafe pub struct NSLayoutAnchor;
}
#[interface_impl(NSObject)]
impl NSLayoutAnchor {
#[method]
pub fn constraint_equal_to_anchor<A>(&self, anchor: A) -> NSLayoutConstraint
where
A: INSLayoutAnchor,
{
unsafe {
NSLayoutConstraint::from_id(msg_send![self.m_self(), constraintEqualToAnchor: anchor])
}
}
}