Package apple.uikit

Class UIControl

    • Constructor Detail

      • UIControl

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • appearance

        public static java.lang.Object appearance()
      • appearanceForTraitCollection

        public static java.lang.Object appearanceForTraitCollection​(UITraitCollection trait)
      • appearanceForTraitCollectionWhenContainedIn

        @Deprecated
        public static java.lang.Object appearanceForTraitCollectionWhenContainedIn​(UITraitCollection trait,
                                                                                   UIAppearanceContainer ContainerClass,
                                                                                   java.lang.Object... varargs)
        Deprecated.
      • appearanceForTraitCollectionWhenContainedInInstancesOfClasses

        public static java.lang.Object appearanceForTraitCollectionWhenContainedInInstancesOfClasses​(UITraitCollection trait,
                                                                                                     NSArray<?> containerTypes)
      • appearanceWhenContainedIn

        @Deprecated
        public static java.lang.Object appearanceWhenContainedIn​(UIAppearanceContainer ContainerClass,
                                                                 java.lang.Object... varargs)
        Deprecated.
      • appearanceWhenContainedInInstancesOfClasses

        public static java.lang.Object appearanceWhenContainedInInstancesOfClasses​(NSArray<?> containerTypes)
      • areAnimationsEnabled

        public static boolean areAnimationsEnabled()
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • beginAnimationsContext

        public static void beginAnimationsContext​(java.lang.String animationID,
                                                  org.moe.natj.general.ptr.VoidPtr context)
      • cancelPreviousPerformRequestsWithTarget

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

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

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

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • clearTextInputContextIdentifier

        public static void clearTextInputContextIdentifier​(java.lang.String identifier)
      • commitAnimations

        public static void commitAnimations()
      • 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()
      • inheritedAnimationDuration

        public static double inheritedAnimationDuration()
      • 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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • layerClass

        public static org.moe.natj.objc.Class layerClass()
      • new_objc

        public static java.lang.Object new_objc()
      • requiresConstraintBasedLayout

        public static boolean requiresConstraintBasedLayout()
      • resolveClassMethod

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

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

        public static void setAnimationBeginsFromCurrentState​(boolean fromCurrentState)
      • setAnimationCurve

        public static void setAnimationCurve​(long curve)
      • setAnimationDelay

        public static void setAnimationDelay​(double delay)
      • setAnimationDelegate

        public static void setAnimationDelegate​(java.lang.Object delegate)
      • setAnimationDidStopSelector

        public static void setAnimationDidStopSelector​(org.moe.natj.objc.SEL selector)
      • setAnimationDuration_static

        public static void setAnimationDuration_static​(double duration)
      • setAnimationRepeatAutoreverses

        public static void setAnimationRepeatAutoreverses​(boolean repeatAutoreverses)
      • setAnimationRepeatCount_static

        public static void setAnimationRepeatCount_static​(float repeatCount)
      • setAnimationStartDate

        public static void setAnimationStartDate​(NSDate startDate)
      • setAnimationTransitionForViewCache

        public static void setAnimationTransitionForViewCache​(long transition,
                                                              UIView view,
                                                              boolean cache)
      • setAnimationWillStartSelector

        public static void setAnimationWillStartSelector​(org.moe.natj.objc.SEL selector)
      • setAnimationsEnabled

        public static void setAnimationsEnabled​(boolean enabled)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public static long userInterfaceLayoutDirectionForSemanticContentAttribute​(long attribute)
      • userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection

        public static long userInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection​(long semanticContentAttribute,
                                                                                                            long layoutDirection)
      • version_static

        public static long version_static()
      • actionsForTargetForControlEvent

        public NSArray<java.lang.String> actionsForTargetForControlEvent​(java.lang.Object target,
                                                                         long controlEvent)
        single event. returns NSArray of NSString selector names. returns nil if none
      • addTargetActionForControlEvents

        public void addTargetActionForControlEvents​(java.lang.Object target,
                                                    org.moe.natj.objc.SEL action,
                                                    long controlEvents)
        add target/action for particular event. you can call this multiple times and you can specify multiple target/actions for a particular event. passing in nil as the target goes up the responder chain. The action may optionally include the sender and the event in that order the action cannot be NULL. Note that the target is not retained.
      • allControlEvents

        public long allControlEvents()
        list of all events that have at least one action
      • allTargets

        public NSSet<?> allTargets()
        set may include NSNull to indicate at least one nil target
      • _appearance

        public java.lang.Object _appearance()
        Description copied from interface: UIAppearance
        To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. For example, to modify the bar tint color for all UINavigationBar instances: [[UINavigationBar appearance] setBarTintColor:myColor]; Note for iOS7: On iOS7 the tintColor property has moved to UIView, and now has special inherited behavior described in UIView.h. This inherited behavior can conflict with the appearance proxy, and therefore tintColor is now disallowed with the appearance proxy.
        Specified by:
        _appearance in interface UIAppearance
        Overrides:
        _appearance in class UIView
      • _appearanceWhenContainedIn

        @Deprecated
        public java.lang.Object _appearanceWhenContainedIn​(UIAppearanceContainer ContainerClass,
                                                           java.lang.Object... varargs)
        Deprecated.
        Description copied from interface: UIAppearance
        To customize the appearances for instances of a class contained within an instance of a container class, or instances in a hierarchy, use +appearanceWhenContainedInInstancesOfClasses: for the appropriate appearance proxy. For example: [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UISplitViewController class]]] setBarTintColor:myColor]; [[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[UITabBarController class], [UISplitViewController class]]] setBarTintColor:myTabbedNavBarColor]; In any given view hierarchy the outermost appearance proxy wins. Specificity (depth of the chain) is the tie-breaker. In other words, the containment statement is treated as a partial ordering. Given a concrete ordering (actual subview hierarchy), we select the partial ordering that is the first unique match when reading the actual hierarchy from the window down.
        Specified by:
        _appearanceWhenContainedIn in interface UIAppearance
        Overrides:
        _appearanceWhenContainedIn in class UIView
      • beginTrackingWithTouchWithEvent

        public boolean beginTrackingWithTouchWithEvent​(UITouch touch,
                                                       UIEvent event)
      • cancelTrackingWithEvent

        public void cancelTrackingWithEvent​(UIEvent event)
        event may be nil if cancelled for non-event reasons, e.g. removed from window
      • contentHorizontalAlignment

        public long contentHorizontalAlignment()
        how to position content horizontally inside control. default is center
      • contentVerticalAlignment

        public long contentVerticalAlignment()
        how to position content vertically inside control. default is center
      • continueTrackingWithTouchWithEvent

        public boolean continueTrackingWithTouchWithEvent​(UITouch touch,
                                                          UIEvent event)
      • endTrackingWithTouchWithEvent

        public void endTrackingWithTouchWithEvent​(UITouch touch,
                                                  UIEvent event)
        touch is sometimes nil if cancelTracking calls through to this.
      • isEnabled

        public boolean isEnabled()
        default is YES. if NO, ignores touch events and subclasses may draw differently
      • setEnabled

        public void setEnabled​(boolean value)
        default is YES. if NO, ignores touch events and subclasses may draw differently
      • isHighlighted

        public boolean isHighlighted()
        default is NO. this gets set/cleared automatically when touch enters/exits during tracking and cleared on up
      • setHighlighted

        public void setHighlighted​(boolean value)
        default is NO. this gets set/cleared automatically when touch enters/exits during tracking and cleared on up
      • isSelected

        public boolean isSelected()
        default is NO may be used by some subclasses or by application
      • setSelected

        public void setSelected​(boolean value)
        default is NO may be used by some subclasses or by application
      • isTouchInside

        public boolean isTouchInside()
        valid during tracking only
      • isTracking

        public boolean isTracking()
      • removeTargetActionForControlEvents

        public void removeTargetActionForControlEvents​(java.lang.Object target,
                                                       org.moe.natj.objc.SEL action,
                                                       long controlEvents)
        remove the target/action for a set of events. pass in NULL for the action to remove all actions for that target
      • sendActionToForEvent

        public void sendActionToForEvent​(org.moe.natj.objc.SEL action,
                                         java.lang.Object target,
                                         UIEvent event)
        Dispatch the target-action pair. This method is called repeatedly by -sendActionsForControlEvents: and is a point at which you can observe or override behavior.
      • sendActionsForControlEvents

        public void sendActionsForControlEvents​(long controlEvents)
        send all actions associated with the given control events
      • setContentHorizontalAlignment

        public void setContentHorizontalAlignment​(long value)
        how to position content horizontally inside control. default is center
      • setContentVerticalAlignment

        public void setContentVerticalAlignment​(long value)
        how to position content vertically inside control. default is center
      • state

        public long state()
        could be more than one state (e.g. disabled|selected). synthesized from other flags.
      • addTargetActionForControlEvents

        public <T> void addTargetActionForControlEvents​(ITargetAction<T> targetAction,
                                                        long controlEvents)

        Abstract:

        Adds a action for a particular event (or events) to an internal dispatch table.

        Parameters:
        targetAction -

        The targetAction object—that is, the object to which the action message is sent.

        controlEvents -

        A bitmask specifying the control events for which the action message is sent. See “Control Events” for bitmask constants.

        See Also:
        ITargetAction
      • removeTargetActionForControlEvents

        public void removeTargetActionForControlEvents​(ITargetAction<?> targetAction,
                                                       long controlEvents)

        Abstract:

        Removes a targetAction for a particular event (or events) from an internal dispatch table.

        Parameters:
        targetAction -

        The targetAction object—that is, the object to which the action message is sent.

        controlEvents -

        A bitmask specifying the control events associated with target and action. See “Control Events” for bitmask constants.

        See Also:
        ITargetAction
      • effectiveContentHorizontalAlignment

        public long effectiveContentHorizontalAlignment()
        how to position content horizontally inside control, guaranteed to return 'left' or 'right' for any 'leading' or 'trailing'
      • addActionForControlEvents

        public void addActionForControlEvents​(UIAction action,
                                              long controlEvents)
        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.
      • contextMenuInteraction

        public UIContextMenuInteraction contextMenuInteraction()
        Returns a UIContextMenuInteraction with this control set as its delegate. Before constructing the UIContextMenuInteraction, UIControl verifies 'self' is a viable delegate. See 'Implementing UIControl Menus' below for more details.
      • contextMenuInteractionConfigurationForMenuAtLocation

        public UIContextMenuConfiguration contextMenuInteractionConfigurationForMenuAtLocation​(UIContextMenuInteraction interaction,
                                                                                               CGPoint location)
        Description copied from interface: UIContextMenuInteractionDelegate
        Called when the interaction begins.
        Specified by:
        contextMenuInteractionConfigurationForMenuAtLocation in interface UIContextMenuInteractionDelegate
        Parameters:
        interaction - The UIContextMenuInteraction.
        location - The location of the interaction in its view.
        Returns:
        A UIContextMenuConfiguration describing the menu to be presented. Return nil to prevent the interaction from beginning. Returning an empty configuration causes the interaction to begin then fail with a cancellation effect. You might use this to indicate to users that it's possible for a menu to be presented from this view, but that there are no actions to present at this particular time.
      • contextMenuInteractionPreviewForDismissingMenuWithConfiguration

        public UITargetedPreview contextMenuInteractionPreviewForDismissingMenuWithConfiguration​(UIContextMenuInteraction interaction,
                                                                                                 UIContextMenuConfiguration configuration)
        Description copied from interface: UIContextMenuInteractionDelegate
        Called when the interaction is about to dismiss. Return a UITargetedPreview describing the desired dismissal target. The interaction will animate the presented menu to the target. Use this to customize the dismissal animation.
        Specified by:
        contextMenuInteractionPreviewForDismissingMenuWithConfiguration in interface UIContextMenuInteractionDelegate
        Parameters:
        interaction - The UIContextMenuInteraction requesting a dismissal preview.
        configuration - The configuration of the menu displayed by this interaction.
        Returns:
        Return a UITargetedPreview describing the desired dismissal target. Return nil to cause the menu to animate away without morphing into a specific view.
      • enumerateEventHandlers

        public void enumerateEventHandlers​(UIControl.Block_enumerateEventHandlers iterator)
        Iterate over the event handlers installed on this control at the time this method is called. For each call, either actionHandler or action will be non-nil. controlEvents is always non-zero. Setting *stop to YES will terminate the enumeration early. It is legal to manipulate the control's event handlers within the block.
      • initWithFramePrimaryAction

        public UIControl initWithFramePrimaryAction​(CGRect frame,
                                                    UIAction primaryAction)
        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.
      • isContextMenuInteractionEnabled

        public boolean isContextMenuInteractionEnabled()
        Specifies if the context menu interaction is enabled. NO by default.
      • menuAttachmentPointForConfiguration

        public CGPoint menuAttachmentPointForConfiguration​(UIContextMenuConfiguration configuration)
        Return a point in this control's coordinate space to which to attach the given configuration's menu.
      • removeActionForControlEvents

        public void removeActionForControlEvents​(UIAction action,
                                                 long controlEvents)
        Removes the action from the set of passed control events.
      • removeActionForIdentifierForControlEvents

        public void removeActionForIdentifierForControlEvents​(java.lang.String actionIdentifier,
                                                              long controlEvents)
        Removes the action with the provided identifier from the set of passed control events.
      • sendAction

        public void sendAction​(UIAction action)
        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.
      • setContextMenuInteractionEnabled

        public void setContextMenuInteractionEnabled​(boolean value)
        Specifies if the context menu interaction is enabled. NO by default.
      • setShowsMenuAsPrimaryAction

        public void setShowsMenuAsPrimaryAction​(boolean value)
        If the contextMenuInteraction is the primary action of the control, invoked on touch-down. NO by default.
      • showsMenuAsPrimaryAction

        public boolean showsMenuAsPrimaryAction()
        If the contextMenuInteraction is the primary action of the control, invoked on touch-down. NO by default.