Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface KDIBadgeView : UIView <KDIDynamicTypeObject>
    #else
    @interface KDIBadgeView : NSView
    #endif
    
    /**
     Set and get the highlighted state of the view.
     
     If `highlighted` is NO, `badgeForegroundColor` and `badgeBackgroundColor` are used to display the `badge` value. Otherwise, if `highlighted` is YES, `badgeHighlightedForegroundColor` and `badgeHighlightedBackgroundColor` are used to display the `badge` value.
     
     @warning *NOTE:* This property will get set automatically if the receiver is used within a `UITableViewCell`
     */
    @property (assign,nonatomic,getter=isHighlighted) BOOL highlighted;
    
    /**
     Set and get the badge value of the receiver.
     
     This value is displayed using `badgeForegroundColor` or `badgeHighlightedForegroundColor`, depending on the value of `highlighted`.
     */
    @property (copy,nonatomic,nullable) NSString *badge;
    
    /**
     Set and get the text color used to display `badge` value when `highlighted` is NO.
     
     The default is `[UIColor whiteColor]` or `[NSColor whiteColor]`.
     */
    #if (TARGET_OS_IPHONE)
    @property (strong,nonatomic,null_resettable) UIColor *badgeForegroundColor UI_APPEARANCE_SELECTOR;
    #else
    @property (strong,nonatomic,null_resettable) NSColor *badgeForegroundColor;
    #endif
    /**
     Set and get the background color used to display `badge` value when `highlighted` is NO.
     
     The default is `[UIColor blackColor]` or `[NSColor blackColor]`.
     */
    #if (TARGET_OS_IPHONE)
    @property (strong,nonatomic,null_resettable) UIColor *badgeBackgroundColor UI_APPEARANCE_SELECTOR;
    #else
    @property (strong,nonatomic,null_resettable) NSColor *badgeBackgroundColor;
    #endif
    
    /**
     Set and get the text color used to display `badge` value when `highlighted` is YES.
     
     The default is `[UIColor lightGrayColor]` or `[NSColor lightGrayColor]`.
     */
    #if (TARGET_OS_IPHONE)
    @property (strong,nonatomic,null_resettable) UIColor *badgeHighlightedForegroundColor UI_APPEARANCE_SELECTOR;
    #else
    @property (strong,nonatomic,null_resettable) NSColor *badgeHighlightedForegroundColor;
    #endif
    /**
     Set and get the background color used to display `badge` value when `highlighted` is YES.
     
     The default is `[UIColor whiteColor]` or `[NSColor whiteColor]`.
     */
    #if (TARGET_OS_IPHONE)
    @property (strong,nonatomic,null_resettable) UIColor *badgeHighlightedBackgroundColor UI_APPEARANCE_SELECTOR;
    #else
    @property (strong,nonatomic,null_resettable) NSColor *badgeHighlightedBackgroundColor;
    #endif
    
    /**
     Set and get the font used to display `badge` value.
     
     The default is `[UIFont boldSystemFontOfSize:17.0]` or `[NSFont boldSystemFontOfSize:17.0]`.
     */
    #if (TARGET_OS_IPHONE)
    @property (strong,nonatomic,null_resettable) UIFont *badgeFont UI_APPEARANCE_SELECTOR;
    #else
    @property (strong,nonatomic,null_resettable) NSFont *badgeFont;
    #endif
    /**
     Set and get the badge corner radius used to draw the rounded corners of the receiver.
     
     The default is 8.0.
     */
    #if (TARGET_OS_IPHONE)
    @property (assign,nonatomic) CGFloat badgeCornerRadius UI_APPEARANCE_SELECTOR;
    #else
    @property (assign,nonatomic) CGFloat badgeCornerRadius;
    #endif
    /**
     Set and get the edge insets used to layout the `badge` value text.
     
     The default is `UIEdgeInsetsMake(4.0, 8.0, 4.0, 8.0)` or `NSEdgeInsetsMake(4.0, 8.0, 4.0, 8.0)`.
     */
    #if (TARGET_OS_IPHONE)
    @property (assign,nonatomic) UIEdgeInsets badgeEdgeInsets UI_APPEARANCE_SELECTOR;
    #else
    @property (assign,nonatomic) NSEdgeInsets badgeEdgeInsets;
    #endif
    
    #if (!TARGET_OS_IPHONE)
    /**
     Equivalent to `-[UIView sizeThatFits:]` for cross platform reasons.
     
     @param size The preferred size of the receiver
     @return A new size that fits the receiver's subviews
     */
    - (NSSize)sizeThatFits:(NSSize)size;
    #endif
    
    @end
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface KDIGradientView : UIView
    #else
    @interface KDIGradientView : NSView
    #endif
    
    /**
     Set and get the colors of the underlying CAGradientLayer.
     
     The array should contain either UIColor or NSColor instances.
     */
    @property (copy,nonatomic,nullable) NSArray<KDIColor *> *colors;
    
    /**
     Set and get the locations of the underlying CAGradientLayer.
     
     The gradient stops are specified as values between 0 and 1. The values must be monotonically increasing. If nil, the stops are spread uniformly across the range. Defaults to nil.
     */
    @property (copy,nonatomic,nullable) NSArray<NSNumber *> *locations;
    
    /**
     The start point of the underlying CAGradientLayer.
     
     The point is defined in unit coordinate space.
     */
    @property (assign,nonatomic) KDIPoint startPoint;
    
    /**
     The end point of the underlying CAGradientLayer.
     
     The point is defined in the unit coordinate space.
     */
    @property (assign,nonatomic) KDIPoint endPoint;
    
    @end
  • KDIView is a UIView/NSView subclass that provides state change methods on macOS. It also conforms to KDIBorderedView, allowing it to display borders.

    See more

    Declaration

    Objective-C

    @interface KDIView : UIView <KDIBorderedView>