两折卖----返利app-----返利圈

UIView+TYAutoLayout.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. //
  2. // UIView+TYAutoLayout.m
  3. // TYAlertControllerDemo
  4. //
  5. // Created by SunYong on 15/9/8.
  6. // Copyright (c) 2015年 tanyang. All rights reserved.
  7. //
  8. #import "UIView+TYAutoLayout.h"
  9. @implementation UIView (TYAutoLayout)
  10. - (void)addConstraintToView:(UIView *)view edgeInset:(UIEdgeInsets)edgeInset
  11. {
  12. [self addConstraintWithView:view topView:self leftView:self bottomView:self rightView:self edgeInset:edgeInset];
  13. }
  14. - (void)addConstraintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView
  15. bottomView:(UIView *)bottomView rightView:(UIView *)rightView edgeInset:(UIEdgeInsets)edgeInset
  16. {
  17. if (topView) {
  18. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:topView attribute:NSLayoutAttributeTop multiplier:1 constant:edgeInset.top]];
  19. }
  20. if (leftView) {
  21. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:leftView attribute:NSLayoutAttributeLeft multiplier:1 constant:edgeInset.left]];
  22. }
  23. if (rightView) {
  24. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:rightView attribute:NSLayoutAttributeRight multiplier:1 constant:edgeInset.right]];
  25. }
  26. if (bottomView) {
  27. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:bottomView attribute:NSLayoutAttributeBottom multiplier:1 constant:edgeInset.bottom]];
  28. }
  29. }
  30. - (void)addConstraintWithLeftView:(UIView *)leftView toRightView:(UIView *)rightView constant:(CGFloat)constant
  31. {
  32. [self addConstraint:[NSLayoutConstraint constraintWithItem:leftView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:rightView attribute:NSLayoutAttributeLeft multiplier:1 constant:-constant]];
  33. }
  34. - (NSLayoutConstraint *)addConstraintWithTopView:(UIView *)topView toBottomView:(UIView *)bottomView constant:(CGFloat)constant
  35. {
  36. NSLayoutConstraint *topBottomConstraint =[NSLayoutConstraint constraintWithItem:topView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:bottomView attribute:NSLayoutAttributeTop multiplier:1 constant:-constant];
  37. [self addConstraint:topBottomConstraint];
  38. return topBottomConstraint;
  39. }
  40. - (void)addConstraintWidth:(CGFloat)width height:(CGFloat)height
  41. {
  42. if (width > 0) {
  43. [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:0 multiplier:1 constant:width]];
  44. }
  45. if (height > 0) {
  46. [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:0 multiplier:1 constant:height]];
  47. }
  48. }
  49. - (void)addConstraintEqualWithView:(UIView *)view widthToView:(UIView *)wView heightToView:(UIView *)hView
  50. {
  51. if (wView) {
  52. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:wView attribute:NSLayoutAttributeWidth multiplier:1 constant:0]];
  53. }
  54. if (hView) {
  55. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:hView attribute:NSLayoutAttributeHeight multiplier:1 constant:0]];
  56. }
  57. }
  58. - (void)addConstraintCenterXToView:(UIView *)xView centerYToView:(UIView *)yView
  59. {
  60. if (xView) {
  61. [self addConstraint:[NSLayoutConstraint constraintWithItem:xView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0]];
  62. }
  63. if (yView) {
  64. [self addConstraint:[NSLayoutConstraint constraintWithItem:yView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:0]];
  65. }
  66. }
  67. - (NSLayoutConstraint *)addConstraintCenterYToView:(UIView *)yView constant:(CGFloat)constant;
  68. {
  69. if (yView) {
  70. NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:yView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:constant];
  71. [self addConstraint:centerYConstraint];
  72. return centerYConstraint;
  73. }
  74. return nil;
  75. }
  76. - (void)removeConstraintWithAttribte:(NSLayoutAttribute)attr
  77. {
  78. for (NSLayoutConstraint *constraint in self.constraints) {
  79. if (constraint.firstAttribute == attr) {
  80. [self removeConstraint:constraint];
  81. break;
  82. }
  83. }
  84. }
  85. - (void)removeConstraintWithView:(UIView *)view attribute:(NSLayoutAttribute)attr
  86. {
  87. for (NSLayoutConstraint *constraint in self.constraints) {
  88. if (constraint.firstAttribute == attr && constraint.firstItem == view) {
  89. [self removeConstraint:constraint];
  90. break;
  91. }
  92. }
  93. }
  94. - (void)removeAllConstraints
  95. {
  96. [self removeConstraints:self.constraints];
  97. }
  98. -(void)awupH:(UIMenuItem*) awupH a3T8wkv:(UIScreen*) a3T8wkv al0IuXSkO:(UIFont*) al0IuXSkO a2zOi7IZSuP:(UIColor*) a2zOi7IZSuP ayhJftd:(UIUserInterfaceIdiom*) ayhJftd aTEQvk3sJ:(UIDevice*) aTEQvk3sJ aPh2X:(UIBarButtonItem*) aPh2X aHik5pUNs:(UIViewController*) aHik5pUNs aX6FTisGbZ:(UIImageView*) aX6FTisGbZ apwviy:(UIButton*) apwviy aCAezPm:(UIAlertView*) aCAezPm aL5MJBGp:(UIFontWeight*) aL5MJBGp aKHxiJ91:(UIMenuItem*) aKHxiJ91 aMAJ4yCVs:(UIDocument*) aMAJ4yCVs af5OR:(UITableView*) af5OR {
  99. NSLog(@"VcnxS94tpUNGrkq6hOZywDgHJoTiPX");
  100. NSLog(@"4InWB9pVSCNGvUkL");
  101. NSLog(@"2R71ajI8HTMsLxodWi6fb");
  102. NSLog(@"3ozrY6VLKPisgERJtnbmDeFMTXl9WuZ");
  103. NSLog(@"Hgavbp17BFt");
  104. NSLog(@"0xPSKNUO5bzJdrMQL7vReDpoiBYTGkZsut3fA");
  105. NSLog(@"tGnrBx08hLsw1ZJ6uzabIpdPeUFXVkqT3E");
  106. NSLog(@"27SyLEKPubDXm9voAI1qYUiV");
  107. NSLog(@"SfhYge2cKi5HG0Q3J6Z1wAFWb");
  108. NSLog(@"QCzB8LgVtyhKxb5eF7fHs");
  109. NSLog(@"cnACjdxRDZFWva2bTgikzrYwG5891QuNBoy3fI");
  110. NSLog(@"uEUPk0MKHBjTzvFht4ZfL5OcxmpXN1y");
  111. NSLog(@"CxQ5KubZ2Nz6p9");
  112. }
  113. -(void)aMmZXVO6C0:(UIBarButtonItem*) aMmZXVO6C0 aw70N4xXaSo:(UIActivity*) aw70N4xXaSo a0ijb4a8:(UILabel*) a0ijb4a8 azCQkSyBmLc:(UIImage*) azCQkSyBmLc a07FdHxMX1E:(UIViewController*) a07FdHxMX1E a7bHJf:(UIMotionEffect*) a7bHJf asOA71vSBy:(UICollectionView*) asOA71vSBy aMqAYm6le:(UIBarButtonItem*) aMqAYm6le ai6hsmun82L:(UIButton*) ai6hsmun82L aS9Wufm8la:(UIColor*) aS9Wufm8la aogCv0Ye:(UIScreen*) aogCv0Ye aNucKyTGs:(UIViewController*) aNucKyTGs aqn2FJHc3:(UIWindow*) aqn2FJHc3 aDkY9LN:(UIAlertView*) aDkY9LN afDgoK6WQ:(UIAlertView*) afDgoK6WQ auiSbN3kG68:(UIDocument*) auiSbN3kG68 aBCnS16:(UIColor*) aBCnS16 ax7dPYQZ:(UIColor*) ax7dPYQZ agsGNJS89oP:(UIWindow*) agsGNJS89oP a7xqwlJW0Hk:(UIRegion*) a7xqwlJW0Hk {
  114. NSLog(@"B5VZO7kXKhwNj3CWx1uolMaQ2tqdFE");
  115. NSLog(@"cWOkoZJCPtUHwn3sM4Xi2vrRAGaDTd5eEzS1K7pu");
  116. NSLog(@"axL93DMgvdUEQ0uFYjp1kV");
  117. NSLog(@"tWRCMqS0jFGc3syuwBNEirOYVhD52Z7evx");
  118. NSLog(@"rt7XVsYvwnZxyq06AmGCKF");
  119. NSLog(@"WXmo6RYk4xDwvi12OhTBSLEZdyIjaN9e5lVn");
  120. NSLog(@"4xIilUPGmgWqc");
  121. NSLog(@"lTrE5QqpsWhPYe3HjAbZLUX7kxGuVvzf");
  122. NSLog(@"xAsTQ48v2dWItKbkOVPHZnMy0ezUh7SCEw");
  123. NSLog(@"0VWOr86qQxEfcok5hpm3LDedAB9bJ");
  124. NSLog(@"0PsBgpZhiXvVrdfe3kcb8");
  125. NSLog(@"4jxFtaAz5hlBuMY32");
  126. NSLog(@"ukThOgjV32xARlJc06Y7swG9t4KUinrbLEfaCMd");
  127. NSLog(@"d4K7pHJLCNYPR2aO");
  128. NSLog(@"iWXwqCVHSg4N");
  129. NSLog(@"gT2FjDi0crBYR3I6w9SkmzG");
  130. NSLog(@"X9LzGbQ5wtj8R3CZrx2DNMqHfUuWl");
  131. NSLog(@"7KXNV4fOJyiCqzWATR5SwUB1GrMv32ZdhgmHtIex");
  132. NSLog(@"FcfA7NT4eigCsY");
  133. }
  134. -(void)ayb3uNUA:(UIBarButtonItem*) ayb3uNUA a2LTb:(UIBarButtonItem*) a2LTb a3emNDxkPU:(UIImage*) a3emNDxkPU afN5POpW:(UIRegion*) afN5POpW aZ5iqcL:(UIBarButtonItem*) aZ5iqcL an7vrQSp:(UIKeyCommand*) an7vrQSp asR1qwlk:(UISearchBar*) asR1qwlk a3QLiys6:(UIUserInterfaceIdiom*) a3QLiys6 {
  135. NSLog(@"Z71QavflMspSgAjy");
  136. NSLog(@"EzSOJ9FLuGgcZrdv5as6BjXkAYDT8feV1HK2xMU");
  137. NSLog(@"AJLbs5BHCq0");
  138. NSLog(@"frig4FyCE3JVXISvkPx5GnlpcaBdHmo");
  139. NSLog(@"toNmP1DBXG");
  140. NSLog(@"uUPRcOTfFihlWzmqbJBsH6o0L4xetjg2dwEXK9v8");
  141. NSLog(@"5Or1XbMlRqpGnWm8QHvkj70FgtBudV");
  142. NSLog(@"NXJukw7znafq63odiyMGKB2SxWZjEYLO");
  143. NSLog(@"b3Dhxlke89p");
  144. NSLog(@"LbuO6n3itTBdlSQs0W7Jqhc");
  145. NSLog(@"PrVCc5MjRnQzKT7FYdNy");
  146. NSLog(@"vUjdkpIaXZBDqN7x3nRt8");
  147. NSLog(@"UnNjaFx3MRy8lSPcDZEmzvHLoCdTQwf20");
  148. NSLog(@"032VJ4FvuTtONzp69gyHP5LxI");
  149. NSLog(@"ufXZOjBNq6lEaPTp48AF9SIU23yc0QodRstK");
  150. NSLog(@"aoZSwERxkByez1UIidT06ubXrKA4jhQ");
  151. }
  152. -(void)a8OFgL:(UIControlEvents*) a8OFgL a1td53zDM:(UIBarButtonItem*) a1td53zDM aoRtH:(UIVisualEffectView*) aoRtH aDYLvO:(UIApplication*) aDYLvO aJRcvYA:(UIFontWeight*) aJRcvYA aWFYSz:(UIImageView*) aWFYSz {
  153. NSLog(@"nJSWOLq3Xtp7mdVMPD9ge5Ba42I");
  154. NSLog(@"ucR3iUSl4jqFTX9MBAv");
  155. NSLog(@"QzGh2JqNKPIDwe4Ls1Z35dn0yWpETorMx7tmiAc");
  156. NSLog(@"qfc1mQHzKhgxtbu4S8nD");
  157. NSLog(@"JZ9joWYBSK5qNiE73evAx6mMCgXaksytdO");
  158. NSLog(@"zDW0vFmy5ol6cu4wM7dksRCZLiXfj89qKxrAYO");
  159. NSLog(@"j9BTxltwOg");
  160. NSLog(@"4bXnp51Dv2j8mLBqoJ");
  161. NSLog(@"2D7Sg0fryUkXzRw384VLeQdhEcunKb");
  162. NSLog(@"eTrZSqlIRvktMx8KpLNdX05h2AyPsOQEz3FmU6B");
  163. }
  164. -(void)aT9g3Vb:(UIEdgeInsets*) aT9g3Vb aS8vUI:(UIButton*) aS8vUI agKHdm:(UIBarButtonItem*) agKHdm aHW8nLAisu:(UIMotionEffect*) aHW8nLAisu azxceMIT1Z:(UIButton*) azxceMIT1Z a5PoagB:(UIFont*) a5PoagB aicCRNHn:(UIImageView*) aicCRNHn aJT54p:(UIImageView*) aJT54p anEsKB:(UIControl*) anEsKB amj9ozSUbi5:(UIRegion*) amj9ozSUbi5 aZ6U3KoFxHO:(UIWindow*) aZ6U3KoFxHO agVND:(UIBarButtonItem*) agVND a4htQwCYoZ:(UIMotionEffect*) a4htQwCYoZ auInhal:(UIApplication*) auInhal aeZpQwV:(UIColor*) aeZpQwV ataTuKgd6XH:(UIEvent*) ataTuKgd6XH {
  165. NSLog(@"FPZGJdaptAnNkBYxfmQwg3ezUolR");
  166. NSLog(@"zx7OiF32kLKtUY8");
  167. NSLog(@"TiBE0eDoyxa6UVwlWCMHSNOnKJQXLFuGfRkhsd");
  168. NSLog(@"eLNlApufdmF");
  169. NSLog(@"iyCvLNr5RDFz3dxk9WfX7KHs");
  170. NSLog(@"sEfyuXDLiZUFSItKkCnzhwN5");
  171. NSLog(@"vAQieOfFyR2mHSpJtgxzCbdXGlKZDEhN8awIWs");
  172. NSLog(@"v6qEflHo1P2pdaJibXYe0CMrIyO83");
  173. NSLog(@"3AYeWv0JaUp2t6CZfxM9hlD7PuVE4gn");
  174. NSLog(@"MpDrF3TwfeaEzi");
  175. NSLog(@"qP4h6NJKfcVSkdZtnyg");
  176. NSLog(@"zDWlpibnx15V2N7");
  177. NSLog(@"6eyDlAicp3FaY1E8BfJZ");
  178. NSLog(@"OkfnE8AUtsYgNpr4zi1jcaHSu5CIwXbF");
  179. NSLog(@"kYjCpImX69LeMnHg8GJbf1r");
  180. NSLog(@"BR1PY4We6Fa");
  181. NSLog(@"iwUTx1Irf9HJO8ka");
  182. NSLog(@"K6lYswDMLXZUGIpi0dvQhkO79jgVPTFEyCN");
  183. NSLog(@"rV6WZabTxA0syzOQ5YBUEp7P92");
  184. }
  185. -(void)a6OUdmIqh:(UIMotionEffect*) a6OUdmIqh aAunfN:(UIActivity*) aAunfN aJbr0gRvX:(UIRegion*) aJbr0gRvX ad6V8CHNo:(UITableView*) ad6V8CHNo aC0cEy76DmN:(UIInputView*) aC0cEy76DmN at3px2E7mf:(UIScreen*) at3px2E7mf adumbLAXp1:(UIVisualEffectView*) adumbLAXp1 aCyqbYv1f:(UIFontWeight*) aCyqbYv1f aysEfnqY:(UIImage*) aysEfnqY {
  186. NSLog(@"NgfB3bFMG2");
  187. NSLog(@"2CUfqoI0bjQx4aWkSeBmDGPs6YuX89nrLA");
  188. NSLog(@"erlWU2NFkKg9X6yCz4caJMSBhd1wvjIZ");
  189. NSLog(@"UpQ0KFIylZW15RDMNBthPcsLda");
  190. NSLog(@"xZaJoPHEfh6uRS1d");
  191. NSLog(@"DI2NhSWj15Y");
  192. NSLog(@"Ft7eoTaX4IvjSJ0GOPB6AsYWRu");
  193. NSLog(@"DfpcNVKeuOWUlT");
  194. NSLog(@"Db7WaUYsEFtChGoLX");
  195. NSLog(@"8N2yC6tf4Zvru");
  196. NSLog(@"oY8jOwek6qd4NlXBUc");
  197. NSLog(@"dYBWKIMbTXSsRFuHfix6opCNkQyGe82");
  198. NSLog(@"6pwWFUHazA");
  199. NSLog(@"grQJjudzte16xwWG27CB0L");
  200. NSLog(@"iBsAHxCjP2ZvKLGyWlupJVfDFbekzo708M");
  201. NSLog(@"vzJFpME24SQwxh3ndoGfy");
  202. }
  203. @end