Frame 과 Bounds는 UIView의 Instance property이다!!
근데 선언된 형태를 봤을 때 CGRect에 대한 이해가 필요할 것 같다.
또 CGRect를 알기 위해선 CGSize와 CGPoint도 알아야하고!!
A structure that contains a point in a two-dimensional coordinate system.
즉 2차원 좌표계의 점을 포함하는 구조체!
x축 y축 좌표계라 생각하면됨
A structure that contains width and height values
즉 너비와 높이 값을 포함하는 구조체!!
너비와 높이를 포함하기 때문에 사각형으로 생각하기 쉽지만 실제로는 그렇지 않음!
사각형의 모양이 있더라도 '어디'에 위치할 것인지에 대한 좌표가 없기 때문에!
A structure that contains the location and dimensions of a rectangle.
즉 사각형의 위치와 크기를 포함하는 구조체
CGSize와는 다르게, origin이 되는 [원점]이 존재한다
open var frame: CGRect
open var bounds: CGRect
CGRect를 통해서 frame 과 bounds는 사각형! 으로 그려진다는 걸 알 수 있다.
The frame rectangle, which describes the view's location and size in its superview's coordinate system.
정의 : SuperView(상위뷰)의 좌표 시스템 안에서 view의 위치와 크기를 나타낸다.
frame의 핵심! SuperView!! 슈퍼뷰는 한단계 위에 있는 상위뷰를 뜻함
The bounds rectangle, which describes the view's location and size in its own coordinate system.
View의 위치와 크기를 자신만의 좌표 시스템 안에서 나타낸다!!
Bounds는 ScrollView의 핵심 로직!!
에펙 offset 수치처럼 생각하면 쉽게 받아들여진다!!