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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。