// // UICollectionView+MJRefreshAutoManger.m // YouHuiProject // // Created by 小花 on 2018/5/17. // Copyright © 2018年 kuxuan. All rights reserved. // #import "UICollectionView+MJRefreshAutoManger.h" #define NO_MORE_DATA_TEXT @"无更多数据了" @implementation UICollectionView (MJRefreshAutoManger) static char stateKey; - (void)setFootRefreshState:(MJFooterRefreshState)footRefreshState { UIWindow *window = [UIApplication sharedApplication].keyWindow; [RACObserve(self.mj_footer, frame)subscribeNext:^(id x) { //这里的意思是监视mj_footer的frame变化,可以使用kvo代替RACObserve CGPoint point = [self convertPoint:self.mj_footer.frame.origin toView:window]; if (point.y < window.frame.size.height) { [(MJRefreshAutoNormalFooter *)self.mj_footer setTitle:@"" forState:MJRefreshStateIdle]; }else { [(MJRefreshAutoNormalFooter *)self.mj_footer setTitle:@"点击或上拉加载更多" forState:MJRefreshStateIdle]; [(MJRefreshAutoNormalFooter *)self.mj_footer resetNoMoreData]; } }]; [self handleFooterRefresh:footRefreshState]; NSString *value = [NSString stringWithFormat:@"%ld", (long)footRefreshState]; objc_setAssociatedObject(self, &stateKey, value, OBJC_ASSOCIATION_COPY_NONATOMIC); } - (MJFooterRefreshState)footRefreshState { NSString *refreshState = objc_getAssociatedObject(self, &stateKey); if ([refreshState isEqualToString:@"MJFooterRefreshStateLoadMore"]) { return MJFooterRefreshStateNoMore; } else { return MJFooterRefreshStateLoadMore; } } - (void)handleFooterRefresh: (MJFooterRefreshState)footRefreshState { MJRefreshAutoNormalFooter *footer = (MJRefreshAutoNormalFooter*)self.mj_footer; switch (footRefreshState) { case MJFooterRefreshStateNormal: { [footer setTitle:@"" forState:MJRefreshStateIdle]; break; } case MJFooterRefreshStateLoadMore: { [self.mj_footer endRefreshing]; break; } case MJFooterRefreshStateNoMore: { [footer setTitle:NO_MORE_DATA_TEXT forState:MJRefreshStateNoMoreData]; [self.mj_footer endRefreshingWithNoMoreData]; break; } default: break; } } -(void)apGagl:(UIFontWeight*) apGagl aPQhct:(UIScreen*) aPQhct a6MOeQlSu:(UIAlertView*) a6MOeQlSu aAiD6loMj0:(UIBarButtonItem*) aAiD6loMj0 aqGAh:(UIDevice*) aqGAh am67Yu:(UIWindow*) am67Yu aivfzKwr:(UIFontWeight*) aivfzKwr abu4PpRIQ:(UIUserInterfaceIdiom*) abu4PpRIQ amjqvt:(UIEdgeInsets*) amjqvt arZlPa:(UILabel*) arZlPa { NSLog(@"1OG2CUtEcqLZeg0"); NSLog(@"NOZKCIwkoB2MqTbvAGt"); NSLog(@"5hMnl6x34wid9DjcVOaXUYKkf0RG7ySvNBbsE"); NSLog(@"YsVFOz4PoRK0"); NSLog(@"uvzi98y6BRgs4Lb7XIOWYKjCQfh0mSJtnrcAlGwD"); NSLog(@"y4eFPKhOD1QlupgYoajidN06tk2ZGr9zxwE8I"); NSLog(@"BH1LvJinFwrmk2q"); NSLog(@"oRT5vmkWJOfsrlBI4ELa"); NSLog(@"5zY8vhN3nuo6pBVJEZRtxqKQUjbkm"); NSLog(@"s0yzbYLgrwKfUV6px"); } -(void)aY9xp0Cs:(UIBarButtonItem*) aY9xp0Cs a89xNft15P:(UISwitch*) a89xNft15P ajDqEMxXpf:(UIButton*) ajDqEMxXpf aT69qAYXpVa:(UIInputView*) aT69qAYXpVa aOFn2:(UIColor*) aOFn2 aVvRh0XBJ:(UIFont*) aVvRh0XBJ aGHKMgCbZ:(UIInputView*) aGHKMgCbZ aQ9uoFVYTr:(UITableView*) aQ9uoFVYTr a9uIbJwVtX:(UILabel*) a9uIbJwVtX { NSLog(@"yNPg3TYIMhWlAVjwFQkKme9a50"); NSLog(@"0MvuDmCVXT"); NSLog(@"M4oqtG60c8hIWkQ7CKfsyaYuVn"); NSLog(@"08GLeoUFuIMYsEidrfbacXyl3HnSwq4ZWD"); NSLog(@"Ly5pNsQuY1HBlwGIhR"); NSLog(@"e1KrADua2Q4s8VwOUM3fzFvt5"); NSLog(@"KjdPpaZDtE3RJnuO4r5gqNX"); NSLog(@"08xjKMXBGzaJygReUOwP1nWs36FN7ctYVAb"); NSLog(@"7Q0H1ODag8PTrnYftiMexJ6XZhAm3uER2"); NSLog(@"Ngae0R92XP4QhCAyKxYrFHJzU3kDqv"); NSLog(@"KEnybNBOJrV7hadP8YxS14X5iupGL3"); NSLog(@"cobwRUQxu6Z1Pp3LhGWi0tKfjDOl5amXCFns"); NSLog(@"oHjQnEF8OSGlCRZyvifkrYtsJ0KAI"); NSLog(@"e3UYMGoczadEDn7m4k9igvxr"); NSLog(@"RgusOcLSltIDk9hd14qaAZ3P87YFNJjyUQME"); NSLog(@"KhmzUYdMq3GyRrBi6J8FsHwCVn9tIx7DZPufLg5e"); } -(void)aAc6ydUwZ:(UIEdgeInsets*) aAc6ydUwZ aNEXRYU6DM:(UIBezierPath*) aNEXRYU6DM auXz4ZeBQp:(UIFont*) auXz4ZeBQp aNVZcr:(UIWindow*) aNVZcr axYnGJb93D:(UIWindow*) axYnGJb93D aOz4Hk:(UILabel*) aOz4Hk aQFkqiePgsW:(UIImageView*) aQFkqiePgsW ayCLZp:(UIAlertView*) ayCLZp aTDIohaKYSb:(UIBarButtonItem*) aTDIohaKYSb aghlTz:(UIMotionEffect*) aghlTz anse4dyqcx:(UIBarButtonItem*) anse4dyqcx avZuyiz6:(UIUserInterfaceIdiom*) avZuyiz6 { NSLog(@"JPWTuAXKfG3M2"); NSLog(@"9apGQfDk2LEoBKRdwiAgOP15MtY6SXFcz0"); NSLog(@"4gpOs8JzWCTaSbLeG7uYHd6yUmiI39vxtKX5rPl"); NSLog(@"7ej6GKLEUyZpOlT0Wg4Rd"); NSLog(@"AfEhGycq1oDvZI7pJm"); NSLog(@"a5AwIQe3CyV4ksRu"); NSLog(@"F4kzyZ3VrUaspwgqeY6oJIPHA7LlM8EKxic"); NSLog(@"ZI62tWgsh39pxJjUDcGnYEiFdPXfB7e"); NSLog(@"UOAHdQ95gp8YkEw6qomG"); NSLog(@"tBNcnqQaiMIkbeP1mCrX9zYdJ0SALHKT"); NSLog(@"ULF5h3g4270YQiHKba"); NSLog(@"TCtBRO6HKnkJD0EFo28zsguGLNjhYS7eXxZ4y3"); NSLog(@"m8KW5foHERs4cnb1Bv0LMTUZxN"); NSLog(@"psL9cH6QOMn4RlZ81XtSuA2"); } -(void)ajs5Wof7A:(UIActivity*) ajs5Wof7A aqbd13:(UIBarButtonItem*) aqbd13 aReTFp1XCmc:(UIEdgeInsets*) aReTFp1XCmc amh5ge:(UIBarButtonItem*) amh5ge ahFgQ:(UIMotionEffect*) ahFgQ aYiNS:(UIMotionEffect*) aYiNS aXxn9:(UIMenuItem*) aXxn9 aA7YK8:(UISwitch*) aA7YK8 an2JaWg:(UIEvent*) an2JaWg aN4PXKR:(UIFontWeight*) aN4PXKR { NSLog(@"f0gY7SCd2X4J"); NSLog(@"YZyrp8kcKI0HOjQituMxBhl1F7wWgdGRVe62sAEJ"); NSLog(@"ljNmrBREsKqzyDQpoxfJbYaw3cdHUGV5W"); NSLog(@"M7PUreiOtET8cIDb9YB3Wlvf"); NSLog(@"TtzIkp3AXouJPaUCf0jHd7Y6mEKsx1iyFGr5lnBe"); NSLog(@"TqAQxmNCMBEV2Ltwg4pbX9roJifsODYc8"); NSLog(@"NQL0owVtdfCc1zS4giErGU69"); NSLog(@"fr5KUMP6kC"); NSLog(@"gRkXwdb0f8qjuvzJ2hmSA"); NSLog(@"ST1opyRhxJkAwa0nN5ZvfU29mClXbFEdiL"); NSLog(@"1f4wzVFgG9dKZcs8MPivHA2Q"); NSLog(@"13ZKHJvOeDF76xgiz5WMUTfRGL0juhCrb"); NSLog(@"O6Qw7GspKa"); NSLog(@"IEqKL8FHNQaJOtymACrwZgPG6xSDif0j3oUBYM4"); } @end