ToolFoundation.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // ToolFoundation.m
  3. // IntercontinentalHealth
  4. //
  5. // Created by zsj on 2018/5/11.
  6. // Copyright © 2018年 ITpower. All rights reserved.
  7. //
  8. #import "ToolFoundation.h"
  9. @implementation ToolFoundation
  10. CGRect CGRM(CGFloat x, CGFloat y, CGFloat width, CGFloat height){
  11. return CGRectMake(x, y, width, height);
  12. }
  13. CGRect CGRM_PS(CGPoint origin, CGSize size){
  14. return CGRM(origin.x, origin.y, size.width, size.height);
  15. }
  16. CGSize CGSM(CGFloat width, CGFloat height){
  17. return CGSizeMake(width, height);
  18. }
  19. CGSize CGSM_SOS(CGSize originSize, CGSize offSizeSize){
  20. return CGSizeMake(originSize.width + offSizeSize.width, originSize.height + offSizeSize.height);
  21. }
  22. CGPoint CGPM(CGFloat x, CGFloat y){
  23. return CGPointMake(x, y);
  24. }
  25. CGPoint CGPM_POP(CGPoint originPoint, CGPoint offsetPoint){
  26. return CGPM(originPoint.x + offsetPoint.x, originPoint.y + offsetPoint.y);
  27. }
  28. CGPoint centerOfSize(CGSize size){
  29. return CGPM(size.width/2.f, size.height/2.f);
  30. }
  31. CGFloat CGFG_ScreenWidth()
  32. {
  33. return [UIScreen mainScreen].bounds.size.width;
  34. }
  35. CGFloat CGFG_ScreenHeight()
  36. {
  37. return [UIScreen mainScreen].bounds.size.height;
  38. }
  39. @end