objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiscreenmode?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIScreenMode;
);

unsafe impl Send for UIScreenMode {}

unsafe impl Sync for UIScreenMode {}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIScreenMode {}
);

impl UIScreenMode {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// This property is not atomic.
        #[unsafe(method(size))]
        #[unsafe(method_family = none)]
        pub fn size(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(pixelAspectRatio))]
        #[unsafe(method_family = none)]
        pub unsafe fn pixelAspectRatio(&self) -> CGFloat;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIScreenMode {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for UIScreenMode {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}