转载: http://iosdevelopertips.com/debugging/how-to-use-nslog-to-debug-cgrect-and-cgpoint.html CGPoint and CGRect are structures (versus objects) and therefore the old NSLog standby %@ will not work as expected. Here is how each structure is defined: s
前言 结构体,这个结构体用来表示事物的坐标点和宽高度. public typealias NSRect = CGRect public struct CGRect { public var origin: CGPoint public var size: CGSize public init() public init(origin: CGPoint, size: CGSize) } 1.NSRect 结构体变量的创建与调用 // NSRect 结构体变量的创建与赋值 // 先定义变量,再赋值