Package apple.uikit

Class UITraitCollection

    • Constructor Detail

      • UITraitCollection

        protected UITraitCollection​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static UITraitCollection allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • traitCollectionWithDisplayGamut

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithDisplayGamut​(long displayGamut)
        API-Since: 10.0
      • traitCollectionWithDisplayScale

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithDisplayScale​(double scale)
      • traitCollectionWithForceTouchCapability

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithForceTouchCapability​(long capability)
        API-Since: 9.0
      • traitCollectionWithHorizontalSizeClass

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithHorizontalSizeClass​(long horizontalSizeClass)
      • traitCollectionWithLayoutDirection

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithLayoutDirection​(long layoutDirection)
        API-Since: 10.0
      • traitCollectionWithPreferredContentSizeCategory

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithPreferredContentSizeCategory​(@NotNull
                                                                                                 @NotNull java.lang.String preferredContentSizeCategory)
        API-Since: 10.0
      • traitCollectionWithTraitsFromCollections

        @Deprecated
        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithTraitsFromCollections​(@NotNull
                                                                                          @NotNull NSArray<? extends UITraitCollection> traitCollections)
        Deprecated.
        API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Use +[UITraitCollection traitCollectionWithTraits:] and -[UITraitCollection traitCollectionByModifyingTraits:] to create and modify trait collections
      • traitCollectionWithUserInterfaceIdiom

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithUserInterfaceIdiom​(long idiom)
      • traitCollectionWithVerticalSizeClass

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithVerticalSizeClass​(long verticalSizeClass)
      • version_static

        public static long version_static()
      • containsTraitsInCollection

        @Deprecated
        public boolean containsTraitsInCollection​(@Nullable
                                                  @Nullable UITraitCollection trait)
        Deprecated.
        This deprecated method considers system traits only. API-Since: 8.0 Deprecated-Since: 17.0 Deprecated-Message: Compare values for specific traits in the trait collections instead
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • displayGamut

        public long displayGamut()
        unspecified: UIDisplayGamutUnspecified API-Since: 10.0
      • displayScale

        public double displayScale()
        unspecified: 0.0
      • forceTouchCapability

        public long forceTouchCapability()
        unspecified: UIForceTouchCapabilityUnknown API-Since: 9.0
      • horizontalSizeClass

        public long horizontalSizeClass()
        unspecified: UIUserInterfaceSizeClassUnspecified
      • layoutDirection

        public long layoutDirection()
        unspecified: UITraitEnvironmentLayoutDirectionUnspecified API-Since: 10.0
      • preferredContentSizeCategory

        @NotNull
        public @NotNull java.lang.String preferredContentSizeCategory()
        unspecified: UIContentSizeCategoryUnspecified API-Since: 10.0
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • userInterfaceIdiom

        public long userInterfaceIdiom()
        unspecified: UIUserInterfaceIdiomUnspecified
      • verticalSizeClass

        public long verticalSizeClass()
        unspecified: UIUserInterfaceSizeClassUnspecified
      • accessibilityContrast

        public long accessibilityContrast()
        unspecified: UIAccessibilityContrastUnspecified API-Since: 13.0
      • currentTraitCollection

        @NotNull
        public static @NotNull UITraitCollection currentTraitCollection()
        The current trait collection, used when resolving the appearance of dynamic UIColors and similar objects. This is a thread-local property, so it may be changed on non-main threads without affecting the main thread. API-Since: 13.0
      • hasDifferentColorAppearanceComparedToTraitCollection

        public boolean hasDifferentColorAppearanceComparedToTraitCollection​(@Nullable
                                                                            @Nullable UITraitCollection traitCollection)
        Return whether this trait collection, compared to a different trait collection, could show a different appearance for dynamic colors that are provided by UIKit or are in an asset catalog. If you need to be aware of when dynamic colors might change, override `traitCollectionDidChange` in your view or view controller, and use this method to compare `self.traitCollection` with `previousTraitCollection`. Currently, a change in any of these traits could affect dynamic colors: userInterfaceIdiom, userInterfaceStyle, displayGamut, accessibilityContrast, userInterfaceLevel and more could be added in the future. API-Since: 13.0
      • imageConfiguration

        @NotNull
        public @NotNull UIImageConfiguration imageConfiguration()
        Returns an image configuration compatible with this trait collection. API-Since: 13.0
      • legibilityWeight

        public long legibilityWeight()
        unspecified: UILegibilityWeightUnspecified API-Since: 13.0
      • performAsCurrentTraitCollection

        public void performAsCurrentTraitCollection​(@NotNull
                                                    @NotNull UITraitCollection.Block_performAsCurrentTraitCollection actions)
        Sets `UITraitCollection.currentTraitCollection` to this trait collection, performs the given actions, then restores `UITraitCollection.currentTraitCollection` to its original value. Just like `currentTraitCollection`, this only affects the current thread, and may be used on non-main threads without affecting the main thread. API-Since: 13.0
      • setCurrentTraitCollection

        public static void setCurrentTraitCollection​(@NotNull
                                                     @NotNull UITraitCollection value)
        The current trait collection, used when resolving the appearance of dynamic UIColors and similar objects. This is a thread-local property, so it may be changed on non-main threads without affecting the main thread. API-Since: 13.0
      • traitCollectionWithAccessibilityContrast

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithAccessibilityContrast​(long accessibilityContrast)
        API-Since: 13.0
      • traitCollectionWithLegibilityWeight

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithLegibilityWeight​(long legibilityWeight)
        API-Since: 13.0
      • traitCollectionWithUserInterfaceLevel

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithUserInterfaceLevel​(long userInterfaceLevel)
        API-Since: 13.0
      • traitCollectionWithUserInterfaceStyle

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithUserInterfaceStyle​(long userInterfaceStyle)
        API-Since: 12.0
      • userInterfaceLevel

        public long userInterfaceLevel()
        unspecified: UIUserInterfaceLevelUnspecified API-Since: 13.0
      • userInterfaceStyle

        public long userInterfaceStyle()
        unspecified: UIUserInterfaceStyleUnspecified API-Since: 12.0
      • activeAppearance

        public long activeAppearance()
        unspecified: UIUserInterfaceActiveAppearanceUnspecified API-Since: 14.0
      • traitCollectionWithActiveAppearance

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithActiveAppearance​(long userInterfaceActiveAppearance)
        This trait indicates whether the UI should have an 'active' appearance. On macOS, this varies based on window activation state. On other platforms, this is always .active. API-Since: 14.0
      • toolbarItemPresentationSize

        public long toolbarItemPresentationSize()
      • traitCollectionWithToolbarItemPresentationSize

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithToolbarItemPresentationSize​(long toolbarItemPresentationSize)
      • changedTraitsFromTraitCollection

        @NotNull
        public @NotNull NSSet<?> changedTraitsFromTraitCollection​(@Nullable
                                                                  @Nullable UITraitCollection traitCollection)
      • imageDynamicRange

        public long imageDynamicRange()
        The imageDynamicRange determines how HDR images will render in the given trait environment. SDR images are unaffected. API-Since: 17.0
      • sceneCaptureState

        public long sceneCaptureState()
        Scene capture state represents whether a scene is currently being mirrored or recorded. API-Since: 17.0
      • systemTraitsAffectingColorAppearance

        @NotNull
        public static @NotNull NSArray<?> systemTraitsAffectingColorAppearance()
      • systemTraitsAffectingImageLookup

        @NotNull
        public static @NotNull NSArray<?> systemTraitsAffectingImageLookup()
      • traitCollectionByReplacingCGFloatValueForTrait

        @NotNull
        public @NotNull UITraitCollection traitCollectionByReplacingCGFloatValueForTrait​(double value,
                                                                                         @NotNull
                                                                                         @NotNull UICGFloatTraitDefinition trait)
      • traitCollectionWithImageDynamicRange

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithImageDynamicRange​(long imageDynamicRange)
        Construct a new trait collection with the given image content dynamic range. API-Since: 17.0
      • traitCollectionWithSceneCaptureState

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithSceneCaptureState​(long sceneCaptureState)
        Construct a new trait collection with the given scene capture state. API-Since: 17.0
      • traitCollectionWithTypesettingLanguage

        @NotNull
        public static @NotNull UITraitCollection traitCollectionWithTypesettingLanguage​(@NotNull
                                                                                        @NotNull java.lang.String language)
        API-Since: 17.0
      • typesettingLanguage

        @NotNull
        public @NotNull java.lang.String typesettingLanguage()
        API-Since: 17.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.