> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/programming/languages/swift-and-ios/uiviewreference.md).

# UIViewReference

{% hint style="info" %}
iOS 앱에서 화면에 보이는 모든 것(객체)의 기본 블록(클래스)\
즉, 화면에 표시되는 모든 것이 UIView 또는 그 서브클래스의 인스턴스이다.\
사각형 영역으로 화면에 컨텐츠를 그리고, 이벤트에 반응하며, 애니메이션을 표시하는 기능을 가진다.
{% endhint %}

## 기본 프로퍼티

* `frame`: 뷰의 위치와 크기를 정의 (부모 뷰의 좌표 시스템에서, 글로벌 좌표계)
  * UIView의 위치나 크기를 설정하는 경우에 사용
* `bounds`: 뷰 자체의 좌표 시스템에서의 위치와 크기를 정의 (로컬 좌표계)
  * 하위 뷰를 정렬하는 등 내부적으로 변경되는 경우에 사용
* `center`: 부모 뷰에 대한 중심의 좌표(위치)
* `backgroundColor`: 배경 색
* `alpha`: 투명도 (0.0 \~ 1.0 사이 값)
* `isHidden`: 뷰의 표시 여부

## 주요 메서드

* `addSubview(_:)`: 다른 뷰의 자식으로 추가
* `removeFromSuperview()`: 뷰를 부모로부터 제거
* `setNeedsDisplay()`: 뷰 다시 그리기를 요청하는 메서드, `draw(_:)` 메서드 호출


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/programming/languages/swift-and-ios/uiviewreference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
