最近發(fā)現(xiàn)UIView最基本的一些內(nèi)容都沒有理解好,因此打算閱讀官方文檔的同時也把自己所學(xué)習(xí)的記錄下來。
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.