pub struct TVLockupView { /* private fields */ }TVLockupView only.Expand description
TVLockupView is a composed view specializing in presenting a main content, and optional header or footer.
See also Apple’s documentation
Implementations§
Source§impl TVLockupView
impl TVLockupView
Sourcepub unsafe fn contentView(&self) -> Retained<UIView>
pub unsafe fn contentView(&self) -> Retained<UIView>
The container view where subviews are added.
Clients should add their subviews to the contentView. Views added directly to the lockup view have undefined behaviors.
Sourcepub unsafe fn contentSize(&self) -> CGSize
Available on crate feature objc2-core-foundation only.
pub unsafe fn contentSize(&self) -> CGSize
objc2-core-foundation only.The size of the content
Clients can use this to explicitly set the size of the content. Default results in system default contentSize.
Sourcepub unsafe fn setContentSize(&self, content_size: CGSize)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setContentSize(&self, content_size: CGSize)
objc2-core-foundation only.Setter for contentSize.
Sourcepub unsafe fn headerView(&self) -> Option<Retained<TVLockupHeaderFooterView>>
Available on crate feature TVLockupHeaderFooterView only.
pub unsafe fn headerView(&self) -> Option<Retained<TVLockupHeaderFooterView>>
TVLockupHeaderFooterView only.The optional header and footer views.
Subclass TVLockupHeaderFooterView for additional customization.
Sourcepub unsafe fn setHeaderView(
&self,
header_view: Option<&TVLockupHeaderFooterView>,
)
Available on crate feature TVLockupHeaderFooterView only.
pub unsafe fn setHeaderView( &self, header_view: Option<&TVLockupHeaderFooterView>, )
TVLockupHeaderFooterView only.Setter for headerView.
TVLockupHeaderFooterView only.Available on crate feature TVLockupHeaderFooterView only.
TVLockupHeaderFooterView only.Setter for footerView.
Sourcepub unsafe fn contentViewInsets(&self) -> NSDirectionalEdgeInsets
pub unsafe fn contentViewInsets(&self) -> NSDirectionalEdgeInsets
The spacing between the content view and its sibling and parent views
.top and .bottom are spaces between the contentView and headerView and footerView, respectively. .leading and .trailing are between contentView and the lockup view itself. Use negative values for positive spacing.
Sourcepub unsafe fn setContentViewInsets(
&self,
content_view_insets: NSDirectionalEdgeInsets,
)
pub unsafe fn setContentViewInsets( &self, content_view_insets: NSDirectionalEdgeInsets, )
Setter for contentViewInsets.
Sourcepub unsafe fn focusSizeIncrease(&self) -> NSDirectionalEdgeInsets
pub unsafe fn focusSizeIncrease(&self) -> NSDirectionalEdgeInsets
The size increase when the lockup view or its subview is in focus
The amount by which headerView and footerView will move when the lockup view or its subview is in focus. Use negative values for positive increase.
Sourcepub unsafe fn setFocusSizeIncrease(
&self,
focus_size_increase: NSDirectionalEdgeInsets,
)
pub unsafe fn setFocusSizeIncrease( &self, focus_size_increase: NSDirectionalEdgeInsets, )
Setter for focusSizeIncrease.
Source§impl TVLockupView
Methods declared on superclass UIControl.
impl TVLockupView
Methods declared on superclass UIControl.
pub unsafe fn initWithFrame( this: Allocated<Self>, frame: CGRect, ) -> Retained<Self>
objc2-core-foundation only.Sourcepub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>
pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder, ) -> Option<Retained<Self>>
§Safety
coder possibly has further requirements.
Sourcepub unsafe fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>
Available on crate feature objc2-core-foundation only.
pub unsafe fn initWithFrame_primaryAction( this: Allocated<Self>, frame: CGRect, primary_action: Option<&UIAction>, ) -> Retained<Self>
objc2-core-foundation only.Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
Source§impl TVLockupView
Methods declared on superclass UIView.
impl TVLockupView
Methods declared on superclass UIView.
Source§impl TVLockupView
Methods declared on superclass NSObject.
impl TVLockupView
Methods declared on superclass NSObject.
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>
Methods from Deref<Target = UIControl>§
pub fn isEnabled(&self) -> bool
Sourcepub fn setEnabled(&self, enabled: bool)
pub fn setEnabled(&self, enabled: bool)
Setter for isEnabled.
pub fn isSelected(&self) -> bool
Sourcepub fn setSelected(&self, selected: bool)
pub fn setSelected(&self, selected: bool)
Setter for isSelected.
pub fn isHighlighted(&self) -> bool
Sourcepub fn setHighlighted(&self, highlighted: bool)
pub fn setHighlighted(&self, highlighted: bool)
Setter for isHighlighted.
pub fn contentVerticalAlignment(&self) -> UIControlContentVerticalAlignment
Sourcepub fn setContentVerticalAlignment(
&self,
content_vertical_alignment: UIControlContentVerticalAlignment,
)
pub fn setContentVerticalAlignment( &self, content_vertical_alignment: UIControlContentVerticalAlignment, )
Setter for contentVerticalAlignment.
pub fn contentHorizontalAlignment(&self) -> UIControlContentHorizontalAlignment
Sourcepub fn setContentHorizontalAlignment(
&self,
content_horizontal_alignment: UIControlContentHorizontalAlignment,
)
pub fn setContentHorizontalAlignment( &self, content_horizontal_alignment: UIControlContentHorizontalAlignment, )
Setter for contentHorizontalAlignment.
pub fn effectiveContentHorizontalAlignment( &self, ) -> UIControlContentHorizontalAlignment
pub fn state(&self) -> UIControlState
pub fn isTracking(&self) -> bool
pub fn isTouchInside(&self) -> bool
Sourcepub unsafe fn addTarget_action_forControlEvents(
&self,
target: Option<&AnyObject>,
action: Sel,
control_events: UIControlEvents,
)
pub unsafe fn addTarget_action_forControlEvents( &self, target: Option<&AnyObject>, action: Sel, control_events: UIControlEvents, )
§Safety
targetshould be of the correct type.actionmust be a valid selector.
Sourcepub unsafe fn removeTarget_action_forControlEvents(
&self,
target: Option<&AnyObject>,
action: Option<Sel>,
control_events: UIControlEvents,
)
pub unsafe fn removeTarget_action_forControlEvents( &self, target: Option<&AnyObject>, action: Option<Sel>, control_events: UIControlEvents, )
§Safety
targetshould be of the correct type.actionmust be a valid selector.
Sourcepub fn addAction_forControlEvents(
&self,
action: &UIAction,
control_events: UIControlEvents,
)
pub fn addAction_forControlEvents( &self, action: &UIAction, control_events: UIControlEvents, )
Adds the UIAction to a given event. UIActions are uniqued based on their identifier, and subsequent actions with the same identifier replace previously added actions. You may add multiple UIActions for corresponding controlEvents, and you may add the same action to multiple controlEvents.
Sourcepub fn removeAction_forControlEvents(
&self,
action: &UIAction,
control_events: UIControlEvents,
)
pub fn removeAction_forControlEvents( &self, action: &UIAction, control_events: UIControlEvents, )
Removes the action from the set of passed control events.
Sourcepub fn removeActionForIdentifier_forControlEvents(
&self,
action_identifier: &NSString,
control_events: UIControlEvents,
)
pub fn removeActionForIdentifier_forControlEvents( &self, action_identifier: &NSString, control_events: UIControlEvents, )
Removes the action with the provided identifier from the set of passed control events.
Sourcepub fn performPrimaryAction(&self)
pub fn performPrimaryAction(&self)
Performs the control’s primary action.
pub fn allTargets(&self) -> Retained<NSSet>
pub fn allControlEvents(&self) -> UIControlEvents
Sourcepub unsafe fn actionsForTarget_forControlEvent(
&self,
target: Option<&AnyObject>,
control_event: UIControlEvents,
) -> Option<Retained<NSArray<NSString>>>
pub unsafe fn actionsForTarget_forControlEvent( &self, target: Option<&AnyObject>, control_event: UIControlEvents, ) -> Option<Retained<NSArray<NSString>>>
§Safety
target should be of the correct type.
Sourcepub fn sendAction(&self, action: &UIAction)
pub fn sendAction(&self, action: &UIAction)
Like -sendAction:to:forEvent:, this method is called by -sendActionsForControlEvents:. You may override this method to observe or modify behavior. If you override this method, you should call super precisely once to dispatch the action, or not call super to suppress sending that action.
Sourcepub fn sendActionsForControlEvents(&self, control_events: UIControlEvents)
pub fn sendActionsForControlEvents(&self, control_events: UIControlEvents)
send all actions associated with the given control events
Sourcepub fn isContextMenuInteractionEnabled(&self) -> bool
pub fn isContextMenuInteractionEnabled(&self) -> bool
Specifies if the context menu interaction is enabled. NO by default.
Sourcepub fn setContextMenuInteractionEnabled(
&self,
context_menu_interaction_enabled: bool,
)
pub fn setContextMenuInteractionEnabled( &self, context_menu_interaction_enabled: bool, )
Setter for isContextMenuInteractionEnabled.
Sourcepub fn showsMenuAsPrimaryAction(&self) -> bool
pub fn showsMenuAsPrimaryAction(&self) -> bool
If the contextMenuInteraction is the primary action of the control, invoked on touch-down. NO by default.
Sourcepub fn setShowsMenuAsPrimaryAction(&self, shows_menu_as_primary_action: bool)
pub fn setShowsMenuAsPrimaryAction(&self, shows_menu_as_primary_action: bool)
Setter for showsMenuAsPrimaryAction.
Sourcepub fn toolTip(&self) -> Option<Retained<NSString>>
pub fn toolTip(&self) -> Option<Retained<NSString>>
Assigning a value to this property causes the tool tip to be displayed for the view. Setting the property to nil cancels the display of the tool tip for the view.
Sourcepub fn setToolTip(&self, tool_tip: Option<&NSString>)
pub fn setToolTip(&self, tool_tip: Option<&NSString>)
Sourcepub fn isSymbolAnimationEnabled(&self) -> bool
pub fn isSymbolAnimationEnabled(&self) -> bool
Whether or not symbol animations are enabled for this control. The default value varies depending on the control.
Sourcepub fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool)
pub fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool)
Setter for isSymbolAnimationEnabled.
Methods from Deref<Target = UIView>§
pub fn isUserInteractionEnabled(&self) -> bool
Sourcepub fn setUserInteractionEnabled(&self, user_interaction_enabled: bool)
pub fn setUserInteractionEnabled(&self, user_interaction_enabled: bool)
Setter for isUserInteractionEnabled.
pub fn tag(&self) -> isize
pub fn canBecomeFocused(&self) -> bool
pub fn isFocused(&self) -> bool
Sourcepub fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>
pub fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>
The identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.
Sourcepub fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>)
pub fn setFocusGroupIdentifier(&self, focus_group_identifier: Option<&NSString>)
Setter for focusGroupIdentifier.
This is copied when set.
Sourcepub fn focusGroupPriority(&self) -> isize
pub fn focusGroupPriority(&self) -> isize
The priority this item has in its focus group. The higher the priority, the more likely it is to get picked when focus moves into this group. Note: this method can only be used to increase an item’s priority, not decrease it. For example if an item is currently selected, the actual priority of this item will be determined by MAX(focusGroupPriority, UIFocusGroupPrioritySelected).
Sourcepub fn setFocusGroupPriority(&self, focus_group_priority: isize)
pub fn setFocusGroupPriority(&self, focus_group_priority: isize)
Setter for focusGroupPriority.
pub fn semanticContentAttribute(&self) -> UISemanticContentAttribute
Sourcepub fn setSemanticContentAttribute(
&self,
semantic_content_attribute: UISemanticContentAttribute,
)
pub fn setSemanticContentAttribute( &self, semantic_content_attribute: UISemanticContentAttribute, )
Setter for semanticContentAttribute.
pub fn frame(&self) -> CGRect
pub fn bounds(&self) -> CGRect
pub fn center(&self) -> CGPoint
pub fn transform(&self) -> CGAffineTransform
Sourcepub fn setTransform(&self, transform: CGAffineTransform)
pub fn setTransform(&self, transform: CGAffineTransform)
Setter for transform.
pub fn contentScaleFactor(&self) -> f64
Sourcepub fn setContentScaleFactor(&self, content_scale_factor: f64)
pub fn setContentScaleFactor(&self, content_scale_factor: f64)
Setter for contentScaleFactor.
pub fn anchorPoint(&self) -> CGPoint
Sourcepub fn setAnchorPoint(&self, anchor_point: CGPoint)
pub fn setAnchorPoint(&self, anchor_point: CGPoint)
Setter for anchorPoint.
pub fn isMultipleTouchEnabled(&self) -> bool
Sourcepub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool)
pub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool)
Setter for isMultipleTouchEnabled.
pub fn isExclusiveTouch(&self) -> bool
Sourcepub fn setExclusiveTouch(&self, exclusive_touch: bool)
pub fn setExclusiveTouch(&self, exclusive_touch: bool)
Setter for isExclusiveTouch.
pub fn convertPoint_toView( &self, point: CGPoint, view: Option<&UIView>, ) -> CGPoint
pub fn convertPoint_fromView( &self, point: CGPoint, view: Option<&UIView>, ) -> CGPoint
pub fn convertRect_toView(&self, rect: CGRect, view: Option<&UIView>) -> CGRect
pub fn convertRect_fromView( &self, rect: CGRect, view: Option<&UIView>, ) -> CGRect
pub fn autoresizesSubviews(&self) -> bool
Sourcepub fn setAutoresizesSubviews(&self, autoresizes_subviews: bool)
pub fn setAutoresizesSubviews(&self, autoresizes_subviews: bool)
Setter for autoresizesSubviews.
pub fn autoresizingMask(&self) -> UIViewAutoresizing
Sourcepub fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing)
pub fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing)
Setter for autoresizingMask.
pub fn sizeThatFits(&self, size: CGSize) -> CGSize
pub fn sizeToFit(&self)
pub fn superview(&self) -> Option<Retained<UIView>>
pub fn subviews(&self) -> Retained<NSArray<UIView>>
pub fn removeFromSuperview(&self)
pub fn insertSubview_atIndex(&self, view: &UIView, index: isize)
pub fn exchangeSubviewAtIndex_withSubviewAtIndex( &self, index1: isize, index2: isize, )
pub fn addSubview(&self, view: &UIView)
pub fn insertSubview_belowSubview( &self, view: &UIView, sibling_subview: &UIView, )
pub fn insertSubview_aboveSubview( &self, view: &UIView, sibling_subview: &UIView, )
pub fn bringSubviewToFront(&self, view: &UIView)
pub fn sendSubviewToBack(&self, view: &UIView)
pub fn didAddSubview(&self, subview: &UIView)
pub fn willRemoveSubview(&self, subview: &UIView)
pub fn willMoveToSuperview(&self, new_superview: Option<&UIView>)
pub fn didMoveToSuperview(&self)
pub fn didMoveToWindow(&self)
pub fn isDescendantOfView(&self, view: &UIView) -> bool
pub fn viewWithTag(&self, tag: isize) -> Option<Retained<UIView>>
Sourcepub fn setNeedsUpdateProperties(&self)
pub fn setNeedsUpdateProperties(&self)
Call to manually request a properties update for the view. Multiple requests may be coalesced into a single update alongside the next layout pass.
Sourcepub fn updateProperties(&self)
pub fn updateProperties(&self)
Override point for subclasses to update properties of this view.
Never call this method directly; use setNeedsUpdateProperties to schedule an update.
Sourcepub fn updatePropertiesIfNeeded(&self)
pub fn updatePropertiesIfNeeded(&self)
Forces an immediate properties update for this view (and its view controller, if applicable) and any subviews, including any view controllers or views in its subtree.
pub fn setNeedsLayout(&self)
pub fn layoutIfNeeded(&self)
pub fn layoutSubviews(&self)
pub fn layoutMargins(&self) -> UIEdgeInsets
Sourcepub fn setLayoutMargins(&self, layout_margins: UIEdgeInsets)
pub fn setLayoutMargins(&self, layout_margins: UIEdgeInsets)
Setter for layoutMargins.
pub fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets
Sourcepub fn setDirectionalLayoutMargins(
&self,
directional_layout_margins: NSDirectionalEdgeInsets,
)
pub fn setDirectionalLayoutMargins( &self, directional_layout_margins: NSDirectionalEdgeInsets, )
Setter for directionalLayoutMargins.
pub fn preservesSuperviewLayoutMargins(&self) -> bool
Sourcepub fn setPreservesSuperviewLayoutMargins(
&self,
preserves_superview_layout_margins: bool,
)
pub fn setPreservesSuperviewLayoutMargins( &self, preserves_superview_layout_margins: bool, )
Setter for preservesSuperviewLayoutMargins.
pub fn insetsLayoutMarginsFromSafeArea(&self) -> bool
Sourcepub fn setInsetsLayoutMarginsFromSafeArea(
&self,
insets_layout_margins_from_safe_area: bool,
)
pub fn setInsetsLayoutMarginsFromSafeArea( &self, insets_layout_margins_from_safe_area: bool, )
Setter for insetsLayoutMarginsFromSafeArea.
pub fn layoutMarginsDidChange(&self)
pub fn safeAreaInsets(&self) -> UIEdgeInsets
pub fn safeAreaInsetsDidChange(&self)
pub fn layoutMarginsGuide(&self) -> Retained<UILayoutGuide>
Sourcepub fn readableContentGuide(&self) -> Retained<UILayoutGuide>
pub fn readableContentGuide(&self) -> Retained<UILayoutGuide>
This content guide provides a layout area that you can use to place text and related content whose width should generally be constrained to a size that is easy for the user to read. This guide provides a centered region that you can place content within to get this behavior for this view.
pub fn safeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>
pub fn drawRect(&self, rect: CGRect)
pub fn setNeedsDisplay(&self)
pub fn setNeedsDisplayInRect(&self, rect: CGRect)
pub fn clipsToBounds(&self) -> bool
Sourcepub fn setClipsToBounds(&self, clips_to_bounds: bool)
pub fn setClipsToBounds(&self, clips_to_bounds: bool)
Setter for clipsToBounds.
pub fn backgroundColor(&self) -> Option<Retained<UIColor>>
Sourcepub fn setBackgroundColor(&self, background_color: Option<&UIColor>)
pub fn setBackgroundColor(&self, background_color: Option<&UIColor>)
Setter for backgroundColor.
This is copied when set.
pub fn alpha(&self) -> f64
pub fn isOpaque(&self) -> bool
pub fn clearsContextBeforeDrawing(&self) -> bool
Sourcepub fn setClearsContextBeforeDrawing(&self, clears_context_before_drawing: bool)
pub fn setClearsContextBeforeDrawing(&self, clears_context_before_drawing: bool)
Setter for clearsContextBeforeDrawing.
pub fn isHidden(&self) -> bool
pub fn contentMode(&self) -> UIViewContentMode
Sourcepub fn setContentMode(&self, content_mode: UIViewContentMode)
pub fn setContentMode(&self, content_mode: UIViewContentMode)
Setter for contentMode.
pub fn contentStretch(&self) -> CGRect
Sourcepub fn setContentStretch(&self, content_stretch: CGRect)
👎Deprecated
pub fn setContentStretch(&self, content_stretch: CGRect)
Setter for contentStretch.
pub fn maskView(&self) -> Option<Retained<UIView>>
Sourcepub fn setMaskView(&self, mask_view: Option<&UIView>)
pub fn setMaskView(&self, mask_view: Option<&UIView>)
Setter for maskView.
pub fn tintColor(&self) -> Option<Retained<UIColor>>
Sourcepub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>)
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>)
pub fn tintAdjustmentMode(&self) -> UIViewTintAdjustmentMode
Sourcepub fn setTintAdjustmentMode(
&self,
tint_adjustment_mode: UIViewTintAdjustmentMode,
)
pub fn setTintAdjustmentMode( &self, tint_adjustment_mode: UIViewTintAdjustmentMode, )
Setter for tintAdjustmentMode.
pub fn tintColorDidChange(&self)
pub fn updateConstraintsIfNeeded(&self)
pub fn updateConstraints(&self)
pub fn needsUpdateConstraints(&self) -> bool
pub fn setNeedsUpdateConstraints(&self)
pub fn translatesAutoresizingMaskIntoConstraints(&self) -> bool
Sourcepub fn setTranslatesAutoresizingMaskIntoConstraints(
&self,
translates_autoresizing_mask_into_constraints: bool,
)
pub fn setTranslatesAutoresizingMaskIntoConstraints( &self, translates_autoresizing_mask_into_constraints: bool, )
Setter for translatesAutoresizingMaskIntoConstraints.
pub fn alignmentRectForFrame(&self, frame: CGRect) -> CGRect
pub fn frameForAlignmentRect(&self, alignment_rect: CGRect) -> CGRect
pub fn alignmentRectInsets(&self) -> UIEdgeInsets
pub fn viewForBaselineLayout(&self) -> Retained<UIView>
pub fn viewForFirstBaselineLayout(&self) -> Retained<UIView>
pub fn viewForLastBaselineLayout(&self) -> Retained<UIView>
pub fn intrinsicContentSize(&self) -> CGSize
pub fn invalidateIntrinsicContentSize(&self)
pub fn systemLayoutSizeFittingSize(&self, target_size: CGSize) -> CGSize
pub fn layoutGuides(&self) -> Retained<NSArray<UILayoutGuide>>
pub fn addLayoutGuide(&self, layout_guide: &UILayoutGuide)
pub fn removeLayoutGuide(&self, layout_guide: &UILayoutGuide)
pub fn hasAmbiguousLayout(&self) -> bool
pub fn exerciseAmbiguityInLayout(&self)
pub fn restorationIdentifier(&self) -> Option<Retained<NSString>>
Sourcepub fn setRestorationIdentifier(
&self,
restoration_identifier: Option<&NSString>,
)
pub fn setRestorationIdentifier( &self, restoration_identifier: Option<&NSString>, )
Setter for restorationIdentifier.
This is copied when set.
Sourcepub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder)
pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder)
§Safety
coder possibly has further requirements.
Sourcepub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder)
pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder)
§Safety
coder possibly has further requirements.
pub fn snapshotViewAfterScreenUpdates( &self, after_updates: bool, ) -> Option<Retained<UIView>>
pub fn resizableSnapshotViewFromRect_afterScreenUpdates_withCapInsets( &self, rect: CGRect, after_updates: bool, cap_insets: UIEdgeInsets, ) -> Option<Retained<UIView>>
pub fn drawViewHierarchyInRect_afterScreenUpdates( &self, rect: CGRect, after_updates: bool, ) -> bool
Sourcepub fn appliedContentSizeCategoryLimitsDescription(&self) -> Retained<NSString>
pub fn appliedContentSizeCategoryLimitsDescription(&self) -> Retained<NSString>
Will return a string with a log of all the superviews of this view, alongside with what content size category each view has and if that view has limits applied. This is for debugging purposes only.
pub fn traitOverrides(&self) -> Retained<ProtocolObject<dyn UITraitOverrides>>
Sourcepub fn updateTraitsIfNeeded(&self)
pub fn updateTraitsIfNeeded(&self)
Forces an immediate trait update for this view (and its view controller, if applicable) and any subviews, including any view controllers or views in its subtree. Any trait change callbacks are sent synchronously.
Sourcepub fn effectiveRadiusForCorner(&self, corner: UIRectCorner) -> f64
pub fn effectiveRadiusForCorner(&self, corner: UIRectCorner) -> f64
Returns the effective radius for the given corner, calculated using the view’s current cornerConfiguration.
When invoked within UIView.layoutSubviews(), UIView.updateProperties(), or UIViewController.updateProperties() automatic invalidation will occur if the effective radius changes.
If more than one corner is provided, the returned radius represents the maximum effective radius of those corners.
- Parameter corner: The corner.
- Returns: The effective radius.
Methods from Deref<Target = UIResponder>§
pub fn nextResponder(&self) -> Option<Retained<UIResponder>>
pub fn canBecomeFirstResponder(&self) -> bool
pub fn becomeFirstResponder(&self) -> bool
pub fn canResignFirstResponder(&self) -> bool
pub fn resignFirstResponder(&self) -> bool
pub fn isFirstResponder(&self) -> bool
Sourcepub unsafe fn canPerformAction_withSender(
&self,
action: Sel,
sender: Option<&AnyObject>,
) -> bool
pub unsafe fn canPerformAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> bool
§Safety
actionmust be a valid selector.sendershould be of the correct type.
Sourcepub unsafe fn targetForAction_withSender(
&self,
action: Sel,
sender: Option<&AnyObject>,
) -> Option<Retained<AnyObject>>
pub unsafe fn targetForAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> Option<Retained<AnyObject>>
§Safety
actionmust be a valid selector.sendershould be of the correct type.
pub fn undoManager(&self) -> Option<Retained<NSUndoManager>>
pub fn editingInteractionConfiguration( &self, ) -> UIEditingInteractionConfiguration
pub fn inputView(&self) -> Option<Retained<UIView>>
pub fn inputAccessoryView(&self) -> Option<Retained<UIView>>
pub fn textInputContextIdentifier(&self) -> Option<Retained<NSString>>
pub fn reloadInputViews(&self)
pub fn userActivity(&self) -> Option<Retained<NSUserActivity>>
Sourcepub fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
pub fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
Setter for userActivity.
pub fn updateUserActivityState(&self, activity: &NSUserActivity)
pub fn restoreUserActivityState(&self, activity: &NSUserActivity)
Sourcepub unsafe fn captureTextFromCamera(&self, sender: Option<&AnyObject>)
pub unsafe fn captureTextFromCamera(&self, sender: Option<&AnyObject>)
§Safety
sender should be of the correct type.
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Panics
May panic if the object is invalid (which may be the case for objects
returned from unavailable init/new methods).
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl AsRef<AnyObject> for TVLockupView
impl AsRef<AnyObject> for TVLockupView
Source§impl AsRef<NSObject> for TVLockupView
impl AsRef<NSObject> for TVLockupView
Source§impl AsRef<TVLockupView> for TVCaptionButtonView
Available on crate feature TVCaptionButtonView only.
impl AsRef<TVLockupView> for TVCaptionButtonView
TVCaptionButtonView only.Source§fn as_ref(&self) -> &TVLockupView
fn as_ref(&self) -> &TVLockupView
Source§impl AsRef<TVLockupView> for TVCardView
Available on crate feature TVCardView only.
impl AsRef<TVLockupView> for TVCardView
TVCardView only.Source§fn as_ref(&self) -> &TVLockupView
fn as_ref(&self) -> &TVLockupView
Source§impl AsRef<TVLockupView> for TVLockupView
impl AsRef<TVLockupView> for TVLockupView
Source§impl AsRef<TVLockupView> for TVMonogramView
Available on crate feature TVMonogramView only.
impl AsRef<TVLockupView> for TVMonogramView
TVMonogramView only.Source§fn as_ref(&self) -> &TVLockupView
fn as_ref(&self) -> &TVLockupView
Source§impl AsRef<TVLockupView> for TVPosterView
Available on crate feature TVPosterView only.
impl AsRef<TVLockupView> for TVPosterView
TVPosterView only.Source§fn as_ref(&self) -> &TVLockupView
fn as_ref(&self) -> &TVLockupView
Source§impl AsRef<UIControl> for TVLockupView
impl AsRef<UIControl> for TVLockupView
Source§impl AsRef<UIResponder> for TVLockupView
impl AsRef<UIResponder> for TVLockupView
Source§fn as_ref(&self) -> &UIResponder
fn as_ref(&self) -> &UIResponder
Source§impl AsRef<UIView> for TVLockupView
impl AsRef<UIView> for TVLockupView
Source§impl Borrow<AnyObject> for TVLockupView
impl Borrow<AnyObject> for TVLockupView
Source§impl Borrow<NSObject> for TVLockupView
impl Borrow<NSObject> for TVLockupView
Source§impl Borrow<TVLockupView> for TVCaptionButtonView
Available on crate feature TVCaptionButtonView only.
impl Borrow<TVLockupView> for TVCaptionButtonView
TVCaptionButtonView only.Source§fn borrow(&self) -> &TVLockupView
fn borrow(&self) -> &TVLockupView
Source§impl Borrow<TVLockupView> for TVCardView
Available on crate feature TVCardView only.
impl Borrow<TVLockupView> for TVCardView
TVCardView only.Source§fn borrow(&self) -> &TVLockupView
fn borrow(&self) -> &TVLockupView
Source§impl Borrow<TVLockupView> for TVMonogramView
Available on crate feature TVMonogramView only.
impl Borrow<TVLockupView> for TVMonogramView
TVMonogramView only.Source§fn borrow(&self) -> &TVLockupView
fn borrow(&self) -> &TVLockupView
Source§impl Borrow<TVLockupView> for TVPosterView
Available on crate feature TVPosterView only.
impl Borrow<TVLockupView> for TVPosterView
TVPosterView only.Source§fn borrow(&self) -> &TVLockupView
fn borrow(&self) -> &TVLockupView
Source§impl Borrow<UIControl> for TVLockupView
impl Borrow<UIControl> for TVLockupView
Source§impl Borrow<UIResponder> for TVLockupView
impl Borrow<UIResponder> for TVLockupView
Source§fn borrow(&self) -> &UIResponder
fn borrow(&self) -> &UIResponder
Source§impl Borrow<UIView> for TVLockupView
impl Borrow<UIView> for TVLockupView
Source§impl CALayerDelegate for TVLockupView
impl CALayerDelegate for TVLockupView
fn displayLayer(&self, layer: &CALayer)
fn layerWillDraw(&self, layer: &CALayer)
fn layoutSublayersOfLayer(&self, layer: &CALayer)
fn actionForLayer_forKey( &self, layer: &CALayer, event: &NSString, ) -> Option<Retained<ProtocolObject<dyn CAAction>>>
Source§impl ClassType for TVLockupView
impl ClassType for TVLockupView
Source§const NAME: &'static str = "TVLockupView"
const NAME: &'static str = "TVLockupView"
Source§type ThreadKind = <<TVLockupView as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<TVLockupView as ClassType>::Super as ClassType>::ThreadKind
Source§impl Debug for TVLockupView
impl Debug for TVLockupView
Source§impl Deref for TVLockupView
impl Deref for TVLockupView
Source§impl Hash for TVLockupView
impl Hash for TVLockupView
Source§impl Message for TVLockupView
impl Message for TVLockupView
Source§impl NSCoding for TVLockupView
impl NSCoding for TVLockupView
Source§impl NSObjectProtocol for TVLockupView
impl NSObjectProtocol for TVLockupView
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_refSource§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
Source§impl PartialEq for TVLockupView
impl PartialEq for TVLockupView
Source§impl RefEncode for TVLockupView
impl RefEncode for TVLockupView
Source§const ENCODING_REF: Encoding = <UIControl as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <UIControl as ::objc2::RefEncode>::ENCODING_REF
Source§impl UIAppearance for TVLockupView
impl UIAppearance for TVLockupView
fn appearance(mtm: MainThreadMarker) -> Retained<Self>
Source§unsafe fn appearanceWhenContainedInInstancesOfClasses(
container_types: &NSArray<AnyClass>,
mtm: MainThreadMarker,
) -> Retained<Self>
unsafe fn appearanceWhenContainedInInstancesOfClasses( container_types: &NSArray<AnyClass>, mtm: MainThreadMarker, ) -> Retained<Self>
fn appearanceForTraitCollection( trait: &UITraitCollection, mtm: MainThreadMarker, ) -> Retained<Self>
Source§unsafe fn appearanceForTraitCollection_whenContainedInInstancesOfClasses(
trait: &UITraitCollection,
container_types: &NSArray<AnyClass>,
mtm: MainThreadMarker,
) -> Retained<Self>
unsafe fn appearanceForTraitCollection_whenContainedInInstancesOfClasses( trait: &UITraitCollection, container_types: &NSArray<AnyClass>, mtm: MainThreadMarker, ) -> Retained<Self>
Source§impl UICoordinateSpace for TVLockupView
impl UICoordinateSpace for TVLockupView
fn convertPoint_toCoordinateSpace( &self, point: CGPoint, coordinate_space: &ProtocolObject<dyn UICoordinateSpace>, ) -> CGPoint
fn convertPoint_fromCoordinateSpace( &self, point: CGPoint, coordinate_space: &ProtocolObject<dyn UICoordinateSpace>, ) -> CGPoint
fn convertRect_toCoordinateSpace( &self, rect: CGRect, coordinate_space: &ProtocolObject<dyn UICoordinateSpace>, ) -> CGRect
fn convertRect_fromCoordinateSpace( &self, rect: CGRect, coordinate_space: &ProtocolObject<dyn UICoordinateSpace>, ) -> CGRect
fn bounds(&self) -> CGRect
Source§impl UIDynamicItem for TVLockupView
impl UIDynamicItem for TVLockupView
fn center(&self) -> CGPoint
fn bounds(&self) -> CGRect
fn transform(&self) -> CGAffineTransform
Source§fn setTransform(&self, transform: CGAffineTransform)
fn setTransform(&self, transform: CGAffineTransform)
transform.Source§fn collisionBoundsType(&self) -> UIDynamicItemCollisionBoundsType
fn collisionBoundsType(&self) -> UIDynamicItemCollisionBoundsType
Source§impl UIFocusEnvironment for TVLockupView
impl UIFocusEnvironment for TVLockupView
Source§fn preferredFocusEnvironments(
&self,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
fn preferredFocusEnvironments( &self, ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
Source§fn parentFocusEnvironment(
&self,
) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
fn parentFocusEnvironment( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
Source§fn focusItemContainer(
&self,
) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
fn focusItemContainer( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
Source§fn setNeedsFocusUpdate(&self)
fn setNeedsFocusUpdate(&self)
[[UIFocusSystem focusSystemForEnvironment:self] requestFocusUpdateToEnvironment:self];Source§fn updateFocusIfNeeded(&self)
fn updateFocusIfNeeded(&self)
[[UIFocusSystem focusSystemForEnvironment:self] updateFocusIfNeeded];.Source§fn shouldUpdateFocusInContext(&self, context: &UIFocusUpdateContext) -> bool
fn shouldUpdateFocusInContext(&self, context: &UIFocusUpdateContext) -> bool
Source§fn soundIdentifierForFocusUpdateInContext(
&self,
context: &UIFocusUpdateContext,
) -> Option<Retained<NSString>>
fn soundIdentifierForFocusUpdateInContext( &self, context: &UIFocusUpdateContext, ) -> Option<Retained<NSString>>
Source§impl UIFocusItem for TVLockupView
impl UIFocusItem for TVLockupView
Source§fn canBecomeFocused(&self) -> bool
fn canBecomeFocused(&self) -> bool
Source§fn frame(&self) -> CGRect
fn frame(&self) -> CGRect
coordinateSpace of the UIFocusItemContainer in which it is contained.Source§fn focusGroupPriority(&self) -> isize
fn focusGroupPriority(&self) -> isize
Source§fn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
fn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
UIFocusItemDeferralModeNever, the focus deferral will not be enabled again
after the user engagement timeout has expired if this item is currently focused and programmatic focus updates pointing
to this item will be executed immediatly. If it returns UIFocusItemDeferralModeAlways focus will always be deferred
when this item is supposed to be focused.
Does nothing when focus deferral is not supported on the platform.Source§fn isTransparentFocusItem(&self) -> bool
fn isTransparentFocusItem(&self) -> bool
Source§impl UIFocusItemContainer for TVLockupView
impl UIFocusItemContainer for TVLockupView
Source§fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
Source§fn focusItemsInRect(
&self,
rect: CGRect,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
fn focusItemsInRect( &self, rect: CGRect, ) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
rect is expressed in coordinateSpace.
Note: starting in iOS
&
tvOS 16.0, UIView will return its subviews from this method. If you override this method in a UIView subclass, it will be your responsibility to call super and merge your array of custom focus items with UIView’s default focus items.Source§impl UIResponderStandardEditActions for TVLockupView
impl UIResponderStandardEditActions for TVLockupView
Source§unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>)
unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>)
Source§unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>)
unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>)
Source§impl UITraitEnvironment for TVLockupView
impl UITraitEnvironment for TVLockupView
fn traitCollection(&self) -> Retained<UITraitCollection>
Source§fn traitCollectionDidChange(
&self,
previous_trait_collection: Option<&UITraitCollection>,
)
fn traitCollectionDidChange( &self, previous_trait_collection: Option<&UITraitCollection>, )
impl DowncastTarget for TVLockupView
impl Eq for TVLockupView
impl UIAppearanceContainer for TVLockupView
Auto Trait Implementations§
impl !Freeze for TVLockupView
impl !RefUnwindSafe for TVLockupView
impl !Send for TVLockupView
impl !Sync for TVLockupView
impl !Unpin for TVLockupView
impl !UnwindSafe for TVLockupView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<'a, T> MainThreadOnly for T
impl<'a, T> MainThreadOnly for T
Source§fn mtm(&self) -> MainThreadMarker
fn mtm(&self) -> MainThreadMarker
MainThreadMarker from the main-thread-only object. Read more