#[repr(C)]pub struct TVPosterView { /* private fields */ }TVLockupView and TVPosterView only.Expand description
TVPosterView is a lockup view specializing in presenting an image and optional title and subtitle labels.
The framework provides system default appearance and behavior, including the optimal .focusSizeIncrease, which is calculated based on the .image. Overriding .focusSizeIncrease has no visible effect.
See also Apple’s documentation
Implementations§
Source§impl TVPosterView
impl TVPosterView
Sourcepub unsafe fn initWithImage(
this: Allocated<Self>,
image: Option<&UIImage>,
) -> Retained<Self>
pub unsafe fn initWithImage( this: Allocated<Self>, image: Option<&UIImage>, ) -> Retained<Self>
A convenience initializer.
Parameter image: The image to become the main content.
Sourcepub unsafe fn image(&self) -> Option<Retained<UIImage>>
pub unsafe fn image(&self) -> Option<Retained<UIImage>>
The image.
When no frame or contentSize is explicitly set on the poster view, its size will be determined by the natural size of this image.
Sourcepub unsafe fn imageView(&self) -> Retained<UIImageView>
pub unsafe fn imageView(&self) -> Retained<UIImageView>
The image view.
Avoid setting an image directly on the image view. Instead, always use the .image property of the poster view.
Sourcepub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>)
pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>)
Setter for subtitle.
Source§impl TVPosterView
Methods declared on superclass UIControl.
impl TVPosterView
Methods declared on superclass UIControl.
pub unsafe fn initWithFrame( this: Allocated<Self>, frame: CGRect, ) -> Retained<Self>
objc2-core-foundation only.pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder, ) -> Option<Retained<Self>>
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.
Methods from Deref<Target = 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.
Methods from Deref<Target = UIControl>§
pub unsafe fn isEnabled(&self) -> bool
Sourcepub unsafe fn setEnabled(&self, enabled: bool)
pub unsafe fn setEnabled(&self, enabled: bool)
Setter for isEnabled.
pub unsafe fn isSelected(&self) -> bool
Sourcepub unsafe fn setSelected(&self, selected: bool)
pub unsafe fn setSelected(&self, selected: bool)
Setter for isSelected.
pub unsafe fn isHighlighted(&self) -> bool
Sourcepub unsafe fn setHighlighted(&self, highlighted: bool)
pub unsafe fn setHighlighted(&self, highlighted: bool)
Setter for isHighlighted.
pub unsafe fn contentVerticalAlignment( &self, ) -> UIControlContentVerticalAlignment
Sourcepub unsafe fn setContentVerticalAlignment(
&self,
content_vertical_alignment: UIControlContentVerticalAlignment,
)
pub unsafe fn setContentVerticalAlignment( &self, content_vertical_alignment: UIControlContentVerticalAlignment, )
Setter for contentVerticalAlignment.
pub unsafe fn contentHorizontalAlignment( &self, ) -> UIControlContentHorizontalAlignment
Sourcepub unsafe fn setContentHorizontalAlignment(
&self,
content_horizontal_alignment: UIControlContentHorizontalAlignment,
)
pub unsafe fn setContentHorizontalAlignment( &self, content_horizontal_alignment: UIControlContentHorizontalAlignment, )
Setter for contentHorizontalAlignment.
pub unsafe fn effectiveContentHorizontalAlignment( &self, ) -> UIControlContentHorizontalAlignment
pub unsafe fn state(&self) -> UIControlState
pub unsafe fn isTracking(&self) -> bool
pub unsafe fn isTouchInside(&self) -> bool
pub unsafe fn addTarget_action_forControlEvents( &self, target: Option<&AnyObject>, action: Sel, control_events: UIControlEvents, )
pub unsafe fn removeTarget_action_forControlEvents( &self, target: Option<&AnyObject>, action: Option<Sel>, control_events: UIControlEvents, )
Sourcepub unsafe fn addAction_forControlEvents(
&self,
action: &UIAction,
control_events: UIControlEvents,
)
pub unsafe 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 unsafe fn removeAction_forControlEvents(
&self,
action: &UIAction,
control_events: UIControlEvents,
)
pub unsafe fn removeAction_forControlEvents( &self, action: &UIAction, control_events: UIControlEvents, )
Removes the action from the set of passed control events.
Sourcepub unsafe fn removeActionForIdentifier_forControlEvents(
&self,
action_identifier: &NSString,
control_events: UIControlEvents,
)
pub unsafe 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 unsafe fn performPrimaryAction(&self)
pub unsafe fn performPrimaryAction(&self)
Performs the control’s primary action.
pub unsafe fn allTargets(&self) -> Retained<NSSet>
pub unsafe fn allControlEvents(&self) -> UIControlEvents
pub unsafe fn actionsForTarget_forControlEvent( &self, target: Option<&AnyObject>, control_event: UIControlEvents, ) -> Option<Retained<NSArray<NSString>>>
Sourcepub unsafe fn sendAction(&self, action: &UIAction)
pub unsafe 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 unsafe fn sendActionsForControlEvents(
&self,
control_events: UIControlEvents,
)
pub unsafe fn sendActionsForControlEvents( &self, control_events: UIControlEvents, )
send all actions associated with the given control events
Sourcepub unsafe fn isContextMenuInteractionEnabled(&self) -> bool
pub unsafe fn isContextMenuInteractionEnabled(&self) -> bool
Specifies if the context menu interaction is enabled. NO by default.
Sourcepub unsafe fn setContextMenuInteractionEnabled(
&self,
context_menu_interaction_enabled: bool,
)
pub unsafe fn setContextMenuInteractionEnabled( &self, context_menu_interaction_enabled: bool, )
Setter for isContextMenuInteractionEnabled.
Sourcepub unsafe fn showsMenuAsPrimaryAction(&self) -> bool
pub unsafe fn showsMenuAsPrimaryAction(&self) -> bool
If the contextMenuInteraction is the primary action of the control, invoked on touch-down. NO by default.
Sourcepub unsafe fn setShowsMenuAsPrimaryAction(
&self,
shows_menu_as_primary_action: bool,
)
pub unsafe fn setShowsMenuAsPrimaryAction( &self, shows_menu_as_primary_action: bool, )
Setter for showsMenuAsPrimaryAction.
Sourcepub unsafe fn toolTip(&self) -> Option<Retained<NSString>>
pub unsafe 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 unsafe fn setToolTip(&self, tool_tip: Option<&NSString>)
pub unsafe fn setToolTip(&self, tool_tip: Option<&NSString>)
Setter for toolTip.
Sourcepub unsafe fn isSymbolAnimationEnabled(&self) -> bool
pub unsafe fn isSymbolAnimationEnabled(&self) -> bool
Whether or not symbol animations are enabled for this control. The default value varies depending on the control.
Sourcepub unsafe fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool)
pub unsafe fn setSymbolAnimationEnabled(&self, symbol_animation_enabled: bool)
Setter for isSymbolAnimationEnabled.
Methods from Deref<Target = UIView>§
pub unsafe fn isUserInteractionEnabled(&self) -> bool
Sourcepub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool)
pub unsafe fn setUserInteractionEnabled(&self, user_interaction_enabled: bool)
Setter for isUserInteractionEnabled.
pub unsafe fn tag(&self) -> isize
pub unsafe fn canBecomeFocused(&self) -> bool
pub unsafe fn isFocused(&self) -> bool
Sourcepub unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>
pub unsafe 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 unsafe fn setFocusGroupIdentifier(
&self,
focus_group_identifier: Option<&NSString>,
)
pub unsafe fn setFocusGroupIdentifier( &self, focus_group_identifier: Option<&NSString>, )
Setter for focusGroupIdentifier.
Sourcepub unsafe fn focusGroupPriority(&self) -> isize
pub unsafe 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 unsafe fn setFocusGroupPriority(&self, focus_group_priority: isize)
pub unsafe fn setFocusGroupPriority(&self, focus_group_priority: isize)
Setter for focusGroupPriority.
pub unsafe fn semanticContentAttribute(&self) -> UISemanticContentAttribute
Sourcepub unsafe fn setSemanticContentAttribute(
&self,
semantic_content_attribute: UISemanticContentAttribute,
)
pub unsafe fn setSemanticContentAttribute( &self, semantic_content_attribute: UISemanticContentAttribute, )
Setter for semanticContentAttribute.
pub fn frame(&self) -> CGRect
pub fn bounds(&self) -> CGRect
pub unsafe fn center(&self) -> CGPoint
pub unsafe fn transform(&self) -> CGAffineTransform
Sourcepub unsafe fn setTransform(&self, transform: CGAffineTransform)
pub unsafe 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 unsafe fn anchorPoint(&self) -> CGPoint
Sourcepub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint)
pub unsafe fn setAnchorPoint(&self, anchor_point: CGPoint)
Setter for anchorPoint.
pub unsafe fn isMultipleTouchEnabled(&self) -> bool
Sourcepub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool)
pub fn setMultipleTouchEnabled(&self, multiple_touch_enabled: bool)
Setter for isMultipleTouchEnabled.
pub unsafe fn isExclusiveTouch(&self) -> bool
Sourcepub unsafe fn setExclusiveTouch(&self, exclusive_touch: bool)
pub unsafe fn setExclusiveTouch(&self, exclusive_touch: bool)
Setter for isExclusiveTouch.
pub unsafe fn convertPoint_toView( &self, point: CGPoint, view: Option<&UIView>, ) -> CGPoint
pub unsafe fn convertPoint_fromView( &self, point: CGPoint, view: Option<&UIView>, ) -> CGPoint
pub unsafe fn convertRect_toView( &self, rect: CGRect, view: Option<&UIView>, ) -> CGRect
pub unsafe fn convertRect_fromView( &self, rect: CGRect, view: Option<&UIView>, ) -> CGRect
pub unsafe fn autoresizesSubviews(&self) -> bool
Sourcepub unsafe fn setAutoresizesSubviews(&self, autoresizes_subviews: bool)
pub unsafe fn setAutoresizesSubviews(&self, autoresizes_subviews: bool)
Setter for autoresizesSubviews.
pub unsafe fn autoresizingMask(&self) -> UIViewAutoresizing
Sourcepub unsafe fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing)
pub unsafe fn setAutoresizingMask(&self, autoresizing_mask: UIViewAutoresizing)
Setter for autoresizingMask.
pub unsafe fn sizeThatFits(&self, size: CGSize) -> CGSize
pub unsafe fn sizeToFit(&self)
pub fn superview(&self) -> Option<Retained<UIView>>
pub fn subviews(&self) -> Retained<NSArray<UIView>>
pub unsafe fn removeFromSuperview(&self)
pub unsafe fn insertSubview_atIndex(&self, view: &UIView, index: isize)
pub unsafe fn exchangeSubviewAtIndex_withSubviewAtIndex( &self, index1: isize, index2: isize, )
pub unsafe fn addSubview(&self, view: &UIView)
pub unsafe fn insertSubview_belowSubview( &self, view: &UIView, sibling_subview: &UIView, )
pub unsafe fn insertSubview_aboveSubview( &self, view: &UIView, sibling_subview: &UIView, )
pub unsafe fn bringSubviewToFront(&self, view: &UIView)
pub unsafe fn sendSubviewToBack(&self, view: &UIView)
pub unsafe fn didAddSubview(&self, subview: &UIView)
pub unsafe fn willRemoveSubview(&self, subview: &UIView)
pub unsafe fn willMoveToSuperview(&self, new_superview: Option<&UIView>)
pub unsafe fn didMoveToSuperview(&self)
pub unsafe fn didMoveToWindow(&self)
pub unsafe fn isDescendantOfView(&self, view: &UIView) -> bool
pub unsafe fn viewWithTag(&self, tag: isize) -> Option<Retained<UIView>>
pub unsafe fn setNeedsLayout(&self)
pub unsafe fn layoutIfNeeded(&self)
pub unsafe fn layoutSubviews(&self)
pub unsafe fn layoutMargins(&self) -> UIEdgeInsets
Sourcepub unsafe fn setLayoutMargins(&self, layout_margins: UIEdgeInsets)
pub unsafe fn setLayoutMargins(&self, layout_margins: UIEdgeInsets)
Setter for layoutMargins.
pub unsafe fn directionalLayoutMargins(&self) -> NSDirectionalEdgeInsets
Sourcepub unsafe fn setDirectionalLayoutMargins(
&self,
directional_layout_margins: NSDirectionalEdgeInsets,
)
pub unsafe fn setDirectionalLayoutMargins( &self, directional_layout_margins: NSDirectionalEdgeInsets, )
Setter for directionalLayoutMargins.
pub unsafe fn preservesSuperviewLayoutMargins(&self) -> bool
Sourcepub unsafe fn setPreservesSuperviewLayoutMargins(
&self,
preserves_superview_layout_margins: bool,
)
pub unsafe fn setPreservesSuperviewLayoutMargins( &self, preserves_superview_layout_margins: bool, )
Setter for preservesSuperviewLayoutMargins.
pub unsafe fn insetsLayoutMarginsFromSafeArea(&self) -> bool
Sourcepub unsafe fn setInsetsLayoutMarginsFromSafeArea(
&self,
insets_layout_margins_from_safe_area: bool,
)
pub unsafe fn setInsetsLayoutMarginsFromSafeArea( &self, insets_layout_margins_from_safe_area: bool, )
Setter for insetsLayoutMarginsFromSafeArea.
pub unsafe fn layoutMarginsDidChange(&self)
pub fn safeAreaInsets(&self) -> UIEdgeInsets
pub unsafe fn safeAreaInsetsDidChange(&self)
pub unsafe fn layoutMarginsGuide(&self) -> Retained<UILayoutGuide>
Sourcepub unsafe fn readableContentGuide(&self) -> Retained<UILayoutGuide>
pub unsafe 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 unsafe fn safeAreaLayoutGuide(&self) -> Retained<UILayoutGuide>
pub unsafe fn drawRect(&self, rect: CGRect)
pub fn setNeedsDisplay(&self)
pub unsafe fn setNeedsDisplayInRect(&self, rect: CGRect)
pub unsafe fn clipsToBounds(&self) -> bool
Sourcepub unsafe fn setClipsToBounds(&self, clips_to_bounds: bool)
pub unsafe 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.
pub unsafe fn alpha(&self) -> f64
pub unsafe fn isOpaque(&self) -> bool
pub unsafe fn clearsContextBeforeDrawing(&self) -> bool
Sourcepub unsafe fn setClearsContextBeforeDrawing(
&self,
clears_context_before_drawing: bool,
)
pub unsafe fn setClearsContextBeforeDrawing( &self, clears_context_before_drawing: bool, )
Setter for clearsContextBeforeDrawing.
pub fn isHidden(&self) -> bool
pub unsafe fn contentMode(&self) -> UIViewContentMode
Sourcepub unsafe fn setContentMode(&self, content_mode: UIViewContentMode)
pub unsafe fn setContentMode(&self, content_mode: UIViewContentMode)
Setter for contentMode.
pub unsafe fn contentStretch(&self) -> CGRect
Sourcepub unsafe fn setContentStretch(&self, content_stretch: CGRect)
👎Deprecated
pub unsafe fn setContentStretch(&self, content_stretch: CGRect)
Setter for contentStretch.
pub unsafe fn maskView(&self) -> Option<Retained<UIView>>
Sourcepub unsafe fn setMaskView(&self, mask_view: Option<&UIView>)
pub unsafe fn setMaskView(&self, mask_view: Option<&UIView>)
Setter for maskView.
pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>
Sourcepub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>)
pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>)
Setter for tintColor.
pub unsafe fn tintAdjustmentMode(&self) -> UIViewTintAdjustmentMode
Sourcepub unsafe fn setTintAdjustmentMode(
&self,
tint_adjustment_mode: UIViewTintAdjustmentMode,
)
pub unsafe fn setTintAdjustmentMode( &self, tint_adjustment_mode: UIViewTintAdjustmentMode, )
Setter for tintAdjustmentMode.
pub unsafe fn tintColorDidChange(&self)
pub unsafe fn updateConstraintsIfNeeded(&self)
pub unsafe fn updateConstraints(&self)
pub unsafe fn needsUpdateConstraints(&self) -> bool
pub unsafe fn setNeedsUpdateConstraints(&self)
pub unsafe fn translatesAutoresizingMaskIntoConstraints(&self) -> bool
Sourcepub unsafe fn setTranslatesAutoresizingMaskIntoConstraints(
&self,
translates_autoresizing_mask_into_constraints: bool,
)
pub unsafe fn setTranslatesAutoresizingMaskIntoConstraints( &self, translates_autoresizing_mask_into_constraints: bool, )
Setter for translatesAutoresizingMaskIntoConstraints.
pub unsafe fn alignmentRectForFrame(&self, frame: CGRect) -> CGRect
pub unsafe fn frameForAlignmentRect(&self, alignment_rect: CGRect) -> CGRect
pub unsafe fn alignmentRectInsets(&self) -> UIEdgeInsets
pub unsafe fn viewForBaselineLayout(&self) -> Retained<UIView>
pub unsafe fn viewForFirstBaselineLayout(&self) -> Retained<UIView>
pub unsafe fn viewForLastBaselineLayout(&self) -> Retained<UIView>
pub unsafe fn intrinsicContentSize(&self) -> CGSize
pub unsafe fn invalidateIntrinsicContentSize(&self)
pub unsafe fn systemLayoutSizeFittingSize(&self, target_size: CGSize) -> CGSize
pub unsafe fn layoutGuides(&self) -> Retained<NSArray<UILayoutGuide>>
pub unsafe fn addLayoutGuide(&self, layout_guide: &UILayoutGuide)
pub unsafe fn removeLayoutGuide(&self, layout_guide: &UILayoutGuide)
pub unsafe fn hasAmbiguousLayout(&self) -> bool
pub unsafe fn exerciseAmbiguityInLayout(&self)
pub unsafe fn restorationIdentifier(&self) -> Option<Retained<NSString>>
Sourcepub unsafe fn setRestorationIdentifier(
&self,
restoration_identifier: Option<&NSString>,
)
pub unsafe fn setRestorationIdentifier( &self, restoration_identifier: Option<&NSString>, )
Setter for restorationIdentifier.
pub unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder)
pub unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder)
pub unsafe fn snapshotViewAfterScreenUpdates( &self, after_updates: bool, ) -> Option<Retained<UIView>>
pub unsafe fn resizableSnapshotViewFromRect_afterScreenUpdates_withCapInsets( &self, rect: CGRect, after_updates: bool, cap_insets: UIEdgeInsets, ) -> Option<Retained<UIView>>
pub unsafe fn drawViewHierarchyInRect_afterScreenUpdates( &self, rect: CGRect, after_updates: bool, ) -> bool
Sourcepub unsafe fn appliedContentSizeCategoryLimitsDescription(
&self,
) -> Retained<NSString>
pub unsafe 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 unsafe fn traitOverrides( &self, ) -> Retained<ProtocolObject<dyn UITraitOverrides>>
Sourcepub unsafe fn updateTraitsIfNeeded(&self)
pub unsafe 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.
Methods from Deref<Target = UIResponder>§
pub unsafe fn nextResponder(&self) -> Option<Retained<UIResponder>>
pub unsafe fn canBecomeFirstResponder(&self) -> bool
pub unsafe fn becomeFirstResponder(&self) -> bool
pub unsafe fn canResignFirstResponder(&self) -> bool
pub unsafe fn resignFirstResponder(&self) -> bool
pub unsafe fn isFirstResponder(&self) -> bool
pub unsafe fn canPerformAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> bool
pub unsafe fn targetForAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> Option<Retained<AnyObject>>
pub unsafe fn undoManager(&self) -> Option<Retained<NSUndoManager>>
pub unsafe fn editingInteractionConfiguration( &self, ) -> UIEditingInteractionConfiguration
pub unsafe fn inputView(&self) -> Option<Retained<UIView>>
pub unsafe fn inputAccessoryView(&self) -> Option<Retained<UIView>>
pub unsafe fn textInputContextIdentifier(&self) -> Option<Retained<NSString>>
pub unsafe fn reloadInputViews(&self)
pub unsafe fn userActivity(&self) -> Option<Retained<NSUserActivity>>
Sourcepub unsafe fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
pub unsafe fn setUserActivity(&self, user_activity: Option<&NSUserActivity>)
Setter for userActivity.
pub unsafe fn updateUserActivityState(&self, activity: &NSUserActivity)
pub unsafe fn restoreUserActivityState(&self, activity: &NSUserActivity)
pub unsafe fn captureTextFromCamera(&self, sender: Option<&AnyObject>)
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 TVPosterView
impl AsRef<AnyObject> for TVPosterView
Source§impl AsRef<NSObject> for TVPosterView
impl AsRef<NSObject> for TVPosterView
Source§impl AsRef<TVLockupView> for TVPosterView
impl AsRef<TVLockupView> for TVPosterView
Source§fn as_ref(&self) -> &TVLockupView
fn as_ref(&self) -> &TVLockupView
Source§impl AsRef<TVPosterView> for TVPosterView
impl AsRef<TVPosterView> for TVPosterView
Source§impl AsRef<UIControl> for TVPosterView
impl AsRef<UIControl> for TVPosterView
Source§impl AsRef<UIResponder> for TVPosterView
impl AsRef<UIResponder> for TVPosterView
Source§fn as_ref(&self) -> &UIResponder
fn as_ref(&self) -> &UIResponder
Source§impl AsRef<UIView> for TVPosterView
impl AsRef<UIView> for TVPosterView
Source§impl Borrow<AnyObject> for TVPosterView
impl Borrow<AnyObject> for TVPosterView
Source§impl Borrow<NSObject> for TVPosterView
impl Borrow<NSObject> for TVPosterView
Source§impl Borrow<TVLockupView> for TVPosterView
impl Borrow<TVLockupView> for TVPosterView
Source§fn borrow(&self) -> &TVLockupView
fn borrow(&self) -> &TVLockupView
Source§impl Borrow<UIControl> for TVPosterView
impl Borrow<UIControl> for TVPosterView
Source§impl Borrow<UIResponder> for TVPosterView
impl Borrow<UIResponder> for TVPosterView
Source§fn borrow(&self) -> &UIResponder
fn borrow(&self) -> &UIResponder
Source§impl Borrow<UIView> for TVPosterView
impl Borrow<UIView> for TVPosterView
Source§impl CALayerDelegate for TVPosterView
impl CALayerDelegate for TVPosterView
unsafe fn displayLayer(&self, layer: &CALayer)
unsafe fn layerWillDraw(&self, layer: &CALayer)
unsafe fn layoutSublayersOfLayer(&self, layer: &CALayer)
unsafe fn actionForLayer_forKey( &self, layer: &CALayer, event: &NSString, ) -> Option<Retained<ProtocolObject<dyn CAAction>>>
Source§impl ClassType for TVPosterView
impl ClassType for TVPosterView
Source§const NAME: &'static str = "TVPosterView"
const NAME: &'static str = "TVPosterView"
Source§type Super = TVLockupView
type Super = TVLockupView
Source§type ThreadKind = <<TVPosterView as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<TVPosterView as ClassType>::Super as ClassType>::ThreadKind
Source§impl Debug for TVPosterView
impl Debug for TVPosterView
Source§impl Deref for TVPosterView
impl Deref for TVPosterView
Source§impl Hash for TVPosterView
impl Hash for TVPosterView
Source§impl Message for TVPosterView
impl Message for TVPosterView
Source§impl NSCoding for TVPosterView
impl NSCoding for TVPosterView
Source§impl NSObjectProtocol for TVPosterView
impl NSObjectProtocol for TVPosterView
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 TVPosterView
impl PartialEq for TVPosterView
Source§impl RefEncode for TVPosterView
impl RefEncode for TVPosterView
Source§const ENCODING_REF: Encoding = <TVLockupView as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <TVLockupView as ::objc2::RefEncode>::ENCODING_REF
Source§impl UIAppearance for TVPosterView
impl UIAppearance for TVPosterView
unsafe fn appearance(mtm: MainThreadMarker) -> Retained<Self>
unsafe fn appearanceWhenContainedInInstancesOfClasses( container_types: &NSArray<AnyClass>, mtm: MainThreadMarker, ) -> Retained<Self>
unsafe fn appearanceForTraitCollection( trait: &UITraitCollection, mtm: MainThreadMarker, ) -> Retained<Self>
unsafe fn appearanceForTraitCollection_whenContainedInInstancesOfClasses( trait: &UITraitCollection, container_types: &NSArray<AnyClass>, mtm: MainThreadMarker, ) -> Retained<Self>
Source§impl UICoordinateSpace for TVPosterView
impl UICoordinateSpace for TVPosterView
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 TVPosterView
impl UIDynamicItem for TVPosterView
unsafe fn center(&self) -> CGPoint
unsafe fn bounds(&self) -> CGRect
unsafe fn transform(&self) -> CGAffineTransform
Source§unsafe fn setTransform(&self, transform: CGAffineTransform)
unsafe fn setTransform(&self, transform: CGAffineTransform)
transform.Source§unsafe fn collisionBoundsType(&self) -> UIDynamicItemCollisionBoundsType
unsafe fn collisionBoundsType(&self) -> UIDynamicItemCollisionBoundsType
Source§impl UIFocusEnvironment for TVPosterView
impl UIFocusEnvironment for TVPosterView
Source§unsafe fn preferredFocusEnvironments(
&self,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
unsafe fn preferredFocusEnvironments( &self, ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
Source§unsafe fn parentFocusEnvironment(
&self,
) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
unsafe fn parentFocusEnvironment( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
Source§unsafe fn focusItemContainer(
&self,
) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
unsafe fn focusItemContainer( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
Source§unsafe fn setNeedsFocusUpdate(&self)
unsafe fn setNeedsFocusUpdate(&self)
[[UIFocusSystem focusSystemForEnvironment:self] requestFocusUpdateToEnvironment:self];Source§unsafe fn updateFocusIfNeeded(&self)
unsafe fn updateFocusIfNeeded(&self)
[[UIFocusSystem focusSystemForEnvironment:self] updateFocusIfNeeded];.Source§unsafe fn shouldUpdateFocusInContext(
&self,
context: &UIFocusUpdateContext,
) -> bool
unsafe fn shouldUpdateFocusInContext( &self, context: &UIFocusUpdateContext, ) -> bool
Source§unsafe fn soundIdentifierForFocusUpdateInContext(
&self,
context: &UIFocusUpdateContext,
) -> Option<Retained<NSString>>
unsafe fn soundIdentifierForFocusUpdateInContext( &self, context: &UIFocusUpdateContext, ) -> Option<Retained<NSString>>
Source§impl UIFocusItem for TVPosterView
impl UIFocusItem for TVPosterView
Source§unsafe fn canBecomeFocused(&self) -> bool
unsafe fn canBecomeFocused(&self) -> bool
Source§unsafe fn frame(&self) -> CGRect
unsafe fn frame(&self) -> CGRect
coordinateSpace of the UIFocusItemContainer in which it is contained.Source§unsafe fn focusGroupPriority(&self) -> isize
unsafe fn focusGroupPriority(&self) -> isize
Source§unsafe fn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
unsafe 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§unsafe fn isTransparentFocusItem(&self) -> bool
unsafe fn isTransparentFocusItem(&self) -> bool
Source§impl UIFocusItemContainer for TVPosterView
impl UIFocusItemContainer for TVPosterView
Source§unsafe fn coordinateSpace(
&self,
) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
unsafe fn coordinateSpace( &self, ) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
Source§unsafe fn focusItemsInRect(
&self,
rect: CGRect,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
unsafe 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 TVPosterView
impl UIResponderStandardEditActions for TVPosterView
unsafe fn cut(&self, sender: Option<&AnyObject>)
unsafe fn copy(&self, sender: Option<&AnyObject>)
unsafe fn paste(&self, sender: Option<&AnyObject>)
unsafe fn pasteAndMatchStyle(&self, sender: Option<&AnyObject>)
unsafe fn pasteAndGo(&self, sender: Option<&AnyObject>)
unsafe fn pasteAndSearch(&self, sender: Option<&AnyObject>)
unsafe fn select(&self, sender: Option<&AnyObject>)
unsafe fn selectAll(&self, sender: Option<&AnyObject>)
unsafe fn delete(&self, sender: Option<&AnyObject>)
unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>)
unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>)
unsafe fn toggleBoldface(&self, sender: Option<&AnyObject>)
unsafe fn toggleItalics(&self, sender: Option<&AnyObject>)
unsafe fn toggleUnderline(&self, sender: Option<&AnyObject>)
unsafe fn increaseSize(&self, sender: Option<&AnyObject>)
unsafe fn decreaseSize(&self, sender: Option<&AnyObject>)
unsafe fn find(&self, sender: Option<&AnyObject>)
unsafe fn findAndReplace(&self, sender: Option<&AnyObject>)
unsafe fn findNext(&self, sender: Option<&AnyObject>)
unsafe fn findPrevious(&self, sender: Option<&AnyObject>)
unsafe fn useSelectionForFind(&self, sender: Option<&AnyObject>)
unsafe fn print(&self, sender: Option<&AnyObject>)
unsafe fn rename(&self, sender: Option<&AnyObject>)
unsafe fn duplicate(&self, sender: Option<&AnyObject>)
unsafe fn move(&self, sender: Option<&AnyObject>)
unsafe fn export(&self, sender: Option<&AnyObject>)
unsafe fn showWritingTools(&self, sender: &AnyObject)
Source§impl UITraitEnvironment for TVPosterView
impl UITraitEnvironment for TVPosterView
fn traitCollection(&self) -> Retained<UITraitCollection>
Source§unsafe fn traitCollectionDidChange(
&self,
previous_trait_collection: Option<&UITraitCollection>,
)
unsafe fn traitCollectionDidChange( &self, previous_trait_collection: Option<&UITraitCollection>, )
impl DowncastTarget for TVPosterView
impl Eq for TVPosterView
impl UIAppearanceContainer for TVPosterView
Auto Trait Implementations§
impl !Freeze for TVPosterView
impl !RefUnwindSafe for TVPosterView
impl !Send for TVPosterView
impl !Sync for TVPosterView
impl !Unpin for TVPosterView
impl !UnwindSafe for TVPosterView
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