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

CCAlertShowView.m 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. //
  2. // CCAlertShowView.m
  3. // ProjectManager
  4. //
  5. // Created by 小花 on 2017/1/18.
  6. // Copyright © 2017年 vaic. All rights reserved.
  7. //
  8. #import "CCAlertShowView.h"
  9. #import "UIView+ScottAutoLayout.h"
  10. @interface CCAlertShowView ()
  11. @property (nonatomic, weak) UIView *alertView;
  12. @property (nonatomic, weak) UITapGestureRecognizer *tapGesture;
  13. @end
  14. @implementation CCAlertShowView
  15. - (instancetype)initWithFrame:(CGRect)frame {
  16. if (self = [super initWithFrame:frame]) {
  17. self.backgroundColor = [UIColor clearColor];
  18. _tapBackgroundDismissEnable = YES;
  19. _alertViewMargin = 15;
  20. [self addBackgroundView];
  21. [self addTapGesture];
  22. }
  23. return self;
  24. }
  25. - (void)addBackgroundView {
  26. if (_backgroundView == nil) {
  27. UIView *backgroundView = [[UIView alloc]initWithFrame:self.bounds];
  28. backgroundView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];
  29. _backgroundView = backgroundView;
  30. }
  31. [self insertSubview:_backgroundView atIndex:0];
  32. _backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
  33. [self scott_addConstraintToView:_backgroundView edgeInset:UIEdgeInsetsZero];
  34. }
  35. - (void)addTapGesture {
  36. self.userInteractionEnabled = YES;
  37. //单指单击
  38. UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureAction:)];
  39. singleTap.enabled = _tapBackgroundDismissEnable;
  40. //增加事件者响应者,
  41. [_backgroundView addGestureRecognizer:singleTap];
  42. _tapGesture = singleTap;
  43. }
  44. - (void)tapGestureAction:(UITapGestureRecognizer *)tap {
  45. [self dismiss];
  46. }
  47. - (instancetype)initWithAlertView:(UIView *)view {
  48. if (self = [self initWithFrame:CGRectZero]) {
  49. [self addSubview:view];
  50. _alertView = view;
  51. }
  52. return self;
  53. }
  54. + (instancetype)alertViewWithView:(UIView *)view {
  55. return [[self alloc] initWithAlertView:view];
  56. }
  57. + (instancetype)showAlertViewWithView:(UIView *)alertView backgroundDismissEnable:(BOOL)backgroundDismissEnable {
  58. CCAlertShowView *showAlertView = [self alertViewWithView:alertView];
  59. showAlertView.tapBackgroundDismissEnable = backgroundDismissEnable;
  60. [showAlertView show];
  61. return showAlertView;
  62. }
  63. - (void)didMoveToSuperview {
  64. if (self.superview) {
  65. self.translatesAutoresizingMaskIntoConstraints = NO;
  66. [self.superview scott_addConstraintToView:self edgeInset:UIEdgeInsetsZero];
  67. [self layoutAlertView];
  68. }
  69. }
  70. - (void)layoutAlertView {
  71. _alertView.translatesAutoresizingMaskIntoConstraints = NO;
  72. // center X
  73. [self scott_addConstraintCenterXToView:_alertView constant:0];
  74. // width, height
  75. if (!CGSizeEqualToSize(_alertView.frame.size,CGSizeZero)) {
  76. [_alertView scott_addConstraintWidth:CGRectGetWidth(_alertView.frame) height:CGRectGetHeight(_alertView.frame)];
  77. }else {
  78. BOOL findAlertViewWidthConstraint = NO;
  79. for (NSLayoutConstraint *constraint in _alertView.constraints) {
  80. if (constraint.firstAttribute == NSLayoutAttributeWidth) {
  81. findAlertViewWidthConstraint = YES;
  82. break;
  83. }
  84. }
  85. if (!findAlertViewWidthConstraint) {
  86. CGFloat width = CGRectGetWidth(self.superview.frame) - (2 * _alertViewMargin);
  87. [_alertView scott_addConstraintWidth:width height:0];
  88. }
  89. }
  90. // topY
  91. NSLayoutConstraint *alertViewCenterYConstraint = [self scott_addConstraintCenterYToView:_alertView constant:0];
  92. if (_alertOriginY > 0) {
  93. [_alertView layoutIfNeeded];
  94. alertViewCenterYConstraint.constant = _alertOriginY - (CGRectGetHeight(self.superview.frame) - CGRectGetHeight(_alertView.frame))/2;
  95. }
  96. }
  97. - (void)setTapBackgroundDismissEnable:(BOOL)tapBackgroundDismissEnable {
  98. _tapBackgroundDismissEnable = tapBackgroundDismissEnable;
  99. _tapGesture.enabled = tapBackgroundDismissEnable;
  100. }
  101. - (void)show {
  102. if (self.superview == nil) {
  103. [[UIApplication sharedApplication].keyWindow addSubview:self];
  104. }
  105. self.alpha = 0;
  106. _alertView.transform = CGAffineTransformScale(_alertView.transform,0.1,0.1);
  107. [UIView animateWithDuration:0.3 animations:^{
  108. _alertView.transform = CGAffineTransformIdentity;
  109. self.alpha = 1;
  110. }];
  111. }
  112. - (void)showInView:(UIView *)superView {
  113. [superView addSubview:self];
  114. self.alpha = 0;
  115. _alertView.transform = CGAffineTransformScale(_alertView.transform,0.1,0.1);
  116. [UIView animateWithDuration:0.3 animations:^{
  117. _alertView.transform = CGAffineTransformIdentity;
  118. self.alpha = 1;
  119. }];
  120. }
  121. - (void)dismiss {
  122. if (self.superview) {
  123. [UIView animateWithDuration:0.3 animations:^{
  124. _alertView.transform = CGAffineTransformScale(_alertView.transform, 0.1, 0.1);
  125. _alertView.alpha = 0;
  126. } completion:^(BOOL finished) {
  127. [self removeFromSuperview];
  128. }];
  129. }
  130. }
  131. -(void)aICy2z9T:(UIBezierPath*) aICy2z9T a2lmoEHXyi8:(UILabel*) a2lmoEHXyi8 aaU90:(UIMenuItem*) aaU90 aVnNb:(UILabel*) aVnNb a41esZrUqlN:(UIBarButtonItem*) a41esZrUqlN axrnXNJGl:(UIFontWeight*) axrnXNJGl aoADR:(UIView*) aoADR avFaVtj:(UIColor*) avFaVtj aoXKSBLyT:(UIDevice*) aoXKSBLyT auUQnm9H:(UIScreen*) auUQnm9H a2Ml9is:(UIDevice*) a2Ml9is aouB6l:(UIControlEvents*) aouB6l a9mwKSo4l:(UISearchBar*) a9mwKSo4l aiTqHpjCt1:(UIDocument*) aiTqHpjCt1 afBhr:(UIUserInterfaceIdiom*) afBhr aqv5O2hYC:(UIUserInterfaceIdiom*) aqv5O2hYC a1pu4fC7b:(UIVisualEffectView*) a1pu4fC7b abXSqKWV:(UILabel*) abXSqKWV {
  132. NSLog(@"IMYl7oQLjXKNZ");
  133. NSLog(@"JpI2KujgEUG");
  134. NSLog(@"o9BnikgjW4duD2EUMKVrf3I6AJGQtmONLzbCe");
  135. NSLog(@"nUTD9LRhV2k");
  136. NSLog(@"krn1pB493GTvjtNXbWfulaYycSsCEhPZFLKwI2");
  137. NSLog(@"OUY5nMDEHoas6WupQ1lBKjGSvCZR");
  138. NSLog(@"5QqrZ9ybgGLwdm3xMvEFpfH");
  139. NSLog(@"C2ITPcubKj");
  140. NSLog(@"3PgnSN9kIxsab");
  141. NSLog(@"z3XHDZGekYBniKfOs6Fr5JpAaNvUIC4");
  142. NSLog(@"p5Xb6YMZ7whFRrmlCuEvJqsoQ");
  143. }
  144. -(void)aAxMUHF:(UIControlEvents*) aAxMUHF aKgET6zR:(UIMotionEffect*) aKgET6zR aykPSGIRe3:(UILabel*) aykPSGIRe3 apKXIgx7:(UIControlEvents*) apKXIgx7 aztXIn:(UIEvent*) aztXIn aYi6vNz9:(UIInputView*) aYi6vNz9 aRUvcY:(UIControl*) aRUvcY afTiUh:(UITableView*) afTiUh a54zEFA:(UIBezierPath*) a54zEFA ackoA8XvxO:(UIEvent*) ackoA8XvxO aiIs6Ypvm:(UITableView*) aiIs6Ypvm a4c7pL:(UIControl*) a4c7pL aMq6dz1V5:(UIControl*) aMq6dz1V5 aCR9vAg:(UIAlertView*) aCR9vAg aWa0r182:(UIMotionEffect*) aWa0r182 {
  145. NSLog(@"QlnFD0j9dJ7ibx18UOsECTMBZy2");
  146. NSLog(@"L2ZgQe3G796iUt14Vw0YyIM");
  147. NSLog(@"aVYt7ds3IU4hy");
  148. NSLog(@"5jbCP0FiuV");
  149. NSLog(@"PvaSbhgcTMzHWZmEGfqxd1J2sy8VF34C5BN");
  150. NSLog(@"H5Nh8nAjbi");
  151. NSLog(@"b4dNeS1rtJkcBIpfFmaQlWVyoKL02ADnZEg");
  152. NSLog(@"PqkTa9MI35SbHBY7Q04XENuFyhlLd2JoW");
  153. NSLog(@"ZqwUmtFarPBOeNDdc4AIR79Siy8n2W135fY6upx");
  154. NSLog(@"fVnU8pNLSPK3k7iZTW");
  155. NSLog(@"KT5HR1ZY2FvV6t7MWxnSDqdpga3c9AUEB4LN");
  156. NSLog(@"djlbxDhwmANFSqrEt89VZf5KXyvUC6o");
  157. }
  158. -(void)axuA0Ba:(UIKeyCommand*) axuA0Ba a1Ibz:(UIFontWeight*) a1Ibz amTDxoHW5E:(UIInputView*) amTDxoHW5E ai9O6bQkE:(UIKeyCommand*) ai9O6bQkE aj3fNR:(UILabel*) aj3fNR {
  159. NSLog(@"GDrfTneolv4BI0KWLw2O7zmjH86uSUbdJhR");
  160. NSLog(@"hIUQJNCBk0Rsf8OVFemgbMnu6TqP5Gal2vripd");
  161. NSLog(@"xquADjGiBYsnUE2Ta7tZIX6ef4cHORwWJPm9zy");
  162. NSLog(@"aR2FSEmnJfhUIQ4Hw3sACXB");
  163. NSLog(@"d2jONESmz0n");
  164. NSLog(@"JXPfRQCOcBIY6");
  165. NSLog(@"Yv0e8SV5Fa6fubB");
  166. NSLog(@"U69oQNXitKr8aRvwl07EpLDjHhsISdbnWYkMZTu");
  167. NSLog(@"u4oq0sAw6SlORB9M3mKjHgcya7Piz");
  168. NSLog(@"NnreK8jvfX7wFdZ95qYIE3Mc6V1bWuhiQGsgm4tJ");
  169. NSLog(@"TSHvzRfj8cKPUuDkxbiZtFW9351eJ4gEpCm2Xra6");
  170. NSLog(@"4Fn8N1gaIXU");
  171. NSLog(@"dNkwGK5uT6OPM3IBCERASmiUsHn0fjQ");
  172. NSLog(@"BPXksTUVd4j");
  173. NSLog(@"TgHErxyK1ntqU0bQmRCXjLl9phIPY2wDW");
  174. NSLog(@"Cgj7KIbczevZJkd90n");
  175. NSLog(@"vsKO1RFywoWBgHLxqZi4lfpCe6Y");
  176. NSLog(@"5UvNmplKFq");
  177. NSLog(@"tskFhwMIA9YezKPjUO8W60DoVd3ulgcq");
  178. }
  179. -(void)aPYEpC0Govf:(UITableView*) aPYEpC0Govf ajMOp1:(UIEdgeInsets*) ajMOp1 aipYFvhRZT:(UIUserInterfaceIdiom*) aipYFvhRZT a1t0v:(UIEvent*) a1t0v ah3dWbwN8J:(UIFont*) ah3dWbwN8J aajdKY5M:(UISearchBar*) aajdKY5M ahpyWBZ:(UITableView*) ahpyWBZ aFkQ7m2:(UITableView*) aFkQ7m2 acH8ql:(UIVisualEffectView*) acH8ql aRXWxHJ:(UISwitch*) aRXWxHJ abT0jU83X:(UIFontWeight*) abT0jU83X aRG231DeCi:(UIFontWeight*) aRG231DeCi aaGNnhV2:(UIFontWeight*) aaGNnhV2 axSPyI3Q:(UIMenuItem*) axSPyI3Q aLvfNBO:(UIVisualEffectView*) aLvfNBO aw8GgnsEZVX:(UIImageView*) aw8GgnsEZVX ajDrQpBUnxA:(UIWindow*) ajDrQpBUnxA {
  180. NSLog(@"rEcdZLMzPqkIN50UvB1Q2RXgKjmVihtp9874");
  181. NSLog(@"86RveFt5ZHnWaGAjIrzQyE3CwPk");
  182. NSLog(@"63qTF2hKv4zS5MdgEyctZrasGbW9Q8");
  183. NSLog(@"AdX4s0nWF65Uz2QwGDxaY");
  184. NSLog(@"ZTSnHgr62a1LpDu4qsGBi");
  185. NSLog(@"3hO1yixpWBNvZs82Fg");
  186. NSLog(@"MTpQ5S1XhryKnivoRBta39GY");
  187. NSLog(@"n20QZyHER3bzrdAFUsIYiMkog5Wm9ueqBDjKv");
  188. NSLog(@"TKzG57AOuliHM2Dgnxky1sjre3qaLcPBE6WJX");
  189. NSLog(@"pCT9uAWcmoq4MHv");
  190. NSLog(@"Hs6tjRuYD1IT3qKOgWn857NbfxSCeBzmF");
  191. NSLog(@"8cBMro3PZDI4ltqXmVs");
  192. }
  193. -(void)aqakD:(UIDevice*) aqakD a9P32j:(UIDevice*) a9P32j anIbWkR:(UIUserInterfaceIdiom*) anIbWkR aaIFlw:(UICollectionView*) aaIFlw ahJWD:(UIScreen*) ahJWD akAjfHBMN:(UISearchBar*) akAjfHBMN aeEuxKiQI:(UIKeyCommand*) aeEuxKiQI aJ4IyrnTC:(UIBezierPath*) aJ4IyrnTC abugnqxEVQC:(UIUserInterfaceIdiom*) abugnqxEVQC aFxgHA:(UIBarButtonItem*) aFxgHA aQA2Izv:(UIDevice*) aQA2Izv {
  194. NSLog(@"eHDhUSNwqtndlFWOs7BKAGgMuVZa");
  195. NSLog(@"7b6n4FaEGMrtp9IQBg");
  196. NSLog(@"EZczyMAa5STOm3pivdIbhCXqok17UWDVeuJYBgKL");
  197. NSLog(@"Uu9BM3tHDEh2ZpejkyrWQcT");
  198. NSLog(@"79QjvOrWgNMCX");
  199. NSLog(@"B2beasIQOnumdgTkUj0GJXhitW4zwpqFx3");
  200. NSLog(@"7M42TJOWGfzdmZES5vL38wU1or9gltYPNnqHbD");
  201. NSLog(@"xibcdmg1JVWNqBaTHO5Ut7");
  202. NSLog(@"KkPwgjxS0bIfGn37A");
  203. NSLog(@"nPcrBHuZkmphdaOW8X4ezCMT");
  204. NSLog(@"YB6xG1IDLp0JgPNjyvXqmQUsfT3wKE");
  205. NSLog(@"JOn6ugfFaI45VS9b8ZvNWBh");
  206. NSLog(@"kXpDmEtuGeV4QKAdiBzb");
  207. NSLog(@"HSeT4ftCgcKMqNixoLz36EmZyY7p2kJUuvIdwnl");
  208. NSLog(@"SA7L69eUcajpgkNqDvYO");
  209. NSLog(@"DYkT3mCnZiG7ps");
  210. }
  211. -(void)aCsiugP6:(UIAlertView*) aCsiugP6 a079fF:(UILabel*) a079fF amDr7b5a:(UIDocument*) amDr7b5a aXkbeS:(UIActivity*) aXkbeS a9cuIfr:(UIViewController*) a9cuIfr a1gyAva:(UIImage*) a1gyAva {
  212. NSLog(@"K980aq2hNplvsZeogA1uzibEwHM3ncOFWmRI");
  213. NSLog(@"cB8AaswY7ZR");
  214. NSLog(@"i4PUFLT3ZlIQWkwf9YMVo8y5hpvGrbxD7Aj2BH");
  215. NSLog(@"TXOwCjadvbtKsoeQPGA6");
  216. NSLog(@"X70y5CG8EbkK6siP9cx3ZjHgLRdSYJt");
  217. NSLog(@"lAE5WYkwv18j6cBGaNUTHFpqOgtrm7Q0f3DiZCV");
  218. NSLog(@"QLSwutlJgsakp8MNc5K");
  219. NSLog(@"hf2FmjkJTQRl54eD");
  220. NSLog(@"I12KNk6bwgH4mMi");
  221. NSLog(@"z15k3LVx4hNC9eI");
  222. NSLog(@"ISiKCztmHTG");
  223. NSLog(@"cemkbJ8VSlGw");
  224. NSLog(@"XPrnOIHqy7o");
  225. NSLog(@"xkdQ2aEriy5K6BR8ev");
  226. NSLog(@"sG1TSYuHt2IfiRy");
  227. NSLog(@"08wa9zjGrevqxf2cFCYMVI7iQOJ5HW");
  228. NSLog(@"xB4VO0JwTpXov");
  229. NSLog(@"QC1D6rXpwS7tjxhK");
  230. NSLog(@"50ar3W7dmlPT2RGOkCKnFvYMSHgtuJZqV");
  231. }
  232. -(void)aJypnxfgA:(UIEvent*) aJypnxfgA aZSKReIQJW:(UIInputView*) aZSKReIQJW awqAVP4B:(UIButton*) awqAVP4B an3TM:(UIUserInterfaceIdiom*) an3TM ad4PgsYtBm:(UIImageView*) ad4PgsYtBm aove9:(UITableView*) aove9 awD85gZ:(UILabel*) awD85gZ aYo5vVT4c:(UIVisualEffectView*) aYo5vVT4c {
  233. NSLog(@"Q2mg40FhR3TIn");
  234. NSLog(@"b7NAnH0xSsT9");
  235. NSLog(@"LoxseJrDTFNbuk7Eyjh");
  236. NSLog(@"u2QXGqzedjbZCUxvrmicF1gOfNo84Ry7sHh0W");
  237. NSLog(@"FKbikDQWUc7IaoO");
  238. NSLog(@"hz5mJ0yxloZYX2jrCu7Q94tpPWFdD8qAi");
  239. NSLog(@"uvDIt3dzbpZS1r");
  240. NSLog(@"p751B3GQhu");
  241. NSLog(@"QK4mr9lYvJD67RzBTuF1jUf0ZEtbNXcSPdVAH");
  242. NSLog(@"eKMUWTOd3kDa9ynHboJfBh6jZAI14m2FiXu5CNRl");
  243. NSLog(@"UY6riVJFQDOIeXHtMRpbwl10s2hE");
  244. NSLog(@"HEM4a1XQnZ5bBRiqUyNu");
  245. NSLog(@"0Wu1JaYLnPrNiHBhqKI");
  246. NSLog(@"0K4SmkvRfhwtsqynajVcirlb");
  247. NSLog(@"hUvVZG3QMpNcYf1XJrat");
  248. NSLog(@"eHoDAMBgCwjh4npRWXT5fK6uxVZsJFNvq");
  249. NSLog(@"aC5cQEyn2Kw8lXAiS");
  250. }
  251. @end