objc2_ui_kit/generated/
UITableView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewstyle?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UITableViewStyle(pub NSInteger);
20impl UITableViewStyle {
21    #[doc(alias = "UITableViewStylePlain")]
22    pub const Plain: Self = Self(0);
23    #[doc(alias = "UITableViewStyleGrouped")]
24    pub const Grouped: Self = Self(1);
25    #[doc(alias = "UITableViewStyleInsetGrouped")]
26    pub const InsetGrouped: Self = Self(2);
27}
28
29unsafe impl Encode for UITableViewStyle {
30    const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UITableViewStyle {
34    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewscrollposition?language=objc)
38// NS_ENUM
39#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct UITableViewScrollPosition(pub NSInteger);
42impl UITableViewScrollPosition {
43    #[doc(alias = "UITableViewScrollPositionNone")]
44    pub const None: Self = Self(0);
45    #[doc(alias = "UITableViewScrollPositionTop")]
46    pub const Top: Self = Self(1);
47    #[doc(alias = "UITableViewScrollPositionMiddle")]
48    pub const Middle: Self = Self(2);
49    #[doc(alias = "UITableViewScrollPositionBottom")]
50    pub const Bottom: Self = Self(3);
51}
52
53unsafe impl Encode for UITableViewScrollPosition {
54    const ENCODING: Encoding = NSInteger::ENCODING;
55}
56
57unsafe impl RefEncode for UITableViewScrollPosition {
58    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
59}
60
61/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewrowanimation?language=objc)
62// NS_ENUM
63#[repr(transparent)]
64#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
65pub struct UITableViewRowAnimation(pub NSInteger);
66impl UITableViewRowAnimation {
67    #[doc(alias = "UITableViewRowAnimationFade")]
68    pub const Fade: Self = Self(0);
69    #[doc(alias = "UITableViewRowAnimationRight")]
70    pub const Right: Self = Self(1);
71    #[doc(alias = "UITableViewRowAnimationLeft")]
72    pub const Left: Self = Self(2);
73    #[doc(alias = "UITableViewRowAnimationTop")]
74    pub const Top: Self = Self(3);
75    #[doc(alias = "UITableViewRowAnimationBottom")]
76    pub const Bottom: Self = Self(4);
77    #[doc(alias = "UITableViewRowAnimationNone")]
78    pub const None: Self = Self(5);
79    #[doc(alias = "UITableViewRowAnimationMiddle")]
80    pub const Middle: Self = Self(6);
81    #[doc(alias = "UITableViewRowAnimationAutomatic")]
82    pub const Automatic: Self = Self(100);
83}
84
85unsafe impl Encode for UITableViewRowAnimation {
86    const ENCODING: Encoding = NSInteger::ENCODING;
87}
88
89unsafe impl RefEncode for UITableViewRowAnimation {
90    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
91}
92
93/// A setting for which items in the table view should tightly hug their content
94///
95/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewcontenthuggingelements?language=objc)
96// NS_OPTIONS
97#[repr(transparent)]
98#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
99pub struct UITableViewContentHuggingElements(pub NSInteger);
100bitflags::bitflags! {
101    impl UITableViewContentHuggingElements: NSInteger {
102/// A content hugging mode where none of the items in the table view tightly hug their content
103        #[doc(alias = "UITableViewContentHuggingElementsNone")]
104        const None = 0;
105/// A content hugging mode where section headers in the table view tightly hug their content
106        #[doc(alias = "UITableViewContentHuggingElementsSectionHeaders")]
107        const SectionHeaders = 1<<0;
108    }
109}
110
111unsafe impl Encode for UITableViewContentHuggingElements {
112    const ENCODING: Encoding = NSInteger::ENCODING;
113}
114
115unsafe impl RefEncode for UITableViewContentHuggingElements {
116    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
117}
118
119extern "C" {
120    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewindexsearch?language=objc)
121    pub static UITableViewIndexSearch: &'static NSString;
122}
123
124extern "C" {
125    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewautomaticdimension?language=objc)
126    #[cfg(feature = "objc2-core-foundation")]
127    pub static UITableViewAutomaticDimension: CGFloat;
128}
129
130/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewrowactionstyle?language=objc)
131// NS_ENUM
132#[deprecated = "Use UIContextualAction and related APIs instead."]
133#[repr(transparent)]
134#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
135pub struct UITableViewRowActionStyle(pub NSInteger);
136impl UITableViewRowActionStyle {
137    #[deprecated = "Use UIContextualAction and related APIs instead."]
138    #[doc(alias = "UITableViewRowActionStyleDefault")]
139    pub const Default: Self = Self(0);
140    #[deprecated = "Use UIContextualAction and related APIs instead."]
141    #[doc(alias = "UITableViewRowActionStyleDestructive")]
142    pub const Destructive: Self = Self(UITableViewRowActionStyle::Default.0);
143    #[deprecated = "Use UIContextualAction and related APIs instead."]
144    #[doc(alias = "UITableViewRowActionStyleNormal")]
145    pub const Normal: Self = Self(1);
146}
147
148unsafe impl Encode for UITableViewRowActionStyle {
149    const ENCODING: Encoding = NSInteger::ENCODING;
150}
151
152unsafe impl RefEncode for UITableViewRowActionStyle {
153    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
154}
155
156extern_class!(
157    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewrowaction?language=objc)
158    #[unsafe(super(NSObject))]
159    #[thread_kind = MainThreadOnly]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    #[deprecated = "Use UIContextualAction and related APIs instead."]
162    pub struct UITableViewRowAction;
163);
164
165unsafe impl NSCopying for UITableViewRowAction {}
166
167unsafe impl CopyingHelper for UITableViewRowAction {
168    type Result = Self;
169}
170
171unsafe impl NSObjectProtocol for UITableViewRowAction {}
172
173impl UITableViewRowAction {
174    extern_methods!(
175        #[cfg(feature = "block2")]
176        #[deprecated = "Use UIContextualAction and related APIs instead."]
177        #[unsafe(method(rowActionWithStyle:title:handler:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn rowActionWithStyle_title_handler(
180            style: UITableViewRowActionStyle,
181            title: Option<&NSString>,
182            handler: &block2::Block<dyn Fn(NonNull<UITableViewRowAction>, NonNull<NSIndexPath>)>,
183            mtm: MainThreadMarker,
184        ) -> Retained<Self>;
185
186        #[deprecated = "Use UIContextualAction and related APIs instead."]
187        #[unsafe(method(style))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn style(&self) -> UITableViewRowActionStyle;
190
191        #[deprecated = "Use UIContextualAction and related APIs instead."]
192        #[unsafe(method(title))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
195
196        /// Setter for [`title`][Self::title].
197        #[deprecated = "Use UIContextualAction and related APIs instead."]
198        #[unsafe(method(setTitle:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn setTitle(&self, title: Option<&NSString>);
201
202        #[cfg(feature = "UIColor")]
203        #[deprecated = "Use UIContextualAction and related APIs instead."]
204        #[unsafe(method(backgroundColor))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn backgroundColor(&self) -> Option<Retained<UIColor>>;
207
208        #[cfg(feature = "UIColor")]
209        /// Setter for [`backgroundColor`][Self::backgroundColor].
210        #[deprecated = "Use UIContextualAction and related APIs instead."]
211        #[unsafe(method(setBackgroundColor:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setBackgroundColor(&self, background_color: Option<&UIColor>);
214
215        #[cfg(feature = "UIVisualEffect")]
216        #[deprecated = "Use UIContextualAction and related APIs instead."]
217        #[unsafe(method(backgroundEffect))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn backgroundEffect(&self) -> Option<Retained<UIVisualEffect>>;
220
221        #[cfg(feature = "UIVisualEffect")]
222        /// Setter for [`backgroundEffect`][Self::backgroundEffect].
223        #[deprecated = "Use UIContextualAction and related APIs instead."]
224        #[unsafe(method(setBackgroundEffect:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn setBackgroundEffect(&self, background_effect: Option<&UIVisualEffect>);
227    );
228}
229
230/// Methods declared on superclass `NSObject`.
231impl UITableViewRowAction {
232    extern_methods!(
233        #[unsafe(method(init))]
234        #[unsafe(method_family = init)]
235        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
236
237        #[unsafe(method(new))]
238        #[unsafe(method_family = new)]
239        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
240    );
241}
242
243extern_class!(
244    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewfocusupdatecontext?language=objc)
245    #[unsafe(super(UIFocusUpdateContext, NSObject))]
246    #[thread_kind = MainThreadOnly]
247    #[derive(Debug, PartialEq, Eq, Hash)]
248    #[cfg(feature = "UIFocus")]
249    pub struct UITableViewFocusUpdateContext;
250);
251
252#[cfg(feature = "UIFocus")]
253unsafe impl NSObjectProtocol for UITableViewFocusUpdateContext {}
254
255#[cfg(feature = "UIFocus")]
256impl UITableViewFocusUpdateContext {
257    extern_methods!(
258        #[unsafe(method(previouslyFocusedIndexPath))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn previouslyFocusedIndexPath(&self) -> Option<Retained<NSIndexPath>>;
261
262        #[unsafe(method(nextFocusedIndexPath))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn nextFocusedIndexPath(&self) -> Option<Retained<NSIndexPath>>;
265    );
266}
267
268/// Methods declared on superclass `NSObject`.
269#[cfg(feature = "UIFocus")]
270impl UITableViewFocusUpdateContext {
271    extern_methods!(
272        #[unsafe(method(init))]
273        #[unsafe(method_family = init)]
274        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
275
276        #[unsafe(method(new))]
277        #[unsafe(method_family = new)]
278        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
279    );
280}
281
282extern_protocol!(
283    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdelegate?language=objc)
284    #[cfg(feature = "UIScrollView")]
285    pub unsafe trait UITableViewDelegate:
286        NSObjectProtocol + UIScrollViewDelegate + MainThreadOnly
287    {
288        #[cfg(all(
289            feature = "UIResponder",
290            feature = "UITableViewCell",
291            feature = "UIView"
292        ))]
293        #[optional]
294        #[unsafe(method(tableView:willDisplayCell:forRowAtIndexPath:))]
295        #[unsafe(method_family = none)]
296        unsafe fn tableView_willDisplayCell_forRowAtIndexPath(
297            &self,
298            table_view: &UITableView,
299            cell: &UITableViewCell,
300            index_path: &NSIndexPath,
301        );
302
303        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
304        #[optional]
305        #[unsafe(method(tableView:willDisplayHeaderView:forSection:))]
306        #[unsafe(method_family = none)]
307        unsafe fn tableView_willDisplayHeaderView_forSection(
308            &self,
309            table_view: &UITableView,
310            view: &UIView,
311            section: NSInteger,
312        );
313
314        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
315        #[optional]
316        #[unsafe(method(tableView:willDisplayFooterView:forSection:))]
317        #[unsafe(method_family = none)]
318        unsafe fn tableView_willDisplayFooterView_forSection(
319            &self,
320            table_view: &UITableView,
321            view: &UIView,
322            section: NSInteger,
323        );
324
325        #[cfg(all(
326            feature = "UIResponder",
327            feature = "UITableViewCell",
328            feature = "UIView"
329        ))]
330        #[optional]
331        #[unsafe(method(tableView:didEndDisplayingCell:forRowAtIndexPath:))]
332        #[unsafe(method_family = none)]
333        unsafe fn tableView_didEndDisplayingCell_forRowAtIndexPath(
334            &self,
335            table_view: &UITableView,
336            cell: &UITableViewCell,
337            index_path: &NSIndexPath,
338        );
339
340        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
341        #[optional]
342        #[unsafe(method(tableView:didEndDisplayingHeaderView:forSection:))]
343        #[unsafe(method_family = none)]
344        unsafe fn tableView_didEndDisplayingHeaderView_forSection(
345            &self,
346            table_view: &UITableView,
347            view: &UIView,
348            section: NSInteger,
349        );
350
351        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
352        #[optional]
353        #[unsafe(method(tableView:didEndDisplayingFooterView:forSection:))]
354        #[unsafe(method_family = none)]
355        unsafe fn tableView_didEndDisplayingFooterView_forSection(
356            &self,
357            table_view: &UITableView,
358            view: &UIView,
359            section: NSInteger,
360        );
361
362        #[cfg(all(
363            feature = "UIResponder",
364            feature = "UIView",
365            feature = "objc2-core-foundation"
366        ))]
367        #[optional]
368        #[unsafe(method(tableView:heightForRowAtIndexPath:))]
369        #[unsafe(method_family = none)]
370        unsafe fn tableView_heightForRowAtIndexPath(
371            &self,
372            table_view: &UITableView,
373            index_path: &NSIndexPath,
374        ) -> CGFloat;
375
376        #[cfg(all(
377            feature = "UIResponder",
378            feature = "UIView",
379            feature = "objc2-core-foundation"
380        ))]
381        #[optional]
382        #[unsafe(method(tableView:heightForHeaderInSection:))]
383        #[unsafe(method_family = none)]
384        unsafe fn tableView_heightForHeaderInSection(
385            &self,
386            table_view: &UITableView,
387            section: NSInteger,
388        ) -> CGFloat;
389
390        #[cfg(all(
391            feature = "UIResponder",
392            feature = "UIView",
393            feature = "objc2-core-foundation"
394        ))]
395        #[optional]
396        #[unsafe(method(tableView:heightForFooterInSection:))]
397        #[unsafe(method_family = none)]
398        unsafe fn tableView_heightForFooterInSection(
399            &self,
400            table_view: &UITableView,
401            section: NSInteger,
402        ) -> CGFloat;
403
404        #[cfg(all(
405            feature = "UIResponder",
406            feature = "UIView",
407            feature = "objc2-core-foundation"
408        ))]
409        #[optional]
410        #[unsafe(method(tableView:estimatedHeightForRowAtIndexPath:))]
411        #[unsafe(method_family = none)]
412        unsafe fn tableView_estimatedHeightForRowAtIndexPath(
413            &self,
414            table_view: &UITableView,
415            index_path: &NSIndexPath,
416        ) -> CGFloat;
417
418        #[cfg(all(
419            feature = "UIResponder",
420            feature = "UIView",
421            feature = "objc2-core-foundation"
422        ))]
423        #[optional]
424        #[unsafe(method(tableView:estimatedHeightForHeaderInSection:))]
425        #[unsafe(method_family = none)]
426        unsafe fn tableView_estimatedHeightForHeaderInSection(
427            &self,
428            table_view: &UITableView,
429            section: NSInteger,
430        ) -> CGFloat;
431
432        #[cfg(all(
433            feature = "UIResponder",
434            feature = "UIView",
435            feature = "objc2-core-foundation"
436        ))]
437        #[optional]
438        #[unsafe(method(tableView:estimatedHeightForFooterInSection:))]
439        #[unsafe(method_family = none)]
440        unsafe fn tableView_estimatedHeightForFooterInSection(
441            &self,
442            table_view: &UITableView,
443            section: NSInteger,
444        ) -> CGFloat;
445
446        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
447        #[optional]
448        #[unsafe(method(tableView:viewForHeaderInSection:))]
449        #[unsafe(method_family = none)]
450        unsafe fn tableView_viewForHeaderInSection(
451            &self,
452            table_view: &UITableView,
453            section: NSInteger,
454        ) -> Option<Retained<UIView>>;
455
456        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
457        #[optional]
458        #[unsafe(method(tableView:viewForFooterInSection:))]
459        #[unsafe(method_family = none)]
460        unsafe fn tableView_viewForFooterInSection(
461            &self,
462            table_view: &UITableView,
463            section: NSInteger,
464        ) -> Option<Retained<UIView>>;
465
466        #[cfg(all(
467            feature = "UIResponder",
468            feature = "UITableViewCell",
469            feature = "UIView"
470        ))]
471        #[deprecated]
472        #[optional]
473        #[unsafe(method(tableView:accessoryTypeForRowWithIndexPath:))]
474        #[unsafe(method_family = none)]
475        unsafe fn tableView_accessoryTypeForRowWithIndexPath(
476            &self,
477            table_view: &UITableView,
478            index_path: &NSIndexPath,
479        ) -> UITableViewCellAccessoryType;
480
481        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
482        #[optional]
483        #[unsafe(method(tableView:accessoryButtonTappedForRowWithIndexPath:))]
484        #[unsafe(method_family = none)]
485        unsafe fn tableView_accessoryButtonTappedForRowWithIndexPath(
486            &self,
487            table_view: &UITableView,
488            index_path: &NSIndexPath,
489        );
490
491        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
492        #[optional]
493        #[unsafe(method(tableView:shouldHighlightRowAtIndexPath:))]
494        #[unsafe(method_family = none)]
495        unsafe fn tableView_shouldHighlightRowAtIndexPath(
496            &self,
497            table_view: &UITableView,
498            index_path: &NSIndexPath,
499        ) -> bool;
500
501        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
502        #[optional]
503        #[unsafe(method(tableView:didHighlightRowAtIndexPath:))]
504        #[unsafe(method_family = none)]
505        unsafe fn tableView_didHighlightRowAtIndexPath(
506            &self,
507            table_view: &UITableView,
508            index_path: &NSIndexPath,
509        );
510
511        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
512        #[optional]
513        #[unsafe(method(tableView:didUnhighlightRowAtIndexPath:))]
514        #[unsafe(method_family = none)]
515        unsafe fn tableView_didUnhighlightRowAtIndexPath(
516            &self,
517            table_view: &UITableView,
518            index_path: &NSIndexPath,
519        );
520
521        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
522        #[optional]
523        #[unsafe(method(tableView:willSelectRowAtIndexPath:))]
524        #[unsafe(method_family = none)]
525        unsafe fn tableView_willSelectRowAtIndexPath(
526            &self,
527            table_view: &UITableView,
528            index_path: &NSIndexPath,
529        ) -> Option<Retained<NSIndexPath>>;
530
531        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
532        #[optional]
533        #[unsafe(method(tableView:willDeselectRowAtIndexPath:))]
534        #[unsafe(method_family = none)]
535        unsafe fn tableView_willDeselectRowAtIndexPath(
536            &self,
537            table_view: &UITableView,
538            index_path: &NSIndexPath,
539        ) -> Option<Retained<NSIndexPath>>;
540
541        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
542        #[optional]
543        #[unsafe(method(tableView:didSelectRowAtIndexPath:))]
544        #[unsafe(method_family = none)]
545        unsafe fn tableView_didSelectRowAtIndexPath(
546            &self,
547            table_view: &UITableView,
548            index_path: &NSIndexPath,
549        );
550
551        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
552        #[optional]
553        #[unsafe(method(tableView:didDeselectRowAtIndexPath:))]
554        #[unsafe(method_family = none)]
555        unsafe fn tableView_didDeselectRowAtIndexPath(
556            &self,
557            table_view: &UITableView,
558            index_path: &NSIndexPath,
559        );
560
561        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
562        /// Called to determine if a primary action can be performed for the row at the given indexPath.
563        /// See
564        /// `tableView:performPrimaryActionForRowAtIndexPath:`for more details about primary actions.
565        ///
566        ///
567        /// Parameter `tableView`: This UITableView
568        ///
569        /// Parameter `indexPath`: NSIndexPath of the row
570        ///
571        ///
572        /// Returns: `YES` if the primary action can be performed; otherwise `NO`. If not implemented defaults to `YES` when not editing
573        /// and `NO` when editing.
574        #[optional]
575        #[unsafe(method(tableView:canPerformPrimaryActionForRowAtIndexPath:))]
576        #[unsafe(method_family = none)]
577        unsafe fn tableView_canPerformPrimaryActionForRowAtIndexPath(
578            &self,
579            table_view: &UITableView,
580            index_path: &NSIndexPath,
581        ) -> bool;
582
583        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
584        /// Called when the primary action should be performed for the row at the given indexPath.
585        ///
586        ///
587        /// Primary actions allow you to distinguish between a change of selection (which can be based on focus changes or
588        /// other indirect selection changes) and distinct user actions. Primary actions are performed when the user selects a cell without extending
589        /// an existing selection. This is called after
590        /// `willSelectRow`and
591        /// `didSelectRow`, regardless of whether the cell's selection
592        /// state was allowed to change.
593        ///
594        /// As an example, use
595        /// `didSelectRowAtIndexPath`for updating state in the current view controller (i.e. buttons, title, etc) and
596        /// use the primary action for navigation or showing another split view column.
597        ///
598        ///
599        /// Parameter `tableView`: This UITableView
600        ///
601        /// Parameter `indexPath`: NSIndexPath of the row to perform the action on
602        #[optional]
603        #[unsafe(method(tableView:performPrimaryActionForRowAtIndexPath:))]
604        #[unsafe(method_family = none)]
605        unsafe fn tableView_performPrimaryActionForRowAtIndexPath(
606            &self,
607            table_view: &UITableView,
608            index_path: &NSIndexPath,
609        );
610
611        #[cfg(all(
612            feature = "UIResponder",
613            feature = "UITableViewCell",
614            feature = "UIView"
615        ))]
616        #[optional]
617        #[unsafe(method(tableView:editingStyleForRowAtIndexPath:))]
618        #[unsafe(method_family = none)]
619        unsafe fn tableView_editingStyleForRowAtIndexPath(
620            &self,
621            table_view: &UITableView,
622            index_path: &NSIndexPath,
623        ) -> UITableViewCellEditingStyle;
624
625        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
626        #[optional]
627        #[unsafe(method(tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:))]
628        #[unsafe(method_family = none)]
629        unsafe fn tableView_titleForDeleteConfirmationButtonForRowAtIndexPath(
630            &self,
631            table_view: &UITableView,
632            index_path: &NSIndexPath,
633        ) -> Option<Retained<NSString>>;
634
635        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
636        #[deprecated]
637        #[optional]
638        #[unsafe(method(tableView:editActionsForRowAtIndexPath:))]
639        #[unsafe(method_family = none)]
640        unsafe fn tableView_editActionsForRowAtIndexPath(
641            &self,
642            table_view: &UITableView,
643            index_path: &NSIndexPath,
644        ) -> Option<Retained<NSArray<UITableViewRowAction>>>;
645
646        #[cfg(all(
647            feature = "UIResponder",
648            feature = "UISwipeActionsConfiguration",
649            feature = "UIView"
650        ))]
651        #[optional]
652        #[unsafe(method(tableView:leadingSwipeActionsConfigurationForRowAtIndexPath:))]
653        #[unsafe(method_family = none)]
654        unsafe fn tableView_leadingSwipeActionsConfigurationForRowAtIndexPath(
655            &self,
656            table_view: &UITableView,
657            index_path: &NSIndexPath,
658        ) -> Option<Retained<UISwipeActionsConfiguration>>;
659
660        #[cfg(all(
661            feature = "UIResponder",
662            feature = "UISwipeActionsConfiguration",
663            feature = "UIView"
664        ))]
665        #[optional]
666        #[unsafe(method(tableView:trailingSwipeActionsConfigurationForRowAtIndexPath:))]
667        #[unsafe(method_family = none)]
668        unsafe fn tableView_trailingSwipeActionsConfigurationForRowAtIndexPath(
669            &self,
670            table_view: &UITableView,
671            index_path: &NSIndexPath,
672        ) -> Option<Retained<UISwipeActionsConfiguration>>;
673
674        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
675        #[optional]
676        #[unsafe(method(tableView:shouldIndentWhileEditingRowAtIndexPath:))]
677        #[unsafe(method_family = none)]
678        unsafe fn tableView_shouldIndentWhileEditingRowAtIndexPath(
679            &self,
680            table_view: &UITableView,
681            index_path: &NSIndexPath,
682        ) -> bool;
683
684        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
685        #[optional]
686        #[unsafe(method(tableView:willBeginEditingRowAtIndexPath:))]
687        #[unsafe(method_family = none)]
688        unsafe fn tableView_willBeginEditingRowAtIndexPath(
689            &self,
690            table_view: &UITableView,
691            index_path: &NSIndexPath,
692        );
693
694        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
695        #[optional]
696        #[unsafe(method(tableView:didEndEditingRowAtIndexPath:))]
697        #[unsafe(method_family = none)]
698        unsafe fn tableView_didEndEditingRowAtIndexPath(
699            &self,
700            table_view: &UITableView,
701            index_path: Option<&NSIndexPath>,
702        );
703
704        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
705        #[optional]
706        #[unsafe(method(tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:))]
707        #[unsafe(method_family = none)]
708        unsafe fn tableView_targetIndexPathForMoveFromRowAtIndexPath_toProposedIndexPath(
709            &self,
710            table_view: &UITableView,
711            source_index_path: &NSIndexPath,
712            proposed_destination_index_path: &NSIndexPath,
713        ) -> Retained<NSIndexPath>;
714
715        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
716        #[optional]
717        #[unsafe(method(tableView:indentationLevelForRowAtIndexPath:))]
718        #[unsafe(method_family = none)]
719        unsafe fn tableView_indentationLevelForRowAtIndexPath(
720            &self,
721            table_view: &UITableView,
722            index_path: &NSIndexPath,
723        ) -> NSInteger;
724
725        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
726        #[deprecated]
727        #[optional]
728        #[unsafe(method(tableView:shouldShowMenuForRowAtIndexPath:))]
729        #[unsafe(method_family = none)]
730        unsafe fn tableView_shouldShowMenuForRowAtIndexPath(
731            &self,
732            table_view: &UITableView,
733            index_path: &NSIndexPath,
734        ) -> bool;
735
736        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
737        #[deprecated]
738        #[optional]
739        #[unsafe(method(tableView:canPerformAction:forRowAtIndexPath:withSender:))]
740        #[unsafe(method_family = none)]
741        unsafe fn tableView_canPerformAction_forRowAtIndexPath_withSender(
742            &self,
743            table_view: &UITableView,
744            action: Sel,
745            index_path: &NSIndexPath,
746            sender: Option<&AnyObject>,
747        ) -> bool;
748
749        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
750        #[deprecated]
751        #[optional]
752        #[unsafe(method(tableView:performAction:forRowAtIndexPath:withSender:))]
753        #[unsafe(method_family = none)]
754        unsafe fn tableView_performAction_forRowAtIndexPath_withSender(
755            &self,
756            table_view: &UITableView,
757            action: Sel,
758            index_path: &NSIndexPath,
759            sender: Option<&AnyObject>,
760        );
761
762        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
763        #[optional]
764        #[unsafe(method(tableView:canFocusRowAtIndexPath:))]
765        #[unsafe(method_family = none)]
766        unsafe fn tableView_canFocusRowAtIndexPath(
767            &self,
768            table_view: &UITableView,
769            index_path: &NSIndexPath,
770        ) -> bool;
771
772        #[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
773        #[optional]
774        #[unsafe(method(tableView:shouldUpdateFocusInContext:))]
775        #[unsafe(method_family = none)]
776        unsafe fn tableView_shouldUpdateFocusInContext(
777            &self,
778            table_view: &UITableView,
779            context: &UITableViewFocusUpdateContext,
780        ) -> bool;
781
782        #[cfg(all(
783            feature = "UIFocus",
784            feature = "UIFocusAnimationCoordinator",
785            feature = "UIResponder",
786            feature = "UIView"
787        ))]
788        #[optional]
789        #[unsafe(method(tableView:didUpdateFocusInContext:withAnimationCoordinator:))]
790        #[unsafe(method_family = none)]
791        unsafe fn tableView_didUpdateFocusInContext_withAnimationCoordinator(
792            &self,
793            table_view: &UITableView,
794            context: &UITableViewFocusUpdateContext,
795            coordinator: &UIFocusAnimationCoordinator,
796        );
797
798        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
799        #[optional]
800        #[unsafe(method(indexPathForPreferredFocusedViewInTableView:))]
801        #[unsafe(method_family = none)]
802        unsafe fn indexPathForPreferredFocusedViewInTableView(
803            &self,
804            table_view: &UITableView,
805        ) -> Option<Retained<NSIndexPath>>;
806
807        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
808        /// Determines if the row at the specified index path should also become selected when focus moves to it.
809        /// If the table view's global selectionFollowsFocus is enabled, this method will allow you to override that behavior on a per-index path basis. This method is not called if selectionFollowsFocus is disabled.
810        #[optional]
811        #[unsafe(method(tableView:selectionFollowsFocusForRowAtIndexPath:))]
812        #[unsafe(method_family = none)]
813        unsafe fn tableView_selectionFollowsFocusForRowAtIndexPath(
814            &self,
815            table_view: &UITableView,
816            index_path: &NSIndexPath,
817        ) -> bool;
818
819        #[cfg(all(
820            feature = "UIResponder",
821            feature = "UISpringLoadedInteraction",
822            feature = "UIView"
823        ))]
824        #[optional]
825        #[unsafe(method(tableView:shouldSpringLoadRowAtIndexPath:withContext:))]
826        #[unsafe(method_family = none)]
827        unsafe fn tableView_shouldSpringLoadRowAtIndexPath_withContext(
828            &self,
829            table_view: &UITableView,
830            index_path: &NSIndexPath,
831            context: &ProtocolObject<dyn UISpringLoadedInteractionContext>,
832        ) -> bool;
833
834        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
835        #[optional]
836        #[unsafe(method(tableView:shouldBeginMultipleSelectionInteractionAtIndexPath:))]
837        #[unsafe(method_family = none)]
838        unsafe fn tableView_shouldBeginMultipleSelectionInteractionAtIndexPath(
839            &self,
840            table_view: &UITableView,
841            index_path: &NSIndexPath,
842        ) -> bool;
843
844        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
845        #[optional]
846        #[unsafe(method(tableView:didBeginMultipleSelectionInteractionAtIndexPath:))]
847        #[unsafe(method_family = none)]
848        unsafe fn tableView_didBeginMultipleSelectionInteractionAtIndexPath(
849            &self,
850            table_view: &UITableView,
851            index_path: &NSIndexPath,
852        );
853
854        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
855        #[optional]
856        #[unsafe(method(tableViewDidEndMultipleSelectionInteraction:))]
857        #[unsafe(method_family = none)]
858        unsafe fn tableViewDidEndMultipleSelectionInteraction(&self, table_view: &UITableView);
859
860        #[cfg(all(
861            feature = "UIContextMenuConfiguration",
862            feature = "UIResponder",
863            feature = "UIView",
864            feature = "objc2-core-foundation"
865        ))]
866        /// Called when the interaction begins.
867        ///
868        ///
869        /// Parameter `tableView`: This UITableView.
870        ///
871        /// Parameter `indexPath`: IndexPath of the row for which a configuration is being requested.
872        ///
873        /// Parameter `point`: Location of the interaction in the table view's coordinate space
874        ///
875        ///
876        /// Returns: A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning.
877        /// Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this
878        /// to indicate to users that it's possible for a menu to be presented from this element, but that there are no actions to
879        /// present at this particular time.
880        #[optional]
881        #[unsafe(method(tableView:contextMenuConfigurationForRowAtIndexPath:point:))]
882        #[unsafe(method_family = none)]
883        unsafe fn tableView_contextMenuConfigurationForRowAtIndexPath_point(
884            &self,
885            table_view: &UITableView,
886            index_path: &NSIndexPath,
887            point: CGPoint,
888        ) -> Option<Retained<UIContextMenuConfiguration>>;
889
890        #[cfg(all(
891            feature = "UIContextMenuConfiguration",
892            feature = "UIResponder",
893            feature = "UITargetedPreview",
894            feature = "UIView"
895        ))]
896        /// Called when the interaction begins. Return a UITargetedPreview to override the default preview created by the table view.
897        ///
898        ///
899        /// Parameter `tableView`: This UITableView.
900        ///
901        /// Parameter `configuration`: The configuration of the menu about to be displayed by this interaction.
902        #[optional]
903        #[unsafe(method(tableView:previewForHighlightingContextMenuWithConfiguration:))]
904        #[unsafe(method_family = none)]
905        unsafe fn tableView_previewForHighlightingContextMenuWithConfiguration(
906            &self,
907            table_view: &UITableView,
908            configuration: &UIContextMenuConfiguration,
909        ) -> Option<Retained<UITargetedPreview>>;
910
911        #[cfg(all(
912            feature = "UIContextMenuConfiguration",
913            feature = "UIResponder",
914            feature = "UITargetedPreview",
915            feature = "UIView"
916        ))]
917        /// Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target.
918        /// The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.
919        ///
920        ///
921        /// Parameter `tableView`: This UITableView.
922        ///
923        /// Parameter `configuration`: The configuration of the menu displayed by this interaction.
924        #[optional]
925        #[unsafe(method(tableView:previewForDismissingContextMenuWithConfiguration:))]
926        #[unsafe(method_family = none)]
927        unsafe fn tableView_previewForDismissingContextMenuWithConfiguration(
928            &self,
929            table_view: &UITableView,
930            configuration: &UIContextMenuConfiguration,
931        ) -> Option<Retained<UITargetedPreview>>;
932
933        #[cfg(all(
934            feature = "UIContextMenuConfiguration",
935            feature = "UIContextMenuInteraction",
936            feature = "UIResponder",
937            feature = "UIView"
938        ))]
939        /// Called when the interaction is about to "commit" in response to the user tapping the preview.
940        ///
941        ///
942        /// Parameter `tableView`: This UITableView.
943        ///
944        /// Parameter `configuration`: Configuration of the currently displayed menu.
945        ///
946        /// Parameter `animator`: Commit animator. Add animations to this object to run them alongside the commit transition.
947        #[optional]
948        #[unsafe(method(tableView:willPerformPreviewActionForMenuWithConfiguration:animator:))]
949        #[unsafe(method_family = none)]
950        unsafe fn tableView_willPerformPreviewActionForMenuWithConfiguration_animator(
951            &self,
952            table_view: &UITableView,
953            configuration: &UIContextMenuConfiguration,
954            animator: &ProtocolObject<dyn UIContextMenuInteractionCommitAnimating>,
955        );
956
957        #[cfg(all(
958            feature = "UIContextMenuConfiguration",
959            feature = "UIContextMenuInteraction",
960            feature = "UIResponder",
961            feature = "UIView"
962        ))]
963        /// Called when the table view is about to display a menu.
964        ///
965        ///
966        /// Parameter `tableView`: This UITableView.
967        ///
968        /// Parameter `configuration`: The configuration of the menu about to be displayed.
969        ///
970        /// Parameter `animator`: Appearance animator. Add animations to run them alongside the appearance transition.
971        #[optional]
972        #[unsafe(method(tableView:willDisplayContextMenuWithConfiguration:animator:))]
973        #[unsafe(method_family = none)]
974        unsafe fn tableView_willDisplayContextMenuWithConfiguration_animator(
975            &self,
976            table_view: &UITableView,
977            configuration: &UIContextMenuConfiguration,
978            animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
979        );
980
981        #[cfg(all(
982            feature = "UIContextMenuConfiguration",
983            feature = "UIContextMenuInteraction",
984            feature = "UIResponder",
985            feature = "UIView"
986        ))]
987        /// Called when the table view's context menu interaction is about to end.
988        ///
989        ///
990        /// Parameter `tableView`: This UITableView.
991        ///
992        /// Parameter `configuration`: Ending configuration.
993        ///
994        /// Parameter `animator`: Disappearance animator. Add animations to run them alongside the disappearance transition.
995        #[optional]
996        #[unsafe(method(tableView:willEndContextMenuInteractionWithConfiguration:animator:))]
997        #[unsafe(method_family = none)]
998        unsafe fn tableView_willEndContextMenuInteractionWithConfiguration_animator(
999            &self,
1000            table_view: &UITableView,
1001            configuration: &UIContextMenuConfiguration,
1002            animator: Option<&ProtocolObject<dyn UIContextMenuInteractionAnimating>>,
1003        );
1004    }
1005);
1006
1007extern "C" {
1008    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewselectiondidchangenotification?language=objc)
1009    pub static UITableViewSelectionDidChangeNotification: &'static NSNotificationName;
1010}
1011
1012/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewseparatorinsetreference?language=objc)
1013// NS_ENUM
1014#[repr(transparent)]
1015#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1016pub struct UITableViewSeparatorInsetReference(pub NSInteger);
1017impl UITableViewSeparatorInsetReference {
1018    #[doc(alias = "UITableViewSeparatorInsetFromCellEdges")]
1019    pub const FromCellEdges: Self = Self(0);
1020    #[doc(alias = "UITableViewSeparatorInsetFromAutomaticInsets")]
1021    pub const FromAutomaticInsets: Self = Self(1);
1022}
1023
1024unsafe impl Encode for UITableViewSeparatorInsetReference {
1025    const ENCODING: Encoding = NSInteger::ENCODING;
1026}
1027
1028unsafe impl RefEncode for UITableViewSeparatorInsetReference {
1029    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1030}
1031
1032/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewselfsizinginvalidation?language=objc)
1033// NS_ENUM
1034#[repr(transparent)]
1035#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1036pub struct UITableViewSelfSizingInvalidation(pub NSInteger);
1037impl UITableViewSelfSizingInvalidation {
1038    /// No updates will take place when -invalidateIntrinsicContentSize is called on a self-sizing cell or its contentView.
1039    #[doc(alias = "UITableViewSelfSizingInvalidationDisabled")]
1040    pub const Disabled: Self = Self(0);
1041    /// Calling -invalidateIntrinsicContentSize on a self-sizing cell or its contentView will cause it to be resized if necessary.
1042    #[doc(alias = "UITableViewSelfSizingInvalidationEnabled")]
1043    pub const Enabled: Self = Self(1);
1044    /// Calling -invalidateIntrinsicContentSize on a self-sizing cell or its contentView will cause it to be resized if necessary, and
1045    /// any Auto Layout changes within the contentView of a self-sizing cell will automatically trigger -invalidateIntrinsicContentSize.
1046    #[doc(alias = "UITableViewSelfSizingInvalidationEnabledIncludingConstraints")]
1047    pub const EnabledIncludingConstraints: Self = Self(2);
1048}
1049
1050unsafe impl Encode for UITableViewSelfSizingInvalidation {
1051    const ENCODING: Encoding = NSInteger::ENCODING;
1052}
1053
1054unsafe impl RefEncode for UITableViewSelfSizingInvalidation {
1055    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1056}
1057
1058extern_class!(
1059    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableview?language=objc)
1060    #[unsafe(super(UIScrollView, UIView, UIResponder, NSObject))]
1061    #[thread_kind = MainThreadOnly]
1062    #[derive(Debug, PartialEq, Eq, Hash)]
1063    #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1064    pub struct UITableView;
1065);
1066
1067#[cfg(all(
1068    feature = "UIResponder",
1069    feature = "UIScrollView",
1070    feature = "UIView",
1071    feature = "objc2-quartz-core"
1072))]
1073#[cfg(not(target_os = "watchos"))]
1074unsafe impl CALayerDelegate for UITableView {}
1075
1076#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1077unsafe impl NSCoding for UITableView {}
1078
1079#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1080unsafe impl NSObjectProtocol for UITableView {}
1081
1082#[cfg(all(
1083    feature = "UIAppearance",
1084    feature = "UIResponder",
1085    feature = "UIScrollView",
1086    feature = "UIView"
1087))]
1088unsafe impl UIAppearance for UITableView {}
1089
1090#[cfg(all(
1091    feature = "UIAppearance",
1092    feature = "UIResponder",
1093    feature = "UIScrollView",
1094    feature = "UIView"
1095))]
1096unsafe impl UIAppearanceContainer for UITableView {}
1097
1098#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1099unsafe impl UICoordinateSpace for UITableView {}
1100
1101#[cfg(all(
1102    feature = "UIDataSourceTranslating",
1103    feature = "UIResponder",
1104    feature = "UIScrollView",
1105    feature = "UIView"
1106))]
1107unsafe impl UIDataSourceTranslating for UITableView {}
1108
1109#[cfg(all(
1110    feature = "UIDynamicBehavior",
1111    feature = "UIResponder",
1112    feature = "UIScrollView",
1113    feature = "UIView"
1114))]
1115unsafe impl UIDynamicItem for UITableView {}
1116
1117#[cfg(all(
1118    feature = "UIFocus",
1119    feature = "UIResponder",
1120    feature = "UIScrollView",
1121    feature = "UIView"
1122))]
1123unsafe impl UIFocusEnvironment for UITableView {}
1124
1125#[cfg(all(
1126    feature = "UIFocus",
1127    feature = "UIResponder",
1128    feature = "UIScrollView",
1129    feature = "UIView"
1130))]
1131unsafe impl UIFocusItem for UITableView {}
1132
1133#[cfg(all(
1134    feature = "UIFocus",
1135    feature = "UIResponder",
1136    feature = "UIScrollView",
1137    feature = "UIView"
1138))]
1139unsafe impl UIFocusItemContainer for UITableView {}
1140
1141#[cfg(all(
1142    feature = "UIFocus",
1143    feature = "UIResponder",
1144    feature = "UIScrollView",
1145    feature = "UIView"
1146))]
1147unsafe impl UIFocusItemScrollableContainer for UITableView {}
1148
1149#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1150unsafe impl UIResponderStandardEditActions for UITableView {}
1151
1152#[cfg(all(
1153    feature = "UIResponder",
1154    feature = "UIScrollView",
1155    feature = "UITraitCollection",
1156    feature = "UIView"
1157))]
1158unsafe impl UITraitEnvironment for UITableView {}
1159
1160#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1161impl UITableView {
1162    extern_methods!(
1163        #[cfg(feature = "objc2-core-foundation")]
1164        #[unsafe(method(initWithFrame:style:))]
1165        #[unsafe(method_family = init)]
1166        pub unsafe fn initWithFrame_style(
1167            this: Allocated<Self>,
1168            frame: CGRect,
1169            style: UITableViewStyle,
1170        ) -> Retained<Self>;
1171
1172        #[unsafe(method(initWithCoder:))]
1173        #[unsafe(method_family = init)]
1174        pub unsafe fn initWithCoder(
1175            this: Allocated<Self>,
1176            coder: &NSCoder,
1177        ) -> Option<Retained<Self>>;
1178
1179        #[unsafe(method(style))]
1180        #[unsafe(method_family = none)]
1181        pub unsafe fn style(&self) -> UITableViewStyle;
1182
1183        #[unsafe(method(dataSource))]
1184        #[unsafe(method_family = none)]
1185        pub unsafe fn dataSource(
1186            &self,
1187        ) -> Option<Retained<ProtocolObject<dyn UITableViewDataSource>>>;
1188
1189        /// This is a [weak property][objc2::topics::weak_property].
1190        /// Setter for [`dataSource`][Self::dataSource].
1191        #[unsafe(method(setDataSource:))]
1192        #[unsafe(method_family = none)]
1193        pub unsafe fn setDataSource(
1194            &self,
1195            data_source: Option<&ProtocolObject<dyn UITableViewDataSource>>,
1196        );
1197
1198        #[unsafe(method(delegate))]
1199        #[unsafe(method_family = none)]
1200        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITableViewDelegate>>>;
1201
1202        /// This is a [weak property][objc2::topics::weak_property].
1203        /// Setter for [`delegate`][Self::delegate].
1204        #[unsafe(method(setDelegate:))]
1205        #[unsafe(method_family = none)]
1206        pub unsafe fn setDelegate(
1207            &self,
1208            delegate: Option<&ProtocolObject<dyn UITableViewDelegate>>,
1209        );
1210
1211        #[unsafe(method(prefetchDataSource))]
1212        #[unsafe(method_family = none)]
1213        pub unsafe fn prefetchDataSource(
1214            &self,
1215        ) -> Option<Retained<ProtocolObject<dyn UITableViewDataSourcePrefetching>>>;
1216
1217        /// This is a [weak property][objc2::topics::weak_property].
1218        /// Setter for [`prefetchDataSource`][Self::prefetchDataSource].
1219        #[unsafe(method(setPrefetchDataSource:))]
1220        #[unsafe(method_family = none)]
1221        pub unsafe fn setPrefetchDataSource(
1222            &self,
1223            prefetch_data_source: Option<&ProtocolObject<dyn UITableViewDataSourcePrefetching>>,
1224        );
1225
1226        #[unsafe(method(isPrefetchingEnabled))]
1227        #[unsafe(method_family = none)]
1228        pub unsafe fn isPrefetchingEnabled(&self) -> bool;
1229
1230        /// Setter for [`isPrefetchingEnabled`][Self::isPrefetchingEnabled].
1231        #[unsafe(method(setPrefetchingEnabled:))]
1232        #[unsafe(method_family = none)]
1233        pub unsafe fn setPrefetchingEnabled(&self, prefetching_enabled: bool);
1234
1235        #[unsafe(method(dragDelegate))]
1236        #[unsafe(method_family = none)]
1237        pub unsafe fn dragDelegate(
1238            &self,
1239        ) -> Option<Retained<ProtocolObject<dyn UITableViewDragDelegate>>>;
1240
1241        /// This is a [weak property][objc2::topics::weak_property].
1242        /// Setter for [`dragDelegate`][Self::dragDelegate].
1243        #[unsafe(method(setDragDelegate:))]
1244        #[unsafe(method_family = none)]
1245        pub unsafe fn setDragDelegate(
1246            &self,
1247            drag_delegate: Option<&ProtocolObject<dyn UITableViewDragDelegate>>,
1248        );
1249
1250        #[unsafe(method(dropDelegate))]
1251        #[unsafe(method_family = none)]
1252        pub unsafe fn dropDelegate(
1253            &self,
1254        ) -> Option<Retained<ProtocolObject<dyn UITableViewDropDelegate>>>;
1255
1256        /// This is a [weak property][objc2::topics::weak_property].
1257        /// Setter for [`dropDelegate`][Self::dropDelegate].
1258        #[unsafe(method(setDropDelegate:))]
1259        #[unsafe(method_family = none)]
1260        pub unsafe fn setDropDelegate(
1261            &self,
1262            drop_delegate: Option<&ProtocolObject<dyn UITableViewDropDelegate>>,
1263        );
1264
1265        #[cfg(feature = "objc2-core-foundation")]
1266        #[unsafe(method(rowHeight))]
1267        #[unsafe(method_family = none)]
1268        pub unsafe fn rowHeight(&self) -> CGFloat;
1269
1270        #[cfg(feature = "objc2-core-foundation")]
1271        /// Setter for [`rowHeight`][Self::rowHeight].
1272        #[unsafe(method(setRowHeight:))]
1273        #[unsafe(method_family = none)]
1274        pub unsafe fn setRowHeight(&self, row_height: CGFloat);
1275
1276        #[cfg(feature = "objc2-core-foundation")]
1277        #[unsafe(method(sectionHeaderHeight))]
1278        #[unsafe(method_family = none)]
1279        pub unsafe fn sectionHeaderHeight(&self) -> CGFloat;
1280
1281        #[cfg(feature = "objc2-core-foundation")]
1282        /// Setter for [`sectionHeaderHeight`][Self::sectionHeaderHeight].
1283        #[unsafe(method(setSectionHeaderHeight:))]
1284        #[unsafe(method_family = none)]
1285        pub unsafe fn setSectionHeaderHeight(&self, section_header_height: CGFloat);
1286
1287        #[cfg(feature = "objc2-core-foundation")]
1288        #[unsafe(method(sectionFooterHeight))]
1289        #[unsafe(method_family = none)]
1290        pub unsafe fn sectionFooterHeight(&self) -> CGFloat;
1291
1292        #[cfg(feature = "objc2-core-foundation")]
1293        /// Setter for [`sectionFooterHeight`][Self::sectionFooterHeight].
1294        #[unsafe(method(setSectionFooterHeight:))]
1295        #[unsafe(method_family = none)]
1296        pub unsafe fn setSectionFooterHeight(&self, section_footer_height: CGFloat);
1297
1298        #[cfg(feature = "objc2-core-foundation")]
1299        #[unsafe(method(estimatedRowHeight))]
1300        #[unsafe(method_family = none)]
1301        pub unsafe fn estimatedRowHeight(&self) -> CGFloat;
1302
1303        #[cfg(feature = "objc2-core-foundation")]
1304        /// Setter for [`estimatedRowHeight`][Self::estimatedRowHeight].
1305        #[unsafe(method(setEstimatedRowHeight:))]
1306        #[unsafe(method_family = none)]
1307        pub unsafe fn setEstimatedRowHeight(&self, estimated_row_height: CGFloat);
1308
1309        #[cfg(feature = "objc2-core-foundation")]
1310        #[unsafe(method(estimatedSectionHeaderHeight))]
1311        #[unsafe(method_family = none)]
1312        pub unsafe fn estimatedSectionHeaderHeight(&self) -> CGFloat;
1313
1314        #[cfg(feature = "objc2-core-foundation")]
1315        /// Setter for [`estimatedSectionHeaderHeight`][Self::estimatedSectionHeaderHeight].
1316        #[unsafe(method(setEstimatedSectionHeaderHeight:))]
1317        #[unsafe(method_family = none)]
1318        pub unsafe fn setEstimatedSectionHeaderHeight(
1319            &self,
1320            estimated_section_header_height: CGFloat,
1321        );
1322
1323        #[cfg(feature = "objc2-core-foundation")]
1324        #[unsafe(method(estimatedSectionFooterHeight))]
1325        #[unsafe(method_family = none)]
1326        pub unsafe fn estimatedSectionFooterHeight(&self) -> CGFloat;
1327
1328        #[cfg(feature = "objc2-core-foundation")]
1329        /// Setter for [`estimatedSectionFooterHeight`][Self::estimatedSectionFooterHeight].
1330        #[unsafe(method(setEstimatedSectionFooterHeight:))]
1331        #[unsafe(method_family = none)]
1332        pub unsafe fn setEstimatedSectionFooterHeight(
1333            &self,
1334            estimated_section_footer_height: CGFloat,
1335        );
1336
1337        #[cfg(feature = "objc2-core-foundation")]
1338        /// The height for filler rows added below the last row when there aren't enough rows to fill a plain style table view.
1339        /// Set 0 to disable filler rows entirely, use `UITableViewAutomaticDimension` for the default height.
1340        #[unsafe(method(fillerRowHeight))]
1341        #[unsafe(method_family = none)]
1342        pub unsafe fn fillerRowHeight(&self) -> CGFloat;
1343
1344        #[cfg(feature = "objc2-core-foundation")]
1345        /// Setter for [`fillerRowHeight`][Self::fillerRowHeight].
1346        #[unsafe(method(setFillerRowHeight:))]
1347        #[unsafe(method_family = none)]
1348        pub unsafe fn setFillerRowHeight(&self, filler_row_height: CGFloat);
1349
1350        #[cfg(feature = "objc2-core-foundation")]
1351        /// Padding above each section header. The default value is `UITableViewAutomaticDimension`.
1352        #[unsafe(method(sectionHeaderTopPadding))]
1353        #[unsafe(method_family = none)]
1354        pub unsafe fn sectionHeaderTopPadding(&self) -> CGFloat;
1355
1356        #[cfg(feature = "objc2-core-foundation")]
1357        /// Setter for [`sectionHeaderTopPadding`][Self::sectionHeaderTopPadding].
1358        #[unsafe(method(setSectionHeaderTopPadding:))]
1359        #[unsafe(method_family = none)]
1360        pub unsafe fn setSectionHeaderTopPadding(&self, section_header_top_padding: CGFloat);
1361
1362        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1363        #[unsafe(method(separatorInset))]
1364        #[unsafe(method_family = none)]
1365        pub unsafe fn separatorInset(&self) -> UIEdgeInsets;
1366
1367        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
1368        /// Setter for [`separatorInset`][Self::separatorInset].
1369        #[unsafe(method(setSeparatorInset:))]
1370        #[unsafe(method_family = none)]
1371        pub unsafe fn setSeparatorInset(&self, separator_inset: UIEdgeInsets);
1372
1373        #[unsafe(method(separatorInsetReference))]
1374        #[unsafe(method_family = none)]
1375        pub unsafe fn separatorInsetReference(&self) -> UITableViewSeparatorInsetReference;
1376
1377        /// Setter for [`separatorInsetReference`][Self::separatorInsetReference].
1378        #[unsafe(method(setSeparatorInsetReference:))]
1379        #[unsafe(method_family = none)]
1380        pub unsafe fn setSeparatorInsetReference(
1381            &self,
1382            separator_inset_reference: UITableViewSeparatorInsetReference,
1383        );
1384
1385        #[unsafe(method(selfSizingInvalidation))]
1386        #[unsafe(method_family = none)]
1387        pub unsafe fn selfSizingInvalidation(&self) -> UITableViewSelfSizingInvalidation;
1388
1389        /// Setter for [`selfSizingInvalidation`][Self::selfSizingInvalidation].
1390        #[unsafe(method(setSelfSizingInvalidation:))]
1391        #[unsafe(method_family = none)]
1392        pub unsafe fn setSelfSizingInvalidation(
1393            &self,
1394            self_sizing_invalidation: UITableViewSelfSizingInvalidation,
1395        );
1396
1397        #[unsafe(method(backgroundView))]
1398        #[unsafe(method_family = none)]
1399        pub unsafe fn backgroundView(&self) -> Option<Retained<UIView>>;
1400
1401        /// Setter for [`backgroundView`][Self::backgroundView].
1402        #[unsafe(method(setBackgroundView:))]
1403        #[unsafe(method_family = none)]
1404        pub unsafe fn setBackgroundView(&self, background_view: Option<&UIView>);
1405
1406        #[cfg(feature = "UIContextMenuInteraction")]
1407        #[unsafe(method(contextMenuInteraction))]
1408        #[unsafe(method_family = none)]
1409        pub unsafe fn contextMenuInteraction(&self) -> Option<Retained<UIContextMenuInteraction>>;
1410
1411        #[unsafe(method(numberOfSections))]
1412        #[unsafe(method_family = none)]
1413        pub unsafe fn numberOfSections(&self) -> NSInteger;
1414
1415        #[unsafe(method(numberOfRowsInSection:))]
1416        #[unsafe(method_family = none)]
1417        pub unsafe fn numberOfRowsInSection(&self, section: NSInteger) -> NSInteger;
1418
1419        #[cfg(feature = "objc2-core-foundation")]
1420        #[unsafe(method(rectForSection:))]
1421        #[unsafe(method_family = none)]
1422        pub unsafe fn rectForSection(&self, section: NSInteger) -> CGRect;
1423
1424        #[cfg(feature = "objc2-core-foundation")]
1425        #[unsafe(method(rectForHeaderInSection:))]
1426        #[unsafe(method_family = none)]
1427        pub unsafe fn rectForHeaderInSection(&self, section: NSInteger) -> CGRect;
1428
1429        #[cfg(feature = "objc2-core-foundation")]
1430        #[unsafe(method(rectForFooterInSection:))]
1431        #[unsafe(method_family = none)]
1432        pub unsafe fn rectForFooterInSection(&self, section: NSInteger) -> CGRect;
1433
1434        #[cfg(feature = "objc2-core-foundation")]
1435        #[unsafe(method(rectForRowAtIndexPath:))]
1436        #[unsafe(method_family = none)]
1437        pub unsafe fn rectForRowAtIndexPath(&self, index_path: &NSIndexPath) -> CGRect;
1438
1439        #[cfg(feature = "objc2-core-foundation")]
1440        #[unsafe(method(indexPathForRowAtPoint:))]
1441        #[unsafe(method_family = none)]
1442        pub unsafe fn indexPathForRowAtPoint(
1443            &self,
1444            point: CGPoint,
1445        ) -> Option<Retained<NSIndexPath>>;
1446
1447        #[cfg(feature = "UITableViewCell")]
1448        #[unsafe(method(indexPathForCell:))]
1449        #[unsafe(method_family = none)]
1450        pub unsafe fn indexPathForCell(
1451            &self,
1452            cell: &UITableViewCell,
1453        ) -> Option<Retained<NSIndexPath>>;
1454
1455        #[cfg(feature = "objc2-core-foundation")]
1456        #[unsafe(method(indexPathsForRowsInRect:))]
1457        #[unsafe(method_family = none)]
1458        pub unsafe fn indexPathsForRowsInRect(
1459            &self,
1460            rect: CGRect,
1461        ) -> Option<Retained<NSArray<NSIndexPath>>>;
1462
1463        #[cfg(feature = "UITableViewCell")]
1464        #[unsafe(method(cellForRowAtIndexPath:))]
1465        #[unsafe(method_family = none)]
1466        pub unsafe fn cellForRowAtIndexPath(
1467            &self,
1468            index_path: &NSIndexPath,
1469        ) -> Option<Retained<UITableViewCell>>;
1470
1471        #[cfg(feature = "UITableViewCell")]
1472        #[unsafe(method(visibleCells))]
1473        #[unsafe(method_family = none)]
1474        pub unsafe fn visibleCells(&self) -> Retained<NSArray<UITableViewCell>>;
1475
1476        #[unsafe(method(indexPathsForVisibleRows))]
1477        #[unsafe(method_family = none)]
1478        pub unsafe fn indexPathsForVisibleRows(&self) -> Option<Retained<NSArray<NSIndexPath>>>;
1479
1480        #[cfg(feature = "UITableViewHeaderFooterView")]
1481        #[unsafe(method(headerViewForSection:))]
1482        #[unsafe(method_family = none)]
1483        pub unsafe fn headerViewForSection(
1484            &self,
1485            section: NSInteger,
1486        ) -> Option<Retained<UITableViewHeaderFooterView>>;
1487
1488        #[cfg(feature = "UITableViewHeaderFooterView")]
1489        #[unsafe(method(footerViewForSection:))]
1490        #[unsafe(method_family = none)]
1491        pub unsafe fn footerViewForSection(
1492            &self,
1493            section: NSInteger,
1494        ) -> Option<Retained<UITableViewHeaderFooterView>>;
1495
1496        #[unsafe(method(scrollToRowAtIndexPath:atScrollPosition:animated:))]
1497        #[unsafe(method_family = none)]
1498        pub unsafe fn scrollToRowAtIndexPath_atScrollPosition_animated(
1499            &self,
1500            index_path: &NSIndexPath,
1501            scroll_position: UITableViewScrollPosition,
1502            animated: bool,
1503        );
1504
1505        #[unsafe(method(scrollToNearestSelectedRowAtScrollPosition:animated:))]
1506        #[unsafe(method_family = none)]
1507        pub unsafe fn scrollToNearestSelectedRowAtScrollPosition_animated(
1508            &self,
1509            scroll_position: UITableViewScrollPosition,
1510            animated: bool,
1511        );
1512
1513        #[cfg(feature = "block2")]
1514        #[unsafe(method(performBatchUpdates:completion:))]
1515        #[unsafe(method_family = none)]
1516        pub unsafe fn performBatchUpdates_completion(
1517            &self,
1518            updates: Option<&block2::Block<dyn Fn() + '_>>,
1519            completion: Option<&block2::Block<dyn Fn(Bool)>>,
1520        );
1521
1522        #[unsafe(method(beginUpdates))]
1523        #[unsafe(method_family = none)]
1524        pub unsafe fn beginUpdates(&self);
1525
1526        #[unsafe(method(endUpdates))]
1527        #[unsafe(method_family = none)]
1528        pub unsafe fn endUpdates(&self);
1529
1530        #[unsafe(method(insertSections:withRowAnimation:))]
1531        #[unsafe(method_family = none)]
1532        pub unsafe fn insertSections_withRowAnimation(
1533            &self,
1534            sections: &NSIndexSet,
1535            animation: UITableViewRowAnimation,
1536        );
1537
1538        #[unsafe(method(deleteSections:withRowAnimation:))]
1539        #[unsafe(method_family = none)]
1540        pub unsafe fn deleteSections_withRowAnimation(
1541            &self,
1542            sections: &NSIndexSet,
1543            animation: UITableViewRowAnimation,
1544        );
1545
1546        #[unsafe(method(moveSection:toSection:))]
1547        #[unsafe(method_family = none)]
1548        pub unsafe fn moveSection_toSection(&self, section: NSInteger, new_section: NSInteger);
1549
1550        #[unsafe(method(reloadSections:withRowAnimation:))]
1551        #[unsafe(method_family = none)]
1552        pub unsafe fn reloadSections_withRowAnimation(
1553            &self,
1554            sections: &NSIndexSet,
1555            animation: UITableViewRowAnimation,
1556        );
1557
1558        #[unsafe(method(insertRowsAtIndexPaths:withRowAnimation:))]
1559        #[unsafe(method_family = none)]
1560        pub unsafe fn insertRowsAtIndexPaths_withRowAnimation(
1561            &self,
1562            index_paths: &NSArray<NSIndexPath>,
1563            animation: UITableViewRowAnimation,
1564        );
1565
1566        #[unsafe(method(deleteRowsAtIndexPaths:withRowAnimation:))]
1567        #[unsafe(method_family = none)]
1568        pub unsafe fn deleteRowsAtIndexPaths_withRowAnimation(
1569            &self,
1570            index_paths: &NSArray<NSIndexPath>,
1571            animation: UITableViewRowAnimation,
1572        );
1573
1574        #[unsafe(method(moveRowAtIndexPath:toIndexPath:))]
1575        #[unsafe(method_family = none)]
1576        pub unsafe fn moveRowAtIndexPath_toIndexPath(
1577            &self,
1578            index_path: &NSIndexPath,
1579            new_index_path: &NSIndexPath,
1580        );
1581
1582        #[unsafe(method(reloadRowsAtIndexPaths:withRowAnimation:))]
1583        #[unsafe(method_family = none)]
1584        pub unsafe fn reloadRowsAtIndexPaths_withRowAnimation(
1585            &self,
1586            index_paths: &NSArray<NSIndexPath>,
1587            animation: UITableViewRowAnimation,
1588        );
1589
1590        #[unsafe(method(reconfigureRowsAtIndexPaths:))]
1591        #[unsafe(method_family = none)]
1592        pub unsafe fn reconfigureRowsAtIndexPaths(&self, index_paths: &NSArray<NSIndexPath>);
1593
1594        #[unsafe(method(hasUncommittedUpdates))]
1595        #[unsafe(method_family = none)]
1596        pub unsafe fn hasUncommittedUpdates(&self) -> bool;
1597
1598        #[unsafe(method(reloadData))]
1599        #[unsafe(method_family = none)]
1600        pub unsafe fn reloadData(&self);
1601
1602        #[unsafe(method(reloadSectionIndexTitles))]
1603        #[unsafe(method_family = none)]
1604        pub unsafe fn reloadSectionIndexTitles(&self);
1605
1606        #[unsafe(method(isEditing))]
1607        #[unsafe(method_family = none)]
1608        pub unsafe fn isEditing(&self) -> bool;
1609
1610        /// Setter for [`isEditing`][Self::isEditing].
1611        #[unsafe(method(setEditing:))]
1612        #[unsafe(method_family = none)]
1613        pub unsafe fn setEditing(&self, editing: bool);
1614
1615        #[unsafe(method(setEditing:animated:))]
1616        #[unsafe(method_family = none)]
1617        pub unsafe fn setEditing_animated(&self, editing: bool, animated: bool);
1618
1619        #[unsafe(method(allowsSelection))]
1620        #[unsafe(method_family = none)]
1621        pub unsafe fn allowsSelection(&self) -> bool;
1622
1623        /// Setter for [`allowsSelection`][Self::allowsSelection].
1624        #[unsafe(method(setAllowsSelection:))]
1625        #[unsafe(method_family = none)]
1626        pub unsafe fn setAllowsSelection(&self, allows_selection: bool);
1627
1628        #[unsafe(method(allowsSelectionDuringEditing))]
1629        #[unsafe(method_family = none)]
1630        pub unsafe fn allowsSelectionDuringEditing(&self) -> bool;
1631
1632        /// Setter for [`allowsSelectionDuringEditing`][Self::allowsSelectionDuringEditing].
1633        #[unsafe(method(setAllowsSelectionDuringEditing:))]
1634        #[unsafe(method_family = none)]
1635        pub unsafe fn setAllowsSelectionDuringEditing(&self, allows_selection_during_editing: bool);
1636
1637        #[unsafe(method(allowsMultipleSelection))]
1638        #[unsafe(method_family = none)]
1639        pub unsafe fn allowsMultipleSelection(&self) -> bool;
1640
1641        /// Setter for [`allowsMultipleSelection`][Self::allowsMultipleSelection].
1642        #[unsafe(method(setAllowsMultipleSelection:))]
1643        #[unsafe(method_family = none)]
1644        pub unsafe fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);
1645
1646        #[unsafe(method(allowsMultipleSelectionDuringEditing))]
1647        #[unsafe(method_family = none)]
1648        pub unsafe fn allowsMultipleSelectionDuringEditing(&self) -> bool;
1649
1650        /// Setter for [`allowsMultipleSelectionDuringEditing`][Self::allowsMultipleSelectionDuringEditing].
1651        #[unsafe(method(setAllowsMultipleSelectionDuringEditing:))]
1652        #[unsafe(method_family = none)]
1653        pub unsafe fn setAllowsMultipleSelectionDuringEditing(
1654            &self,
1655            allows_multiple_selection_during_editing: bool,
1656        );
1657
1658        #[unsafe(method(indexPathForSelectedRow))]
1659        #[unsafe(method_family = none)]
1660        pub unsafe fn indexPathForSelectedRow(&self) -> Option<Retained<NSIndexPath>>;
1661
1662        #[unsafe(method(indexPathsForSelectedRows))]
1663        #[unsafe(method_family = none)]
1664        pub unsafe fn indexPathsForSelectedRows(&self) -> Option<Retained<NSArray<NSIndexPath>>>;
1665
1666        #[unsafe(method(selectRowAtIndexPath:animated:scrollPosition:))]
1667        #[unsafe(method_family = none)]
1668        pub unsafe fn selectRowAtIndexPath_animated_scrollPosition(
1669            &self,
1670            index_path: Option<&NSIndexPath>,
1671            animated: bool,
1672            scroll_position: UITableViewScrollPosition,
1673        );
1674
1675        #[unsafe(method(deselectRowAtIndexPath:animated:))]
1676        #[unsafe(method_family = none)]
1677        pub unsafe fn deselectRowAtIndexPath_animated(
1678            &self,
1679            index_path: &NSIndexPath,
1680            animated: bool,
1681        );
1682
1683        #[unsafe(method(sectionIndexMinimumDisplayRowCount))]
1684        #[unsafe(method_family = none)]
1685        pub unsafe fn sectionIndexMinimumDisplayRowCount(&self) -> NSInteger;
1686
1687        /// Setter for [`sectionIndexMinimumDisplayRowCount`][Self::sectionIndexMinimumDisplayRowCount].
1688        #[unsafe(method(setSectionIndexMinimumDisplayRowCount:))]
1689        #[unsafe(method_family = none)]
1690        pub unsafe fn setSectionIndexMinimumDisplayRowCount(
1691            &self,
1692            section_index_minimum_display_row_count: NSInteger,
1693        );
1694
1695        #[cfg(feature = "UIColor")]
1696        #[unsafe(method(sectionIndexColor))]
1697        #[unsafe(method_family = none)]
1698        pub unsafe fn sectionIndexColor(&self) -> Option<Retained<UIColor>>;
1699
1700        #[cfg(feature = "UIColor")]
1701        /// Setter for [`sectionIndexColor`][Self::sectionIndexColor].
1702        #[unsafe(method(setSectionIndexColor:))]
1703        #[unsafe(method_family = none)]
1704        pub unsafe fn setSectionIndexColor(&self, section_index_color: Option<&UIColor>);
1705
1706        #[cfg(feature = "UIColor")]
1707        #[unsafe(method(sectionIndexBackgroundColor))]
1708        #[unsafe(method_family = none)]
1709        pub unsafe fn sectionIndexBackgroundColor(&self) -> Option<Retained<UIColor>>;
1710
1711        #[cfg(feature = "UIColor")]
1712        /// Setter for [`sectionIndexBackgroundColor`][Self::sectionIndexBackgroundColor].
1713        #[unsafe(method(setSectionIndexBackgroundColor:))]
1714        #[unsafe(method_family = none)]
1715        pub unsafe fn setSectionIndexBackgroundColor(
1716            &self,
1717            section_index_background_color: Option<&UIColor>,
1718        );
1719
1720        #[cfg(feature = "UIColor")]
1721        #[unsafe(method(sectionIndexTrackingBackgroundColor))]
1722        #[unsafe(method_family = none)]
1723        pub unsafe fn sectionIndexTrackingBackgroundColor(&self) -> Option<Retained<UIColor>>;
1724
1725        #[cfg(feature = "UIColor")]
1726        /// Setter for [`sectionIndexTrackingBackgroundColor`][Self::sectionIndexTrackingBackgroundColor].
1727        #[unsafe(method(setSectionIndexTrackingBackgroundColor:))]
1728        #[unsafe(method_family = none)]
1729        pub unsafe fn setSectionIndexTrackingBackgroundColor(
1730            &self,
1731            section_index_tracking_background_color: Option<&UIColor>,
1732        );
1733
1734        #[cfg(feature = "UITableViewCell")]
1735        #[unsafe(method(separatorStyle))]
1736        #[unsafe(method_family = none)]
1737        pub unsafe fn separatorStyle(&self) -> UITableViewCellSeparatorStyle;
1738
1739        #[cfg(feature = "UITableViewCell")]
1740        /// Setter for [`separatorStyle`][Self::separatorStyle].
1741        #[unsafe(method(setSeparatorStyle:))]
1742        #[unsafe(method_family = none)]
1743        pub unsafe fn setSeparatorStyle(&self, separator_style: UITableViewCellSeparatorStyle);
1744
1745        #[cfg(feature = "UIColor")]
1746        #[unsafe(method(separatorColor))]
1747        #[unsafe(method_family = none)]
1748        pub unsafe fn separatorColor(&self) -> Option<Retained<UIColor>>;
1749
1750        #[cfg(feature = "UIColor")]
1751        /// Setter for [`separatorColor`][Self::separatorColor].
1752        #[unsafe(method(setSeparatorColor:))]
1753        #[unsafe(method_family = none)]
1754        pub unsafe fn setSeparatorColor(&self, separator_color: Option<&UIColor>);
1755
1756        #[cfg(feature = "UIVisualEffect")]
1757        #[unsafe(method(separatorEffect))]
1758        #[unsafe(method_family = none)]
1759        pub unsafe fn separatorEffect(&self) -> Option<Retained<UIVisualEffect>>;
1760
1761        #[cfg(feature = "UIVisualEffect")]
1762        /// Setter for [`separatorEffect`][Self::separatorEffect].
1763        #[unsafe(method(setSeparatorEffect:))]
1764        #[unsafe(method_family = none)]
1765        pub unsafe fn setSeparatorEffect(&self, separator_effect: Option<&UIVisualEffect>);
1766
1767        #[unsafe(method(cellLayoutMarginsFollowReadableWidth))]
1768        #[unsafe(method_family = none)]
1769        pub unsafe fn cellLayoutMarginsFollowReadableWidth(&self) -> bool;
1770
1771        /// Setter for [`cellLayoutMarginsFollowReadableWidth`][Self::cellLayoutMarginsFollowReadableWidth].
1772        #[unsafe(method(setCellLayoutMarginsFollowReadableWidth:))]
1773        #[unsafe(method_family = none)]
1774        pub unsafe fn setCellLayoutMarginsFollowReadableWidth(
1775            &self,
1776            cell_layout_margins_follow_readable_width: bool,
1777        );
1778
1779        #[unsafe(method(insetsContentViewsToSafeArea))]
1780        #[unsafe(method_family = none)]
1781        pub unsafe fn insetsContentViewsToSafeArea(&self) -> bool;
1782
1783        /// Setter for [`insetsContentViewsToSafeArea`][Self::insetsContentViewsToSafeArea].
1784        #[unsafe(method(setInsetsContentViewsToSafeArea:))]
1785        #[unsafe(method_family = none)]
1786        pub unsafe fn setInsetsContentViewsToSafeArea(
1787            &self,
1788            insets_content_views_to_safe_area: bool,
1789        );
1790
1791        #[unsafe(method(tableHeaderView))]
1792        #[unsafe(method_family = none)]
1793        pub unsafe fn tableHeaderView(&self) -> Option<Retained<UIView>>;
1794
1795        /// Setter for [`tableHeaderView`][Self::tableHeaderView].
1796        #[unsafe(method(setTableHeaderView:))]
1797        #[unsafe(method_family = none)]
1798        pub unsafe fn setTableHeaderView(&self, table_header_view: Option<&UIView>);
1799
1800        #[unsafe(method(tableFooterView))]
1801        #[unsafe(method_family = none)]
1802        pub unsafe fn tableFooterView(&self) -> Option<Retained<UIView>>;
1803
1804        /// Setter for [`tableFooterView`][Self::tableFooterView].
1805        #[unsafe(method(setTableFooterView:))]
1806        #[unsafe(method_family = none)]
1807        pub unsafe fn setTableFooterView(&self, table_footer_view: Option<&UIView>);
1808
1809        #[cfg(feature = "UITableViewCell")]
1810        #[unsafe(method(dequeueReusableCellWithIdentifier:))]
1811        #[unsafe(method_family = none)]
1812        pub unsafe fn dequeueReusableCellWithIdentifier(
1813            &self,
1814            identifier: &NSString,
1815        ) -> Option<Retained<UITableViewCell>>;
1816
1817        #[cfg(feature = "UITableViewCell")]
1818        #[unsafe(method(dequeueReusableCellWithIdentifier:forIndexPath:))]
1819        #[unsafe(method_family = none)]
1820        pub unsafe fn dequeueReusableCellWithIdentifier_forIndexPath(
1821            &self,
1822            identifier: &NSString,
1823            index_path: &NSIndexPath,
1824        ) -> Retained<UITableViewCell>;
1825
1826        #[cfg(feature = "UITableViewHeaderFooterView")]
1827        #[unsafe(method(dequeueReusableHeaderFooterViewWithIdentifier:))]
1828        #[unsafe(method_family = none)]
1829        pub unsafe fn dequeueReusableHeaderFooterViewWithIdentifier(
1830            &self,
1831            identifier: &NSString,
1832        ) -> Option<Retained<UITableViewHeaderFooterView>>;
1833
1834        #[cfg(feature = "UINib")]
1835        #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
1836        #[unsafe(method(registerNib:forCellReuseIdentifier:))]
1837        #[unsafe(method_family = none)]
1838        pub unsafe fn registerNib_forCellReuseIdentifier(
1839            &self,
1840            nib: Option<&UINib>,
1841            identifier: &NSString,
1842        );
1843
1844        #[unsafe(method(registerClass:forCellReuseIdentifier:))]
1845        #[unsafe(method_family = none)]
1846        pub unsafe fn registerClass_forCellReuseIdentifier(
1847            &self,
1848            cell_class: Option<&AnyClass>,
1849            identifier: &NSString,
1850        );
1851
1852        #[cfg(feature = "UINib")]
1853        #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
1854        #[unsafe(method(registerNib:forHeaderFooterViewReuseIdentifier:))]
1855        #[unsafe(method_family = none)]
1856        pub unsafe fn registerNib_forHeaderFooterViewReuseIdentifier(
1857            &self,
1858            nib: Option<&UINib>,
1859            identifier: &NSString,
1860        );
1861
1862        #[unsafe(method(registerClass:forHeaderFooterViewReuseIdentifier:))]
1863        #[unsafe(method_family = none)]
1864        pub unsafe fn registerClass_forHeaderFooterViewReuseIdentifier(
1865            &self,
1866            a_class: Option<&AnyClass>,
1867            identifier: &NSString,
1868        );
1869
1870        #[unsafe(method(remembersLastFocusedIndexPath))]
1871        #[unsafe(method_family = none)]
1872        pub unsafe fn remembersLastFocusedIndexPath(&self) -> bool;
1873
1874        /// Setter for [`remembersLastFocusedIndexPath`][Self::remembersLastFocusedIndexPath].
1875        #[unsafe(method(setRemembersLastFocusedIndexPath:))]
1876        #[unsafe(method_family = none)]
1877        pub unsafe fn setRemembersLastFocusedIndexPath(
1878            &self,
1879            remembers_last_focused_index_path: bool,
1880        );
1881
1882        /// When enabled, the table view ensures that selection is automatically triggered when focus moves to a cell.
1883        /// Defaults to a system derived value based on platform and other properties of the table view.
1884        #[unsafe(method(selectionFollowsFocus))]
1885        #[unsafe(method_family = none)]
1886        pub unsafe fn selectionFollowsFocus(&self) -> bool;
1887
1888        /// Setter for [`selectionFollowsFocus`][Self::selectionFollowsFocus].
1889        #[unsafe(method(setSelectionFollowsFocus:))]
1890        #[unsafe(method_family = none)]
1891        pub unsafe fn setSelectionFollowsFocus(&self, selection_follows_focus: bool);
1892
1893        /// Determines if the table view allows its cells to become focused.
1894        /// When tableView:canFocusRowAtIndexPath: is implemented, its return value takes precedence over this method.
1895        /// Defaults to a system derived value based on platform and other properties of the table view.
1896        #[unsafe(method(allowsFocus))]
1897        #[unsafe(method_family = none)]
1898        pub unsafe fn allowsFocus(&self) -> bool;
1899
1900        /// Setter for [`allowsFocus`][Self::allowsFocus].
1901        #[unsafe(method(setAllowsFocus:))]
1902        #[unsafe(method_family = none)]
1903        pub unsafe fn setAllowsFocus(&self, allows_focus: bool);
1904
1905        /// Determines if the table view allows its cells to become focused while editing.
1906        /// When tableView:canFocusRowAtIndexPath: is implemented, its return value takes precedence over this method.
1907        /// Defaults to a system derived value based on platform and other properties of the table view.
1908        #[unsafe(method(allowsFocusDuringEditing))]
1909        #[unsafe(method_family = none)]
1910        pub unsafe fn allowsFocusDuringEditing(&self) -> bool;
1911
1912        /// Setter for [`allowsFocusDuringEditing`][Self::allowsFocusDuringEditing].
1913        #[unsafe(method(setAllowsFocusDuringEditing:))]
1914        #[unsafe(method_family = none)]
1915        pub unsafe fn setAllowsFocusDuringEditing(&self, allows_focus_during_editing: bool);
1916
1917        #[unsafe(method(dragInteractionEnabled))]
1918        #[unsafe(method_family = none)]
1919        pub unsafe fn dragInteractionEnabled(&self) -> bool;
1920
1921        /// Setter for [`dragInteractionEnabled`][Self::dragInteractionEnabled].
1922        #[unsafe(method(setDragInteractionEnabled:))]
1923        #[unsafe(method_family = none)]
1924        pub unsafe fn setDragInteractionEnabled(&self, drag_interaction_enabled: bool);
1925
1926        #[unsafe(method(hasActiveDrag))]
1927        #[unsafe(method_family = none)]
1928        pub unsafe fn hasActiveDrag(&self) -> bool;
1929
1930        #[unsafe(method(hasActiveDrop))]
1931        #[unsafe(method_family = none)]
1932        pub unsafe fn hasActiveDrop(&self) -> bool;
1933
1934        /// Determines the type of items that will tightly hug their content.
1935        ///
1936        /// The default value for this property is `UITableViewContentHuggingElementsSectionHeaders` on visionOS for plain style table views and `UITableViewContentHuggingElementsNone` on all other platforms.
1937        /// When the value of this property is `UITableViewContentHuggingElementsSectionHeaders`, any header view will not stretch the width of the table view if their content's intrinsic content size is less than the table view's width.
1938        #[unsafe(method(contentHuggingElements))]
1939        #[unsafe(method_family = none)]
1940        pub unsafe fn contentHuggingElements(&self) -> UITableViewContentHuggingElements;
1941
1942        /// Setter for [`contentHuggingElements`][Self::contentHuggingElements].
1943        #[unsafe(method(setContentHuggingElements:))]
1944        #[unsafe(method_family = none)]
1945        pub unsafe fn setContentHuggingElements(
1946            &self,
1947            content_hugging_elements: UITableViewContentHuggingElements,
1948        );
1949    );
1950}
1951
1952/// Methods declared on superclass `UIView`.
1953#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1954impl UITableView {
1955    extern_methods!(
1956        #[cfg(feature = "objc2-core-foundation")]
1957        #[unsafe(method(initWithFrame:))]
1958        #[unsafe(method_family = init)]
1959        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
1960    );
1961}
1962
1963/// Methods declared on superclass `NSObject`.
1964#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1965impl UITableView {
1966    extern_methods!(
1967        #[unsafe(method(init))]
1968        #[unsafe(method_family = init)]
1969        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1970
1971        #[unsafe(method(new))]
1972        #[unsafe(method_family = new)]
1973        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1974    );
1975}
1976
1977/// UIDragAndDrop.
1978#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1979impl UITableView {
1980    extern_methods!();
1981}
1982
1983#[cfg(all(
1984    feature = "UIResponder",
1985    feature = "UIScrollView",
1986    feature = "UISpringLoadedInteractionSupporting",
1987    feature = "UIView"
1988))]
1989unsafe impl UISpringLoadedInteractionSupporting for UITableView {}
1990
1991extern_protocol!(
1992    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdatasource?language=objc)
1993    pub unsafe trait UITableViewDataSource: NSObjectProtocol + MainThreadOnly {
1994        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1995        #[unsafe(method(tableView:numberOfRowsInSection:))]
1996        #[unsafe(method_family = none)]
1997        unsafe fn tableView_numberOfRowsInSection(
1998            &self,
1999            table_view: &UITableView,
2000            section: NSInteger,
2001        ) -> NSInteger;
2002
2003        #[cfg(all(
2004            feature = "UIResponder",
2005            feature = "UIScrollView",
2006            feature = "UITableViewCell",
2007            feature = "UIView"
2008        ))]
2009        #[unsafe(method(tableView:cellForRowAtIndexPath:))]
2010        #[unsafe(method_family = none)]
2011        unsafe fn tableView_cellForRowAtIndexPath(
2012            &self,
2013            table_view: &UITableView,
2014            index_path: &NSIndexPath,
2015        ) -> Retained<UITableViewCell>;
2016
2017        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2018        #[optional]
2019        #[unsafe(method(numberOfSectionsInTableView:))]
2020        #[unsafe(method_family = none)]
2021        unsafe fn numberOfSectionsInTableView(&self, table_view: &UITableView) -> NSInteger;
2022
2023        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2024        #[optional]
2025        #[unsafe(method(tableView:titleForHeaderInSection:))]
2026        #[unsafe(method_family = none)]
2027        unsafe fn tableView_titleForHeaderInSection(
2028            &self,
2029            table_view: &UITableView,
2030            section: NSInteger,
2031        ) -> Option<Retained<NSString>>;
2032
2033        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2034        #[optional]
2035        #[unsafe(method(tableView:titleForFooterInSection:))]
2036        #[unsafe(method_family = none)]
2037        unsafe fn tableView_titleForFooterInSection(
2038            &self,
2039            table_view: &UITableView,
2040            section: NSInteger,
2041        ) -> Option<Retained<NSString>>;
2042
2043        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2044        #[optional]
2045        #[unsafe(method(tableView:canEditRowAtIndexPath:))]
2046        #[unsafe(method_family = none)]
2047        unsafe fn tableView_canEditRowAtIndexPath(
2048            &self,
2049            table_view: &UITableView,
2050            index_path: &NSIndexPath,
2051        ) -> bool;
2052
2053        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2054        #[optional]
2055        #[unsafe(method(tableView:canMoveRowAtIndexPath:))]
2056        #[unsafe(method_family = none)]
2057        unsafe fn tableView_canMoveRowAtIndexPath(
2058            &self,
2059            table_view: &UITableView,
2060            index_path: &NSIndexPath,
2061        ) -> bool;
2062
2063        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2064        #[optional]
2065        #[unsafe(method(sectionIndexTitlesForTableView:))]
2066        #[unsafe(method_family = none)]
2067        unsafe fn sectionIndexTitlesForTableView(
2068            &self,
2069            table_view: &UITableView,
2070        ) -> Option<Retained<NSArray<NSString>>>;
2071
2072        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2073        #[optional]
2074        #[unsafe(method(tableView:sectionForSectionIndexTitle:atIndex:))]
2075        #[unsafe(method_family = none)]
2076        unsafe fn tableView_sectionForSectionIndexTitle_atIndex(
2077            &self,
2078            table_view: &UITableView,
2079            title: &NSString,
2080            index: NSInteger,
2081        ) -> NSInteger;
2082
2083        #[cfg(all(
2084            feature = "UIResponder",
2085            feature = "UIScrollView",
2086            feature = "UITableViewCell",
2087            feature = "UIView"
2088        ))]
2089        #[optional]
2090        #[unsafe(method(tableView:commitEditingStyle:forRowAtIndexPath:))]
2091        #[unsafe(method_family = none)]
2092        unsafe fn tableView_commitEditingStyle_forRowAtIndexPath(
2093            &self,
2094            table_view: &UITableView,
2095            editing_style: UITableViewCellEditingStyle,
2096            index_path: &NSIndexPath,
2097        );
2098
2099        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2100        #[optional]
2101        #[unsafe(method(tableView:moveRowAtIndexPath:toIndexPath:))]
2102        #[unsafe(method_family = none)]
2103        unsafe fn tableView_moveRowAtIndexPath_toIndexPath(
2104            &self,
2105            table_view: &UITableView,
2106            source_index_path: &NSIndexPath,
2107            destination_index_path: &NSIndexPath,
2108        );
2109    }
2110);
2111
2112extern_protocol!(
2113    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdatasourceprefetching?language=objc)
2114    pub unsafe trait UITableViewDataSourcePrefetching:
2115        NSObjectProtocol + MainThreadOnly
2116    {
2117        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2118        #[unsafe(method(tableView:prefetchRowsAtIndexPaths:))]
2119        #[unsafe(method_family = none)]
2120        unsafe fn tableView_prefetchRowsAtIndexPaths(
2121            &self,
2122            table_view: &UITableView,
2123            index_paths: &NSArray<NSIndexPath>,
2124        );
2125
2126        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2127        #[optional]
2128        #[unsafe(method(tableView:cancelPrefetchingForRowsAtIndexPaths:))]
2129        #[unsafe(method_family = none)]
2130        unsafe fn tableView_cancelPrefetchingForRowsAtIndexPaths(
2131            &self,
2132            table_view: &UITableView,
2133            index_paths: &NSArray<NSIndexPath>,
2134        );
2135    }
2136);
2137
2138extern_protocol!(
2139    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdragdelegate?language=objc)
2140    pub unsafe trait UITableViewDragDelegate: NSObjectProtocol + MainThreadOnly {
2141        #[cfg(all(
2142            feature = "UIDragItem",
2143            feature = "UIDragSession",
2144            feature = "UIResponder",
2145            feature = "UIScrollView",
2146            feature = "UIView"
2147        ))]
2148        #[unsafe(method(tableView:itemsForBeginningDragSession:atIndexPath:))]
2149        #[unsafe(method_family = none)]
2150        unsafe fn tableView_itemsForBeginningDragSession_atIndexPath(
2151            &self,
2152            table_view: &UITableView,
2153            session: &ProtocolObject<dyn UIDragSession>,
2154            index_path: &NSIndexPath,
2155        ) -> Retained<NSArray<UIDragItem>>;
2156
2157        #[cfg(all(
2158            feature = "UIDragItem",
2159            feature = "UIDragSession",
2160            feature = "UIResponder",
2161            feature = "UIScrollView",
2162            feature = "UIView",
2163            feature = "objc2-core-foundation"
2164        ))]
2165        #[optional]
2166        #[unsafe(method(tableView:itemsForAddingToDragSession:atIndexPath:point:))]
2167        #[unsafe(method_family = none)]
2168        unsafe fn tableView_itemsForAddingToDragSession_atIndexPath_point(
2169            &self,
2170            table_view: &UITableView,
2171            session: &ProtocolObject<dyn UIDragSession>,
2172            index_path: &NSIndexPath,
2173            point: CGPoint,
2174        ) -> Retained<NSArray<UIDragItem>>;
2175
2176        #[cfg(all(
2177            feature = "UIDragPreviewParameters",
2178            feature = "UIPreviewParameters",
2179            feature = "UIResponder",
2180            feature = "UIScrollView",
2181            feature = "UIView"
2182        ))]
2183        #[optional]
2184        #[unsafe(method(tableView:dragPreviewParametersForRowAtIndexPath:))]
2185        #[unsafe(method_family = none)]
2186        unsafe fn tableView_dragPreviewParametersForRowAtIndexPath(
2187            &self,
2188            table_view: &UITableView,
2189            index_path: &NSIndexPath,
2190        ) -> Option<Retained<UIDragPreviewParameters>>;
2191
2192        #[cfg(all(
2193            feature = "UIDragSession",
2194            feature = "UIResponder",
2195            feature = "UIScrollView",
2196            feature = "UIView"
2197        ))]
2198        #[optional]
2199        #[unsafe(method(tableView:dragSessionWillBegin:))]
2200        #[unsafe(method_family = none)]
2201        unsafe fn tableView_dragSessionWillBegin(
2202            &self,
2203            table_view: &UITableView,
2204            session: &ProtocolObject<dyn UIDragSession>,
2205        );
2206
2207        #[cfg(all(
2208            feature = "UIDragSession",
2209            feature = "UIResponder",
2210            feature = "UIScrollView",
2211            feature = "UIView"
2212        ))]
2213        #[optional]
2214        #[unsafe(method(tableView:dragSessionDidEnd:))]
2215        #[unsafe(method_family = none)]
2216        unsafe fn tableView_dragSessionDidEnd(
2217            &self,
2218            table_view: &UITableView,
2219            session: &ProtocolObject<dyn UIDragSession>,
2220        );
2221
2222        #[cfg(all(
2223            feature = "UIDragSession",
2224            feature = "UIResponder",
2225            feature = "UIScrollView",
2226            feature = "UIView"
2227        ))]
2228        #[optional]
2229        #[unsafe(method(tableView:dragSessionAllowsMoveOperation:))]
2230        #[unsafe(method_family = none)]
2231        unsafe fn tableView_dragSessionAllowsMoveOperation(
2232            &self,
2233            table_view: &UITableView,
2234            session: &ProtocolObject<dyn UIDragSession>,
2235        ) -> bool;
2236
2237        #[cfg(all(
2238            feature = "UIDragSession",
2239            feature = "UIResponder",
2240            feature = "UIScrollView",
2241            feature = "UIView"
2242        ))]
2243        #[optional]
2244        #[unsafe(method(tableView:dragSessionIsRestrictedToDraggingApplication:))]
2245        #[unsafe(method_family = none)]
2246        unsafe fn tableView_dragSessionIsRestrictedToDraggingApplication(
2247            &self,
2248            table_view: &UITableView,
2249            session: &ProtocolObject<dyn UIDragSession>,
2250        ) -> bool;
2251    }
2252);
2253
2254extern_protocol!(
2255    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropdelegate?language=objc)
2256    pub unsafe trait UITableViewDropDelegate: NSObjectProtocol + MainThreadOnly {
2257        #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
2258        #[unsafe(method(tableView:performDropWithCoordinator:))]
2259        #[unsafe(method_family = none)]
2260        unsafe fn tableView_performDropWithCoordinator(
2261            &self,
2262            table_view: &UITableView,
2263            coordinator: &ProtocolObject<dyn UITableViewDropCoordinator>,
2264        );
2265
2266        #[cfg(all(
2267            feature = "UIDragSession",
2268            feature = "UIResponder",
2269            feature = "UIScrollView",
2270            feature = "UIView"
2271        ))]
2272        #[optional]
2273        #[unsafe(method(tableView:canHandleDropSession:))]
2274        #[unsafe(method_family = none)]
2275        unsafe fn tableView_canHandleDropSession(
2276            &self,
2277            table_view: &UITableView,
2278            session: &ProtocolObject<dyn UIDropSession>,
2279        ) -> bool;
2280
2281        #[cfg(all(
2282            feature = "UIDragSession",
2283            feature = "UIResponder",
2284            feature = "UIScrollView",
2285            feature = "UIView"
2286        ))]
2287        #[optional]
2288        #[unsafe(method(tableView:dropSessionDidEnter:))]
2289        #[unsafe(method_family = none)]
2290        unsafe fn tableView_dropSessionDidEnter(
2291            &self,
2292            table_view: &UITableView,
2293            session: &ProtocolObject<dyn UIDropSession>,
2294        );
2295
2296        #[cfg(all(
2297            feature = "UIDragSession",
2298            feature = "UIDropInteraction",
2299            feature = "UIResponder",
2300            feature = "UIScrollView",
2301            feature = "UIView"
2302        ))]
2303        #[optional]
2304        #[unsafe(method(tableView:dropSessionDidUpdate:withDestinationIndexPath:))]
2305        #[unsafe(method_family = none)]
2306        unsafe fn tableView_dropSessionDidUpdate_withDestinationIndexPath(
2307            &self,
2308            table_view: &UITableView,
2309            session: &ProtocolObject<dyn UIDropSession>,
2310            destination_index_path: Option<&NSIndexPath>,
2311        ) -> Retained<UITableViewDropProposal>;
2312
2313        #[cfg(all(
2314            feature = "UIDragSession",
2315            feature = "UIResponder",
2316            feature = "UIScrollView",
2317            feature = "UIView"
2318        ))]
2319        #[optional]
2320        #[unsafe(method(tableView:dropSessionDidExit:))]
2321        #[unsafe(method_family = none)]
2322        unsafe fn tableView_dropSessionDidExit(
2323            &self,
2324            table_view: &UITableView,
2325            session: &ProtocolObject<dyn UIDropSession>,
2326        );
2327
2328        #[cfg(all(
2329            feature = "UIDragSession",
2330            feature = "UIResponder",
2331            feature = "UIScrollView",
2332            feature = "UIView"
2333        ))]
2334        #[optional]
2335        #[unsafe(method(tableView:dropSessionDidEnd:))]
2336        #[unsafe(method_family = none)]
2337        unsafe fn tableView_dropSessionDidEnd(
2338            &self,
2339            table_view: &UITableView,
2340            session: &ProtocolObject<dyn UIDropSession>,
2341        );
2342
2343        #[cfg(all(
2344            feature = "UIDragPreviewParameters",
2345            feature = "UIPreviewParameters",
2346            feature = "UIResponder",
2347            feature = "UIScrollView",
2348            feature = "UIView"
2349        ))]
2350        #[optional]
2351        #[unsafe(method(tableView:dropPreviewParametersForRowAtIndexPath:))]
2352        #[unsafe(method_family = none)]
2353        unsafe fn tableView_dropPreviewParametersForRowAtIndexPath(
2354            &self,
2355            table_view: &UITableView,
2356            index_path: &NSIndexPath,
2357        ) -> Option<Retained<UIDragPreviewParameters>>;
2358    }
2359);
2360
2361/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropintent?language=objc)
2362// NS_ENUM
2363#[repr(transparent)]
2364#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2365pub struct UITableViewDropIntent(pub NSInteger);
2366impl UITableViewDropIntent {
2367    #[doc(alias = "UITableViewDropIntentUnspecified")]
2368    pub const Unspecified: Self = Self(0);
2369    #[doc(alias = "UITableViewDropIntentInsertAtDestinationIndexPath")]
2370    pub const InsertAtDestinationIndexPath: Self = Self(1);
2371    #[doc(alias = "UITableViewDropIntentInsertIntoDestinationIndexPath")]
2372    pub const InsertIntoDestinationIndexPath: Self = Self(2);
2373    #[doc(alias = "UITableViewDropIntentAutomatic")]
2374    pub const Automatic: Self = Self(3);
2375}
2376
2377unsafe impl Encode for UITableViewDropIntent {
2378    const ENCODING: Encoding = NSInteger::ENCODING;
2379}
2380
2381unsafe impl RefEncode for UITableViewDropIntent {
2382    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2383}
2384
2385extern_class!(
2386    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropproposal?language=objc)
2387    #[unsafe(super(UIDropProposal, NSObject))]
2388    #[thread_kind = MainThreadOnly]
2389    #[derive(Debug, PartialEq, Eq, Hash)]
2390    #[cfg(feature = "UIDropInteraction")]
2391    pub struct UITableViewDropProposal;
2392);
2393
2394#[cfg(feature = "UIDropInteraction")]
2395unsafe impl NSCopying for UITableViewDropProposal {}
2396
2397#[cfg(feature = "UIDropInteraction")]
2398unsafe impl CopyingHelper for UITableViewDropProposal {
2399    type Result = Self;
2400}
2401
2402#[cfg(feature = "UIDropInteraction")]
2403unsafe impl NSObjectProtocol for UITableViewDropProposal {}
2404
2405#[cfg(feature = "UIDropInteraction")]
2406impl UITableViewDropProposal {
2407    extern_methods!(
2408        #[unsafe(method(initWithDropOperation:intent:))]
2409        #[unsafe(method_family = init)]
2410        pub unsafe fn initWithDropOperation_intent(
2411            this: Allocated<Self>,
2412            operation: UIDropOperation,
2413            intent: UITableViewDropIntent,
2414        ) -> Retained<Self>;
2415
2416        #[unsafe(method(intent))]
2417        #[unsafe(method_family = none)]
2418        pub unsafe fn intent(&self) -> UITableViewDropIntent;
2419    );
2420}
2421
2422/// Methods declared on superclass `UIDropProposal`.
2423#[cfg(feature = "UIDropInteraction")]
2424impl UITableViewDropProposal {
2425    extern_methods!(
2426        #[unsafe(method(initWithDropOperation:))]
2427        #[unsafe(method_family = init)]
2428        pub unsafe fn initWithDropOperation(
2429            this: Allocated<Self>,
2430            operation: UIDropOperation,
2431        ) -> Retained<Self>;
2432
2433        #[unsafe(method(init))]
2434        #[unsafe(method_family = init)]
2435        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2436
2437        #[unsafe(method(new))]
2438        #[unsafe(method_family = new)]
2439        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2440    );
2441}
2442
2443extern_protocol!(
2444    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropcoordinator?language=objc)
2445    pub unsafe trait UITableViewDropCoordinator: NSObjectProtocol + MainThreadOnly {
2446        #[unsafe(method(items))]
2447        #[unsafe(method_family = none)]
2448        unsafe fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UITableViewDropItem>>>;
2449
2450        #[unsafe(method(destinationIndexPath))]
2451        #[unsafe(method_family = none)]
2452        unsafe fn destinationIndexPath(&self) -> Option<Retained<NSIndexPath>>;
2453
2454        #[cfg(feature = "UIDropInteraction")]
2455        #[unsafe(method(proposal))]
2456        #[unsafe(method_family = none)]
2457        unsafe fn proposal(&self) -> Retained<UITableViewDropProposal>;
2458
2459        #[cfg(feature = "UIDragSession")]
2460        #[unsafe(method(session))]
2461        #[unsafe(method_family = none)]
2462        unsafe fn session(&self) -> Retained<ProtocolObject<dyn UIDropSession>>;
2463
2464        #[cfg(all(feature = "UIDragInteraction", feature = "UIDragItem"))]
2465        #[unsafe(method(dropItem:toPlaceholder:))]
2466        #[unsafe(method_family = none)]
2467        unsafe fn dropItem_toPlaceholder(
2468            &self,
2469            drag_item: &UIDragItem,
2470            placeholder: &UITableViewDropPlaceholder,
2471        ) -> Retained<ProtocolObject<dyn UITableViewDropPlaceholderContext>>;
2472
2473        #[cfg(all(feature = "UIDragInteraction", feature = "UIDragItem"))]
2474        #[unsafe(method(dropItem:toRowAtIndexPath:))]
2475        #[unsafe(method_family = none)]
2476        unsafe fn dropItem_toRowAtIndexPath(
2477            &self,
2478            drag_item: &UIDragItem,
2479            index_path: &NSIndexPath,
2480        ) -> Retained<ProtocolObject<dyn UIDragAnimating>>;
2481
2482        #[cfg(all(
2483            feature = "UIDragInteraction",
2484            feature = "UIDragItem",
2485            feature = "objc2-core-foundation"
2486        ))]
2487        #[unsafe(method(dropItem:intoRowAtIndexPath:rect:))]
2488        #[unsafe(method_family = none)]
2489        unsafe fn dropItem_intoRowAtIndexPath_rect(
2490            &self,
2491            drag_item: &UIDragItem,
2492            index_path: &NSIndexPath,
2493            rect: CGRect,
2494        ) -> Retained<ProtocolObject<dyn UIDragAnimating>>;
2495
2496        #[cfg(all(
2497            feature = "UIDragInteraction",
2498            feature = "UIDragItem",
2499            feature = "UITargetedDragPreview",
2500            feature = "UITargetedPreview"
2501        ))]
2502        #[unsafe(method(dropItem:toTarget:))]
2503        #[unsafe(method_family = none)]
2504        unsafe fn dropItem_toTarget(
2505            &self,
2506            drag_item: &UIDragItem,
2507            target: &UIDragPreviewTarget,
2508        ) -> Retained<ProtocolObject<dyn UIDragAnimating>>;
2509    }
2510);
2511
2512extern_class!(
2513    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewplaceholder?language=objc)
2514    #[unsafe(super(NSObject))]
2515    #[thread_kind = MainThreadOnly]
2516    #[derive(Debug, PartialEq, Eq, Hash)]
2517    pub struct UITableViewPlaceholder;
2518);
2519
2520unsafe impl NSObjectProtocol for UITableViewPlaceholder {}
2521
2522impl UITableViewPlaceholder {
2523    extern_methods!(
2524        #[cfg(feature = "objc2-core-foundation")]
2525        #[unsafe(method(initWithInsertionIndexPath:reuseIdentifier:rowHeight:))]
2526        #[unsafe(method_family = init)]
2527        pub unsafe fn initWithInsertionIndexPath_reuseIdentifier_rowHeight(
2528            this: Allocated<Self>,
2529            insertion_index_path: &NSIndexPath,
2530            reuse_identifier: &NSString,
2531            row_height: CGFloat,
2532        ) -> Retained<Self>;
2533
2534        #[unsafe(method(init))]
2535        #[unsafe(method_family = init)]
2536        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2537
2538        #[unsafe(method(new))]
2539        #[unsafe(method_family = new)]
2540        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2541
2542        #[cfg(all(
2543            feature = "UIResponder",
2544            feature = "UITableViewCell",
2545            feature = "UIView",
2546            feature = "block2"
2547        ))]
2548        #[unsafe(method(cellUpdateHandler))]
2549        #[unsafe(method_family = none)]
2550        pub unsafe fn cellUpdateHandler(
2551            &self,
2552        ) -> *mut block2::Block<dyn Fn(NonNull<UITableViewCell>)>;
2553
2554        #[cfg(all(
2555            feature = "UIResponder",
2556            feature = "UITableViewCell",
2557            feature = "UIView",
2558            feature = "block2"
2559        ))]
2560        /// Setter for [`cellUpdateHandler`][Self::cellUpdateHandler].
2561        #[unsafe(method(setCellUpdateHandler:))]
2562        #[unsafe(method_family = none)]
2563        pub unsafe fn setCellUpdateHandler(
2564            &self,
2565            cell_update_handler: Option<&block2::Block<dyn Fn(NonNull<UITableViewCell>)>>,
2566        );
2567    );
2568}
2569
2570extern_class!(
2571    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropplaceholder?language=objc)
2572    #[unsafe(super(UITableViewPlaceholder, NSObject))]
2573    #[thread_kind = MainThreadOnly]
2574    #[derive(Debug, PartialEq, Eq, Hash)]
2575    pub struct UITableViewDropPlaceholder;
2576);
2577
2578unsafe impl NSObjectProtocol for UITableViewDropPlaceholder {}
2579
2580impl UITableViewDropPlaceholder {
2581    extern_methods!(
2582        #[cfg(all(
2583            feature = "UIDragPreviewParameters",
2584            feature = "UIPreviewParameters",
2585            feature = "UIResponder",
2586            feature = "UITableViewCell",
2587            feature = "UIView",
2588            feature = "block2"
2589        ))]
2590        #[unsafe(method(previewParametersProvider))]
2591        #[unsafe(method_family = none)]
2592        pub unsafe fn previewParametersProvider(
2593            &self,
2594        ) -> *mut block2::Block<dyn Fn(NonNull<UITableViewCell>) -> *mut UIDragPreviewParameters>;
2595
2596        #[cfg(all(
2597            feature = "UIDragPreviewParameters",
2598            feature = "UIPreviewParameters",
2599            feature = "UIResponder",
2600            feature = "UITableViewCell",
2601            feature = "UIView",
2602            feature = "block2"
2603        ))]
2604        /// Setter for [`previewParametersProvider`][Self::previewParametersProvider].
2605        #[unsafe(method(setPreviewParametersProvider:))]
2606        #[unsafe(method_family = none)]
2607        pub unsafe fn setPreviewParametersProvider(
2608            &self,
2609            preview_parameters_provider: Option<
2610                &block2::Block<dyn Fn(NonNull<UITableViewCell>) -> *mut UIDragPreviewParameters>,
2611            >,
2612        );
2613    );
2614}
2615
2616/// Methods declared on superclass `UITableViewPlaceholder`.
2617impl UITableViewDropPlaceholder {
2618    extern_methods!(
2619        #[cfg(feature = "objc2-core-foundation")]
2620        #[unsafe(method(initWithInsertionIndexPath:reuseIdentifier:rowHeight:))]
2621        #[unsafe(method_family = init)]
2622        pub unsafe fn initWithInsertionIndexPath_reuseIdentifier_rowHeight(
2623            this: Allocated<Self>,
2624            insertion_index_path: &NSIndexPath,
2625            reuse_identifier: &NSString,
2626            row_height: CGFloat,
2627        ) -> Retained<Self>;
2628
2629        #[unsafe(method(init))]
2630        #[unsafe(method_family = init)]
2631        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2632
2633        #[unsafe(method(new))]
2634        #[unsafe(method_family = new)]
2635        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
2636    );
2637}
2638
2639extern_protocol!(
2640    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropitem?language=objc)
2641    pub unsafe trait UITableViewDropItem: NSObjectProtocol + MainThreadOnly {
2642        #[cfg(feature = "UIDragItem")]
2643        #[unsafe(method(dragItem))]
2644        #[unsafe(method_family = none)]
2645        unsafe fn dragItem(&self) -> Retained<UIDragItem>;
2646
2647        #[unsafe(method(sourceIndexPath))]
2648        #[unsafe(method_family = none)]
2649        unsafe fn sourceIndexPath(&self) -> Option<Retained<NSIndexPath>>;
2650
2651        #[cfg(feature = "objc2-core-foundation")]
2652        #[unsafe(method(previewSize))]
2653        #[unsafe(method_family = none)]
2654        unsafe fn previewSize(&self) -> CGSize;
2655    }
2656);
2657
2658extern_protocol!(
2659    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewdropplaceholdercontext?language=objc)
2660    #[cfg(feature = "UIDragInteraction")]
2661    pub unsafe trait UITableViewDropPlaceholderContext:
2662        UIDragAnimating + MainThreadOnly
2663    {
2664        #[cfg(feature = "UIDragItem")]
2665        #[unsafe(method(dragItem))]
2666        #[unsafe(method_family = none)]
2667        unsafe fn dragItem(&self) -> Retained<UIDragItem>;
2668
2669        #[cfg(feature = "block2")]
2670        #[unsafe(method(commitInsertionWithDataSourceUpdates:))]
2671        #[unsafe(method_family = none)]
2672        unsafe fn commitInsertionWithDataSourceUpdates(
2673            &self,
2674            data_source_updates: &block2::Block<dyn Fn(NonNull<NSIndexPath>) + '_>,
2675        ) -> bool;
2676
2677        #[unsafe(method(deletePlaceholder))]
2678        #[unsafe(method_family = none)]
2679        unsafe fn deletePlaceholder(&self) -> bool;
2680    }
2681);