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::*;
use objc2_foundation::*;

use crate::*;

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

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

impl UILocalizedIndexedCollation {
    extern_methods!(
        #[unsafe(method(currentCollation))]
        #[unsafe(method_family = none)]
        pub fn currentCollation(mtm: MainThreadMarker) -> Retained<Self>;

        #[unsafe(method(sectionTitles))]
        #[unsafe(method_family = none)]
        pub fn sectionTitles(&self) -> Retained<NSArray<NSString>>;

        #[unsafe(method(sectionIndexTitles))]
        #[unsafe(method_family = none)]
        pub fn sectionIndexTitles(&self) -> Retained<NSArray<NSString>>;

        #[unsafe(method(sectionForSectionIndexTitleAtIndex:))]
        #[unsafe(method_family = none)]
        pub fn sectionForSectionIndexTitleAtIndex(&self, index_title_index: NSInteger)
            -> NSInteger;

        /// # Safety
        ///
        /// - `object` should be of the correct type.
        /// - `selector` must be a valid selector.
        #[unsafe(method(sectionForObject:collationStringSelector:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sectionForObject_collationStringSelector(
            &self,
            object: &AnyObject,
            selector: Sel,
        ) -> NSInteger;

        /// # Safety
        ///
        /// - `array` generic should be of the correct type.
        /// - `selector` must be a valid selector.
        #[unsafe(method(sortedArrayFromArray:collationStringSelector:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sortedArrayFromArray_collationStringSelector(
            &self,
            array: &NSArray,
            selector: Sel,
        ) -> Retained<NSArray>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UILocalizedIndexedCollation {
    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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}