CGRect&& CGPoint

//判断点是否相等
bool CGPointEqualToPoint(CGPoint point1, CGPoint point2);
//判断大小是否相等
bool CGSizeEqualToSize(CGSize size1, CGSize size2);
//判断矩形框是否相等
bool CGRectEqualToRect(CGRect rect1, CGRect rect2);
//返回一个CGRect
CGRect CGRectStandardize(CGRect rect);  
//CGRectMake(1, 1, 1, 1)返回(1, 1, 1, 1)
//CGRectMake(1, 1, 1, -1)返回(1, 0, 1, 1)
//CGRectMake(1, 1, -1, 1)返回(0, 1, 1, 1)
//CGRectMake(1, 1, -1, -1)返回(0, 0, 1, 1)
//只有当width或height小于零时才有改变
//判断是否为空 既width或height为0 
bool CGRectIsEmpty(CGRect rect);
//判断是否为空 Null一般时执行某个方法后的返回值(例如两个不相交的CGRect执行相交方法(在下面)返回值为Null)
bool CGRectIsNull(CGRect rect)  
//判断是否为无穷大
bool CGRectIsInfinite(CGRect rect) 
//返回一个CGRect,x为原本的x-dx y为原本的y-dy  width为原本的width-2dx  height为原本的height-2dy
CGRect CGRectInset(CGRect rect, CGFloat dx, CGFloat dy)  
//情况与CGRectStandardize类似 
CGRect CGRectIntegral(CGRect rect) 
//两个CGRect的合集
CGRect CGRectUnion(CGRect r1, CGRect r2)
//两个CGRect的交集
CGRect CGRectIntersection(CGRect r1, CGRect r2) 
 //CGRect向x或y方向便宜  x>0向右偏 x<0向左 y>0向下偏 y<0向上   
CGRect CGRectOffset(CGRect rect, CGFloat dx, CGFloat dy);
void CGRectDivide(CGRect rect, CGRect *slice, CGRect *remainder,CGFloat amount, CGRectEdge edge);
 //判断point是否在rect内
bool CGRectContainsPoint(CGRect rect, CGPoint point)
//判断rect1是否包含rect2 
bool CGRectContainsRect(CGRect rect1, CGRect rect2)  
 //判断rect1和rect2是否相交
bool CGRectIntersectsRect(CGRect rect1, CGRect rect2)
//把点转换为不可变字典
CFDictionaryRefCGPointCreateDictionaryRepresentation(CGPoint point) 
//把字典转换为点,存在point里,成功返回true 其他false
bool CGPointMakeWithDictionaryRepresentation(CFDictionaryRef dict,CGPoint *point); 
//把CGSize转换为不可变字典
CFDictionaryRef CGSizeCreateDictionaryRepresentation(CGSize size);   
//把字典转换为CGSize,存在size里,成功返回true 其他false
bool CGSizeMakeWithDictionaryRepresentation(CFDictionaryRef dict,CGSize *size);  
//把CGRect转换为不可变字典
CFDictionaryRef CGRectCreateDictionaryRepresentation(CGRect);   
//把字典转换为CGSize,存在rect里,成功返回true 其他false
bool CGRectMakeWithDictionaryRepresentation(CFDictionaryRef dict,CGRect *rect);  
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容