---
title: "addSubview(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiview/addsubview(_:)"
---

# addSubview(_:)

Adds a view to the end of the receiver’s list of subviews.

## Declaration

```swift
func addSubview(_ view: UIView)
```

## Parameters

- `view`: The view to be added. After being added, this view appears on top of any other subviews.

## Discussion

Discussion This method establishes a strong reference to view and sets its next responder to the receiver, which is its new superview. Views can have only one superview. If view already has a superview and that view is not the receiver, this method removes the previous superview before making the receiver its new superview.

## See Also

### Managing the view hierarchy

- [superview](uikit/uiview/superview.md)
- [subviews](uikit/uiview/subviews.md)
- [window](uikit/uiview/window.md)
- [bringSubviewToFront(_:)](uikit/uiview/bringsubviewtofront(_:).md)
- [sendSubviewToBack(_:)](uikit/uiview/sendsubviewtoback(_:).md)
- [removeFromSuperview()](uikit/uiview/removefromsuperview().md)
- [insertSubview(_:at:)](uikit/uiview/insertsubview(_:at:).md)
- [insertSubview(_:aboveSubview:)](uikit/uiview/insertsubview(_:abovesubview:).md)
- [insertSubview(_:belowSubview:)](uikit/uiview/insertsubview(_:belowsubview:).md)
- [exchangeSubview(at:withSubviewAt:)](uikit/uiview/exchangesubview(at:withsubviewat:).md)
- [isDescendant(of:)](uikit/uiview/isdescendant(of:).md)
