问题描述
我在别的地方看到这样一句话CALayer sits at a lower technical level than UIButton, which means it doesn’t understand what a UIColor is. UIButton knows what a UIColor is because they are both at the same technical level, but CALayer is below UIButton, so UIColor is a mystery.
问题解答
回答1:CGColor存在于较为底层的CoreGraphics框架中,它是一个结构体UIColor存在于相对CoreGraphics框架较高的UIKit框架中,他是一个类
CoreGraphics框架是可以跨平台使用的,UIKit框架仅限于iOS为了保证移植性以及框架的统一性,不能互用