Struct objc2_ui_kit::UITraitCollection
source · #[repr(C)]pub struct UITraitCollection { /* private fields */ }
Available on crate feature
UITraitCollection
only.Implementations§
source§impl UITraitCollection
impl UITraitCollection
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
pub unsafe fn initWithCoder( this: Allocated<Self>, coder: &NSCoder ) -> Option<Retained<Self>>
pub unsafe fn containsTraitsInCollection( &self, trait: Option<&UITraitCollection> ) -> bool
👎Deprecated: Compare values for specific traits in the trait collections instead
pub unsafe fn traitCollectionWithTraitsFromCollections( trait_collections: &NSArray<UITraitCollection> ) -> Retained<UITraitCollection>
👎Deprecated: Use +[UITraitCollection traitCollectionWithTraits:] and -[UITraitCollection traitCollectionByModifyingTraits:] to create and modify trait collections
pub unsafe fn traitCollectionWithUserInterfaceIdiom( idiom: UIUserInterfaceIdiom ) -> Retained<UITraitCollection>
Available on crate feature
UIDevice
only.pub unsafe fn userInterfaceIdiom(&self) -> UIUserInterfaceIdiom
Available on crate feature
UIDevice
only.pub unsafe fn traitCollectionWithUserInterfaceStyle( user_interface_style: UIUserInterfaceStyle ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn userInterfaceStyle(&self) -> UIUserInterfaceStyle
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithLayoutDirection( layout_direction: UITraitEnvironmentLayoutDirection ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn layoutDirection(&self) -> UITraitEnvironmentLayoutDirection
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithDisplayScale( scale: CGFloat ) -> Retained<UITraitCollection>
pub unsafe fn displayScale(&self) -> CGFloat
pub unsafe fn traitCollectionWithHorizontalSizeClass( horizontal_size_class: UIUserInterfaceSizeClass ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn horizontalSizeClass(&self) -> UIUserInterfaceSizeClass
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithVerticalSizeClass( vertical_size_class: UIUserInterfaceSizeClass ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn verticalSizeClass(&self) -> UIUserInterfaceSizeClass
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithForceTouchCapability( capability: UIForceTouchCapability ) -> Retained<UITraitCollection>
Available on crate feature
UITouch
only.pub fn forceTouchCapability(&self) -> UIForceTouchCapability
Available on crate feature
UITouch
only.pub unsafe fn traitCollectionWithPreferredContentSizeCategory( preferred_content_size_category: &UIContentSizeCategory ) -> Retained<UITraitCollection>
Available on crate feature
UIContentSizeCategory
only.pub unsafe fn preferredContentSizeCategory( &self ) -> Retained<UIContentSizeCategory>
Available on crate feature
UIContentSizeCategory
only.pub unsafe fn traitCollectionWithDisplayGamut( display_gamut: UIDisplayGamut ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn displayGamut(&self) -> UIDisplayGamut
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithAccessibilityContrast( accessibility_contrast: UIAccessibilityContrast ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn accessibilityContrast(&self) -> UIAccessibilityContrast
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithUserInterfaceLevel( user_interface_level: UIUserInterfaceLevel ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn userInterfaceLevel(&self) -> UIUserInterfaceLevel
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithLegibilityWeight( legibility_weight: UILegibilityWeight ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn legibilityWeight(&self) -> UILegibilityWeight
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithActiveAppearance( user_interface_active_appearance: UIUserInterfaceActiveAppearance ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn activeAppearance(&self) -> UIUserInterfaceActiveAppearance
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithToolbarItemPresentationSize( toolbar_item_presentation_size: UINSToolbarItemPresentationSize ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn toolbarItemPresentationSize( &self ) -> UINSToolbarItemPresentationSize
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithImageDynamicRange( image_dynamic_range: UIImageDynamicRange ) -> Retained<UITraitCollection>
Available on crate feature
UIInterface
only.pub unsafe fn imageDynamicRange(&self) -> UIImageDynamicRange
Available on crate feature
UIInterface
only.pub unsafe fn traitCollectionWithTypesettingLanguage( language: &NSString ) -> Retained<UITraitCollection>
pub unsafe fn typesettingLanguage(&self) -> Retained<NSString>
pub unsafe fn traitCollectionWithSceneCaptureState( scene_capture_state: UISceneCaptureState ) -> Retained<UITraitCollection>
Available on crate feature
UISceneDefinitions
only.pub unsafe fn sceneCaptureState(&self) -> UISceneCaptureState
Available on crate feature
UISceneDefinitions
only.source§impl UITraitCollection
impl UITraitCollection
Methods declared on superclass NSObject
source§impl UITraitCollection
impl UITraitCollection
pub unsafe fn traitCollectionWithTraits( mutations: UITraitMutations ) -> Retained<UITraitCollection>
Available on crate feature
block2
only.pub unsafe fn traitCollectionByModifyingTraits( &self, mutations: UITraitMutations ) -> Retained<UITraitCollection>
Available on crate feature
block2
only.pub unsafe fn traitCollectionWithCGFloatValue_forTrait( value: CGFloat, trait: UICGFloatTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn traitCollectionByReplacingCGFloatValue_forTrait( &self, value: CGFloat, trait: UICGFloatTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn valueForCGFloatTrait(&self, trait: UICGFloatTrait) -> CGFloat
Available on crate feature
UITrait
only.pub unsafe fn traitCollectionWithNSIntegerValue_forTrait( value: NSInteger, trait: UINSIntegerTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn traitCollectionByReplacingNSIntegerValue_forTrait( &self, value: NSInteger, trait: UINSIntegerTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn valueForNSIntegerTrait( &self, trait: UINSIntegerTrait ) -> NSInteger
Available on crate feature
UITrait
only.pub unsafe fn traitCollectionWithObject_forTrait( object: Option<&NSObject>, trait: UIObjectTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn traitCollectionByReplacingObject_forTrait( &self, object: Option<&NSObject>, trait: UIObjectTrait ) -> Retained<UITraitCollection>
Available on crate feature
UITrait
only.pub unsafe fn objectForTrait( &self, trait: UIObjectTrait ) -> Option<Retained<NSObject>>
Available on crate feature
UITrait
only.source§impl UITraitCollection
impl UITraitCollection
CurrentTraitCollection
pub unsafe fn currentTraitCollection() -> Retained<UITraitCollection>
pub unsafe fn setCurrentTraitCollection( current_trait_collection: &UITraitCollection )
pub unsafe fn performAsCurrentTraitCollection( &self, actions: &Block<dyn Fn() + '_> )
Available on crate feature
block2
only.source§impl UITraitCollection
impl UITraitCollection
DynamicAppearance
pub unsafe fn hasDifferentColorAppearanceComparedToTraitCollection( &self, trait_collection: Option<&UITraitCollection> ) -> bool
source§impl UITraitCollection
impl UITraitCollection
ImageConfiguration
pub unsafe fn imageConfiguration(&self) -> Retained<UIImageConfiguration>
Available on crate feature
UIImageConfiguration
only.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
Available on crate feature UIIndirectScribbleInteraction
only.
pub fn class(&self) -> &'static AnyClass
UIIndirectScribbleInteraction
only.Dynamically find the class of this object.
§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.Available on crate feature UIIndirectScribbleInteraction
only.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.UIIndirectScribbleInteraction
only.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 unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.Available on crate feature UIIndirectScribbleInteraction
only.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.UIIndirectScribbleInteraction
only.Use Ivar::load_mut
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.
Trait Implementations§
source§impl AsMut<AnyObject> for UITraitCollection
impl AsMut<AnyObject> for UITraitCollection
source§impl AsMut<NSObject> for UITraitCollection
impl AsMut<NSObject> for UITraitCollection
source§impl AsMut<UITraitCollection> for UITraitCollection
impl AsMut<UITraitCollection> for UITraitCollection
source§impl AsRef<AnyObject> for UITraitCollection
impl AsRef<AnyObject> for UITraitCollection
source§impl AsRef<NSObject> for UITraitCollection
impl AsRef<NSObject> for UITraitCollection
source§impl AsRef<UITraitCollection> for UITraitCollection
impl AsRef<UITraitCollection> for UITraitCollection
source§impl Borrow<AnyObject> for UITraitCollection
impl Borrow<AnyObject> for UITraitCollection
source§impl Borrow<NSObject> for UITraitCollection
impl Borrow<NSObject> for UITraitCollection
source§impl BorrowMut<AnyObject> for UITraitCollection
impl BorrowMut<AnyObject> for UITraitCollection
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for UITraitCollection
impl BorrowMut<NSObject> for UITraitCollection
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for UITraitCollection
impl ClassType for UITraitCollection
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "UITraitCollection"
const NAME: &'static str = "UITraitCollection"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl Debug for UITraitCollection
impl Debug for UITraitCollection
source§impl Deref for UITraitCollection
impl Deref for UITraitCollection
source§impl DerefMut for UITraitCollection
impl DerefMut for UITraitCollection
source§impl Hash for UITraitCollection
impl Hash for UITraitCollection
source§impl NSCoding for UITraitCollection
impl NSCoding for UITraitCollection
source§impl NSCopying for UITraitCollection
impl NSCopying for UITraitCollection
source§impl NSObjectProtocol for UITraitCollection
impl NSObjectProtocol for UITraitCollection
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSSecureCoding for UITraitCollection
impl NSSecureCoding for UITraitCollection
source§impl PartialEq for UITraitCollection
impl PartialEq for UITraitCollection
source§fn eq(&self, other: &UITraitCollection) -> bool
fn eq(&self, other: &UITraitCollection) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for UITraitCollection
impl RefEncode for UITraitCollection
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for UITraitCollection
impl Message for UITraitCollection
impl Send for UITraitCollection
impl StructuralPartialEq for UITraitCollection
impl Sync for UITraitCollection
Auto Trait Implementations§
impl !Freeze for UITraitCollection
impl !RefUnwindSafe for UITraitCollection
impl !Unpin for UITraitCollection
impl !UnwindSafe for UITraitCollection
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
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more