Class: CAShapeLayer
Overview
The CAShapeLayer class draws a cubic Bezier spline in its coordinate space. The shape is composited between the layer's contents and its first sublayer.
Instance Attribute Summary (collapse)
-
- fillColor
The color used to fill the shape’s path.
-
- fillRule
The fill rule used when filling the shape’s path.
-
- lineCap
Specifies the line cap style for the shape’s path.
-
- lineDashPattern
The dash pattern applied to the shape’s path when stroked.
-
- lineDashPhase
The dash phase applied to the shape’s path when stroked.
-
- lineJoin
Specifies the line join style for the shape’s path.
-
- lineWidth
Specifies the line width of the shape’s path.
-
- miterLimit
The miter limit used when stroking the shape’s path.
-
- path
The path defining the shape to be rendered.
-
- strokeColor
The color used to stroke the shape’s path.
-
- strokeEnd
The relative location at which to stop stroking the path.
-
- strokeStart
The relative location at which to begin stroking the path.
Attributes inherited from CALayer
#actions, #anchorPoint, #anchorPointZ, #backgroundColor, #backgroundFilters, #borderColor, #borderWidth, #bounds, #compositingFilter, #contents, #contentsCenter, #contentsGravity, #contentsRect, #contentsScale, #cornerRadius, #delegate, #doubleSided, #drawsAsynchronously, #edgeAntialiasingMask, #filters, #frame, #geometryFlipped, #hidden, #magnificationFilter, #mask, #masksToBounds, #minificationFilter, #minificationFilterBias, #name, #needsDisplayOnBoundsChange, #opacity, #opaque, #position, #rasterizationScale, #shadowColor, #shadowOffset, #shadowOpacity, #shadowPath, #shadowRadius, #shouldRasterize, #style, #sublayerTransform, #sublayers, #superlayer, #transform, #visibleRect, #zPosition
Method Summary
Methods inherited from CALayer
#actionForKey:, #addAnimation:forKey:, #addSublayer:, #affineTransform, #animationForKey:, #animationKeys, #containsPoint:, #contentsAreFlipped, #convertPoint:fromLayer:, #convertPoint:toLayer:, #convertRect:fromLayer:, #convertRect:toLayer:, #convertTime:fromLayer:, #convertTime:toLayer:, defaultActionForKey:, defaultValueForKey:, #display, #displayIfNeeded, #drawInContext:, #hitTest:, #init, #initWithLayer:, #insertSublayer:above:, #insertSublayer:atIndex:, #insertSublayer:below:, layer, #layoutIfNeeded, #layoutSublayers, #modelLayer, #needsDisplay, needsDisplayForKey:, #needsLayout, #preferredFrameSize, #presentationLayer, #removeAllAnimations, #removeAnimationForKey:, #removeFromSuperlayer, #renderInContext:, #replaceSublayer:with:, #scrollPoint:, #scrollRectToVisible:, #setAffineTransform:, #setNeedsDisplay, #setNeedsDisplayInRect:, #setNeedsLayout, #shouldArchiveValueForKey:
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (CGColorRef) fillColor
The color used to fill the shape’s path. Animatable. Setting fillColor to nil results in no fill being rendered. Default is opaque black.
- (String) fillRule
The fill rule used when filling the shape’s path. The possible values are shown in “Shape Fill Mode Values.” The default is kCAFillRuleNonZero. See “Winding Rules” in Cocoa Drawing Guide for examples of the two fill rules.
- (String) lineCap
Specifies the line cap style for the shape’s path. The line cap style specifies the shape of the endpoints of an open path when stroked. The supported values are described in “Line Cap Values.” Figure 1 shows the appearance of the available line cap styles.Figure 1 Line cap styles The default is kCALineCapButt.
- (Array) lineDashPattern
The dash pattern applied to the shape’s path when stroked. The dash pattern is specified as an array of NSNumber objects that specify the lengths of the painted segments and unpainted segments, respectively, of the dash pattern.For example, passing an array with the values [2,3] sets a dash pattern that alternates between a 2-user-space-unit-long painted segment and a 3-user-space-unit-long unpainted segment. Passing the values [1,3,4,2] sets the pattern to a 1-unit painted segment, a 3-unit unpainted segment, a 4-unit painted segment, and a 2-unit unpainted segment.Default is nil, a solid line.
- (Float) lineDashPhase
The dash phase applied to the shape’s path when stroked. Animatable. Line dash phase specifies how far into the dash pattern the line starts.Default is 0.
- (String) lineJoin
Specifies the line join style for the shape’s path. The line join style specifies the shape of the joints between connected segments of a stroked path. The supported values are described in “Line Join Values.” Figure 2 shows the appearance of the available line join styles.Figure 2 Line join stylesThe default is kCALineJoinMiter.
- (Float) lineWidth
Specifies the line width of the shape’s path. Animatable.
- (Float) miterLimit
The miter limit used when stroking the shape’s path. Animatable. If the current line join style is set to kCALineJoinMiter (see lineJoin), the miter limit determines whether the lines should be joined with a bevel instead of a miter. The length of the miter is divided by the line width. If the result is greater than the miter limit, the path is drawn with a bevel.Default is 10.0.
- (CGPathRef) path
The path defining the shape to be rendered. Animatable. Unlike most animatable properties, path (as with all CGPathRef animatable properties) does not support implicit animation. The path object may be animated using any of the concrete subclasses of CAPropertyAnimation. Paths will interpolate as a linear blend of the “on-line” points; “off-line” points may be interpolated non-linearly (e.g. to preserve continuity of the curve’s derivative). If the two paths have a different number of control points or segments the results are undefined. If the path extends outside the layer bounds it will not automatically be clipped to the layer, only if the normal layer masking rules cause that.If the value in this property is non-nil, the path is created using the specified path instead of the layer’s composited alpha channel. The path defines the outline of the shape layer. It is filled using the non-zero winding rule and the current color, opacity, and blur radius. Specifying an explicit path usually improves rendering performance.The default value of this property is NULL.
- (CGColorRef) strokeColor
The color used to stroke the shape’s path. Animatable. Setting strokeColor to nil results in no stroke being rendered. Default is nil.
- (Float) strokeEnd
The relative location at which to stop stroking the path. Animatable. The value of this property must be in the range 0.0 to 1.0. The default value of this property is 1.0. Combined with the strokeStart property, this property defines the subregion of the path to stroke. The value in this property indicates the relative point along the path at which to finish stroking while the strokeStart property defines the starting point. A value of 0.0 represents the beginning of the path while a value of 1.0 represents the end of the path. Values in between are interpreted linearly along the path length.
- (Float) strokeStart
The relative location at which to begin stroking the path. Animatable. The value of this property must be in the range 0.0 to 1.0. The default value of this property is 0.0. Combined with the strokeEnd property, this property defines the subregion of the path to stroke. The value in this property indicates the relative point along the path at which to begin stroking while the strokeEnd property defines the end point. A value of 0.0 represents the beginning of the path while a value of 1.0 represents the end of the path. Values in between are interpreted linearly along the path length.