iOS Developer Library

Developer

UIKit Framework Reference NSShadow Class Reference

Options
Deployment Target:

On This Page
Language:

NSShadow

An NSShadow object encapsulates the attributes used to create a drop shadow during drawing operations. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 6.0 and later.
  • The offset values of the shadow.

    Declaration

    Swift

    var shadowOffset: CGSize

    Objective-C

    @property(nonatomic, assign) CGSize shadowOffset

    Discussion

    This property contains the horizontal and vertical offset values, specified using the width and height fields of the CGSize data type. These offsets are measured using the default user coordinate space and are not affected by custom transformations. This means that positive values always extend down and to the right from the user's perspective.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Returns the offset values for the receiver.

    Declaration

    Swift

    var shadowOffset: CGSize

    Objective-C

    @property(nonatomic, assign) CGSize shadowOffset

    Return Value

    The horizontal and vertical offset values, specified using the width and height fields of the NSSize data type. These offsets are measured using the default user coordinate space and are not affected by custom transformations. This means that positive values always extend up and to the right from the user's perspective.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Sets the offset values for the receiver.

    Declaration

    Swift

    var shadowOffset: CGSize

    Objective-C

    @property(nonatomic, assign) CGSize shadowOffset

    Parameters

    offset

    The horizontal and vertical offset values, specified using the width and height fields of the NSSize data type. These offsets are measured using the default user coordinate space and are not affected by custom transformations. This means that positive values always extend up and to the right from the user's perspective.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • The blur radius of the shadow.

    Declaration

    Swift

    var shadowBlurRadius: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat shadowBlurRadius

    Discussion

    This property contains the blur radius, as measured in the default user coordinate space. A value of 0 indicates no blur, while larger values produce correspondingly larger blurring. The default value is 0.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Returns the blur radius of the receiver.

    Declaration

    Swift

    var shadowBlurRadius: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat shadowBlurRadius

    Return Value

    The blur radius, as measured in the default user coordinate space. A value of 0 indicates no blur, while larger values produce correspondingly larger blurring. The default value is 0.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Sets the blur radius of the receiver.

    Declaration

    Swift

    var shadowBlurRadius: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat shadowBlurRadius

    Parameters

    val

    The blur radius, as measured in the default user coordinate space. A value of 0 indicates no blur, while larger values produce correspondingly larger blurring. This value must not be negative.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • The color of the shadow.

    Declaration

    Swift

    var shadowColor: AnyObject?

    Objective-C

    @property(nonatomic, retain) id shadowColor

    Discussion

    The default shadow color is black with an alpha of 1/3. If you set this property to nil, the shadow is not drawn.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Returns the color for the receiver.

    Declaration

    Swift

    var shadowColor: AnyObject?

    Objective-C

    @property(nonatomic, retain) id shadowColor

    Return Value

    The current shadow color. A nil shadow color indicates the shadow is not to be drawn. The default shadow color is black with an alpha of 1/3.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

  • Sets the shadow color for the receiver.

    Declaration

    Swift

    var shadowColor: AnyObject?

    Objective-C

    @property(nonatomic, retain) id shadowColor

    Parameters

    color

    The shadow color, which must be convertible to an RGBA color. Specify nil if you do not want the shadow to be drawn. Your color may contain alpha information.

    Import Statement

    import UIKit

    Availability

    Available in iOS 6.0 and later.

    See Also

    – shadowColor