UIView 02

最近发现UIView最基本的一些内容都没有理解好,因此打算阅读官方文档的同时也把自己所学习的记录下来。
https://developer.apple.com/documentation/uikit/uiview

UIView
a view object renders its content within its bounds rectangle and handles any interactions with that content.

Main Responsibilities:
drawing and animation
layout and subview management
event handling

drawRect
when actual of view content changes,it's your responsibility to notify the system to redraw setNeedsDisplay
define GLKView not UIView when use OpenGL EL for drawing

manipulations to your app's user interface must occur on main thread.the only time this may not necessary strictly occur is creating the view object itself.

你可能感兴趣的:(UIView 02)