The outline of a 2D shape.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Swift
UI
Declaration
@frozen struct Path
The outline of a 2D shape.
SDKs
Framework
@frozen struct Path
func offset(x: CGFloat, y: CGFloat) -> Offset Shape<Path>
Changes the relative position of this shape using the specified coordinates.
init()
Creates an empty path.
init(CGMutable Path)
Creates a path from a copy of a mutable shape path.
init(CGPath)
Creates a path from an immutable shape path.
init((inout Path) -> ())
Creates an empty path, and then executes the closure to add the initial elements.
init(CGRect)
Creates a path as the given rectangle.
init(ellipse In: CGRect)
Creates a path as an ellipse inscribed within the given rectangle.
init(rounded Rect: CGRect, corner Radius: CGFloat, style: Rounded Corner Style)
Creates a path as the given rounded rectangle.
init(rounded Rect: CGRect, corner Size: CGSize, style: Rounded Corner Style)
Creates a path as the given rounded rectangle.
var animatable Data: Empty Animatable Data
The data to be animated.
var bounding Rect: CGRect
A rectangle containing all path segments.
var cg Path: CGPath
An immutable path representing the elements in the path.
var is Empty: Bool
A Boolean value indicating whether the path contains zero elements.
func add Arc(center: CGPoint, radius: CGFloat, start Angle: Angle, end Angle: Angle, clockwise: Bool, transform: CGAffine Transform)
Adds an arc of a circle to the path, specified with a radius and angles.
func add Arc(tangent1End: CGPoint, tangent2End: CGPoint, radius: CGFloat, transform: CGAffine Transform)
Adds an arc of a circle to the path, specified with a radius and two tangent lines.
func add Curve(to: CGPoint, control1: CGPoint, control2: CGPoint)
Adds a cubic Bézier curve to the path, with the specified end point and control points.
func add Ellipse(in: CGRect, transform: CGAffine Transform)
Adds an ellipse to the path.
func add Line(to: CGPoint)
Appends a straight line segment from the current point to the specified point.
func add Lines([CGPoint])
Adds a sequence of connected straight-line segments to the path.
func add Path(Path, transform: CGAffine Transform)
Appends a copy of path to the path.
func add Quad Curve(to: CGPoint, control: CGPoint)
Adds a quadratic Bézier curve to the path, with the specified end point and control point.
func add Rect(CGRect, transform: CGAffine Transform)
Adds a rectangular subpath to the path.
func add Rects([CGRect], transform: CGAffine Transform)
Adds a sequence of rectangular subpaths to the path.
func add Relative Arc(center: CGPoint, radius: CGFloat, start Angle: Angle, delta: Angle, transform: CGAffine Transform)
Adds an arc of a circle to the path, specified with a radius and a difference in angle.
func add Rounded Rect(in: CGRect, corner Size: CGSize, style: Rounded Corner Style, transform: CGAffine Transform)
Adds a rounded rectangle to the path.
func applying(CGAffine Transform) -> Path
Returns a path constructed by applying the transform to all points of the path.
func close Subpath()
Closes and completes the current subpath.
func contains(CGPoint, eo Fill: Bool) -> Bool
Returns true if the path contains a specified point.
func for Each((Path .Element) -> Void)
Calls body
with each element in the path.
func move(to: CGPoint)
Begins a new subpath at the specified point.
func offset(CGSize) -> Offset Shape<Path>
Changes the relative position of this shape using the specified size.
func offset(CGPoint) -> Offset Shape<Path>
Changes the relative position of this shape using the specified point.
func offset By(dx: CGFloat, dy: CGFloat) -> Path
Returns a path constructed by translating self
by (dx, dy)
.
func rotation(Angle, anchor: Unit Point) -> Rotated Shape<Path>
Rotates this shape around an anchor point at the angle you specify.
func scale(CGFloat, anchor: Unit Point) -> Scaled Shape<Path>
Scales this shape without changing its bounding frame.
func scale(x: CGFloat, y: CGFloat, anchor: Unit Point) -> Scaled Shape<Path>
Scales this shape without changing its bounding frame.
func stroked Path(Stroke Style) -> Path
Returns a stroked copy of the path using style
to define how the stroked outline is created.
func transform(CGAffine Transform) -> Transformed Shape<Path>
Applies an affine transform to this shape.
func trimmed Path(from: CGFloat, to: CGFloat) -> Path
Returns a partial copy of the path.
static func != (Path, Path) -> Bool
Returns a Boolean value indicating whether two values are not equal.
enum Path .Element
An element of a path.
func frame(width: CGFloat?, height: CGFloat?, alignment: Alignment) -> View
Positions the view within an invisible frame with the specified size.
func frame(min Width: CGFloat?, ideal Width: CGFloat?, max Width: CGFloat?, min Height: CGFloat?, ideal Height: CGFloat?, max Height: CGFloat?, alignment: Alignment) -> View
Positions the view within an invisible frame with the specified width and height.
func fixed Size() -> View
Fixes the view at its ideal size.
func fixed Size(horizontal: Bool, vertical: Bool) -> View
Fixes the view at its ideal size in the specified dimensions.
func layout Priority(Double) -> View
Sets the priority by which a parent layout should apportion space to the child.
func position(CGPoint) -> View
Fixes the center of the view at the specified point in its parent’s coordinate space.
func position(x: CGFloat, y: CGFloat) -> View
Fixes the center of the view at the specified coordinates in its parent’s coordinate space.
func offset(CGSize) -> View
Offsets the view by the horizontal and vertical distances in the given size.
func edges Ignoring Safe Area(Edge .Set) -> View
Extends the view out of the safe area on the specified edges.
func coordinate Space<T>(name: T) -> View
Assigns a name to this view’s coordinate space to which descendants of this view can refer.
func alignment Guide(Horizontal Alignment, compute Value: (View Dimensions) -> CGFloat) -> View
Sets the view’s horizontal alignment.
func alignment Guide(Vertical Alignment, compute Value: (View Dimensions) -> CGFloat) -> View
Sets the view’s vertical alignment.
func padding(CGFloat) -> View
Pads the view along all edge insets by the specified amount.
func padding(Edge Insets) -> View
Pads the view using the specified edge insets.
func padding(Edge .Set, CGFloat?) -> View
Pads the view using the specified edge insets.
func overlay<Overlay>(Overlay, alignment: Alignment) -> View
Layers a secondary view in front of the view.
func z Index(Double) -> View
Controls the display order of overlapping views.
func border<S>(S, width: CGFloat) -> View
Adds a border to the view with the specified style and width.
func clipped(antialiased: Bool) -> View
Clips the view to its bounding rectangular frame.
func clip Shape<S>(S, style: Fill Style) -> View
Sets a clipping shape for the view.
func corner Radius(CGFloat, antialiased: Bool) -> View
Clips the view to its bounding frame, with the specified corner radius.
func mask<Mask>(Mask) -> View
Masks this view using the alpha channel of the given view.
func scaled To Fill() -> View
Scales the view to fill its parent.
func scaled To Fit() -> View
Scales the view to fit its parent.
func scale Effect(CGFloat, anchor: Unit Point) -> View
Scales this view’s rendered output by the given amount in both the horizontal and vertical directions, relative to an anchor point.
func scale Effect(CGSize, anchor: Unit Point) -> View
Scales this view’s rendered output by the given vertical and horizontal size amounts, relative to an anchor point.
func scale Effect(x: CGFloat, y: CGFloat, anchor: Unit Point) -> View
Scales this view’s rendered output by the given horizontal and vertical amounts, relative to an anchor point.
func aspect Ratio(CGFloat?, content Mode: Content Mode) -> View
Constrains the view’s dimensions to the specified aspect ratio.
func aspect Ratio(CGSize, content Mode: Content Mode) -> View
Constrains the view’s dimensions to the aspect ratio of the specified size.
func image Scale(Image .Scale) -> View
Sets the scale of images inside the view.
func rotation Effect(Angle, anchor: Unit Point) -> View
Rotates this view’s rendered output around the specified point.
func rotation3DEffect(Angle, axis: (x: CGFloat, y: CGFloat, z: CGFloat), anchor: Unit Point, anchor Z: CGFloat, perspective: CGFloat) -> View
Rotates this view’s rendered output in three dimensions around the given axis of rotation.
func projection Effect(Projection Transform) -> View
Applies a projection transformation to this view’s rendered output.
func transform Effect(CGAffine Transform) -> View
Applies an affine transformation to this view’s rendered output.
func keyboard Type(UIKeyboard Type) -> View
Sets the keyboard type for this view.
func font(Font?) -> View
Sets the default font for text in the view.
func line Limit(Int?) -> View
Sets the maximum number of lines that text can occupy in the view.
func line Spacing(CGFloat) -> View
Sets the amount of space between lines of text in the view.
func minimum Scale Factor(CGFloat) -> View
Sets the minimum amount that text scales down to fit the available space.
func truncation Mode(Text .Truncation Mode) -> View
Sets the truncation mode for lines of text that are too long to fit in the available space.
func allows Tightening(Bool) -> View
Sets whether text can compress the space between characters when necessary to fit text in a line.
func text Content Type(UIText Content Type?) -> View
Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on an iOS or tvOS device.
func text Content Type(WKText Content Type?) -> View
Sets the text content type for this view, which the system uses to offer suggestions while the user enters text on a watchOS device.
func flips For Right To Left Layout Direction(Bool) -> View
Sets whether the view flips its contents horizontally when the layout direction is right-to-left.
func autocapitalization(UIText Autocapitalization Type) -> View
Sets whether to apply auto-capitalization to this view.
func disable Autocorrection(Bool?) -> View
Sets whether to disable autocorrection for this view.
func animation(Animation?) -> View
Applies the given animation to all animatable values within the view.
func animation<V>(Animation?, value: V) -> View
Applies the given animation to the view when the specified value changes.
func transition(Any Transition) -> View
Associates a transition with the view.
func on Tap Gesture(count: Int, perform: () -> Void) -> View
Adds an action to perform when this view recognizes a tap gesture.
func on Long Press Gesture(minimum Duration: Double, maximum Distance: CGFloat, pressing: ((Bool) -> Void)?, perform: () -> Void) -> View
Adds an action to perform when this view recognizes a long press gesture.
func gesture<T>(T, including: Gesture Mask) -> View
Attaches a gesture to the view with a lower precedence than gestures defined by the view.
func high Priority Gesture<T>(T, including: Gesture Mask) -> View
Attaches a gesture to the view with a higher precedence than gestures defined by the view.
func simultaneous Gesture<T>(T, including: Gesture Mask) -> View
Attaches a gesture to the view to process simultaneously with gestures defined by the view.
func digital Crown Rotation<V>(Binding<V>) -> View
Tracks Digital Crown rotations by updating the specified binding.
func digital Crown Rotation<V>(Binding<V>, from: V, through: V, by: V .Stride?, sensitivity: Digital Crown Rotational Sensitivity, is Continuous: Bool, is Haptic Feedback Enabled: Bool) -> View
Tracks Digital Crown rotations by updating the specified binding.
func transaction((inout Transaction) -> Void) -> View
Applies the given transaction mutation function to all transactions used within the view.
func on Appear(perform: (() -> Void)?) -> View
Adds an action to perform when the view appears.
func on Disappear(perform: (() -> Void)?) -> View
Adds an action to perform when the view disappears.
func on Cut Command(perform: (() -> [NSItem Provider])?) -> View
Adds an action to perform in response to the system’s Cut command.
func on Copy Command(perform: (() -> [NSItem Provider])?) -> View
Adds an action to perform in response to the system’s Copy command.
func on Paste Command(of: [String], perform: ([NSItem Provider]) -> Void) -> View
Adds an action to perform in response to the system’s Paste command.
func on Paste Command<Payload>(of: [String], validator: ([NSItem Provider]) -> Payload?, perform: (Payload) -> Void) -> View
Adds an action to perform in response to the system’s Paste command with items that you validate.
func on Delete Command(perform: (() -> Void)?) -> View
Adds an action to perform in response to the system’s Delete command.
func on Move Command(perform: ((Move Command Direction) -> Void)?) -> View
Adds an action to perform in response to a move command, like when the user presses an arrow key on a Mac keyboard, or taps the edge of the Siri Remote when controlling an Apple TV.
func on Exit Command(perform: (() -> Void)?) -> View
Sets up an action that triggers in response to receiving the exit command while the view has focus.
func on Play Pause Command(perform: (() -> Void)?) -> View
Adds an action to perform in response to the system’s Play/Pause command.
func on Command(Selector, perform: (() -> Void)?) -> View
Adds an action to perform in response to the given selector.
func delete Disabled(Bool) -> View
Adds a condition for whether the view’s view hierarchy is deletable.
func move Disabled(Bool) -> View
Adds a condition for whether the view's view hierarchy is movable.
func on Receive<P>(P, perform: (P .Output) -> Void) -> View
Adds an action to perform when this view detects data emitted by the given publisher.
func on Hover(perform: (Bool) -> Void) -> View
Adds an action to perform when the user moves the pointer over or away from the view’s frame.
func focusable(Bool, on Focus Change: (Bool) -> Void) -> View
Specifies if the view is focusable and, if so, adds an action to perform when the view comes into focus.
func on Drag(() -> NSItem Provider) -> View
Activates the view as the source of a drag and drop operation.
func on Drop(of: [String], delegate: Drop Delegate) -> View
Defines the destination of a drag and drop operation with the same size and position as the view using behavior controlled by the given delegate.
func on Drop(of: [String], is Targeted: Binding<Bool>?, perform: ([NSItem Provider], CGPoint) -> Bool) -> View
Defines the destination of a drag and drop operation with the same size and position as the view by handling dropped content and the drop location with the specified closure.
func on Drop(of: [String], is Targeted: Binding<Bool>?, perform: ([NSItem Provider]) -> Bool) -> View
Defines the destination for a drag and drop operation with the same size and position as the view by handling dropped content with the specified closure.
func item Provider(Optional<() -> NSItem Provider?>) -> View
Provides a closure that vends the drag representation to be used for a particular data element.
func sheet<Content>(is Presented: Binding<Bool>, on Dismiss: (() -> Void)?, content: () -> Content) -> View
Presents a sheet when a given condition is true.
func sheet<Item, Content>(item: Binding<Item?>, on Dismiss: (() -> Void)?, content: (Item) -> Content) -> View
Presents a sheet using the given item as a data source for the sheet’s content.
func action Sheet(is Presented: Binding<Bool>, content: () -> Action Sheet) -> View
Presents an action sheet when a given condition is true.
func action Sheet<T>(item: Binding<T?>, content: (T) -> Action Sheet) -> View
Presents an action sheet using the given item as a data source for the sheet’s content.
func alert(is Presented: Binding<Bool>, content: () -> Alert) -> View
Presents an alert to the user.
func alert<Item>(item: Binding<Item?>, content: (Item) -> Alert) -> View
Presents an alert to the user.
func popover<Content>(is Presented: Binding<Bool>, attachment Anchor: Popover Attachment Anchor, arrow Edge: Edge, content: () -> Content) -> View
Presents a popover when a given condition is true.
func popover<Item, Content>(item: Binding<Item?>, attachment Anchor: Popover Attachment Anchor, arrow Edge: Edge, content: (Item) -> Content) -> View
Presents a popover using the given item as a data source for the popover’s content.
func foreground Color(Color?) -> View
Sets the color that the view uses for foreground elements.
func accent Color(Color?) -> View
Sets the accent color for the view and the views it contains.
func color Scheme(Color Scheme) -> View
Sets the view’s color scheme.
func preferred Color Scheme(Color Scheme?) -> View
Sets the preferred color scheme for this view.
func blur(radius: CGFloat, opaque: Bool) -> View
Applies a Gaussian blur to the view.
func opacity(Double) -> View
Sets the transparency of the view.
func brightness(Double) -> View
Brightens the view by the specified amount.
func contrast(Double) -> View
Sets the contrast and separation between similar colors in the view.
func color Invert() -> View
Inverts the colors in the view.
func color Multiply(Color) -> View
Adds a color multiplication effect to the view.
func saturation(Double) -> View
Adjusts the color saturation of the view.
func grayscale(Double) -> View
Adds a grayscale effect to the view.
func hue Rotation(Angle) -> View
Applies a hue rotation effect to the view.
func luminance To Alpha() -> View
Adds a luminance to alpha effect to the view.
func shadow(color: Color, radius: CGFloat, x: CGFloat, y: CGFloat) -> View
Adds a shadow to the view.
func blend Mode(Blend Mode) -> View
Sets the blend mode for compositing the view with overlapping views.
func compositing Group() -> View
Wraps the view in a compositing group.
func drawing Group(opaque: Bool, color Mode: Color Rendering Mode) -> View
Composites the view’s contents into an offscreen image before final display.
func labels Hidden() -> View
Hides the labels of any controls contained within this view.
func default Wheel Picker Item Height(CGFloat) -> View
Sets the default wheel-style picker item height.
func horizontal Radio Group Layout() -> View
Sets the style for radio group style pickers within the view’s environment to be radio buttons horizontally arranged inside of the layout.
func control Size(Control Size) -> View
Sets the size class, like regular or small, for controls within this view.
func button Style<S>(S) -> View
Sets the style for buttons within this view.
func button Style<S>(S) -> View
Sets the style for buttons within this view.
func menu Button Style<S>(S) -> View
Sets the style for menu buttons within this view.
func picker Style<S>(S) -> View
Sets the style for pickers within this view.
func date Picker Style<S>(S) -> View
Sets the style for date pickers within this view.
func text Field Style<S>(S) -> View
Sets the style for text fields within this view.
func toggle Style<S>(S) -> View
Sets the style for toggles within this view.
func list Style<S>(S) -> View
Sets the style for lists within this view.
func navigation View Style<S>(S) -> View
Sets the style for navigation views within this view.
func list Row Insets(Edge Insets?) -> View
Sets the inset to be applied to the view when placed in a list.
func list Row Background<V>(V?) -> View
Sets a view behind the view when placed in a list.
func list Row Platter Color(Color?) -> View
Sets the color to apply to the system cell platter of the view when placed in a list.
func tag<V>(V) -> View
Sets a tag for the view in order to differentiate it from a list of view options.
func navigation Bar Title(Text) -> View
Configures the title in the navigation bar for the view.
func navigation Bar Title(Text, display Mode: Navigation Bar Item .Title Display Mode) -> View
Configures the title of the navigation bar for the view.
func navigation Bar Title(Localized String Key) -> View
Configures the title of this view's navigation bar with a localized string.
func navigation Bar Title<S>(S) -> View
Configures the title of this view’s navigation bar with a string.
func navigation Bar Title(Localized String Key, display Mode: Navigation Bar Item .Title Display Mode) -> View
Configures the title of this view's navigation bar with a localized string and a display mode.
func navigation Bar Hidden(Bool) -> View
Hides the navigation bar for the view.
func status Bar(hidden: Bool) -> View
Sets the visibility of the status bar for the view.
func navigation Bar Back Button Hidden(Bool) -> View
Hides the navigation bar back button for the view.
func navigation Bar Items<L>(leading: L) -> View
Configures the navigation bar items for the view.
func navigation Bar Items<L, T>(leading: L, trailing: T) -> View
Configures the navigation bar items for the view.
func navigation Bar Items<T>(trailing: T) -> View
Configures the navigation bar items for the view.
func tab Item<V>(() -> V) -> View
Sets the tab bar item associated with this view.
func context Menu<Menu Items>(Context Menu<Menu Items>?) -> View
Attaches a contextual menu and its children to the view.
func context Menu<Menu Items>(menu Items: () -> Menu Items) -> View
Attaches a contextual menu to the view.
func touch Bar<Content>(content: () -> Content) -> View
Sets the content that the Touch Bar displays.
func touch Bar<Content>(Touch Bar<Content>) -> View
Sets the touch bar and its content to be shown in the Touch Bar when applicable.
func touch Bar Item Principal(Bool) -> View
Sets the view as having special significance to the TouchBar.
func touch Bar Customization Label(Text) -> View
Sets a user-visible string identifying the view’s functionality.
func touch Bar Item Presence(Touch Bar Item Presence) -> View
Sets the behavior of the view when being customized by the user.
func hidden() -> View
Hides the view.
func disabled(Bool) -> View
Adds a condition for whether users can interact with the view.
func accessibility(label: Text) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds a label to the view that describes its contents.
func accessibility(value: Text) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds a textual description of the value that the view contains.
func accessibility(hidden: Bool) -> Modified Content<Path, Accessibility Attachment Modifier>
Specifies whether to hide this view from system accessibility features.
func accessibility(identifier: String) -> Modified Content<Path, Accessibility Attachment Modifier>
Uses the specified string to identify the view.
func accessibility(selection Identifier: Any Hashable) -> Modified Content<Path, Accessibility Attachment Modifier>
Sets a selection identifier for this view’s accessibility element.
func accessibility(hint: Text) -> Modified Content<Path, Accessibility Attachment Modifier>
Communicates to the user what happens after performing the view’s action.
func accessibility(activation Point: Unit Point) -> Modified Content<Path, Accessibility Attachment Modifier>
Specifies the unit point where activations occur in a view that’s an accessibility element.
func accessibility(activation Point: CGPoint) -> Modified Content<Path, Accessibility Attachment Modifier>
Specifies the point where activations occur in a view that’s an accessibility element.
func accessibility Action(Accessibility Action Kind, () -> Void) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds an accessibility action to this view.
func accessibility Action(named: Text, () -> Void) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds a custom accessibility action to the view.
func accessibility Adjustable Action((Accessibility Adjustment Direction) -> Void) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds an accessibility adjustable action to the view.
func accessibility Scroll Action((Edge) -> Void) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds an accessibility scroll action to the view.
func accessibility Element(children: Accessibility Child Behavior) -> View
Wraps this view as a new accessibility element.
func accessibility(add Traits: Accessibility Traits) -> Modified Content<Path, Accessibility Attachment Modifier>
Adds information about how the view behaves.
func accessibility(remove Traits: Accessibility Traits) -> Modified Content<Path, Accessibility Attachment Modifier>
Removes view behavior information that doesn’t apply to the view.
func accessibility(sort Priority: Double) -> Modified Content<Path, Accessibility Attachment Modifier>
Sets the sort priority order for this view’s accessibility element, relative to other elements at the same level.
func preference<K>(key: K .Type, value: K .Value) -> View
Sets a value to return for the given preference key when accessed by ancestors.
func transform Preference<K>(K .Type, (inout K .Value) -> Void) -> View
Sets a callback to return a value for the given preference key when accessed by ancestors.
func on Preference Change<K>(K .Type, perform: (K .Value) -> Void) -> View
Adds an action to perform when the specified preference key’s value changes.
func background Preference Value<Key, T>(Key .Type, (Key .Value) -> T) -> View
Uses the specified preference value from the view to produce another view as a background to the first view.
func overlay Preference Value<Key, T>(Key .Type, (Key .Value) -> T) -> View
Uses the specified preference value from the view to produce another view as an overlay atop the first view.
func environment<V>(Writable Key Path<Environment Values, V>, V) -> View
Sets the environment value indicated by a key path to the given value.
func transform Environment<V>(Writable Key Path<Environment Values, V>, transform: (inout V) -> Void) -> View
Transforms the environment value indicated by a key path with the given function.
func allows Hit Testing(Bool) -> View
Configures whether this view participates in hit test operations.
func content Shape<S>(S, eo Fill: Bool) -> View
Defines the content shape for hit testing.
func preview Device(Preview Device?) -> View
Overrides the device for a preview.
func preview Display Name(String?) -> View
Provides a user visible name shown in the editor.
func preview Layout(Preview Layout) -> View
Overrides the size of the container for the preview.
func id<ID>(ID) -> View
Generates a uniquely identified view that can be inserted or removed.
func equatable() -> Equatable View<Path>
Prevents the view from updating its child view when its new value is the same as its old value.
func modifier<T>(T) -> Modified Content<Path, T>
Applies a modifier to a view.
struct Rectangle
A rectangular shape aligned inside the frame of the view containing it.
enum Edge
An enumeration to indicate one edge of a rectangle.
struct Rounded Rectangle
A rectangular shape with rounded corners, aligned inside the frame of the view containing it.
struct Circle
A circle centered on the frame of the view containing it.
struct Ellipse
An ellipse aligned inside the frame of the view containing it.
struct Capsule
A capsule shape aligned inside the frame of the view containing it.