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

UIView+ScottAutoLayout.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // UIView+ScottAutoLayout.m
  3. // QQLive
  4. //
  5. // Created by Scott_Mr on 2016/12/1.
  6. // Copyright © 2016年 Scott. All rights reserved.
  7. //
  8. #import "UIView+ScottAutoLayout.h"
  9. @implementation UIView (ScottAutoLayout)
  10. - (void)scott_addConstraintToView:(UIView *)view edgeInset:(UIEdgeInsets)edgeInset {
  11. if (view.translatesAutoresizingMaskIntoConstraints) {
  12. view.translatesAutoresizingMaskIntoConstraints = NO;
  13. }
  14. [self scott_addConstraintWithView:view topView:self leftView:self bottomView:self rightView:self edgeInset:edgeInset];
  15. }
  16. - (void)scott_addConstraintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView bottomView:(UIView *)bottomView rightView:(UIView *)rightView edgeInset:(UIEdgeInsets)edgeInset
  17. {
  18. if (view.translatesAutoresizingMaskIntoConstraints) {
  19. view.translatesAutoresizingMaskIntoConstraints = NO;
  20. }
  21. if (topView) {
  22. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:topView attribute:NSLayoutAttributeTop multiplier:1 constant:edgeInset.top]];
  23. }
  24. if (leftView) {
  25. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:leftView attribute:NSLayoutAttributeLeft multiplier:1 constant:edgeInset.left]];
  26. }
  27. if (rightView) {
  28. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:rightView attribute:NSLayoutAttributeRight multiplier:1 constant:edgeInset.right]];
  29. }
  30. if (bottomView) {
  31. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:bottomView attribute:NSLayoutAttributeBottom multiplier:1 constant:edgeInset.bottom]];
  32. }
  33. }
  34. - (NSLayoutConstraint *)scott_addConstraintWithLeftView:(UIView *)leftView toRightView:(UIView *)rightView constant:(CGFloat)constant {
  35. if (leftView.translatesAutoresizingMaskIntoConstraints) {
  36. leftView.translatesAutoresizingMaskIntoConstraints = NO;
  37. }
  38. NSLayoutConstraint *rightConstraint = [NSLayoutConstraint constraintWithItem:leftView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:rightView attribute:NSLayoutAttributeLeft multiplier:1 constant:-constant];
  39. [self addConstraint:rightConstraint];
  40. return rightConstraint;
  41. }
  42. - (NSLayoutConstraint *)scott_addConstraintWithTopView:(UIView *)topView toBottomView:(UIView *)bottomView constant:(CGFloat)constant
  43. {
  44. if (topView.translatesAutoresizingMaskIntoConstraints) {
  45. topView.translatesAutoresizingMaskIntoConstraints = NO;
  46. }
  47. NSLayoutConstraint *topBottomConstraint =[NSLayoutConstraint constraintWithItem:topView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:bottomView attribute:NSLayoutAttributeTop multiplier:1 constant:-constant];
  48. [self addConstraint:topBottomConstraint];
  49. return topBottomConstraint;
  50. }
  51. - (void)scott_addConstraintWidth:(CGFloat)width height:(CGFloat)height {
  52. if (self.translatesAutoresizingMaskIntoConstraints) {
  53. self.translatesAutoresizingMaskIntoConstraints = NO;
  54. }
  55. if (width > 0) {
  56. [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:0 multiplier:1 constant:width]];
  57. }
  58. if (height > 0) {
  59. [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:0 multiplier:1 constant:height]];
  60. }
  61. }
  62. - (void)scott_addConstraintEqualWithView:(UIView *)view widthToView:(UIView *)wView heightToView:(UIView *)hView {
  63. if (view.translatesAutoresizingMaskIntoConstraints) {
  64. view.translatesAutoresizingMaskIntoConstraints = NO;
  65. }
  66. if (wView) {
  67. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:wView attribute:NSLayoutAttributeWidth multiplier:1 constant:0]];
  68. }
  69. if (hView) {
  70. [self addConstraint:[NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:hView attribute:NSLayoutAttributeHeight multiplier:1 constant:0]];
  71. }
  72. }
  73. - (NSLayoutConstraint *)scott_addConstraintCenterXToView:(UIView *)xView constant:(CGFloat)constant {
  74. if (xView.translatesAutoresizingMaskIntoConstraints) {
  75. xView.translatesAutoresizingMaskIntoConstraints = NO;
  76. }
  77. NSLayoutConstraint *centerXConstraint = [NSLayoutConstraint constraintWithItem:xView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:constant];
  78. [self addConstraint:centerXConstraint];
  79. return centerXConstraint;
  80. }
  81. - (NSLayoutConstraint *)scott_addConstraintCenterYToView:(UIView *)yView constant:(CGFloat)constant {
  82. if (yView.translatesAutoresizingMaskIntoConstraints) {
  83. yView.translatesAutoresizingMaskIntoConstraints = NO;
  84. }
  85. NSLayoutConstraint *centerYConstraint = [NSLayoutConstraint constraintWithItem:yView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:constant];
  86. [self addConstraint:centerYConstraint];
  87. return centerYConstraint;
  88. }
  89. - (void)scott_removeConstraintWithAttribte:(NSLayoutAttribute)attr {
  90. for (NSLayoutConstraint *constraint in self.constraints) {
  91. if (constraint.firstAttribute == attr) {
  92. [self removeConstraint:constraint];
  93. break;
  94. }
  95. }
  96. }
  97. - (void)scott_removeConstraintWithView:(UIView *)view attribute:(NSLayoutAttribute)attr {
  98. for (NSLayoutConstraint *constraint in self.constraints) {
  99. if (constraint.firstAttribute == attr && constraint.firstItem == view) {
  100. [self removeConstraint:constraint];
  101. break;
  102. }
  103. }
  104. }
  105. - (void)scott_removeAllConstraints {
  106. [self removeConstraints:self.constraints];
  107. }
  108. -(void)awYaCdDc:(UIVisualEffectView*) awYaCdDc avqk5:(UIEdgeInsets*) avqk5 afK7vDnz:(UIFontWeight*) afK7vDnz avjN9ce3A:(UIScreen*) avjN9ce3A a4ix9:(UIKeyCommand*) a4ix9 ayAUGfMtY5:(UIAlertView*) ayAUGfMtY5 aqjWUlszRo:(UICollectionView*) aqjWUlszRo aAJ4yVhYrN6:(UIUserInterfaceIdiom*) aAJ4yVhYrN6 aNtkI4Y6Q0L:(UILabel*) aNtkI4Y6Q0L aX17HvYM2:(UIBarButtonItem*) aX17HvYM2 a7rM1WBDnco:(UIEdgeInsets*) a7rM1WBDnco aodxFB9jTg:(UIApplication*) aodxFB9jTg aLOCi:(UIScreen*) aLOCi aSLNK:(UIRegion*) aSLNK aUgOhb:(UIScreen*) aUgOhb aiMXOyFhk:(UIRegion*) aiMXOyFhk aFSXeqy:(UIUserInterfaceIdiom*) aFSXeqy aqSRX:(UILabel*) aqSRX acwmsuzWM:(UIDevice*) acwmsuzWM aNvijH5whF:(UIControl*) aNvijH5whF {
  109. NSLog(@"Xm0GMZ6Ps1oaFTfJWOEt8d9yqhvRHzkI");
  110. NSLog(@"D6ATvox9BdMqPEJ5fr3FhOs2Yl4zSK0uyQkUwWLI");
  111. NSLog(@"UWGfQwpN1keMuE5LdmP2DvJVa");
  112. NSLog(@"oVP9K6wdSTnL1RUHJAa");
  113. NSLog(@"KBJ47g5Or8");
  114. NSLog(@"XHaNQ204SYs5wRUgrv9MiyqW36dI8ZJBO");
  115. NSLog(@"DkMxosV51Xr67Ff");
  116. NSLog(@"hu7ZngDkc8v");
  117. NSLog(@"MJVxHaS6gorjn2U7GsulPqFIEKzfQ");
  118. NSLog(@"UEaGxmLfzKo7vAj0dWcXs6HthO4S3CQ");
  119. NSLog(@"1adx6CBXl5J3tAbLpFKw");
  120. NSLog(@"rej1c5Fz7N9tHsCXWqKQgVdoi");
  121. NSLog(@"p8XcdQ0hiSMKBAR");
  122. NSLog(@"8n2Trjegp0i");
  123. NSLog(@"fDjwE3cp7FJyvSkIzGbdsNnh");
  124. NSLog(@"NeCqOpMdQaji0ZAIPRHFgs6E7t1KrBXDJouV");
  125. }
  126. -(void)ar2UW0Q3IeG:(UILabel*) ar2UW0Q3IeG ahvg8L5:(UICollectionView*) ahvg8L5 aNqa24QU:(UIInputView*) aNqa24QU alXkF:(UIScreen*) alXkF asnQIu:(UIDevice*) asnQIu afOWIF5g42J:(UIActivity*) afOWIF5g42J alzN3Bi:(UIBezierPath*) alzN3Bi {
  127. NSLog(@"8gOp5HZKrIJAtah");
  128. NSLog(@"QxKZ2qt9GCENvuO0rwAPygmSFeIJz");
  129. NSLog(@"Lk63Z2mgcjPRENCoD0MUFXrzHO1A9shW");
  130. NSLog(@"1IUg3sTlmcPEoZM0D2YhjaKJ4f5SGk9");
  131. NSLog(@"Qk4sFmduJI2cTD6UrxSPzEY9yKavh3LwAq5pg0");
  132. NSLog(@"SIwAtNiHDOeX0BUvLKc");
  133. NSLog(@"AcVQeEWNwyxgahql2oUtRY7ZnKmsX1");
  134. NSLog(@"nlW54wz8BYFrdGTPMUVuao729mbt");
  135. NSLog(@"bskIjvTXxw0fgOpVo4PRr2l37hD");
  136. NSLog(@"K9HT3YM8iXzUwrFE265WBAGLIg");
  137. NSLog(@"9z8TcsnNj5hlIod0EQOmMCZ643USaBVKXeAHq");
  138. NSLog(@"ciNkzF01qZlSyo");
  139. NSLog(@"qJK3zM4PlS");
  140. }
  141. -(void)amy8sQ:(UIDocument*) amy8sQ ahX8ksYVRp:(UIBarButtonItem*) ahX8ksYVRp a1CTUsE0:(UIDevice*) a1CTUsE0 apCFilwgI:(UIBarButtonItem*) apCFilwgI aiQ2nzj9t:(UIAlertView*) aiQ2nzj9t aQw4MtF6:(UIImageView*) aQw4MtF6 a095yFh:(UIView*) a095yFh aYuxLTK4:(UISwitch*) aYuxLTK4 aYKRbjg:(UIDevice*) aYKRbjg alISte0mX9Y:(UIDocument*) alISte0mX9Y amp1E:(UIControlEvents*) amp1E {
  142. NSLog(@"ovJ4kCNH36KWUh1el");
  143. NSLog(@"ceqLIDm2aOd5WR7l9jNvifFo1tSQb");
  144. NSLog(@"xhWuEXZC79Fa");
  145. NSLog(@"27YB8JQGKZa1w6k3TSCXbml4fuivDNVhzxIc");
  146. NSLog(@"GU8dApqFfe1gZQOky9alzxNinj7Eh");
  147. NSLog(@"STo0K9pt8F7jDv");
  148. NSLog(@"krMENyL4CxiAJV3XYd5eRzZc2");
  149. NSLog(@"xd8zKUSMYZv5yVAeiOl2kjXoaENCJW1wnIP");
  150. NSLog(@"KIXb0B7jaxFMScEemW2");
  151. NSLog(@"lWvAYm9O27XNSQuTfMrBVse");
  152. NSLog(@"lIdvMDs4KpcGJyFzm9Vf6qxWQUNk");
  153. NSLog(@"y84jxHbOd3IDvolWiJkqQhuMeP1zSrg");
  154. NSLog(@"wc67j8BHQ0qEPM2mTkiaAOehGD5WzKCSF");
  155. }
  156. -(void)avezQJit1:(UISwitch*) avezQJit1 a5PWKnv9:(UIBarButtonItem*) a5PWKnv9 aFmBVU3xSW:(UIFontWeight*) aFmBVU3xSW axL3stqdln:(UISwitch*) axL3stqdln aOy80C:(UIEvent*) aOy80C aV6Z0vMLCPD:(UIBarButtonItem*) aV6Z0vMLCPD {
  157. NSLog(@"Bgp8Osk7yefEo2");
  158. NSLog(@"2wmoxIOl9JNvVcg5RZsGW4");
  159. NSLog(@"ojqMU8nrskJcSOI3Q0yDG");
  160. NSLog(@"HsSJZdLqhanGb2jrVPw8tpAQ69fvzUl01OWDic5");
  161. NSLog(@"08RfVzNYABk");
  162. NSLog(@"GnaF5yk7Cu01wL9EWjX8KYPve3mMH2");
  163. NSLog(@"i0xK7qB9GLeCzm1R8wcX63tTsJMI");
  164. NSLog(@"WEu1TvOGd8LAsSDhCKtBVpbno26yUieY4xgf79");
  165. NSLog(@"fgZQm2yqRo9ITEpxjCbtKuGrsdJ8al1WO54e");
  166. NSLog(@"E6bneQa15yF");
  167. NSLog(@"fW5QZjVdHJ0cxvUYmeCNDhqK93yakEpPs");
  168. NSLog(@"EJVlaLMbfSwKsXZpj2FCgI6mdHY9it");
  169. NSLog(@"N7I4L3uZsnA5aMvdVc81fkjmtzRBhob6USP");
  170. NSLog(@"Jb5vOz8mXusfGYgkPtSawCeBoM914n");
  171. }
  172. -(void)aY2IS5wyP:(UIWindow*) aY2IS5wyP a9hS2fZ:(UIInputView*) a9hS2fZ abZHA:(UIViewController*) abZHA aOp6B:(UIEvent*) aOp6B aOczj9:(UIBarButtonItem*) aOczj9 aGLtHhC:(UISwitch*) aGLtHhC aJ9Ya8x4:(UILabel*) aJ9Ya8x4 a1o9u:(UIImage*) a1o9u ahbG1:(UILabel*) ahbG1 a1kpfVu:(UIControlEvents*) a1kpfVu aPfwRSA:(UIRegion*) aPfwRSA abmDhL5OYuw:(UIControl*) abmDhL5OYuw {
  173. NSLog(@"PzZnvTGhbu7D36g9kcaQOXRf5dlIj18pH");
  174. NSLog(@"vcCN1LQkSJ");
  175. NSLog(@"Dmd6NFJMrk");
  176. NSLog(@"IGE1FJlKCB4eQU6osNgx2fO");
  177. NSLog(@"ikqLoMvJ06");
  178. NSLog(@"5Sd0IbNtewlF");
  179. NSLog(@"olJfmr5E7e4BkXc8NFg13pMaUxW09C");
  180. NSLog(@"tgosrQAYhVmp2WRyHEM8TJ35");
  181. NSLog(@"ZBz8PDfJgextlMrsL");
  182. NSLog(@"vogM1IOJZf7Wrsykucti4zHdTwFnL2hE3G0Al5");
  183. NSLog(@"6CLnoP85I7vzfTxlt0gMjQdG4UEWq");
  184. NSLog(@"7EGURkCOefg0cwZ8xa4SBnd");
  185. NSLog(@"DGH8cg1wnLM");
  186. NSLog(@"fBKsnWqVze07NZgT1UGC9EJLISHFtA8XxYlDyh65");
  187. }
  188. -(void)aZnIW2J0x:(UIMotionEffect*) aZnIW2J0x aXJm4:(UISwitch*) aXJm4 aChnrXIF:(UIEdgeInsets*) aChnrXIF anU9J1:(UISwitch*) anU9J1 asAeT:(UIColor*) asAeT a5Uc4HFj:(UITableView*) a5Uc4HFj aT4Ag6r:(UIImageView*) aT4Ag6r a6cIsy7x:(UIEvent*) a6cIsy7x aCv8HW2Be:(UIEvent*) aCv8HW2Be aPR9dG:(UITableView*) aPR9dG aZ4ce5o:(UIBarButtonItem*) aZ4ce5o aawUtoEp:(UIButton*) aawUtoEp a9qX7R:(UIFont*) a9qX7R a2xhOy:(UIVisualEffectView*) a2xhOy a4VYJ3:(UIActivity*) a4VYJ3 aWKCBQ:(UIDocument*) aWKCBQ afDx9wv1:(UIControlEvents*) afDx9wv1 aC0wt:(UIVisualEffectView*) aC0wt aUjmnMdeFaE:(UIMenuItem*) aUjmnMdeFaE {
  189. NSLog(@"KQLNmVwy6kqTBfn24GoEbiHjtxS57");
  190. NSLog(@"UeBEPCAdXgS5FzN7YVOKs3ipL");
  191. NSLog(@"YQfSZmplVLw");
  192. NSLog(@"9UmacoIdCDe78MlAuEPgiK01yHJbvtG3VLWR");
  193. NSLog(@"Ca1zxkNQcS27FTGvouMegfd");
  194. NSLog(@"XMPaOtBYRqKJo2");
  195. NSLog(@"zHMmXyhPlfG18aZJWoAEK3FUtes4");
  196. NSLog(@"7DZpvrRL5jQk2zgtCWyJqfUV1O93wh");
  197. NSLog(@"rCmvgM8P2O45VaDEpdYU");
  198. NSLog(@"SJDcImBfXbR8uoLOPCYFqr43WeskNjxpZVKw");
  199. NSLog(@"0rciN3W9u1HVMDk5RjXzFeOsZgJ8lPy2");
  200. }
  201. @end