├── .gitignore ├── JSLoadMoreService.podspec ├── JSLoadMoreService ├── JSLoadMoreHeader.h ├── JSRequestTools.h ├── JSRequestTools.m ├── NSObject+LoadMoreService.h ├── NSObject+LoadMoreService.m ├── UITableView+Preload.h └── UITableView+Preload.m ├── JSLoadMoreServiceDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── JSLoadMoreServiceDemo.xcworkspace └── contents.xcworkspacedata ├── JSLoadMoreServiceDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Demo │ ├── Model │ │ ├── JSGoodListModel.h │ │ └── JSGoodListModel.m │ ├── View │ │ ├── JSListTableView.h │ │ └── JSListTableView.m │ ├── ViewController │ │ ├── ViewController.h │ │ └── ViewController.m │ └── ViewModel │ │ ├── JSListViewModel.h │ │ └── JSListViewModel.m ├── Info.plist └── main.m ├── JSLoadMoreServiceDemoTests ├── Info.plist └── JSLoadMoreServiceDemoTests.m ├── JSLoadMoreServiceDemoUITests ├── Info.plist └── JSLoadMoreServiceDemoUITests.m ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ ├── README.md │ └── UIKit+AFNetworking │ │ ├── AFAutoPurgingImageCache.h │ │ ├── AFAutoPurgingImageCache.m │ │ ├── AFImageDownloader.h │ │ ├── AFImageDownloader.m │ │ ├── AFNetworkActivityIndicatorManager.h │ │ ├── AFNetworkActivityIndicatorManager.m │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ ├── UIButton+AFNetworking.h │ │ ├── UIButton+AFNetworking.m │ │ ├── UIImage+AFNetworking.h │ │ ├── UIImageView+AFNetworking.h │ │ ├── UIImageView+AFNetworking.m │ │ ├── UIKit+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.h │ │ ├── UIProgressView+AFNetworking.m │ │ ├── UIRefreshControl+AFNetworking.h │ │ ├── UIRefreshControl+AFNetworking.m │ │ ├── UIWebView+AFNetworking.h │ │ └── UIWebView+AFNetworking.m ├── MJRefresh │ ├── LICENSE │ ├── MJRefresh │ │ ├── Base │ │ │ ├── MJRefreshAutoFooter.h │ │ │ ├── MJRefreshAutoFooter.m │ │ │ ├── MJRefreshBackFooter.h │ │ │ ├── MJRefreshBackFooter.m │ │ │ ├── MJRefreshComponent.h │ │ │ ├── MJRefreshComponent.m │ │ │ ├── MJRefreshFooter.h │ │ │ ├── MJRefreshFooter.m │ │ │ ├── MJRefreshHeader.h │ │ │ └── MJRefreshHeader.m │ │ ├── Custom │ │ │ ├── Footer │ │ │ │ ├── Auto │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ ├── MJRefreshAutoGifFooter.m │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ └── Back │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ ├── MJRefreshBackNormalFooter.m │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ └── Header │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ └── MJRefreshStateHeader.m │ │ ├── MJRefresh.bundle │ │ │ ├── arrow@2x.png │ │ │ ├── en.lproj │ │ │ │ └── Localizable.strings │ │ │ ├── zh-Hans.lproj │ │ │ │ └── Localizable.strings │ │ │ └── zh-Hant.lproj │ │ │ │ └── Localizable.strings │ │ ├── MJRefresh.h │ │ ├── MJRefreshConst.h │ │ ├── MJRefreshConst.m │ │ ├── NSBundle+MJRefresh.h │ │ ├── NSBundle+MJRefresh.m │ │ ├── UIScrollView+MJExtension.h │ │ ├── UIScrollView+MJExtension.m │ │ ├── UIScrollView+MJRefresh.h │ │ ├── UIScrollView+MJRefresh.m │ │ ├── UIView+MJExtension.h │ │ └── UIView+MJExtension.m │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── ReactiveObjC │ ├── LICENSE.md │ ├── README.md │ └── ReactiveObjC │ │ ├── MKAnnotationView+RACSignalSupport.h │ │ ├── MKAnnotationView+RACSignalSupport.m │ │ ├── NSArray+RACSequenceAdditions.h │ │ ├── NSArray+RACSequenceAdditions.m │ │ ├── NSData+RACSupport.h │ │ ├── NSData+RACSupport.m │ │ ├── NSDictionary+RACSequenceAdditions.h │ │ ├── NSDictionary+RACSequenceAdditions.m │ │ ├── NSEnumerator+RACSequenceAdditions.h │ │ ├── NSEnumerator+RACSequenceAdditions.m │ │ ├── NSFileHandle+RACSupport.h │ │ ├── NSFileHandle+RACSupport.m │ │ ├── NSIndexSet+RACSequenceAdditions.h │ │ ├── NSIndexSet+RACSequenceAdditions.m │ │ ├── NSInvocation+RACTypeParsing.h │ │ ├── NSInvocation+RACTypeParsing.m │ │ ├── NSNotificationCenter+RACSupport.h │ │ ├── NSNotificationCenter+RACSupport.m │ │ ├── NSObject+RACDeallocating.h │ │ ├── NSObject+RACDeallocating.m │ │ ├── NSObject+RACDescription.h │ │ ├── NSObject+RACDescription.m │ │ ├── NSObject+RACKVOWrapper.h │ │ ├── NSObject+RACKVOWrapper.m │ │ ├── NSObject+RACLifting.h │ │ ├── NSObject+RACLifting.m │ │ ├── NSObject+RACPropertySubscribing.h │ │ ├── NSObject+RACPropertySubscribing.m │ │ ├── NSObject+RACSelectorSignal.h │ │ ├── NSObject+RACSelectorSignal.m │ │ ├── NSOrderedSet+RACSequenceAdditions.h │ │ ├── NSOrderedSet+RACSequenceAdditions.m │ │ ├── NSSet+RACSequenceAdditions.h │ │ ├── NSSet+RACSequenceAdditions.m │ │ ├── NSString+RACKeyPathUtilities.h │ │ ├── NSString+RACKeyPathUtilities.m │ │ ├── NSString+RACSequenceAdditions.h │ │ ├── NSString+RACSequenceAdditions.m │ │ ├── NSString+RACSupport.h │ │ ├── NSString+RACSupport.m │ │ ├── NSURLConnection+RACSupport.h │ │ ├── NSURLConnection+RACSupport.m │ │ ├── NSUserDefaults+RACSupport.h │ │ ├── NSUserDefaults+RACSupport.m │ │ ├── RACAnnotations.h │ │ ├── RACArraySequence.h │ │ ├── RACArraySequence.m │ │ ├── RACBehaviorSubject.h │ │ ├── RACBehaviorSubject.m │ │ ├── RACBlockTrampoline.h │ │ ├── RACBlockTrampoline.m │ │ ├── RACChannel.h │ │ ├── RACChannel.m │ │ ├── RACCommand.h │ │ ├── RACCommand.m │ │ ├── RACCompoundDisposable.h │ │ ├── RACCompoundDisposable.m │ │ ├── RACCompoundDisposableProvider.d │ │ ├── RACDelegateProxy.h │ │ ├── RACDelegateProxy.m │ │ ├── RACDisposable.h │ │ ├── RACDisposable.m │ │ ├── RACDynamicSequence.h │ │ ├── RACDynamicSequence.m │ │ ├── RACDynamicSignal.h │ │ ├── RACDynamicSignal.m │ │ ├── RACEagerSequence.h │ │ ├── RACEagerSequence.m │ │ ├── RACEmptySequence.h │ │ ├── RACEmptySequence.m │ │ ├── RACEmptySignal.h │ │ ├── RACEmptySignal.m │ │ ├── RACErrorSignal.h │ │ ├── RACErrorSignal.m │ │ ├── RACEvent.h │ │ ├── RACEvent.m │ │ ├── RACGroupedSignal.h │ │ ├── RACGroupedSignal.m │ │ ├── RACImmediateScheduler.h │ │ ├── RACImmediateScheduler.m │ │ ├── RACIndexSetSequence.h │ │ ├── RACIndexSetSequence.m │ │ ├── RACKVOChannel.h │ │ ├── RACKVOChannel.m │ │ ├── RACKVOProxy.h │ │ ├── RACKVOProxy.m │ │ ├── RACKVOTrampoline.h │ │ ├── RACKVOTrampoline.m │ │ ├── RACMulticastConnection+Private.h │ │ ├── RACMulticastConnection.h │ │ ├── RACMulticastConnection.m │ │ ├── RACPassthroughSubscriber.h │ │ ├── RACPassthroughSubscriber.m │ │ ├── RACQueueScheduler+Subclass.h │ │ ├── RACQueueScheduler.h │ │ ├── RACQueueScheduler.m │ │ ├── RACReplaySubject.h │ │ ├── RACReplaySubject.m │ │ ├── RACReturnSignal.h │ │ ├── RACReturnSignal.m │ │ ├── RACScheduler+Private.h │ │ ├── RACScheduler+Subclass.h │ │ ├── RACScheduler.h │ │ ├── RACScheduler.m │ │ ├── RACScopedDisposable.h │ │ ├── RACScopedDisposable.m │ │ ├── RACSequence.h │ │ ├── RACSequence.m │ │ ├── RACSerialDisposable.h │ │ ├── RACSerialDisposable.m │ │ ├── RACSignal+Operations.h │ │ ├── RACSignal+Operations.m │ │ ├── RACSignal.h │ │ ├── RACSignal.m │ │ ├── RACSignalProvider.d │ │ ├── RACSignalSequence.h │ │ ├── RACSignalSequence.m │ │ ├── RACStream+Private.h │ │ ├── RACStream.h │ │ ├── RACStream.m │ │ ├── RACStringSequence.h │ │ ├── RACStringSequence.m │ │ ├── RACSubject.h │ │ ├── RACSubject.m │ │ ├── RACSubscriber+Private.h │ │ ├── RACSubscriber.h │ │ ├── RACSubscriber.m │ │ ├── RACSubscriptingAssignmentTrampoline.h │ │ ├── RACSubscriptingAssignmentTrampoline.m │ │ ├── RACSubscriptionScheduler.h │ │ ├── RACSubscriptionScheduler.m │ │ ├── RACTargetQueueScheduler.h │ │ ├── RACTargetQueueScheduler.m │ │ ├── RACTestScheduler.h │ │ ├── RACTestScheduler.m │ │ ├── RACTuple.h │ │ ├── RACTuple.m │ │ ├── RACTupleSequence.h │ │ ├── RACTupleSequence.m │ │ ├── RACUnarySequence.h │ │ ├── RACUnarySequence.m │ │ ├── RACUnit.h │ │ ├── RACUnit.m │ │ ├── RACValueTransformer.h │ │ ├── RACValueTransformer.m │ │ ├── ReactiveObjC.h │ │ ├── UIActionSheet+RACSignalSupport.h │ │ ├── UIActionSheet+RACSignalSupport.m │ │ ├── UIAlertView+RACSignalSupport.h │ │ ├── UIAlertView+RACSignalSupport.m │ │ ├── UIBarButtonItem+RACCommandSupport.h │ │ ├── UIBarButtonItem+RACCommandSupport.m │ │ ├── UIButton+RACCommandSupport.h │ │ ├── UIButton+RACCommandSupport.m │ │ ├── UICollectionReusableView+RACSignalSupport.h │ │ ├── UICollectionReusableView+RACSignalSupport.m │ │ ├── UIControl+RACSignalSupport.h │ │ ├── UIControl+RACSignalSupport.m │ │ ├── UIControl+RACSignalSupportPrivate.h │ │ ├── UIControl+RACSignalSupportPrivate.m │ │ ├── UIDatePicker+RACSignalSupport.h │ │ ├── UIDatePicker+RACSignalSupport.m │ │ ├── UIGestureRecognizer+RACSignalSupport.h │ │ ├── UIGestureRecognizer+RACSignalSupport.m │ │ ├── UIImagePickerController+RACSignalSupport.h │ │ ├── UIImagePickerController+RACSignalSupport.m │ │ ├── UIRefreshControl+RACCommandSupport.h │ │ ├── UIRefreshControl+RACCommandSupport.m │ │ ├── UISegmentedControl+RACSignalSupport.h │ │ ├── UISegmentedControl+RACSignalSupport.m │ │ ├── UISlider+RACSignalSupport.h │ │ ├── UISlider+RACSignalSupport.m │ │ ├── UIStepper+RACSignalSupport.h │ │ ├── UIStepper+RACSignalSupport.m │ │ ├── UISwitch+RACSignalSupport.h │ │ ├── UISwitch+RACSignalSupport.m │ │ ├── UITableViewCell+RACSignalSupport.h │ │ ├── UITableViewCell+RACSignalSupport.m │ │ ├── UITableViewHeaderFooterView+RACSignalSupport.h │ │ ├── UITableViewHeaderFooterView+RACSignalSupport.m │ │ ├── UITextField+RACSignalSupport.h │ │ ├── UITextField+RACSignalSupport.m │ │ ├── UITextView+RACSignalSupport.h │ │ ├── UITextView+RACSignalSupport.m │ │ └── extobjc │ │ ├── RACEXTKeyPathCoding.h │ │ ├── RACEXTRuntimeExtensions.h │ │ ├── RACEXTRuntimeExtensions.m │ │ ├── RACEXTScope.h │ │ └── RACmetamacros.h ├── Target Support Files │ ├── AFNetworking │ │ ├── AFNetworking-dummy.m │ │ ├── AFNetworking-prefix.pch │ │ ├── AFNetworking-umbrella.h │ │ ├── AFNetworking.modulemap │ │ ├── AFNetworking.xcconfig │ │ └── Info.plist │ ├── MJRefresh │ │ ├── Info.plist │ │ ├── MJRefresh-dummy.m │ │ ├── MJRefresh-prefix.pch │ │ ├── MJRefresh-umbrella.h │ │ ├── MJRefresh.modulemap │ │ └── MJRefresh.xcconfig │ ├── Pods-JSLoadMoreServiceDemo │ │ ├── Info.plist │ │ ├── Pods-JSLoadMoreServiceDemo-acknowledgements.markdown │ │ ├── Pods-JSLoadMoreServiceDemo-acknowledgements.plist │ │ ├── Pods-JSLoadMoreServiceDemo-dummy.m │ │ ├── Pods-JSLoadMoreServiceDemo-frameworks.sh │ │ ├── Pods-JSLoadMoreServiceDemo-resources.sh │ │ ├── Pods-JSLoadMoreServiceDemo-umbrella.h │ │ ├── Pods-JSLoadMoreServiceDemo.debug.xcconfig │ │ ├── Pods-JSLoadMoreServiceDemo.modulemap │ │ └── Pods-JSLoadMoreServiceDemo.release.xcconfig │ ├── ReactiveObjC │ │ ├── Info.plist │ │ ├── ReactiveObjC-dummy.m │ │ ├── ReactiveObjC-prefix.pch │ │ ├── ReactiveObjC-umbrella.h │ │ ├── ReactiveObjC.modulemap │ │ └── ReactiveObjC.xcconfig │ └── YYModel │ │ ├── Info.plist │ │ ├── YYModel-dummy.m │ │ ├── YYModel-prefix.pch │ │ ├── YYModel-umbrella.h │ │ ├── YYModel.modulemap │ │ └── YYModel.xcconfig └── YYModel │ ├── LICENSE │ ├── README.md │ └── YYModel │ ├── NSObject+YYModel.h │ ├── NSObject+YYModel.m │ ├── YYClassInfo.h │ ├── YYClassInfo.m │ └── YYModel.h └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | 65 | README.md 66 | -------------------------------------------------------------------------------- /JSLoadMoreService/JSLoadMoreHeader.h: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // JSLoadMoreHeader.h 4 | // JSLoadMoreServiceDemo 5 | // 6 | // Created by 乔同新 on 2017/8/8. 7 | // Copyright © 2017年 乔同新. All rights reserved. 8 | // Github: https://github.com/Josin22/JSLoadMoreService 9 | 10 | #ifndef JSLoadMoreHeader_h 11 | #define JSLoadMoreHeader_h 12 | 13 | #import "NSObject+LoadMoreService.h" 14 | #import "JSRequestTools.h" 15 | #import "UITableView+Preload.h" 16 | 17 | #if __has_include() 18 | #import 19 | #endif 20 | 21 | #if __has_include("AFNetworking.h") 22 | #import "AFNetworking.h" 23 | #endif 24 | 25 | #if __has_include("YYModel.h") 26 | #import "YYModel.h" 27 | #endif 28 | 29 | #if __has_include() 30 | #import 31 | #endif 32 | 33 | #endif /* JSLoadMoreHeader_h */ 34 | -------------------------------------------------------------------------------- /JSLoadMoreService/JSRequestTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSRequestTools.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | 11 | @class RACSignal,JSFileConfig; 12 | 13 | typedef NS_ENUM(NSInteger, RequestType) { 14 | RequestTypeGET = 0, 15 | RequestTypePOST, 16 | RequestTypeDELETE, 17 | RequestTypePUT, 18 | RequestTypePOSTUPLOAD 19 | }; 20 | /** 21 | * 简单用RAC封装的请求下 22 | */ 23 | @interface JSRequestTools : NSObject 24 | 25 | + (RACSignal *)js_getURL:(NSString *)url para:(NSMutableDictionary *)para; 26 | 27 | + (RACSignal *)js_postURL:(NSString *)url para:(NSMutableDictionary *)para; 28 | 29 | + (RACSignal *)js_deleteURL:(NSString *)url para:(NSMutableDictionary *)para; 30 | 31 | + (RACSignal *)js_putURL:(NSString *)url para:(NSMutableDictionary *)para; 32 | 33 | + (RACSignal *)js_uploadURL:(NSString *)url para:(NSMutableDictionary *)para files:(NSMutableArray *)files; 34 | 35 | @end 36 | 37 | 38 | /** 39 | * 用来封装上文件数据的模型类 40 | */ 41 | @interface JSFileConfig : NSObject 42 | /** 43 | * 文件数据 44 | */ 45 | @property (nonatomic, strong) NSData *fileData; 46 | 47 | /** 48 | * 服务器接收参数名 49 | */ 50 | @property (nonatomic, copy) NSString *name; 51 | 52 | /** 53 | * 文件名 54 | */ 55 | @property (nonatomic, copy) NSString *fileName; 56 | 57 | /** 58 | * 文件类型 59 | */ 60 | @property (nonatomic, copy) NSString *mimeType; 61 | 62 | + (instancetype)fileConfigWithfileData:(NSData *)fileData 63 | name:(NSString *)name 64 | fileName:(NSString *)fileName 65 | mimeType:(NSString *)mimeType; 66 | 67 | - (instancetype)initWithfileData:(NSData *)fileData 68 | name:(NSString *)name 69 | fileName:(NSString *)fileName 70 | mimeType:(NSString *)mimeType; 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /JSLoadMoreService/UITableView+Preload.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Prereload.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/8. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | 11 | #define kWeakSelf(type)__weak typeof(type)weak##type = type; 12 | 13 | #define kStrongSelf(type)__strong typeof(type)type = weak##type; 14 | 15 | /** 16 | * 预加载触发的数量 17 | */ 18 | static NSInteger const PreloadMinCount = 10; 19 | 20 | typedef void(^PreloadBlock)(void); 21 | 22 | typedef void(^ReloadBlock)(void); 23 | 24 | @interface UITableView (Prereload) 25 | /** 26 | * 预加载回调 27 | */ 28 | @property (nonatomic, copy ) PreloadBlock js_preloadBlock; 29 | /** 30 | * tableview数据 31 | */ 32 | @property (nonatomic, strong) NSMutableArray *dataArray; 33 | /** 34 | * 计算当前index是否达到预加载条件并回调 35 | * 36 | * @param currentIndex row or section 37 | */ 38 | - (void)preloadDataWithCurrentIndex:(NSInteger)currentIndex; 39 | /** 40 | * 上拉刷新 41 | * 42 | * @param js_reloadBlock 刷新回调 43 | */ 44 | - (void)headerReloadBlock:(ReloadBlock)js_reloadBlock; 45 | /** 46 | * 结束上拉刷新 47 | */ 48 | - (void)endReload; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /JSLoadMoreService/UITableView+Preload.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+Prereload.m 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/8. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import "UITableView+Preload.h" 10 | #import 11 | #import 12 | 13 | static const char * key_js_dataArray = "key_js_dataArray"; 14 | 15 | static const char * key_js_preloadBlock = "key_js_preloadBlock"; 16 | 17 | @implementation UITableView (Prereload) 18 | 19 | - (PreloadBlock)js_preloadBlock{ 20 | return objc_getAssociatedObject(self, &key_js_preloadBlock); 21 | } 22 | 23 | - (void)setJs_preloadBlock:(PreloadBlock)js_preloadBlock{ 24 | objc_setAssociatedObject(self, &key_js_preloadBlock, js_preloadBlock, OBJC_ASSOCIATION_COPY); 25 | } 26 | 27 | - (NSMutableArray *)dataArray{ 28 | return objc_getAssociatedObject(self, &key_js_dataArray); 29 | } 30 | 31 | - (void)setDataArray:(NSMutableArray *)dataArray{ 32 | objc_setAssociatedObject(self, &key_js_dataArray, dataArray, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 33 | } 34 | 35 | - (void)headerReloadBlock:(ReloadBlock)js_reloadBlock{ 36 | 37 | MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:js_reloadBlock]; 38 | self.mj_header = header; 39 | } 40 | 41 | - (void)endReload{ 42 | 43 | [self.mj_header endRefreshing]; 44 | } 45 | 46 | - (void)preloadDataWithCurrentIndex:(NSInteger)currentIndex{ 47 | NSInteger totalCount = self.dataArray.count; 48 | if ([self isSatisfyPreloadDataWithTotalCount:totalCount currentIndex:currentIndex]&&self.js_preloadBlock) { 49 | self.js_preloadBlock(); 50 | } 51 | } 52 | 53 | - (BOOL)isSatisfyPreloadDataWithTotalCount:(NSInteger)totalCount currentIndex:(NSInteger)currentIndex{ 54 | return ((currentIndex == totalCount - PreloadMinCount) && (currentIndex >= PreloadMinCount)); 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/Model/JSGoodListModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSGoodListModel.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/8. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | 11 | @interface JSGoodListModel : NSObject 12 | 13 | @property (nonatomic, copy ) NSString *title; 14 | @property (nonatomic, copy ) NSString *avatar_url; 15 | @property (nonatomic, strong) NSNumber *price; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/Model/JSGoodListModel.m: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // JSGoodListModel.m 4 | // JSLoadMoreServiceDemo 5 | // 6 | // Created by 乔同新 on 2017/8/8. 7 | // Copyright © 2017年 乔同新. All rights reserved. 8 | // 9 | 10 | #import "JSGoodListModel.h" 11 | 12 | @implementation JSGoodListModel 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/View/JSListTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSListTableView.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/8. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | 11 | @interface JSListTableView : UITableView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/ViewController/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/ViewModel/JSListViewModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSListViewModel.h 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import 10 | #import "NSObject+LoadMoreService.h" 11 | 12 | @interface JSListViewModel : NSObject 13 | 14 | - (RACSignal *)siganlForJokeDataIsReload:(BOOL)isReload; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Demo/ViewModel/JSListViewModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSListViewModel.m 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // Github: https://github.com/Josin22/JSLoadMoreService 8 | 9 | #import "JSListViewModel.h" 10 | #import "JSGoodListModel.h" 11 | #import "JSLoadMoreHeader.h" 12 | 13 | static NSString *const Test_Page_URL = @"http://www.51xiaoniu.cn/api/v1/products"; 14 | 15 | @implementation JSListViewModel 16 | 17 | - (RACSignal *)siganlForJokeDataIsReload:(BOOL)isReload{ 18 | 19 | RACReplaySubject *subject = [RACReplaySubject subject]; 20 | 21 | [[self js_singalForSingleRequestWithURL:Test_Page_URL 22 | para:nil 23 | keyOfArray:@"pdlist" 24 | classNameOfModelArray:@"JSGoodListModel" 25 | isReload:isReload] subscribeNext:^(id _Nullable x) { 26 | /** 27 | * x : 分类方法(js_singalForSingleRequestWithURL:...)里 sendNext 传过来的数组 28 | * 你可以对每次传过来的数组的元素"再加工",知道达到你的要求后 再 sendNext 29 | */ 30 | //... 31 | [subject sendNext:x]; 32 | } error:^(NSError * _Nullable error) { 33 | [subject sendError:error]; 34 | } completed:^{ 35 | /** 36 | * 走到这里为,每次分页请求所有逻辑处理完毕 37 | */ 38 | [subject sendCompleted]; 39 | }]; 40 | 41 | return subject; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JSLoadMoreServiceDemo 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemoTests/JSLoadMoreServiceDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSLoadMoreServiceDemoTests.m 3 | // JSLoadMoreServiceDemoTests 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JSLoadMoreServiceDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JSLoadMoreServiceDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /JSLoadMoreServiceDemoUITests/JSLoadMoreServiceDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSLoadMoreServiceDemoUITests.m 3 | // JSLoadMoreServiceDemoUITests 4 | // 5 | // Created by 乔同新 on 2017/8/7. 6 | // Copyright © 2017年 乔同新. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JSLoadMoreServiceDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation JSLoadMoreServiceDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 乔同X 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/artsy/Specs.git' 2 | source 'https://github.com/CocoaPods/Specs.git' 3 | 4 | platform :ios, '8.0' 5 | target ‘JSLoadMoreServiceDemo’ do 6 | use_frameworks! 7 | pod 'AFNetworking' 8 | pod 'ReactiveObjC' 9 | pod 'YYModel' 10 | pod 'MJRefresh' 11 | # pod 'JSLoadMoreService' 12 | end 13 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | - MJRefresh (3.1.12) 18 | - ReactiveObjC (3.0.0) 19 | - YYModel (1.0.4) 20 | 21 | DEPENDENCIES: 22 | - AFNetworking 23 | - MJRefresh 24 | - ReactiveObjC 25 | - YYModel 26 | 27 | SPEC CHECKSUMS: 28 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 29 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 30 | ReactiveObjC: ce79989e8684b9086b5f8d0c74bc7b81a8729c9e 31 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 32 | 33 | PODFILE CHECKSUM: b7fd768f689c00d5ea1834fda9e4a8238ea084a2 34 | 35 | COCOAPODS: 1.2.1.rc.1 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/MJRefresh/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden; 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | 17 | /** 设置state状态下的文字 */ 18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 19 | 20 | /** 隐藏刷新状态的文字 */ 21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | /** 设置state状态下的文字 */ 17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 18 | 19 | /** 获取state状态下的title */ 20 | - (NSString *)titleForState:(MJRefreshState)state; 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 文字距离圈圈、箭头的距离 */ 20 | @property (assign, nonatomic) CGFloat labelLeftInset; 21 | /** 显示刷新状态的label */ 22 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 23 | /** 设置state状态下的文字 */ 24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josin22/JSLoadMoreService/d568f21f0ccfe10096d6a6156474373b18a2f829/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josin22/JSLoadMoreService/d568f21f0ccfe10096d6a6156474373b18a2f829/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Josin22/JSLoadMoreService/d568f21f0ccfe10096d6a6156474373b18a2f829/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "下拉可以刷新"; 2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新"; 3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多"; 6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢"; 8 | 9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多"; 10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多"; 11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "最後更新:"; 15 | "MJRefreshHeaderDateTodayText" = "今天"; 16 | "MJRefreshHeaderNoneLastDateText" = "無記錄"; 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | 5 | const CGFloat MJRefreshLabelLeftInset = 25; 6 | const CGFloat MJRefreshHeaderHeight = 54.0; 7 | const CGFloat MJRefreshFooterHeight = 44.0; 8 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 10 | 11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset"; 12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset"; 13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize"; 14 | NSString *const MJRefreshKeyPathPanState = @"state"; 15 | 16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey"; 17 | 18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText"; 19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText"; 20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText"; 21 | 22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText"; 23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText"; 24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText"; 25 | 26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText"; 27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText"; 28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText"; 29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText"; 30 | 31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText"; 32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText"; 33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText"; -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (MJRefresh) 12 | + (instancetype)mj_refreshBundle; 13 | + (UIImage *)mj_arrowImage; 14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value; 15 | + (NSString *)mj_localizedStringForKey:(NSString *)key; 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_insetT; 14 | @property (assign, nonatomic) CGFloat mj_insetB; 15 | @property (assign, nonatomic) CGFloat mj_insetL; 16 | @property (assign, nonatomic) CGFloat mj_insetR; 17 | 18 | @property (assign, nonatomic) CGFloat mj_offsetX; 19 | @property (assign, nonatomic) CGFloat mj_offsetY; 20 | 21 | @property (assign, nonatomic) CGFloat mj_contentW; 22 | @property (assign, nonatomic) CGFloat mj_contentH; 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/MJRefresh/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIView+MJExtension.h" 11 | 12 | @implementation UIView (MJExtension) 13 | - (void)setMj_x:(CGFloat)mj_x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = mj_x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)mj_x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setMj_y:(CGFloat)mj_y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = mj_y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)mj_y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setMj_w:(CGFloat)mj_w 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = mj_w; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)mj_w 45 | { 46 | return self.frame.size.width; 47 | } 48 | 49 | - (void)setMj_h:(CGFloat)mj_h 50 | { 51 | CGRect frame = self.frame; 52 | frame.size.height = mj_h; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)mj_h 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setMj_size:(CGSize)mj_size 62 | { 63 | CGRect frame = self.frame; 64 | frame.size = mj_size; 65 | self.frame = frame; 66 | } 67 | 68 | - (CGSize)mj_size 69 | { 70 | return self.frame.size; 71 | } 72 | 73 | - (void)setMj_origin:(CGPoint)mj_origin 74 | { 75 | CGRect frame = self.frame; 76 | frame.origin = mj_origin; 77 | self.frame = frame; 78 | } 79 | 80 | - (CGPoint)mj_origin 81 | { 82 | return self.frame.origin; 83 | } 84 | @end 85 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | - MJRefresh (3.1.12) 18 | - ReactiveObjC (3.0.0) 19 | - YYModel (1.0.4) 20 | 21 | DEPENDENCIES: 22 | - AFNetworking 23 | - MJRefresh 24 | - ReactiveObjC 25 | - YYModel 26 | 27 | SPEC CHECKSUMS: 28 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 29 | MJRefresh: b96cdb21c4aa75a7b07654311ab2f315c497e806 30 | ReactiveObjC: ce79989e8684b9086b5f8d0c74bc7b81a8729c9e 31 | YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30 32 | 33 | PODFILE CHECKSUM: b7fd768f689c00d5ea1834fda9e4a8238ea084a2 34 | 35 | COCOAPODS: 1.2.1.rc.1 36 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/LICENSE.md: -------------------------------------------------------------------------------- 1 | **Copyright (c) 2012 - 2016, GitHub, Inc.** 2 | **All rights reserved.** 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/MKAnnotationView+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Zak Remer on 3/31/15. 6 | // Copyright (c) 2015 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @class RACSignal<__covariant ValueType>; 13 | @class RACUnit; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface MKAnnotationView (RACSignalSupport) 18 | 19 | /// A signal which will send a RACUnit whenever -prepareForReuse is invoked upon 20 | /// the receiver. 21 | /// 22 | /// Examples 23 | /// 24 | /// [[[self.cancelButton 25 | /// rac_signalForControlEvents:UIControlEventTouchUpInside] 26 | /// takeUntil:self.rac_prepareForReuseSignal] 27 | /// subscribeNext:^(UIButton *x) { 28 | /// // do other things 29 | /// }]; 30 | @property (nonatomic, strong, readonly) RACSignal *rac_prepareForReuseSignal; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/MKAnnotationView+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // MKAnnotationView+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Zak Remer on 3/31/15. 6 | // Copyright (c) 2015 GitHub. All rights reserved. 7 | // 8 | 9 | #import "MKAnnotationView+RACSignalSupport.h" 10 | #import "NSObject+RACDescription.h" 11 | #import "NSObject+RACSelectorSignal.h" 12 | #import "RACSignal+Operations.h" 13 | #import "RACUnit.h" 14 | #import 15 | 16 | @implementation MKAnnotationView (RACSignalSupport) 17 | 18 | - (RACSignal *)rac_prepareForReuseSignal { 19 | RACSignal *signal = objc_getAssociatedObject(self, _cmd); 20 | if (signal != nil) return signal; 21 | 22 | signal = [[[self 23 | rac_signalForSelector:@selector(prepareForReuse)] 24 | mapReplace:RACUnit.defaultUnit] 25 | setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)]; 26 | 27 | objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return signal; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSArray+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSArray<__covariant ObjectType> (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence corresponding to the receiver. 18 | /// 19 | /// Mutating the receiver will not affect the sequence after it's been created. 20 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSArray+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSArray+RACSequenceAdditions.h" 10 | #import "RACArraySequence.h" 11 | 12 | @implementation NSArray (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | return [RACArraySequence sequenceWithArray:self offset:0]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSData+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/11/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACScheduler; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface NSData (RACSupport) 17 | 18 | // Read the data at the URL using -[NSData initWithContentsOfURL:options:error:]. 19 | // Sends the data or the error. 20 | // 21 | // scheduler - cannot be nil. 22 | + (RACSignal *)rac_readContentsOfURL:(nullable NSURL *)URL options:(NSDataReadingOptions)options scheduler:(RACScheduler *)scheduler; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSData+RACSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+RACSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/11/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSData+RACSupport.h" 10 | #import "RACReplaySubject.h" 11 | #import "RACScheduler.h" 12 | 13 | @implementation NSData (RACSupport) 14 | 15 | + (RACSignal *)rac_readContentsOfURL:(NSURL *)URL options:(NSDataReadingOptions)options scheduler:(RACScheduler *)scheduler { 16 | NSCParameterAssert(scheduler != nil); 17 | 18 | RACReplaySubject *subject = [RACReplaySubject subject]; 19 | [subject setNameWithFormat:@"+rac_readContentsOfURL: %@ options: %lu scheduler: %@", URL, (unsigned long)options, scheduler]; 20 | 21 | [scheduler schedule:^{ 22 | NSError *error = nil; 23 | NSData *data = [[NSData alloc] initWithContentsOfURL:URL options:options error:&error]; 24 | if (data == nil) { 25 | [subject sendError:error]; 26 | } else { 27 | [subject sendNext:data]; 28 | [subject sendCompleted]; 29 | } 30 | }]; 31 | 32 | return subject; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSDictionary+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | @class RACTwoTuple<__covariant First, __covariant Second>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface NSDictionary<__covariant KeyType, __covariant ObjectType> (RACSequenceAdditions) 17 | 18 | /// Creates and returns a sequence of key/value tuples. 19 | /// 20 | /// Mutating the receiver will not affect the sequence after it's been created. 21 | @property (nonatomic, copy, readonly) RACSequence *> *rac_sequence; 22 | 23 | /// Creates and returns a sequence corresponding to the keys in the receiver. 24 | /// 25 | /// Mutating the receiver will not affect the sequence after it's been created. 26 | @property (nonatomic, copy, readonly) RACSequence *rac_keySequence; 27 | 28 | /// Creates and returns a sequence corresponding to the values in the receiver. 29 | /// 30 | /// Mutating the receiver will not affect the sequence after it's been created. 31 | @property (nonatomic, copy, readonly) RACSequence *rac_valueSequence; 32 | 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSDictionary+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+RACSequenceAdditions.h" 10 | #import "NSArray+RACSequenceAdditions.h" 11 | #import "RACSequence.h" 12 | #import "RACTuple.h" 13 | 14 | @implementation NSDictionary (RACSequenceAdditions) 15 | 16 | - (RACSequence *)rac_sequence { 17 | NSDictionary *immutableDict = [self copy]; 18 | 19 | // TODO: First class support for dictionary sequences. 20 | return [immutableDict.allKeys.rac_sequence map:^(id key) { 21 | id value = immutableDict[key]; 22 | return RACTuplePack(key, value); 23 | }]; 24 | } 25 | 26 | - (RACSequence *)rac_keySequence { 27 | return self.allKeys.rac_sequence; 28 | } 29 | 30 | - (RACSequence *)rac_valueSequence { 31 | return self.allValues.rac_sequence; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSEnumerator+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSEnumerator+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 07/01/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSEnumerator (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence corresponding to the receiver. 18 | /// 19 | /// The receiver is exhausted lazily as the sequence is enumerated. 20 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSEnumerator+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSEnumerator+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 07/01/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSEnumerator+RACSequenceAdditions.h" 10 | #import "RACSequence.h" 11 | 12 | @implementation NSEnumerator (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | return [RACSequence sequenceWithHeadBlock:^{ 16 | return [self nextObject]; 17 | } tailBlock:^{ 18 | return self.rac_sequence; 19 | }]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSFileHandle+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSFileHandle+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/10/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSFileHandle (RACSupport) 16 | 17 | // Read any available data in the background and send it. Completes when data 18 | // length is <= 0. 19 | - (RACSignal *)rac_readInBackground; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSFileHandle+RACSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSFileHandle+RACSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/10/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSFileHandle+RACSupport.h" 10 | #import "NSNotificationCenter+RACSupport.h" 11 | #import "NSObject+RACDescription.h" 12 | #import "RACReplaySubject.h" 13 | #import "RACDisposable.h" 14 | 15 | @implementation NSFileHandle (RACSupport) 16 | 17 | - (RACSignal *)rac_readInBackground { 18 | RACReplaySubject *subject = [RACReplaySubject subject]; 19 | [subject setNameWithFormat:@"%@ -rac_readInBackground", RACDescription(self)]; 20 | 21 | RACSignal *dataNotification = [[[NSNotificationCenter defaultCenter] rac_addObserverForName:NSFileHandleReadCompletionNotification object:self] map:^(NSNotification *note) { 22 | return note.userInfo[NSFileHandleNotificationDataItem]; 23 | }]; 24 | 25 | __block RACDisposable *subscription = [dataNotification subscribeNext:^(NSData *data) { 26 | if (data.length > 0) { 27 | [subject sendNext:data]; 28 | [self readInBackgroundAndNotify]; 29 | } else { 30 | [subject sendCompleted]; 31 | [subscription dispose]; 32 | } 33 | }]; 34 | 35 | [self readInBackgroundAndNotify]; 36 | 37 | return subject; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSIndexSet+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexSet+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Sergey Gavrilyuk on 12/17/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSIndexSet (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence of indexes (as `NSNumber`s) corresponding to 18 | /// the receiver. 19 | /// 20 | /// Mutating the receiver will not affect the sequence after it's been created. 21 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSIndexSet+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSIndexSet+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Sergey Gavrilyuk on 12/17/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSIndexSet+RACSequenceAdditions.h" 10 | #import "RACIndexSetSequence.h" 11 | 12 | @implementation NSIndexSet (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | return [RACIndexSetSequence sequenceWithIndexSet:self]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSInvocation+RACTypeParsing.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSInvocation+RACTypeParsing.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/17/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACTuple; 12 | 13 | // A private category of methods to handle wrapping and unwrapping of values. 14 | @interface NSInvocation (RACTypeParsing) 15 | 16 | // Sets the argument for the invocation at the given index by unboxing the given 17 | // object based on the type signature of the argument. 18 | // 19 | // This does not support C arrays or unions. 20 | // 21 | // Note that calling this on a char * or const char * argument can cause all 22 | // arguments to be retained. 23 | // 24 | // object - The object to unbox and set as the argument. 25 | // index - The index of the argument to set. 26 | - (void)rac_setArgument:(id)object atIndex:(NSUInteger)index; 27 | 28 | // Gets the argument for the invocation at the given index based on the 29 | // invocation's method signature. The value is then wrapped in the appropriate 30 | // object type. 31 | // 32 | // This does not support C arrays or unions. 33 | // 34 | // index - The index of the argument to get. 35 | // 36 | // Returns the argument of the invocation, wrapped in an object. 37 | - (id)rac_argumentAtIndex:(NSUInteger)index; 38 | 39 | // Arguments tuple for the invocation. 40 | // 41 | // The arguments tuple excludes implicit variables `self` and `_cmd`. 42 | // 43 | // See -rac_argumentAtIndex: and -rac_setArgumentAtIndex: for further 44 | // description of the underlying behavior. 45 | @property (nonatomic, copy) RACTuple *rac_argumentsTuple; 46 | 47 | // Gets the return value from the invocation based on the invocation's method 48 | // signature. The value is then wrapped in the appropriate object type. 49 | // 50 | // This does not support C arrays or unions. 51 | // 52 | // Returns the return value of the invocation, wrapped in an object. Voids are 53 | // returned as `RACUnit.defaultUnit`. 54 | - (id)rac_returnValue; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSNotificationCenter+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSNotificationCenter+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/10/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSNotificationCenter (RACSupport) 16 | 17 | // Sends the NSNotification every time the notification is posted. 18 | - (RACSignal *)rac_addObserverForName:(nullable NSString *)notificationName object:(nullable id)object; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSNotificationCenter+RACSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSNotificationCenter+RACSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/10/12. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSNotificationCenter+RACSupport.h" 10 | #import 11 | #import "RACSignal.h" 12 | #import "RACSubscriber.h" 13 | #import "RACDisposable.h" 14 | 15 | @implementation NSNotificationCenter (RACSupport) 16 | 17 | - (RACSignal *)rac_addObserverForName:(NSString *)notificationName object:(id)object { 18 | @unsafeify(object); 19 | return [[RACSignal createSignal:^(id subscriber) { 20 | @strongify(object); 21 | id observer = [self addObserverForName:notificationName object:object queue:nil usingBlock:^(NSNotification *note) { 22 | [subscriber sendNext:note]; 23 | }]; 24 | 25 | return [RACDisposable disposableWithBlock:^{ 26 | [self removeObserver:observer]; 27 | }]; 28 | }] setNameWithFormat:@"-rac_addObserverForName: %@ object: <%@: %p>", notificationName, [object class], object]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSObject+RACDeallocating.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+RACDeallocating.h 3 | // ReactiveObjC 4 | // 5 | // Created by Kazuo Koga on 2013/03/15. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACCompoundDisposable; 12 | @class RACDisposable; 13 | @class RACSignal<__covariant ValueType>; 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | @interface NSObject (RACDeallocating) 18 | 19 | /// The compound disposable which will be disposed of when the receiver is 20 | /// deallocated. 21 | @property (atomic, readonly, strong) RACCompoundDisposable *rac_deallocDisposable; 22 | 23 | /// Returns a signal that will complete immediately before the receiver is fully 24 | /// deallocated. If already deallocated when the signal is subscribed to, 25 | /// a `completed` event will be sent immediately. 26 | - (RACSignal *)rac_willDeallocSignal; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSObject+RACDescription.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+RACDescription.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // A simplified description of the object, which does not invoke -description 12 | // (and thus should be much faster in many cases). 13 | // 14 | // This is for debugging purposes only, and will return a constant string 15 | // unless the RAC_DEBUG_SIGNAL_NAMES environment variable is set. 16 | NSString *RACDescription(id object); 17 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSObject+RACDescription.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+RACDescription.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSObject+RACDescription.h" 10 | #import "RACTuple.h" 11 | 12 | @implementation NSValue (RACDescription) 13 | 14 | - (NSString *)rac_description { 15 | return self.description; 16 | } 17 | 18 | @end 19 | 20 | @implementation NSString (RACDescription) 21 | 22 | - (NSString *)rac_description { 23 | return self.description; 24 | } 25 | 26 | @end 27 | 28 | @implementation RACTuple (RACDescription) 29 | 30 | - (NSString *)rac_description { 31 | if (getenv("RAC_DEBUG_SIGNAL_NAMES") != NULL) { 32 | return self.allObjects.description; 33 | } else { 34 | return @"(description skipped)"; 35 | } 36 | } 37 | 38 | @end 39 | 40 | NSString *RACDescription(id object) { 41 | if (getenv("RAC_DEBUG_SIGNAL_NAMES") != NULL) { 42 | if ([object respondsToSelector:@selector(rac_description)]) { 43 | return [object rac_description]; 44 | } else { 45 | return [[NSString alloc] initWithFormat:@"<%@: %p>", [object class], object]; 46 | } 47 | } else { 48 | return @"(description skipped)"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSOrderedSet+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSOrderedSet+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSOrderedSet<__covariant ObjectType> (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence corresponding to the receiver. 18 | /// 19 | /// Mutating the receiver will not affect the sequence after it's been created. 20 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSOrderedSet+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSOrderedSet+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSOrderedSet+RACSequenceAdditions.h" 10 | #import "NSArray+RACSequenceAdditions.h" 11 | 12 | @implementation NSOrderedSet (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | // TODO: First class support for ordered set sequences. 16 | return self.array.rac_sequence; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSSet+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSSet+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSSet<__covariant ObjectType> (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence corresponding to the receiver. 18 | /// 19 | /// Mutating the receiver will not affect the sequence after it's been created. 20 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSSet+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSSet+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSSet+RACSequenceAdditions.h" 10 | #import "NSArray+RACSequenceAdditions.h" 11 | 12 | @implementation NSSet (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | // TODO: First class support for set sequences. 16 | return self.allObjects.rac_sequence; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACKeyPathUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACKeyPathUtilities.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 05/05/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // A private category of methods to extract parts of a key path. 12 | @interface NSString (RACKeyPathUtilities) 13 | 14 | // Returns an array of the components of the receiver. 15 | // 16 | // Calling this method on a string that isn't a key path is considered undefined 17 | // behavior. 18 | - (NSArray *)rac_keyPathComponents; 19 | 20 | // Returns a key path with all the components of the receiver except for the 21 | // last one. 22 | // 23 | // Calling this method on a string that isn't a key path is considered undefined 24 | // behavior. 25 | - (NSString *)rac_keyPathByDeletingLastKeyPathComponent; 26 | 27 | // Returns a key path with all the components of the receiver expect for the 28 | // first one. 29 | // 30 | // Calling this method on a string that isn't a key path is considered undefined 31 | // behavior. 32 | - (NSString *)rac_keyPathByDeletingFirstKeyPathComponent; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACKeyPathUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACKeyPathUtilities.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 05/05/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSString+RACKeyPathUtilities.h" 10 | 11 | @implementation NSString (RACKeyPathUtilities) 12 | 13 | - (NSArray *)rac_keyPathComponents { 14 | if (self.length == 0) { 15 | return nil; 16 | } 17 | return [self componentsSeparatedByString:@"."]; 18 | } 19 | 20 | - (NSString *)rac_keyPathByDeletingLastKeyPathComponent { 21 | NSUInteger lastDotIndex = [self rangeOfString:@"." options:NSBackwardsSearch].location; 22 | if (lastDotIndex == NSNotFound) { 23 | return nil; 24 | } 25 | return [self substringToIndex:lastDotIndex]; 26 | } 27 | 28 | - (NSString *)rac_keyPathByDeletingFirstKeyPathComponent { 29 | NSUInteger firstDotIndex = [self rangeOfString:@"."].location; 30 | if (firstDotIndex == NSNotFound) { 31 | return nil; 32 | } 33 | return [self substringFromIndex:firstDotIndex + 1]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACSequenceAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACSequenceAdditions.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSequence<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSString (RACSequenceAdditions) 16 | 17 | /// Creates and returns a sequence containing strings corresponding to each 18 | /// composed character sequence in the receiver. 19 | /// 20 | /// Mutating the receiver will not affect the sequence after it's been created. 21 | @property (nonatomic, copy, readonly) RACSequence *rac_sequence; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACSequenceAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACSequenceAdditions.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "NSString+RACSequenceAdditions.h" 10 | #import "RACStringSequence.h" 11 | 12 | @implementation NSString (RACSequenceAdditions) 13 | 14 | - (RACSequence *)rac_sequence { 15 | return [RACStringSequence sequenceWithString:self offset:0]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/11/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACScheduler; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface NSString (RACSupport) 17 | 18 | // Reads in the contents of the file using +[NSString stringWithContentsOfURL:usedEncoding:error:]. 19 | // Note that encoding won't be valid until the signal completes successfully. 20 | // 21 | // scheduler - cannot be nil. 22 | + (RACSignal *)rac_readContentsOfURL:(NSURL *)URL usedEncoding:(NSStringEncoding *)encoding scheduler:(RACScheduler *)scheduler; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSString+RACSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RACSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/11/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSString+RACSupport.h" 10 | #import "RACReplaySubject.h" 11 | #import "RACScheduler.h" 12 | 13 | @implementation NSString (RACSupport) 14 | 15 | + (RACSignal *)rac_readContentsOfURL:(NSURL *)URL usedEncoding:(NSStringEncoding *)encoding scheduler:(RACScheduler *)scheduler { 16 | NSCParameterAssert(URL != nil); 17 | NSCParameterAssert(encoding != nil); 18 | NSCParameterAssert(scheduler != nil); 19 | 20 | RACReplaySubject *subject = [RACReplaySubject subject]; 21 | [subject setNameWithFormat:@"+rac_readContentsOfURL: %@ usedEncoding:scheduler: %@", URL, scheduler]; 22 | 23 | [scheduler schedule:^{ 24 | NSError *error = nil; 25 | NSString *string = [NSString stringWithContentsOfURL:URL usedEncoding:encoding error:&error]; 26 | if (string == nil) { 27 | [subject sendError:error]; 28 | } else { 29 | [subject sendNext:string]; 30 | [subject sendCompleted]; 31 | } 32 | }]; 33 | 34 | return subject; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSURLConnection+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURLConnection+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-01. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACTwoTuple<__covariant First, __covariant Second>; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface NSURLConnection (RACSupport) 17 | 18 | /// Lazily loads data for the given request in the background. 19 | /// 20 | /// request - The URL request to load. This must not be nil. 21 | /// 22 | /// Returns a signal which will begin loading the request upon each subscription, 23 | /// then send a tuple of the received response and downloaded data, and complete 24 | /// on a background thread. If any errors occur, the returned signal will error 25 | /// out. 26 | + (RACSignal *> *)rac_sendAsynchronousRequest:(NSURLRequest *)request; 27 | 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSUserDefaults+RACSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+RACSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Matt Diephouse on 12/19/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface NSUserDefaults (RACSupport) 16 | 17 | /// Creates and returns a terminal for binding the user defaults key. 18 | /// 19 | /// **Note:** The value in the user defaults is *asynchronously* updated with 20 | /// values sent to the channel. 21 | /// 22 | /// key - The user defaults key to create the channel terminal for. 23 | /// 24 | /// Returns a channel terminal that sends the value of the user defaults key 25 | /// upon subscription, sends an updated value whenever the default changes, and 26 | /// updates the default asynchronously with values it receives. 27 | - (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/NSUserDefaults+RACSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+RACSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Matt Diephouse on 12/19/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "NSUserDefaults+RACSupport.h" 10 | #import 11 | #import "NSNotificationCenter+RACSupport.h" 12 | #import "NSObject+RACDeallocating.h" 13 | #import "RACChannel.h" 14 | #import "RACScheduler.h" 15 | #import "RACSignal+Operations.h" 16 | 17 | @implementation NSUserDefaults (RACSupport) 18 | 19 | - (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key { 20 | NSParameterAssert(key != nil); 21 | 22 | RACChannel *channel = [RACChannel new]; 23 | 24 | RACScheduler *scheduler = [RACScheduler scheduler]; 25 | __block BOOL ignoreNextValue = NO; 26 | 27 | @weakify(self); 28 | [[[[[[[NSNotificationCenter.defaultCenter 29 | rac_addObserverForName:NSUserDefaultsDidChangeNotification object:self] 30 | map:^(id _) { 31 | @strongify(self); 32 | return [self objectForKey:key]; 33 | }] 34 | startWith:[self objectForKey:key]] 35 | // Don't send values that were set on the other side of the terminal. 36 | filter:^ BOOL (id _) { 37 | if (RACScheduler.currentScheduler == scheduler && ignoreNextValue) { 38 | ignoreNextValue = NO; 39 | return NO; 40 | } 41 | return YES; 42 | }] 43 | distinctUntilChanged] 44 | takeUntil:self.rac_willDeallocSignal] 45 | subscribe:channel.leadingTerminal]; 46 | 47 | [[channel.leadingTerminal 48 | deliverOn:scheduler] 49 | subscribeNext:^(id value) { 50 | @strongify(self); 51 | ignoreNextValue = YES; 52 | [self setObject:value forKey:key]; 53 | }]; 54 | 55 | return channel.followingTerminal; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACAnnotations.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACAnnotations.h 3 | // ReactiveObjC 4 | // 5 | // Created by Eric Horacek on 3/31/17. 6 | // Copyright © 2017 GitHub. All rights reserved. 7 | // 8 | 9 | #ifndef RAC_WARN_UNUSED_RESULT 10 | #define RAC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 11 | #endif 12 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACArraySequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACArraySequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class that adapts an array to the RACSequence interface. 12 | @interface RACArraySequence : RACSequence 13 | 14 | // Returns a sequence for enumerating over the given array, starting from the 15 | // given offset. The array will be copied to prevent mutation. 16 | + (RACSequence *)sequenceWithArray:(NSArray *)array offset:(NSUInteger)offset; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACBehaviorSubject.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACBehaviorSubject.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/16/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubject.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A behavior subject sends the last value it received when it is subscribed to. 14 | @interface RACBehaviorSubject : RACSubject 15 | 16 | /// Creates a new behavior subject with a default value. If it hasn't received 17 | /// any values when it gets subscribed to, it sends the default value. 18 | + (instancetype)behaviorSubjectWithDefaultValue:(nullable ValueType)value; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACBehaviorSubject.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACBehaviorSubject.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/16/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACBehaviorSubject.h" 10 | #import "RACDisposable.h" 11 | #import "RACScheduler+Private.h" 12 | 13 | @interface RACBehaviorSubject () 14 | 15 | // This property should only be used while synchronized on self. 16 | @property (nonatomic, strong) ValueType currentValue; 17 | 18 | @end 19 | 20 | @implementation RACBehaviorSubject 21 | 22 | #pragma mark Lifecycle 23 | 24 | + (instancetype)behaviorSubjectWithDefaultValue:(id)value { 25 | RACBehaviorSubject *subject = [self subject]; 26 | subject.currentValue = value; 27 | return subject; 28 | } 29 | 30 | #pragma mark RACSignal 31 | 32 | - (RACDisposable *)subscribe:(id)subscriber { 33 | RACDisposable *subscriptionDisposable = [super subscribe:subscriber]; 34 | 35 | RACDisposable *schedulingDisposable = [RACScheduler.subscriptionScheduler schedule:^{ 36 | @synchronized (self) { 37 | [subscriber sendNext:self.currentValue]; 38 | } 39 | }]; 40 | 41 | return [RACDisposable disposableWithBlock:^{ 42 | [subscriptionDisposable dispose]; 43 | [schedulingDisposable dispose]; 44 | }]; 45 | } 46 | 47 | #pragma mark RACSubscriber 48 | 49 | - (void)sendNext:(id)value { 50 | @synchronized (self) { 51 | self.currentValue = value; 52 | [super sendNext:value]; 53 | } 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACBlockTrampoline.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACBlockTrampoline.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 10/21/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACTuple; 12 | 13 | // A private class that allows a limited type of dynamic block invocation. 14 | @interface RACBlockTrampoline : NSObject 15 | 16 | // Invokes the given block with the given arguments. All of the block's 17 | // argument types must be objects and it must be typed to return an object. 18 | // 19 | // At this time, it only supports blocks that take up to 15 arguments. Any more 20 | // is just cray. 21 | // 22 | // block - The block to invoke. Must accept as many arguments as are given in 23 | // the arguments array. Cannot be nil. 24 | // arguments - The arguments with which to invoke the block. `RACTupleNil`s will 25 | // be passed as nils. 26 | // 27 | // Returns the return value of invoking the block. 28 | + (id)invokeBlock:(id)block withArguments:(RACTuple *)arguments; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACCompoundDisposable.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACCompoundDisposable.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACDisposable.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A disposable of disposables. When it is disposed, it disposes of all its 14 | /// contained disposables. 15 | /// 16 | /// If -addDisposable: is called after the compound disposable has been disposed 17 | /// of, the given disposable is immediately disposed. This allows a compound 18 | /// disposable to act as a stand-in for a disposable that will be delivered 19 | /// asynchronously. 20 | @interface RACCompoundDisposable : RACDisposable 21 | 22 | /// Creates and returns a new compound disposable. 23 | + (instancetype)compoundDisposable; 24 | 25 | /// Creates and returns a new compound disposable containing the given 26 | /// disposables. 27 | + (instancetype)compoundDisposableWithDisposables:(nullable NSArray *)disposables; 28 | 29 | /// Adds the given disposable. If the receiving disposable has already been 30 | /// disposed of, the given disposable is disposed immediately. 31 | /// 32 | /// This method is thread-safe. 33 | /// 34 | /// disposable - The disposable to add. This may be nil, in which case nothing 35 | /// happens. 36 | - (void)addDisposable:(nullable RACDisposable *)disposable; 37 | 38 | /// Removes the specified disposable from the compound disposable (regardless of 39 | /// its disposed status), or does nothing if it's not in the compound disposable. 40 | /// 41 | /// This is mainly useful for limiting the memory usage of the compound 42 | /// disposable for long-running operations. 43 | /// 44 | /// This method is thread-safe. 45 | /// 46 | /// disposable - The disposable to remove. This argument may be nil (to make the 47 | /// use of weak references easier). 48 | - (void)removeDisposable:(nullable RACDisposable *)disposable; 49 | 50 | @end 51 | 52 | NS_ASSUME_NONNULL_END 53 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACCompoundDisposableProvider.d: -------------------------------------------------------------------------------- 1 | provider RACCompoundDisposable { 2 | probe added(char *compoundDisposable, char *disposable, long newTotal); 3 | probe removed(char *compoundDisposable, char *disposable, long newTotal); 4 | }; 5 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACDelegateProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACDelegateProxy.h 3 | // ReactiveObjC 4 | // 5 | // Created by Cody Krieger on 5/19/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | // A private delegate object suitable for using 16 | // -rac_signalForSelector:fromProtocol: upon. 17 | @interface RACDelegateProxy : NSObject 18 | 19 | // The delegate to which messages should be forwarded if not handled by 20 | // any -signalForSelector: applications. 21 | @property (nonatomic, unsafe_unretained) id rac_proxiedDelegate; 22 | 23 | // Creates a delegate proxy capable of responding to selectors from `protocol`. 24 | - (instancetype)initWithProtocol:(Protocol *)protocol; 25 | 26 | // Calls -rac_signalForSelector:fromProtocol: using the `protocol` specified 27 | // during initialization. 28 | - (RACSignal *)signalForSelector:(SEL)selector; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACDisposable.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACDisposable.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/16/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACScopedDisposable; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /// A disposable encapsulates the work necessary to tear down and cleanup a 16 | /// subscription. 17 | @interface RACDisposable : NSObject 18 | 19 | /// Whether the receiver has been disposed. 20 | /// 21 | /// Use of this property is discouraged, since it may be set to `YES` 22 | /// concurrently at any time. 23 | /// 24 | /// This property is not KVO-compliant. 25 | @property (atomic, assign, getter = isDisposed, readonly) BOOL disposed; 26 | 27 | + (instancetype)disposableWithBlock:(void (^)(void))block; 28 | 29 | /// Performs the disposal work. Can be called multiple times, though subsequent 30 | /// calls won't do anything. 31 | - (void)dispose; 32 | 33 | /// Returns a new disposable which will dispose of this disposable when it gets 34 | /// dealloc'd. 35 | - (RACScopedDisposable *)asScopedDisposable; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACDynamicSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACDynamicSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class that implements a sequence dynamically using blocks. 12 | @interface RACDynamicSequence : RACSequence 13 | 14 | // Returns a sequence which evaluates `dependencyBlock` only once, the first 15 | // time either `headBlock` or `tailBlock` is evaluated. The result of 16 | // `dependencyBlock` will be passed into `headBlock` and `tailBlock` when 17 | // invoked. 18 | + (RACSequence *)sequenceWithLazyDependency:(id (^)(void))dependencyBlock headBlock:(id (^)(id dependency))headBlock tailBlock:(RACSequence *(^)(id dependency))tailBlock; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACDynamicSignal.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACDynamicSignal.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignal.h" 10 | 11 | // A private `RACSignal` subclasses that implements its subscription behavior 12 | // using a block. 13 | @interface RACDynamicSignal : RACSignal 14 | 15 | + (RACSignal *)createSignal:(RACDisposable * (^)(id subscriber))didSubscribe; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACDynamicSignal.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACDynamicSignal.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACDynamicSignal.h" 10 | #import 11 | #import "RACCompoundDisposable.h" 12 | #import "RACPassthroughSubscriber.h" 13 | #import "RACScheduler+Private.h" 14 | #import "RACSubscriber.h" 15 | #import 16 | 17 | @interface RACDynamicSignal () 18 | 19 | // The block to invoke for each subscriber. 20 | @property (nonatomic, copy, readonly) RACDisposable * (^didSubscribe)(id subscriber); 21 | 22 | @end 23 | 24 | @implementation RACDynamicSignal 25 | 26 | #pragma mark Lifecycle 27 | 28 | + (RACSignal *)createSignal:(RACDisposable * (^)(id subscriber))didSubscribe { 29 | RACDynamicSignal *signal = [[self alloc] init]; 30 | signal->_didSubscribe = [didSubscribe copy]; 31 | return [signal setNameWithFormat:@"+createSignal:"]; 32 | } 33 | 34 | #pragma mark Managing Subscribers 35 | 36 | - (RACDisposable *)subscribe:(id)subscriber { 37 | NSCParameterAssert(subscriber != nil); 38 | 39 | RACCompoundDisposable *disposable = [RACCompoundDisposable compoundDisposable]; 40 | subscriber = [[RACPassthroughSubscriber alloc] initWithSubscriber:subscriber signal:self disposable:disposable]; 41 | 42 | if (self.didSubscribe != NULL) { 43 | RACDisposable *schedulingDisposable = [RACScheduler.subscriptionScheduler schedule:^{ 44 | RACDisposable *innerDisposable = self.didSubscribe(subscriber); 45 | [disposable addDisposable:innerDisposable]; 46 | }]; 47 | 48 | [disposable addDisposable:schedulingDisposable]; 49 | } 50 | 51 | return disposable; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEagerSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACEagerSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 02/01/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACArraySequence.h" 10 | 11 | // Private class that implements an eager sequence. 12 | @interface RACEagerSequence : RACArraySequence 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEmptySequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACEmptySequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class representing an empty sequence. 12 | @interface RACEmptySequence : RACSequence 13 | 14 | + (RACEmptySequence *)empty; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEmptySequence.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACEmptySequence.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACEmptySequence.h" 10 | 11 | @implementation RACEmptySequence 12 | 13 | #pragma mark Lifecycle 14 | 15 | + (instancetype)empty { 16 | static id singleton; 17 | static dispatch_once_t pred; 18 | 19 | dispatch_once(&pred, ^{ 20 | singleton = [[self alloc] init]; 21 | }); 22 | 23 | return singleton; 24 | } 25 | 26 | #pragma mark RACSequence 27 | 28 | - (id)head { 29 | return nil; 30 | } 31 | 32 | - (RACSequence *)tail { 33 | return nil; 34 | } 35 | 36 | - (RACSequence *)bind:(RACStreamBindBlock)bindBlock passingThroughValuesFromSequence:(RACSequence *)passthroughSequence { 37 | return passthroughSequence ?: self; 38 | } 39 | 40 | #pragma mark NSCoding 41 | 42 | - (Class)classForCoder { 43 | // Empty sequences should be encoded as themselves, not array sequences. 44 | return self.class; 45 | } 46 | 47 | - (instancetype)initWithCoder:(NSCoder *)coder { 48 | // Return the singleton. 49 | return self.class.empty; 50 | } 51 | 52 | - (void)encodeWithCoder:(NSCoder *)coder { 53 | } 54 | 55 | #pragma mark NSObject 56 | 57 | - (NSString *)description { 58 | return [NSString stringWithFormat:@"<%@: %p>{ name = %@ }", self.class, self, self.name]; 59 | } 60 | 61 | - (NSUInteger)hash { 62 | // This hash isn't ideal, but it's better than -[RACSequence hash], which 63 | // would just be zero because we have no head. 64 | return (NSUInteger)(__bridge void *)self; 65 | } 66 | 67 | - (BOOL)isEqual:(RACSequence *)seq { 68 | return (self == seq); 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEmptySignal.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACEmptySignal.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignal.h" 10 | 11 | // A private `RACSignal` subclasses that synchronously sends completed to any 12 | // subscribers. 13 | @interface RACEmptySignal<__covariant ValueType> : RACSignal 14 | 15 | + (RACSignal *)empty; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEmptySignal.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACEmptySignal.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACEmptySignal.h" 10 | #import "RACScheduler+Private.h" 11 | #import "RACSubscriber.h" 12 | 13 | @implementation RACEmptySignal 14 | 15 | #pragma mark Properties 16 | 17 | // Only allow this signal's name to be customized in DEBUG, since it's 18 | // a singleton in release builds (see +empty). 19 | - (void)setName:(NSString *)name { 20 | #ifdef DEBUG 21 | [super setName:name]; 22 | #endif 23 | } 24 | 25 | - (NSString *)name { 26 | #ifdef DEBUG 27 | return super.name; 28 | #else 29 | return @"+empty"; 30 | #endif 31 | } 32 | 33 | #pragma mark Lifecycle 34 | 35 | + (RACSignal *)empty { 36 | #ifdef DEBUG 37 | // Create multiple instances of this class in DEBUG so users can set custom 38 | // names on each. 39 | return [[[self alloc] init] setNameWithFormat:@"+empty"]; 40 | #else 41 | static id singleton; 42 | static dispatch_once_t pred; 43 | 44 | dispatch_once(&pred, ^{ 45 | singleton = [[self alloc] init]; 46 | }); 47 | 48 | return singleton; 49 | #endif 50 | } 51 | 52 | #pragma mark Subscription 53 | 54 | - (RACDisposable *)subscribe:(id)subscriber { 55 | NSCParameterAssert(subscriber != nil); 56 | 57 | return [RACScheduler.subscriptionScheduler schedule:^{ 58 | [subscriber sendCompleted]; 59 | }]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACErrorSignal.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACErrorSignal.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignal.h" 10 | 11 | // A private `RACSignal` subclass that synchronously sends an error to any 12 | // subscriber. 13 | @interface RACErrorSignal : RACSignal 14 | 15 | + (RACSignal *)error:(NSError *)error; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACErrorSignal.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACErrorSignal.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACErrorSignal.h" 10 | #import "RACScheduler+Private.h" 11 | #import "RACSubscriber.h" 12 | 13 | @interface RACErrorSignal () 14 | 15 | // The error to send upon subscription. 16 | @property (nonatomic, strong, readonly) NSError *error; 17 | 18 | @end 19 | 20 | @implementation RACErrorSignal 21 | 22 | #pragma mark Lifecycle 23 | 24 | + (RACSignal *)error:(NSError *)error { 25 | RACErrorSignal *signal = [[self alloc] init]; 26 | signal->_error = error; 27 | 28 | #ifdef DEBUG 29 | [signal setNameWithFormat:@"+error: %@", error]; 30 | #else 31 | signal.name = @"+error:"; 32 | #endif 33 | 34 | return signal; 35 | } 36 | 37 | #pragma mark Subscription 38 | 39 | - (RACDisposable *)subscribe:(id)subscriber { 40 | NSCParameterAssert(subscriber != nil); 41 | 42 | return [RACScheduler.subscriptionScheduler schedule:^{ 43 | [subscriber sendError:self.error]; 44 | }]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACEvent.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-01-07. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// Describes the type of a RACEvent. 14 | /// 15 | /// RACEventTypeCompleted - A `completed` event. 16 | /// RACEventTypeError - An `error` event. 17 | /// RACEventTypeNext - A `next` event. 18 | typedef NS_ENUM(NSUInteger, RACEventType) { 19 | RACEventTypeCompleted, 20 | RACEventTypeError, 21 | RACEventTypeNext 22 | }; 23 | 24 | /// Represents an event sent by a RACSignal. 25 | /// 26 | /// This corresponds to the `Notification` class in Rx. 27 | @interface RACEvent<__covariant ValueType> : NSObject 28 | 29 | /// Returns a singleton RACEvent representing the `completed` event. 30 | + (RACEvent *)completedEvent; 31 | 32 | /// Returns a new event of type RACEventTypeError, containing the given error. 33 | + (RACEvent *)eventWithError:(nullable NSError *)error; 34 | 35 | /// Returns a new event of type RACEventTypeNext, containing the given value. 36 | + (RACEvent *)eventWithValue:(nullable ValueType)value; 37 | 38 | /// The type of event represented by the receiver. 39 | @property (nonatomic, assign, readonly) RACEventType eventType; 40 | 41 | /// Returns whether the receiver is of type RACEventTypeCompleted or 42 | /// RACEventTypeError. 43 | @property (nonatomic, getter = isFinished, assign, readonly) BOOL finished; 44 | 45 | /// The error associated with an event of type RACEventTypeError. This will be 46 | /// nil for all other event types. 47 | @property (nonatomic, strong, readonly, nullable) NSError *error; 48 | 49 | /// The value associated with an event of type RACEventTypeNext. This will be 50 | /// nil for all other event types. 51 | @property (nonatomic, strong, readonly, nullable) ValueType value; 52 | 53 | @end 54 | 55 | NS_ASSUME_NONNULL_END 56 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACGroupedSignal.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACGroupedSignal.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/2/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubject.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A grouped signal is used by -[RACSignal groupBy:transform:]. 14 | @interface RACGroupedSignal : RACSubject 15 | 16 | /// The key shared by the group. 17 | @property (nonatomic, readonly, copy) id key; 18 | 19 | + (instancetype)signalWithKey:(id)key; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACGroupedSignal.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACGroupedSignal.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 5/2/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACGroupedSignal.h" 10 | 11 | @interface RACGroupedSignal () 12 | @property (nonatomic, copy) id key; 13 | @end 14 | 15 | @implementation RACGroupedSignal 16 | 17 | #pragma mark API 18 | 19 | + (instancetype)signalWithKey:(id)key { 20 | RACGroupedSignal *subject = [self subject]; 21 | subject.key = key; 22 | return subject; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACImmediateScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACImmediateScheduler.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScheduler.h" 10 | 11 | // A private scheduler which immediately executes its scheduled blocks. 12 | @interface RACImmediateScheduler : RACScheduler 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACImmediateScheduler.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACImmediateScheduler.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACImmediateScheduler.h" 10 | #import "RACScheduler+Private.h" 11 | 12 | @implementation RACImmediateScheduler 13 | 14 | #pragma mark Lifecycle 15 | 16 | - (instancetype)init { 17 | return [super initWithName:@"org.reactivecocoa.ReactiveObjC.RACScheduler.immediateScheduler"]; 18 | } 19 | 20 | #pragma mark RACScheduler 21 | 22 | - (RACDisposable *)schedule:(void (^)(void))block { 23 | NSCParameterAssert(block != NULL); 24 | 25 | block(); 26 | return nil; 27 | } 28 | 29 | - (RACDisposable *)after:(NSDate *)date schedule:(void (^)(void))block { 30 | NSCParameterAssert(date != nil); 31 | NSCParameterAssert(block != NULL); 32 | 33 | [NSThread sleepUntilDate:date]; 34 | block(); 35 | 36 | return nil; 37 | } 38 | 39 | - (RACDisposable *)after:(NSDate *)date repeatingEvery:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway schedule:(void (^)(void))block { 40 | NSCAssert(NO, @"+[RACScheduler immediateScheduler] does not support %@.", NSStringFromSelector(_cmd)); 41 | return nil; 42 | } 43 | 44 | - (RACDisposable *)scheduleRecursiveBlock:(RACSchedulerRecursiveBlock)recursiveBlock { 45 | for (__block NSUInteger remaining = 1; remaining > 0; remaining--) { 46 | recursiveBlock(^{ 47 | remaining++; 48 | }); 49 | } 50 | 51 | return nil; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACIndexSetSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACIndexSetSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Sergey Gavrilyuk on 12/18/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class that adapts an array to the RACSequence interface. 12 | @interface RACIndexSetSequence : RACSequence 13 | 14 | + (RACSequence *)sequenceWithIndexSet:(NSIndexSet *)indexSet; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACKVOProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACKVOProxy.h 3 | // ReactiveObjC 4 | // 5 | // Created by Richard Speyer on 4/10/14. 6 | // Copyright (c) 2014 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// A singleton that can act as a proxy between a KVO observation and a RAC 12 | /// subscriber, in order to protect against KVO lifetime issues. 13 | @interface RACKVOProxy : NSObject 14 | 15 | /// Returns the singleton KVO proxy object. 16 | + (instancetype)sharedProxy; 17 | 18 | /// Registers an observer with the proxy, such that when the proxy receives a 19 | /// KVO change with the given context, it forwards it to the observer. 20 | /// 21 | /// observer - True observer of the KVO change. Must not be nil. 22 | /// context - Arbitrary context object used to differentiate multiple 23 | /// observations of the same keypath. Must be unique, cannot be nil. 24 | - (void)addObserver:(__weak NSObject *)observer forContext:(void *)context; 25 | 26 | /// Removes an observer from the proxy. Parameters must match those passed to 27 | /// addObserver:forContext:. 28 | /// 29 | /// observer - True observer of the KVO change. Must not be nil. 30 | /// context - Arbitrary context object used to differentiate multiple 31 | /// observations of the same keypath. Must be unique, cannot be nil. 32 | - (void)removeObserver:(NSObject *)observer forContext:(void *)context; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACKVOProxy.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACKVOProxy.m 3 | // ReactiveObjC 4 | // 5 | // Created by Richard Speyer on 4/10/14. 6 | // Copyright (c) 2014 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACKVOProxy.h" 10 | 11 | @interface RACKVOProxy() 12 | 13 | @property (strong, nonatomic, readonly) NSMapTable *trampolines; 14 | @property (strong, nonatomic, readonly) dispatch_queue_t queue; 15 | 16 | @end 17 | 18 | @implementation RACKVOProxy 19 | 20 | + (instancetype)sharedProxy { 21 | static RACKVOProxy *proxy; 22 | static dispatch_once_t onceToken; 23 | 24 | dispatch_once(&onceToken, ^{ 25 | proxy = [[self alloc] init]; 26 | }); 27 | 28 | return proxy; 29 | } 30 | 31 | - (instancetype)init { 32 | self = [super init]; 33 | 34 | _queue = dispatch_queue_create("org.reactivecocoa.ReactiveObjC.RACKVOProxy", DISPATCH_QUEUE_SERIAL); 35 | _trampolines = [NSMapTable strongToWeakObjectsMapTable]; 36 | 37 | return self; 38 | } 39 | 40 | - (void)addObserver:(__weak NSObject *)observer forContext:(void *)context { 41 | NSValue *valueContext = [NSValue valueWithPointer:context]; 42 | 43 | dispatch_sync(self.queue, ^{ 44 | [self.trampolines setObject:observer forKey:valueContext]; 45 | }); 46 | } 47 | 48 | - (void)removeObserver:(NSObject *)observer forContext:(void *)context { 49 | NSValue *valueContext = [NSValue valueWithPointer:context]; 50 | 51 | dispatch_sync(self.queue, ^{ 52 | [self.trampolines removeObjectForKey:valueContext]; 53 | }); 54 | } 55 | 56 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 57 | NSValue *valueContext = [NSValue valueWithPointer:context]; 58 | __block NSObject *trueObserver; 59 | 60 | dispatch_sync(self.queue, ^{ 61 | trueObserver = [self.trampolines objectForKey:valueContext]; 62 | }); 63 | 64 | if (trueObserver != nil) { 65 | [trueObserver observeValueForKeyPath:keyPath ofObject:object change:change context:context]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACKVOTrampoline.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACKVOTrampoline.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 1/15/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "NSObject+RACKVOWrapper.h" 11 | #import "RACDisposable.h" 12 | 13 | // A private trampoline object that represents a KVO observation. 14 | // 15 | // Disposing of the trampoline will stop observation. 16 | @interface RACKVOTrampoline : RACDisposable 17 | 18 | // Initializes the receiver with the given parameters. 19 | // 20 | // target - The object whose key path should be observed. Cannot be nil. 21 | // observer - The object that gets notified when the value at the key path 22 | // changes. Can be nil. 23 | // keyPath - The key path on `target` to observe. Cannot be nil. 24 | // options - Any key value observing options to use in the observation. 25 | // block - The block to call when the value at the observed key path changes. 26 | // Cannot be nil. 27 | // 28 | // Returns the initialized object. 29 | - (instancetype)initWithTarget:(__weak NSObject *)target observer:(__weak NSObject *)observer keyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options block:(RACKVOBlock)block; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACMulticastConnection+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACMulticastConnection+Private.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 4/11/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACMulticastConnection.h" 10 | 11 | @class RACSubject; 12 | 13 | @interface RACMulticastConnection<__covariant ValueType> () 14 | 15 | - (instancetype)initWithSourceSignal:(RACSignal *)source subject:(RACSubject *)subject; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACPassthroughSubscriber.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACPassthroughSubscriber.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-06-13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RACSubscriber.h" 11 | 12 | @class RACCompoundDisposable; 13 | @class RACSignal<__covariant ValueType>; 14 | 15 | // A private subscriber that passes through all events to another subscriber 16 | // while not disposed. 17 | @interface RACPassthroughSubscriber : NSObject 18 | 19 | // Initializes the receiver to pass through events until disposed. 20 | // 21 | // subscriber - The subscriber to forward events to. This must not be nil. 22 | // signal - The signal that will be sending events to the receiver. 23 | // disposable - When this disposable is disposed, no more events will be 24 | // forwarded. This must not be nil. 25 | // 26 | // Returns an initialized passthrough subscriber. 27 | - (instancetype)initWithSubscriber:(id)subscriber signal:(RACSignal *)signal disposable:(RACCompoundDisposable *)disposable; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACQueueScheduler+Subclass.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACQueueScheduler+Subclass.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 6/6/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACQueueScheduler.h" 10 | #import "RACScheduler+Subclass.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /// An interface for use by GCD queue-based subclasses. 15 | /// 16 | /// See RACScheduler+Subclass.h for subclassing notes. 17 | @interface RACQueueScheduler () 18 | 19 | /// The queue on which blocks are enqueued. 20 | #if OS_OBJECT_USE_OBJC 21 | @property (nonatomic, strong, readonly) dispatch_queue_t queue; 22 | #else 23 | // Swift builds with OS_OBJECT_HAVE_OBJC_SUPPORT=0 for Playgrounds and LLDB :( 24 | @property (nonatomic, assign, readonly) dispatch_queue_t queue; 25 | #endif 26 | 27 | /// Initializes the receiver with the name of the scheduler and the queue which 28 | /// the scheduler should use. 29 | /// 30 | /// name - The name of the scheduler. If nil, a default name will be used. 31 | /// queue - The queue upon which the receiver should enqueue scheduled blocks. 32 | /// This argument must not be NULL. 33 | /// 34 | /// Returns the initialized object. 35 | - (instancetype)initWithName:(nullable NSString *)name queue:(dispatch_queue_t)queue; 36 | 37 | /// Converts a date into a GCD time using dispatch_walltime(). 38 | /// 39 | /// date - The date to convert. This must not be nil. 40 | + (dispatch_time_t)wallTimeWithDate:(NSDate *)date; 41 | 42 | @end 43 | 44 | NS_ASSUME_NONNULL_END 45 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACQueueScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACQueueScheduler.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScheduler.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// An abstract scheduler which asynchronously enqueues all its work to a Grand 14 | /// Central Dispatch queue. 15 | /// 16 | /// Because RACQueueScheduler is abstract, it should not be instantiated 17 | /// directly. Create a subclass using the `RACQueueScheduler+Subclass.h` 18 | /// interface and use that instead. 19 | @interface RACQueueScheduler : RACScheduler 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACReplaySubject.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACReplaySubject.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/14/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubject.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | extern const NSUInteger RACReplaySubjectUnlimitedCapacity; 14 | 15 | /// A replay subject saves the values it is sent (up to its defined capacity) 16 | /// and resends those to new subscribers. It will also replay an error or 17 | /// completion. 18 | @interface RACReplaySubject : RACSubject 19 | 20 | /// Creates a new replay subject with the given capacity. A capacity of 21 | /// RACReplaySubjectUnlimitedCapacity means values are never trimmed. 22 | + (instancetype)replaySubjectWithCapacity:(NSUInteger)capacity; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACReturnSignal.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACReturnSignal.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-10-10. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignal.h" 10 | 11 | // A private `RACSignal` subclasses that synchronously sends a value to any 12 | // subscribers, then completes. 13 | @interface RACReturnSignal<__covariant ValueType> : RACSignal 14 | 15 | + (RACSignal *)return:(ValueType)value; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACScheduler+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACScheduler+Private.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/29/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScheduler.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | // The thread-specific current scheduler key. 14 | extern NSString * const RACSchedulerCurrentSchedulerKey; 15 | 16 | // A private interface for internal RAC use only. 17 | @interface RACScheduler () 18 | 19 | // A dedicated scheduler that fills two requirements: 20 | // 21 | // 1. By the time subscription happens, we need a valid +currentScheduler. 22 | // 2. Subscription should happen as soon as possible. 23 | // 24 | // To fulfill those two, if we already have a valid +currentScheduler, it 25 | // immediately executes scheduled blocks. If we don't, it will execute scheduled 26 | // blocks with a private background scheduler. 27 | + (instancetype)subscriptionScheduler; 28 | 29 | // Initializes the receiver with the given name. 30 | // 31 | // name - The name of the scheduler. If nil, a default name will be used. 32 | // 33 | // Returns the initialized object. 34 | - (instancetype)initWithName:(nullable NSString *)name; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACScheduler+Subclass.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACScheduler.m 3 | // ReactiveObjC 4 | // 5 | // Created by Miķelis Vindavs on 5/27/14. 6 | // Copyright (c) 2014 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RACScheduler.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /// An interface for use by subclasses. 15 | /// 16 | /// Subclasses should use `-performAsCurrentScheduler:` to do the actual block 17 | /// invocation so that +[RACScheduler currentScheduler] behaves as expected. 18 | /// 19 | /// **Note that RACSchedulers are expected to be serial**. Subclasses must honor 20 | /// that contract. See `RACTargetQueueScheduler` for a queue-based scheduler 21 | /// which will enforce the serialization guarantee. 22 | @interface RACScheduler () 23 | 24 | /// Performs the given block with the receiver as the current scheduler for 25 | /// its thread. This should only be called by subclasses to perform their 26 | /// scheduled blocks. 27 | /// 28 | /// block - The block to execute. Cannot be NULL. 29 | - (void)performAsCurrentScheduler:(void (^)(void))block; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACScopedDisposable.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACScopedDisposable.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/28/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACDisposable.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A disposable that calls its own -dispose when it is dealloc'd. 14 | @interface RACScopedDisposable : RACDisposable 15 | 16 | /// Creates a new scoped disposable that will also dispose of the given 17 | /// disposable when it is dealloc'd. 18 | + (instancetype)scopedDisposableWithDisposable:(RACDisposable *)disposable; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACScopedDisposable.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACScopedDisposable.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/28/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScopedDisposable.h" 10 | 11 | @implementation RACScopedDisposable 12 | 13 | #pragma mark Lifecycle 14 | 15 | + (instancetype)scopedDisposableWithDisposable:(RACDisposable *)disposable { 16 | return [self disposableWithBlock:^{ 17 | [disposable dispose]; 18 | }]; 19 | } 20 | 21 | - (void)dealloc { 22 | [self dispose]; 23 | } 24 | 25 | #pragma mark RACDisposable 26 | 27 | - (RACScopedDisposable *)asScopedDisposable { 28 | // totally already are 29 | return self; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSerialDisposable.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSerialDisposable.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-07-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACDisposable.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A disposable that contains exactly one other disposable and allows it to be 14 | /// swapped out atomically. 15 | @interface RACSerialDisposable : RACDisposable 16 | 17 | /// The inner disposable managed by the serial disposable. 18 | /// 19 | /// This property is thread-safe for reading and writing. However, if you want to 20 | /// read the current value _and_ write a new one atomically, use 21 | /// -swapInDisposable: instead. 22 | /// 23 | /// Disposing of the receiver will also dispose of the current disposable set for 24 | /// this property, then set the property to nil. If any new disposable is set 25 | /// after the receiver is disposed, it will be disposed immediately and this 26 | /// property will remain set to nil. 27 | @property (atomic, strong, nullable) RACDisposable *disposable; 28 | 29 | /// Creates a serial disposable which will wrap the given disposable. 30 | /// 31 | /// disposable - The value to set for `disposable`. This may be nil. 32 | /// 33 | /// Returns a RACSerialDisposable. 34 | + (instancetype)serialDisposableWithDisposable:(nullable RACDisposable *)disposable; 35 | 36 | /// Atomically swaps the receiver's `disposable` for `newDisposable`. 37 | /// 38 | /// newDisposable - The new value for `disposable`. If the receiver has already 39 | /// been disposed, this disposable will be too, and `disposable` 40 | /// will remain set to nil. This argument may be nil. 41 | /// 42 | /// Returns the previous value for the `disposable` property. 43 | - (nullable RACDisposable *)swapInDisposable:(nullable RACDisposable *)newDisposable; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSignalProvider.d: -------------------------------------------------------------------------------- 1 | provider RACSignal { 2 | probe next(char *signal, char *subscriber, char *valueDescription); 3 | probe completed(char *signal, char *subscriber); 4 | probe error(char *signal, char *subscriber, char *errorDescription); 5 | }; 6 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSignalSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSignalSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-11-09. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | // Private class that adapts a RACSignal to the RACSequence interface. 14 | @interface RACSignalSequence : RACSequence 15 | 16 | // Returns a sequence for enumerating over the given signal. 17 | + (RACSequence *)sequenceWithSignal:(RACSignal *)signal; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSignalSequence.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACSignalSequence.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-11-09. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignalSequence.h" 10 | #import "RACDisposable.h" 11 | #import "RACReplaySubject.h" 12 | #import "RACSignal+Operations.h" 13 | 14 | @interface RACSignalSequence () 15 | 16 | // Replays the signal given on initialization. 17 | @property (nonatomic, strong, readonly) RACReplaySubject *subject; 18 | 19 | @end 20 | 21 | @implementation RACSignalSequence 22 | 23 | #pragma mark Lifecycle 24 | 25 | + (RACSequence *)sequenceWithSignal:(RACSignal *)signal { 26 | RACSignalSequence *seq = [[self alloc] init]; 27 | 28 | RACReplaySubject *subject = [RACReplaySubject subject]; 29 | [signal subscribeNext:^(id value) { 30 | [subject sendNext:value]; 31 | } error:^(NSError *error) { 32 | [subject sendError:error]; 33 | } completed:^{ 34 | [subject sendCompleted]; 35 | }]; 36 | 37 | seq->_subject = subject; 38 | return seq; 39 | } 40 | 41 | #pragma mark RACSequence 42 | 43 | - (id)head { 44 | id value = [self.subject firstOrDefault:self]; 45 | 46 | if (value == self) { 47 | return nil; 48 | } else { 49 | return value ?: NSNull.null; 50 | } 51 | } 52 | 53 | - (RACSequence *)tail { 54 | RACSequence *sequence = [self.class sequenceWithSignal:[self.subject skip:1]]; 55 | sequence.name = self.name; 56 | return sequence; 57 | } 58 | 59 | - (NSArray *)array { 60 | return self.subject.toArray; 61 | } 62 | 63 | #pragma mark NSObject 64 | 65 | - (NSString *)description { 66 | // Synchronously accumulate the values that have been sent so far. 67 | NSMutableArray *values = [NSMutableArray array]; 68 | RACDisposable *disposable = [self.subject subscribeNext:^(id value) { 69 | @synchronized (values) { 70 | [values addObject:value ?: NSNull.null]; 71 | } 72 | }]; 73 | 74 | [disposable dispose]; 75 | 76 | return [NSString stringWithFormat:@"<%@: %p>{ name = %@, values = %@ … }", self.class, self, self.name, values]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACStream+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACStream+Private.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-07-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACStream.h" 10 | 11 | @interface RACStream () 12 | 13 | // Combines a list of streams using the logic of the given block. 14 | // 15 | // streams - The streams to combine. 16 | // block - An operator that combines two streams and returns a new one. The 17 | // returned stream should contain 2-tuples of the streams' combined 18 | // values. 19 | // 20 | // Returns a combined stream. 21 | + (__kindof RACStream *)join:(id)streams block:(RACStream * (^)(id, id))block; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACStringSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACStringSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class that adapts a string to the RACSequence interface. 12 | @interface RACStringSequence : RACSequence 13 | 14 | // Returns a sequence for enumerating over the given string, starting from the 15 | // given character offset. The string will be copied to prevent mutation. 16 | + (RACSequence *)sequenceWithString:(NSString *)string offset:(NSUInteger)offset; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACStringSequence.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACStringSequence.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2012-10-29. 6 | // Copyright (c) 2012 GitHub. All rights reserved. 7 | // 8 | 9 | #import "RACStringSequence.h" 10 | 11 | @interface RACStringSequence () 12 | 13 | // The string being sequenced. 14 | @property (nonatomic, copy, readonly) NSString *string; 15 | 16 | // The index in the string from which the sequence starts. 17 | @property (nonatomic, assign, readonly) NSUInteger offset; 18 | 19 | @end 20 | 21 | @implementation RACStringSequence 22 | 23 | #pragma mark Lifecycle 24 | 25 | + (RACSequence *)sequenceWithString:(NSString *)string offset:(NSUInteger)offset { 26 | NSCParameterAssert(offset <= string.length); 27 | 28 | if (offset == string.length) return self.empty; 29 | 30 | RACStringSequence *seq = [[self alloc] init]; 31 | seq->_string = [string copy]; 32 | seq->_offset = offset; 33 | return seq; 34 | } 35 | 36 | #pragma mark RACSequence 37 | 38 | - (id)head { 39 | return [self.string substringWithRange:NSMakeRange(self.offset, 1)]; 40 | } 41 | 42 | - (RACSequence *)tail { 43 | RACSequence *sequence = [self.class sequenceWithString:self.string offset:self.offset + 1]; 44 | sequence.name = self.name; 45 | return sequence; 46 | } 47 | 48 | - (NSArray *)array { 49 | NSUInteger substringLength = self.string.length - self.offset; 50 | NSMutableArray *array = [NSMutableArray arrayWithCapacity:substringLength]; 51 | 52 | [self.string enumerateSubstringsInRange:NSMakeRange(self.offset, substringLength) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { 53 | [array addObject:substring]; 54 | }]; 55 | 56 | return [array copy]; 57 | } 58 | 59 | #pragma mark NSObject 60 | 61 | - (NSString *)description { 62 | return [NSString stringWithFormat:@"<%@: %p>{ name = %@, string = %@ }", self.class, self, self.name, [self.string substringFromIndex:self.offset]]; 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubject.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubject.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/9/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSignal.h" 10 | #import "RACSubscriber.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /// A subject can be thought of as a signal that you can manually control by 15 | /// sending next, completed, and error. 16 | /// 17 | /// They're most helpful in bridging the non-RAC world to RAC, since they let you 18 | /// manually control the sending of events. 19 | @interface RACSubject : RACSignal 20 | 21 | /// Returns a new subject. 22 | + (instancetype)subject; 23 | 24 | // Redeclaration of the RACSubscriber method. Made in order to specify a generic type. 25 | - (void)sendNext:(nullable ValueType)value; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubscriber+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubscriber+Private.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-06-13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubscriber.h" 10 | 11 | // A simple block-based subscriber. 12 | @interface RACSubscriber : NSObject 13 | 14 | // Creates a new subscriber with the given blocks. 15 | + (instancetype)subscriberWithNext:(void (^)(id x))next error:(void (^)(NSError *error))error completed:(void (^)(void))completed; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubscriber.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubscriber.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/1/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACCompoundDisposable; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | /// Represents any object which can directly receive values from a RACSignal. 16 | /// 17 | /// You generally shouldn't need to implement this protocol. +[RACSignal 18 | /// createSignal:], RACSignal's subscription methods, or RACSubject should work 19 | /// for most uses. 20 | /// 21 | /// Implementors of this protocol may receive messages and values from multiple 22 | /// threads simultaneously, and so should be thread-safe. Subscribers will also 23 | /// be weakly referenced so implementations must allow that. 24 | @protocol RACSubscriber 25 | @required 26 | 27 | /// Sends the next value to subscribers. 28 | /// 29 | /// value - The value to send. This can be `nil`. 30 | - (void)sendNext:(nullable id)value; 31 | 32 | /// Sends the error to subscribers. 33 | /// 34 | /// error - The error to send. This can be `nil`. 35 | /// 36 | /// This terminates the subscription, and invalidates the subscriber (such that 37 | /// it cannot subscribe to anything else in the future). 38 | - (void)sendError:(nullable NSError *)error; 39 | 40 | /// Sends completed to subscribers. 41 | /// 42 | /// This terminates the subscription, and invalidates the subscriber (such that 43 | /// it cannot subscribe to anything else in the future). 44 | - (void)sendCompleted; 45 | 46 | /// Sends the subscriber a disposable that represents one of its subscriptions. 47 | /// 48 | /// A subscriber may receive multiple disposables if it gets subscribed to 49 | /// multiple signals; however, any error or completed events must terminate _all_ 50 | /// subscriptions. 51 | - (void)didSubscribeWithDisposable:(RACCompoundDisposable *)disposable; 52 | 53 | @end 54 | 55 | NS_ASSUME_NONNULL_END 56 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubscriptingAssignmentTrampoline.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubscriptingAssignmentTrampoline.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 9/24/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubscriptingAssignmentTrampoline.h" 10 | #import "RACSignal+Operations.h" 11 | 12 | @interface RACSubscriptingAssignmentTrampoline () 13 | 14 | // The object to bind to. 15 | @property (nonatomic, strong, readonly) id target; 16 | 17 | // A value to use when `nil` is sent on the bound signal. 18 | @property (nonatomic, strong, readonly) id nilValue; 19 | 20 | @end 21 | 22 | @implementation RACSubscriptingAssignmentTrampoline 23 | 24 | - (instancetype)initWithTarget:(id)target nilValue:(id)nilValue { 25 | // This is often a programmer error, but this prevents crashes if the target 26 | // object has unexpectedly deallocated. 27 | if (target == nil) return nil; 28 | 29 | self = [super init]; 30 | if (self == nil) return nil; 31 | 32 | _target = target; 33 | _nilValue = nilValue; 34 | 35 | return self; 36 | } 37 | 38 | - (void)setObject:(RACSignal *)signal forKeyedSubscript:(NSString *)keyPath { 39 | [signal setKeyPath:keyPath onObject:self.target nilValue:self.nilValue]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubscriptionScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubscriptionScheduler.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScheduler.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | // A private scheduler used only for subscriptions. See the private 14 | // +[RACScheduler subscriptionScheduler] method for more information. 15 | @interface RACSubscriptionScheduler : RACScheduler 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACSubscriptionScheduler.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACSubscriptionScheduler.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 11/30/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSubscriptionScheduler.h" 10 | #import "RACScheduler+Private.h" 11 | 12 | @interface RACSubscriptionScheduler () 13 | 14 | // A private background scheduler on which to subscribe if the +currentScheduler 15 | // is unknown. 16 | @property (nonatomic, strong, readonly) RACScheduler *backgroundScheduler; 17 | 18 | @end 19 | 20 | @implementation RACSubscriptionScheduler 21 | 22 | #pragma mark Lifecycle 23 | 24 | - (instancetype)init { 25 | self = [super initWithName:@"org.reactivecocoa.ReactiveObjC.RACScheduler.subscriptionScheduler"]; 26 | 27 | _backgroundScheduler = [RACScheduler scheduler]; 28 | 29 | return self; 30 | } 31 | 32 | #pragma mark RACScheduler 33 | 34 | - (RACDisposable *)schedule:(void (^)(void))block { 35 | NSCParameterAssert(block != NULL); 36 | 37 | if (RACScheduler.currentScheduler == nil) return [self.backgroundScheduler schedule:block]; 38 | 39 | block(); 40 | return nil; 41 | } 42 | 43 | - (RACDisposable *)after:(NSDate *)date schedule:(void (^)(void))block { 44 | RACScheduler *scheduler = RACScheduler.currentScheduler ?: self.backgroundScheduler; 45 | return [scheduler after:date schedule:block]; 46 | } 47 | 48 | - (RACDisposable *)after:(NSDate *)date repeatingEvery:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway schedule:(void (^)(void))block { 49 | RACScheduler *scheduler = RACScheduler.currentScheduler ?: self.backgroundScheduler; 50 | return [scheduler after:date repeatingEvery:interval withLeeway:leeway schedule:block]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACTargetQueueScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACTargetQueueScheduler.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 6/6/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACQueueScheduler.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A scheduler that enqueues blocks on a private serial queue, targeting an 14 | /// arbitrary GCD queue. 15 | @interface RACTargetQueueScheduler : RACQueueScheduler 16 | 17 | /// Initializes the receiver with a serial queue that will target the given 18 | /// `targetQueue`. 19 | /// 20 | /// name - The name of the scheduler. If nil, a default name will be used. 21 | /// targetQueue - The queue to target. Cannot be NULL. 22 | /// 23 | /// Returns the initialized object. 24 | - (instancetype)initWithName:(nullable NSString *)name targetQueue:(dispatch_queue_t)targetQueue; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACTargetQueueScheduler.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACTargetQueueScheduler.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 6/6/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACTargetQueueScheduler.h" 10 | #import "RACQueueScheduler+Subclass.h" 11 | 12 | @implementation RACTargetQueueScheduler 13 | 14 | #pragma mark Lifecycle 15 | 16 | - (instancetype)initWithName:(NSString *)name targetQueue:(dispatch_queue_t)targetQueue { 17 | NSCParameterAssert(targetQueue != NULL); 18 | 19 | if (name == nil) { 20 | name = [NSString stringWithFormat:@"org.reactivecocoa.ReactiveObjC.RACTargetQueueScheduler(%s)", dispatch_queue_get_label(targetQueue)]; 21 | } 22 | 23 | dispatch_queue_t queue = dispatch_queue_create(name.UTF8String, DISPATCH_QUEUE_SERIAL); 24 | if (queue == NULL) return nil; 25 | 26 | dispatch_set_target_queue(queue, targetQueue); 27 | 28 | return [super initWithName:name queue:queue]; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACTestScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACTestScheduler.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-07-06. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACScheduler.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A special kind of scheduler that steps through virtualized time. 14 | /// 15 | /// This scheduler class can be used in unit tests to verify asynchronous 16 | /// behaviors without spending significant time waiting. 17 | /// 18 | /// This class can be used from multiple threads, but only one thread can `step` 19 | /// through the enqueued actions at a time. Other threads will wait while the 20 | /// scheduled blocks are being executed. 21 | @interface RACTestScheduler : RACScheduler 22 | 23 | /// Initializes a new test scheduler. 24 | - (instancetype)init; 25 | 26 | /// Executes the next scheduled block, if any. 27 | /// 28 | /// This method will block until the scheduled action has completed. 29 | - (void)step; 30 | 31 | /// Executes up to the next `ticks` scheduled blocks. 32 | /// 33 | /// This method will block until the scheduled actions have completed. 34 | /// 35 | /// ticks - The number of scheduled blocks to execute. If there aren't this many 36 | /// blocks enqueued, all scheduled blocks are executed. 37 | - (void)step:(NSUInteger)ticks; 38 | 39 | /// Executes all of the scheduled blocks on the receiver. 40 | /// 41 | /// This method will block until the scheduled actions have completed. 42 | - (void)stepAll; 43 | 44 | @end 45 | 46 | NS_ASSUME_NONNULL_END 47 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACTupleSequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACTupleSequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-01. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class that adapts a RACTuple to the RACSequence interface. 12 | @interface RACTupleSequence : RACSequence 13 | 14 | // Returns a sequence for enumerating over the given backing array (from a 15 | // RACTuple), starting from the given offset. 16 | + (RACSequence *)sequenceWithTupleBackingArray:(NSArray *)backingArray offset:(NSUInteger)offset; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACUnarySequence.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACUnarySequence.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-05-01. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACSequence.h" 10 | 11 | // Private class representing a sequence of exactly one value. 12 | @interface RACUnarySequence : RACSequence 13 | 14 | + (RACUnarySequence *)return:(id)value; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACUnit.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACUnit.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/27/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | /// A unit represents an empty value. 14 | /// 15 | /// It should never be necessary to create a unit yourself. Just use +defaultUnit. 16 | @interface RACUnit : NSObject 17 | 18 | /// A singleton instance. 19 | + (RACUnit *)defaultUnit; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACUnit.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACUnit.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/27/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACUnit.h" 10 | 11 | @implementation RACUnit 12 | 13 | #pragma mark API 14 | 15 | + (RACUnit *)defaultUnit { 16 | static dispatch_once_t onceToken; 17 | static RACUnit *defaultUnit = nil; 18 | dispatch_once(&onceToken, ^{ 19 | defaultUnit = [[self alloc] init]; 20 | }); 21 | 22 | return defaultUnit; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACValueTransformer.h: -------------------------------------------------------------------------------- 1 | // 2 | // RACValueTransformer.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/6/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // A private block based transformer. 12 | @interface RACValueTransformer : NSValueTransformer 13 | 14 | + (instancetype)transformerWithBlock:(id (^)(id value))block; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/RACValueTransformer.m: -------------------------------------------------------------------------------- 1 | // 2 | // RACValueTransformer.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 3/6/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "RACValueTransformer.h" 10 | 11 | @interface RACValueTransformer () 12 | @property (nonatomic, copy) id (^transformBlock)(id value); 13 | @end 14 | 15 | 16 | @implementation RACValueTransformer 17 | 18 | 19 | #pragma mark NSValueTransformer 20 | 21 | + (BOOL)allowsReverseTransformation { 22 | return NO; 23 | } 24 | 25 | - (id)transformedValue:(id)value { 26 | return self.transformBlock(value); 27 | } 28 | 29 | 30 | #pragma mark API 31 | 32 | @synthesize transformBlock; 33 | 34 | + (instancetype)transformerWithBlock:(id (^)(id value))block { 35 | NSCParameterAssert(block != NULL); 36 | 37 | RACValueTransformer *transformer = [[self alloc] init]; 38 | transformer.transformBlock = block; 39 | return transformer; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIActionSheet+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIActionSheet+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Dave Lee on 2013-06-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACDelegateProxy; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UIActionSheet (RACSignalSupport) 17 | 18 | /// A delegate proxy which will be set as the receiver's delegate when any of the 19 | /// methods in this category are used. 20 | @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy; 21 | 22 | /// Creates a signal for button clicks on the receiver. 23 | /// 24 | /// When this method is invoked, the `rac_delegateProxy` will become the 25 | /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy 26 | /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't 27 | /// know how to handle. Setting the receiver's `delegate` afterward is 28 | /// considered undefined behavior. 29 | /// 30 | /// Returns a signal which will send the index of the specific button clicked. 31 | /// The signal will complete when the receiver is deallocated. 32 | - (RACSignal *)rac_buttonClickedSignal; 33 | 34 | @end 35 | 36 | NS_ASSUME_NONNULL_END 37 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIActionSheet+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIActionSheet+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Dave Lee on 2013-06-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIActionSheet+RACSignalSupport.h" 10 | #import "RACDelegateProxy.h" 11 | #import "RACSignal+Operations.h" 12 | #import "NSObject+RACDeallocating.h" 13 | #import "NSObject+RACDescription.h" 14 | #import 15 | 16 | @implementation UIActionSheet (RACSignalSupport) 17 | 18 | static void RACUseDelegateProxy(UIActionSheet *self) { 19 | if (self.delegate == self.rac_delegateProxy) return; 20 | 21 | self.rac_delegateProxy.rac_proxiedDelegate = self.delegate; 22 | self.delegate = (id)self.rac_delegateProxy; 23 | } 24 | 25 | - (RACDelegateProxy *)rac_delegateProxy { 26 | RACDelegateProxy *proxy = objc_getAssociatedObject(self, _cmd); 27 | if (proxy == nil) { 28 | proxy = [[RACDelegateProxy alloc] initWithProtocol:@protocol(UIActionSheetDelegate)]; 29 | objc_setAssociatedObject(self, _cmd, proxy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 30 | } 31 | 32 | return proxy; 33 | } 34 | 35 | - (RACSignal *)rac_buttonClickedSignal { 36 | RACSignal *signal = [[[[self.rac_delegateProxy 37 | signalForSelector:@selector(actionSheet:clickedButtonAtIndex:)] 38 | reduceEach:^(UIActionSheet *actionSheet, NSNumber *buttonIndex) { 39 | return buttonIndex; 40 | }] 41 | takeUntil:self.rac_willDeallocSignal] 42 | setNameWithFormat:@"%@ -rac_buttonClickedSignal", RACDescription(self)]; 43 | 44 | RACUseDelegateProxy(self); 45 | 46 | return signal; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIAlertView+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Henrik Hodne on 6/16/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIAlertView+RACSignalSupport.h" 10 | #import "RACDelegateProxy.h" 11 | #import "RACSignal+Operations.h" 12 | #import "NSObject+RACDeallocating.h" 13 | #import "NSObject+RACDescription.h" 14 | #import 15 | 16 | @implementation UIAlertView (RACSignalSupport) 17 | 18 | static void RACUseDelegateProxy(UIAlertView *self) { 19 | if (self.delegate == self.rac_delegateProxy) return; 20 | 21 | self.rac_delegateProxy.rac_proxiedDelegate = self.delegate; 22 | self.delegate = (id)self.rac_delegateProxy; 23 | } 24 | 25 | - (RACDelegateProxy *)rac_delegateProxy { 26 | RACDelegateProxy *proxy = objc_getAssociatedObject(self, _cmd); 27 | if (proxy == nil) { 28 | proxy = [[RACDelegateProxy alloc] initWithProtocol:@protocol(UIAlertViewDelegate)]; 29 | objc_setAssociatedObject(self, _cmd, proxy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 30 | } 31 | 32 | return proxy; 33 | } 34 | 35 | - (RACSignal *)rac_buttonClickedSignal { 36 | RACSignal *signal = [[[[self.rac_delegateProxy 37 | signalForSelector:@selector(alertView:clickedButtonAtIndex:)] 38 | reduceEach:^(UIAlertView *alertView, NSNumber *buttonIndex) { 39 | return buttonIndex; 40 | }] 41 | takeUntil:self.rac_willDeallocSignal] 42 | setNameWithFormat:@"%@ -rac_buttonClickedSignal", RACDescription(self)]; 43 | 44 | RACUseDelegateProxy(self); 45 | 46 | return signal; 47 | } 48 | 49 | - (RACSignal *)rac_willDismissSignal { 50 | RACSignal *signal = [[[[self.rac_delegateProxy 51 | signalForSelector:@selector(alertView:willDismissWithButtonIndex:)] 52 | reduceEach:^(UIAlertView *alertView, NSNumber *buttonIndex) { 53 | return buttonIndex; 54 | }] 55 | takeUntil:self.rac_willDeallocSignal] 56 | setNameWithFormat:@"%@ -rac_willDismissSignal", RACDescription(self)]; 57 | 58 | RACUseDelegateProxy(self); 59 | 60 | return signal; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIBarButtonItem+RACCommandSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+RACCommandSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Kyle LeNeau on 3/27/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACCommand<__contravariant InputType, __covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIBarButtonItem (RACCommandSupport) 16 | 17 | /// Sets the control's command. When the control is clicked, the command is 18 | /// executed with the sender of the event. The control's enabledness is bound 19 | /// to the command's `canExecute`. 20 | /// 21 | /// Note: this will reset the control's target and action. 22 | @property (nonatomic, strong, nullable) RACCommand<__kindof UIBarButtonItem *, id> *rac_command; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIBarButtonItem+RACCommandSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+RACCommandSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Kyle LeNeau on 3/27/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIBarButtonItem+RACCommandSupport.h" 10 | #import 11 | #import "RACCommand.h" 12 | #import "RACDisposable.h" 13 | #import "RACSignal+Operations.h" 14 | #import 15 | 16 | static void *UIControlRACCommandKey = &UIControlRACCommandKey; 17 | static void *UIControlEnabledDisposableKey = &UIControlEnabledDisposableKey; 18 | 19 | @implementation UIBarButtonItem (RACCommandSupport) 20 | 21 | - (RACCommand *)rac_command { 22 | return objc_getAssociatedObject(self, UIControlRACCommandKey); 23 | } 24 | 25 | - (void)setRac_command:(RACCommand *)command { 26 | objc_setAssociatedObject(self, UIControlRACCommandKey, command, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 27 | 28 | // Check for stored signal in order to remove it and add a new one 29 | RACDisposable *disposable = objc_getAssociatedObject(self, UIControlEnabledDisposableKey); 30 | [disposable dispose]; 31 | 32 | if (command == nil) return; 33 | 34 | disposable = [command.enabled setKeyPath:@keypath(self.enabled) onObject:self]; 35 | objc_setAssociatedObject(self, UIControlEnabledDisposableKey, disposable, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 36 | 37 | [self rac_hijackActionAndTargetIfNeeded]; 38 | } 39 | 40 | - (void)rac_hijackActionAndTargetIfNeeded { 41 | SEL hijackSelector = @selector(rac_commandPerformAction:); 42 | if (self.target == self && self.action == hijackSelector) return; 43 | 44 | if (self.target != nil) NSLog(@"WARNING: UIBarButtonItem.rac_command hijacks the control's existing target and action."); 45 | 46 | self.target = self; 47 | self.action = hijackSelector; 48 | } 49 | 50 | - (void)rac_commandPerformAction:(id)sender { 51 | [self.rac_command execute:sender]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIButton+RACCommandSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+RACCommandSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Ash Furrow on 2013-06-06. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACCommand<__contravariant InputType, __covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIButton (RACCommandSupport) 16 | 17 | /// Sets the button's command. When the button is clicked, the command is 18 | /// executed with the sender of the event. The button's enabledness is bound 19 | /// to the command's `canExecute`. 20 | @property (nonatomic, strong, nullable) RACCommand<__kindof UIButton *, id> *rac_command; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIButton+RACCommandSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+RACCommandSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Ash Furrow on 2013-06-06. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIButton+RACCommandSupport.h" 10 | #import 11 | #import "RACCommand.h" 12 | #import "RACDisposable.h" 13 | #import "RACSignal+Operations.h" 14 | #import 15 | 16 | static void *UIButtonRACCommandKey = &UIButtonRACCommandKey; 17 | static void *UIButtonEnabledDisposableKey = &UIButtonEnabledDisposableKey; 18 | 19 | @implementation UIButton (RACCommandSupport) 20 | 21 | - (RACCommand *)rac_command { 22 | return objc_getAssociatedObject(self, UIButtonRACCommandKey); 23 | } 24 | 25 | - (void)setRac_command:(RACCommand *)command { 26 | objc_setAssociatedObject(self, UIButtonRACCommandKey, command, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 27 | 28 | // Check for stored signal in order to remove it and add a new one 29 | RACDisposable *disposable = objc_getAssociatedObject(self, UIButtonEnabledDisposableKey); 30 | [disposable dispose]; 31 | 32 | if (command == nil) return; 33 | 34 | disposable = [command.enabled setKeyPath:@keypath(self.enabled) onObject:self]; 35 | objc_setAssociatedObject(self, UIButtonEnabledDisposableKey, disposable, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 36 | 37 | [self rac_hijackActionAndTargetIfNeeded]; 38 | } 39 | 40 | - (void)rac_hijackActionAndTargetIfNeeded { 41 | SEL hijackSelector = @selector(rac_commandPerformAction:); 42 | 43 | for (NSString *selector in [self actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) { 44 | if (hijackSelector == NSSelectorFromString(selector)) { 45 | return; 46 | } 47 | } 48 | 49 | [self addTarget:self action:hijackSelector forControlEvents:UIControlEventTouchUpInside]; 50 | } 51 | 52 | - (void)rac_commandPerformAction:(id)sender { 53 | [self.rac_command execute:sender]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UICollectionReusableView+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionReusableView+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Kent Wong on 2013-10-04. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | @class RACUnit; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | // This category is only applicable to iOS >= 6.0. 17 | @interface UICollectionReusableView (RACSignalSupport) 18 | 19 | /// A signal which will send a RACUnit whenever -prepareForReuse is invoked upon 20 | /// the receiver. 21 | /// 22 | /// Examples 23 | /// 24 | /// [[[self.cancelButton 25 | /// rac_signalForControlEvents:UIControlEventTouchUpInside] 26 | /// takeUntil:self.rac_prepareForReuseSignal] 27 | /// subscribeNext:^(UIButton *x) { 28 | /// // do other things 29 | /// }]; 30 | @property (nonatomic, strong, readonly) RACSignal *rac_prepareForReuseSignal; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UICollectionReusableView+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UICollectionReusableView+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Kent Wong on 2013-10-04. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UICollectionReusableView+RACSignalSupport.h" 10 | #import "NSObject+RACDescription.h" 11 | #import "NSObject+RACSelectorSignal.h" 12 | #import "RACSignal+Operations.h" 13 | #import "RACUnit.h" 14 | #import 15 | 16 | @implementation UICollectionReusableView (RACSignalSupport) 17 | 18 | - (RACSignal *)rac_prepareForReuseSignal { 19 | RACSignal *signal = objc_getAssociatedObject(self, _cmd); 20 | if (signal != nil) return signal; 21 | 22 | signal = [[[self 23 | rac_signalForSelector:@selector(prepareForReuse)] 24 | mapReplace:RACUnit.defaultUnit] 25 | setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)]; 26 | 27 | objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return signal; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIControl+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 4/17/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIControl (RACSignalSupport) 16 | 17 | /// Creates and returns a signal that sends the sender of the control event 18 | /// whenever one of the control events is triggered. 19 | - (RACSignal<__kindof UIControl *> *)rac_signalForControlEvents:(UIControlEvents)controlEvents; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIControl+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 4/17/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIControl+RACSignalSupport.h" 10 | #import 11 | #import "RACCompoundDisposable.h" 12 | #import "RACDisposable.h" 13 | #import "RACSignal.h" 14 | #import "RACSubscriber.h" 15 | #import "NSObject+RACDeallocating.h" 16 | #import "NSObject+RACDescription.h" 17 | 18 | @implementation UIControl (RACSignalSupport) 19 | 20 | - (RACSignal *)rac_signalForControlEvents:(UIControlEvents)controlEvents { 21 | @weakify(self); 22 | 23 | return [[RACSignal 24 | createSignal:^(id subscriber) { 25 | @strongify(self); 26 | 27 | [self addTarget:subscriber action:@selector(sendNext:) forControlEvents:controlEvents]; 28 | 29 | RACDisposable *disposable = [RACDisposable disposableWithBlock:^{ 30 | [subscriber sendCompleted]; 31 | }]; 32 | [self.rac_deallocDisposable addDisposable:disposable]; 33 | 34 | return [RACDisposable disposableWithBlock:^{ 35 | @strongify(self); 36 | [self.rac_deallocDisposable removeDisposable:disposable]; 37 | [self removeTarget:subscriber action:@selector(sendNext:) forControlEvents:controlEvents]; 38 | }]; 39 | }] 40 | setNameWithFormat:@"%@ -rac_signalForControlEvents: %lx", RACDescription(self), (unsigned long)controlEvents]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIControl+RACSignalSupportPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+RACSignalSupportPrivate.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 06/08/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIControl (RACSignalSupportPrivate) 16 | 17 | /// Adds a RACChannel-based interface to the receiver for the given 18 | /// UIControlEvents and exposes it. 19 | /// 20 | /// controlEvents - A mask of UIControlEvents on which to send new values. 21 | /// key - The key whose value should be read and set when a control 22 | /// event fires and when a value is sent to the 23 | /// RACChannelTerminal respectively. 24 | /// nilValue - The value to be assigned to the key when `nil` is sent to the 25 | /// RACChannelTerminal. This value can itself be nil. 26 | /// 27 | /// Returns a RACChannelTerminal which will send future values from the receiver, 28 | /// and update the receiver when values are sent to the terminal. 29 | - (RACChannelTerminal *)rac_channelForControlEvents:(UIControlEvents)controlEvents key:(NSString *)key nilValue:(nullable id)nilValue; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIControl+RACSignalSupportPrivate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+RACSignalSupportPrivate.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 06/08/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIControl+RACSignalSupportPrivate.h" 10 | #import "NSObject+RACDeallocating.h" 11 | #import "NSObject+RACLifting.h" 12 | #import "RACChannel.h" 13 | #import "RACCompoundDisposable.h" 14 | #import "RACDisposable.h" 15 | #import "RACSignal+Operations.h" 16 | #import "UIControl+RACSignalSupport.h" 17 | 18 | @implementation UIControl (RACSignalSupportPrivate) 19 | 20 | - (RACChannelTerminal *)rac_channelForControlEvents:(UIControlEvents)controlEvents key:(NSString *)key nilValue:(id)nilValue { 21 | NSCParameterAssert(key.length > 0); 22 | key = [key copy]; 23 | RACChannel *channel = [[RACChannel alloc] init]; 24 | 25 | [self.rac_deallocDisposable addDisposable:[RACDisposable disposableWithBlock:^{ 26 | [channel.followingTerminal sendCompleted]; 27 | }]]; 28 | 29 | RACSignal *eventSignal = [[[self 30 | rac_signalForControlEvents:controlEvents] 31 | mapReplace:key] 32 | takeUntil:[[channel.followingTerminal 33 | ignoreValues] 34 | catchTo:RACSignal.empty]]; 35 | [[self 36 | rac_liftSelector:@selector(valueForKey:) withSignals:eventSignal, nil] 37 | subscribe:channel.followingTerminal]; 38 | 39 | RACSignal *valuesSignal = [channel.followingTerminal 40 | map:^(id value) { 41 | return value ?: nilValue; 42 | }]; 43 | [self rac_liftSelector:@selector(setValue:forKey:) withSignals:valuesSignal, [RACSignal return:key], nil]; 44 | 45 | return channel.leadingTerminal; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIDatePicker+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIDatePicker+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIDatePicker (RACSignalSupport) 16 | 17 | /// Creates a new RACChannel-based binding to the receiver. 18 | /// 19 | /// nilValue - The date to set when the terminal receives `nil`. 20 | /// 21 | /// Returns a RACChannelTerminal that sends the receiver's date whenever the 22 | /// UIControlEventValueChanged control event is fired, and sets the date to the 23 | /// values it receives. 24 | - (RACChannelTerminal *)rac_newDateChannelWithNilValue:(nullable NSDate *)nilValue; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIDatePicker+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIDatePicker+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIDatePicker+RACSignalSupport.h" 10 | #import 11 | #import "UIControl+RACSignalSupportPrivate.h" 12 | 13 | @implementation UIDatePicker (RACSignalSupport) 14 | 15 | - (RACChannelTerminal *)rac_newDateChannelWithNilValue:(NSDate *)nilValue { 16 | return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.date) nilValue:nilValue]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIGestureRecognizer+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIGestureRecognizer+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Vera on 5/5/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIGestureRecognizer (RACSignalSupport) 16 | 17 | /// Returns a signal that sends the receiver when its gesture occurs. 18 | - (RACSignal<__kindof UIGestureRecognizer *> *)rac_gestureSignal; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIGestureRecognizer+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIGestureRecognizer+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Vera on 5/5/13. 6 | // Copyright (c) 2013 GitHub. All rights reserved. 7 | // 8 | 9 | #import "UIGestureRecognizer+RACSignalSupport.h" 10 | #import 11 | #import "NSObject+RACDeallocating.h" 12 | #import "NSObject+RACDescription.h" 13 | #import "RACCompoundDisposable.h" 14 | #import "RACDisposable.h" 15 | #import "RACSignal.h" 16 | #import "RACSubscriber.h" 17 | 18 | @implementation UIGestureRecognizer (RACSignalSupport) 19 | 20 | - (RACSignal *)rac_gestureSignal { 21 | @weakify(self); 22 | 23 | return [[RACSignal 24 | createSignal:^(id subscriber) { 25 | @strongify(self); 26 | 27 | [self addTarget:subscriber action:@selector(sendNext:)]; 28 | [self.rac_deallocDisposable addDisposable:[RACDisposable disposableWithBlock:^{ 29 | [subscriber sendCompleted]; 30 | }]]; 31 | 32 | return [RACDisposable disposableWithBlock:^{ 33 | @strongify(self); 34 | [self removeTarget:subscriber action:@selector(sendNext:)]; 35 | }]; 36 | }] 37 | setNameWithFormat:@"%@ -rac_gestureSignal", RACDescription(self)]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIImagePickerController+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImagePickerController+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Timur Kuchkarov on 28.03.14. 6 | // Copyright (c) 2014 GitHub. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACDelegateProxy; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UIImagePickerController (RACSignalSupport) 17 | 18 | /// A delegate proxy which will be set as the receiver's delegate when any of the 19 | /// methods in this category are used. 20 | @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy; 21 | 22 | /// Creates a signal for every new selected image. 23 | /// 24 | /// When this method is invoked, the `rac_delegateProxy` will become the 25 | /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy 26 | /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't 27 | /// know how to handle. Setting the receiver's `delegate` afterward is considered 28 | /// undefined behavior. 29 | /// 30 | /// Returns a signal which will send the dictionary with info for the selected image. 31 | /// Caller is responsible for picker controller dismissal. The signal will complete 32 | /// itself when the receiver is deallocated or when user cancels selection. 33 | - (RACSignal *)rac_imageSelectedSignal; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIImagePickerController+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImagePickerController+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Timur Kuchkarov on 28.03.14. 6 | // Copyright (c) 2014 GitHub. All rights reserved. 7 | // 8 | 9 | #import "UIImagePickerController+RACSignalSupport.h" 10 | #import "RACDelegateProxy.h" 11 | #import "RACSignal+Operations.h" 12 | #import "NSObject+RACDeallocating.h" 13 | #import "NSObject+RACDescription.h" 14 | #import 15 | 16 | @implementation UIImagePickerController (RACSignalSupport) 17 | 18 | static void RACUseDelegateProxy(UIImagePickerController *self) { 19 | if (self.delegate == self.rac_delegateProxy) return; 20 | 21 | self.rac_delegateProxy.rac_proxiedDelegate = self.delegate; 22 | self.delegate = (id)self.rac_delegateProxy; 23 | } 24 | 25 | - (RACDelegateProxy *)rac_delegateProxy { 26 | RACDelegateProxy *proxy = objc_getAssociatedObject(self, _cmd); 27 | if (proxy == nil) { 28 | proxy = [[RACDelegateProxy alloc] initWithProtocol:@protocol(UIImagePickerControllerDelegate)]; 29 | objc_setAssociatedObject(self, _cmd, proxy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 30 | } 31 | 32 | return proxy; 33 | } 34 | 35 | - (RACSignal *)rac_imageSelectedSignal { 36 | RACSignal *pickerCancelledSignal = [[self.rac_delegateProxy 37 | signalForSelector:@selector(imagePickerControllerDidCancel:)] 38 | merge:self.rac_willDeallocSignal]; 39 | 40 | RACSignal *imagePickerSignal = [[[[self.rac_delegateProxy 41 | signalForSelector:@selector(imagePickerController:didFinishPickingMediaWithInfo:)] 42 | reduceEach:^(UIImagePickerController *pickerController, NSDictionary *userInfo) { 43 | return userInfo; 44 | }] 45 | takeUntil:pickerCancelledSignal] 46 | setNameWithFormat:@"%@ -rac_imageSelectedSignal", RACDescription(self)]; 47 | 48 | RACUseDelegateProxy(self); 49 | 50 | return imagePickerSignal; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIRefreshControl+RACCommandSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIRefreshControl+RACCommandSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Dave Lee on 2013-10-17. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACCommand<__contravariant InputType, __covariant ValueType>; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIRefreshControl (RACCommandSupport) 16 | 17 | /// Manipulate the RACCommand property associated with this refresh control. 18 | /// 19 | /// When this refresh control is activated by the user, the command will be 20 | /// executed. Upon completion or error of the execution signal, -endRefreshing 21 | /// will be invoked. 22 | @property (nonatomic, strong, nullable) RACCommand<__kindof UIRefreshControl *, id> *rac_command; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISegmentedControl+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISegmentedControl+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UISegmentedControl (RACSignalSupport) 16 | 17 | /// Creates a new RACChannel-based binding to the receiver. 18 | /// 19 | /// nilValue - The segment to select when the terminal receives `nil`. 20 | /// 21 | /// Returns a RACChannelTerminal that sends the receiver's currently selected 22 | /// segment's index whenever the UIControlEventValueChanged control event is 23 | /// fired, and sets the selected segment index to the values it receives. 24 | - (RACChannelTerminal *)rac_newSelectedSegmentIndexChannelWithNilValue:(nullable NSNumber *)nilValue; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISegmentedControl+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISegmentedControl+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UISegmentedControl+RACSignalSupport.h" 10 | #import 11 | #import "UIControl+RACSignalSupportPrivate.h" 12 | 13 | @implementation UISegmentedControl (RACSignalSupport) 14 | 15 | - (RACChannelTerminal *)rac_newSelectedSegmentIndexChannelWithNilValue:(NSNumber *)nilValue { 16 | return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.selectedSegmentIndex) nilValue:nilValue]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISlider+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISlider+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UISlider (RACSignalSupport) 16 | 17 | /// Creates a new RACChannel-based binding to the receiver. 18 | /// 19 | /// nilValue - The value to set when the terminal receives `nil`. 20 | /// 21 | /// Returns a RACChannelTerminal that sends the receiver's value whenever the 22 | /// UIControlEventValueChanged control event is fired, and sets the value to the 23 | /// values it receives. 24 | - (RACChannelTerminal *)rac_newValueChannelWithNilValue:(nullable NSNumber *)nilValue; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISlider+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISlider+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UISlider+RACSignalSupport.h" 10 | #import 11 | #import "UIControl+RACSignalSupportPrivate.h" 12 | 13 | @implementation UISlider (RACSignalSupport) 14 | 15 | - (RACChannelTerminal *)rac_newValueChannelWithNilValue:(NSNumber *)nilValue { 16 | return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.value) nilValue:nilValue]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIStepper+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIStepper+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UIStepper (RACSignalSupport) 16 | 17 | /// Creates a new RACChannel-based binding to the receiver. 18 | /// 19 | /// nilValue - The value to set when the terminal receives `nil`. 20 | /// 21 | /// Returns a RACChannelTerminal that sends the receiver's value whenever the 22 | /// UIControlEventValueChanged control event is fired, and sets the value to the 23 | /// values it receives. 24 | - (RACChannelTerminal *)rac_newValueChannelWithNilValue:(nullable NSNumber *)nilValue; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UIStepper+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIStepper+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UIStepper+RACSignalSupport.h" 10 | #import 11 | #import "UIControl+RACSignalSupportPrivate.h" 12 | 13 | @implementation UIStepper (RACSignalSupport) 14 | 15 | - (RACChannelTerminal *)rac_newValueChannelWithNilValue:(NSNumber *)nilValue { 16 | return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.value) nilValue:nilValue]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISwitch+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISwitch+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface UISwitch (RACSignalSupport) 16 | 17 | /// Creates a new RACChannel-based binding to the receiver. 18 | /// 19 | /// Returns a RACChannelTerminal that sends whether the receiver is on whenever 20 | /// the UIControlEventValueChanged control event is fired, and sets it on or off 21 | /// when it receives @YES or @NO respectively. 22 | - (RACChannelTerminal *)rac_newOnChannel; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UISwitch+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISwitch+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Uri Baghin on 20/07/2013. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UISwitch+RACSignalSupport.h" 10 | #import 11 | #import "UIControl+RACSignalSupportPrivate.h" 12 | 13 | @implementation UISwitch (RACSignalSupport) 14 | 15 | - (RACChannelTerminal *)rac_newOnChannel { 16 | return [self rac_channelForControlEvents:UIControlEventValueChanged key:@keypath(self.on) nilValue:@NO]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITableViewCell+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-07-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | @class RACUnit; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UITableViewCell (RACSignalSupport) 17 | 18 | /// A signal which will send a RACUnit whenever -prepareForReuse is invoked upon 19 | /// the receiver. 20 | /// 21 | /// Examples 22 | /// 23 | /// [[[self.cancelButton 24 | /// rac_signalForControlEvents:UIControlEventTouchUpInside] 25 | /// takeUntil:self.rac_prepareForReuseSignal] 26 | /// subscribeNext:^(UIButton *x) { 27 | /// // do other things 28 | /// }]; 29 | @property (nonatomic, strong, readonly) RACSignal *rac_prepareForReuseSignal; 30 | 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITableViewCell+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Justin Spahr-Summers on 2013-07-22. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UITableViewCell+RACSignalSupport.h" 10 | #import "NSObject+RACDescription.h" 11 | #import "NSObject+RACSelectorSignal.h" 12 | #import "RACSignal+Operations.h" 13 | #import "RACUnit.h" 14 | #import 15 | 16 | @implementation UITableViewCell (RACSignalSupport) 17 | 18 | - (RACSignal *)rac_prepareForReuseSignal { 19 | RACSignal *signal = objc_getAssociatedObject(self, _cmd); 20 | if (signal != nil) return signal; 21 | 22 | signal = [[[self 23 | rac_signalForSelector:@selector(prepareForReuse)] 24 | mapReplace:RACUnit.defaultUnit] 25 | setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)]; 26 | 27 | objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return signal; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITableViewHeaderFooterView+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewHeaderFooterView+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Syo Ikeda on 12/30/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACSignal<__covariant ValueType>; 12 | @class RACUnit; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | // This category is only applicable to iOS >= 6.0. 17 | @interface UITableViewHeaderFooterView (RACSignalSupport) 18 | 19 | /// A signal which will send a RACUnit whenever -prepareForReuse is invoked upon 20 | /// the receiver. 21 | /// 22 | /// Examples 23 | /// 24 | /// [[[self.cancelButton 25 | /// rac_signalForControlEvents:UIControlEventTouchUpInside] 26 | /// takeUntil:self.rac_prepareForReuseSignal] 27 | /// subscribeNext:^(UIButton *x) { 28 | /// // do other things 29 | /// }]; 30 | @property (nonatomic, strong, readonly) RACSignal *rac_prepareForReuseSignal; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITableViewHeaderFooterView+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewHeaderFooterView+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Syo Ikeda on 12/30/13. 6 | // Copyright (c) 2013 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UITableViewHeaderFooterView+RACSignalSupport.h" 10 | #import "NSObject+RACDescription.h" 11 | #import "NSObject+RACSelectorSignal.h" 12 | #import "RACSignal+Operations.h" 13 | #import "RACUnit.h" 14 | #import 15 | 16 | @implementation UITableViewHeaderFooterView (RACSignalSupport) 17 | 18 | - (RACSignal *)rac_prepareForReuseSignal { 19 | RACSignal *signal = objc_getAssociatedObject(self, _cmd); 20 | if (signal != nil) return signal; 21 | 22 | signal = [[[self 23 | rac_signalForSelector:@selector(prepareForReuse)] 24 | mapReplace:RACUnit.defaultUnit] 25 | setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)]; 26 | 27 | objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return signal; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITextField+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 4/17/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACChannelTerminal; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UITextField (RACSignalSupport) 17 | 18 | /// Creates and returns a signal for the text of the field. It always starts with 19 | /// the current text. The signal sends next when the UIControlEventAllEditingEvents 20 | /// control event is fired on the control. 21 | - (RACSignal *)rac_textSignal; 22 | 23 | /// Creates a new RACChannel-based binding to the receiver. 24 | /// 25 | /// Returns a RACChannelTerminal that sends the receiver's text whenever the 26 | /// UIControlEventAllEditingEvents control event is fired, and sets the text 27 | /// to the values it receives. 28 | - (RACChannelTerminal *)rac_newTextChannel; 29 | 30 | @end 31 | 32 | NS_ASSUME_NONNULL_END 33 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITextField+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Josh Abernathy on 4/17/12. 6 | // Copyright (c) 2012 GitHub, Inc. All rights reserved. 7 | // 8 | 9 | #import "UITextField+RACSignalSupport.h" 10 | #import 11 | #import 12 | #import "NSObject+RACDeallocating.h" 13 | #import "NSObject+RACDescription.h" 14 | #import "RACSignal+Operations.h" 15 | #import "UIControl+RACSignalSupport.h" 16 | #import "UIControl+RACSignalSupportPrivate.h" 17 | 18 | @implementation UITextField (RACSignalSupport) 19 | 20 | - (RACSignal *)rac_textSignal { 21 | @weakify(self); 22 | return [[[[[RACSignal 23 | defer:^{ 24 | @strongify(self); 25 | return [RACSignal return:self]; 26 | }] 27 | concat:[self rac_signalForControlEvents:UIControlEventAllEditingEvents]] 28 | map:^(UITextField *x) { 29 | return x.text; 30 | }] 31 | takeUntil:self.rac_willDeallocSignal] 32 | setNameWithFormat:@"%@ -rac_textSignal", RACDescription(self)]; 33 | } 34 | 35 | - (RACChannelTerminal *)rac_newTextChannel { 36 | return [self rac_channelForControlEvents:UIControlEventAllEditingEvents key:@keypath(self.text) nilValue:@""]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITextView+RACSignalSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+RACSignalSupport.h 3 | // ReactiveObjC 4 | // 5 | // Created by Cody Krieger on 5/18/12. 6 | // Copyright (c) 2012 Cody Krieger. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class RACDelegateProxy; 12 | @class RACSignal<__covariant ValueType>; 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface UITextView (RACSignalSupport) 17 | 18 | /// A delegate proxy which will be set as the receiver's delegate when any of the 19 | /// methods in this category are used. 20 | @property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy; 21 | 22 | /// Creates a signal for the text of the receiver. 23 | /// 24 | /// When this method is invoked, the `rac_delegateProxy` will become the 25 | /// receiver's delegate. Any previous delegate will become the -[RACDelegateProxy 26 | /// rac_proxiedDelegate], so that it receives any messages that the proxy doesn't 27 | /// know how to handle. Setting the receiver's `delegate` afterward is 28 | /// considered undefined behavior. 29 | /// 30 | /// Returns a signal which will send the current text upon subscription, then 31 | /// again whenever the receiver's text is changed. The signal will complete when 32 | /// the receiver is deallocated. 33 | - (RACSignal *)rac_textSignal; 34 | 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | -------------------------------------------------------------------------------- /Pods/ReactiveObjC/ReactiveObjC/UITextView+RACSignalSupport.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+RACSignalSupport.m 3 | // ReactiveObjC 4 | // 5 | // Created by Cody Krieger on 5/18/12. 6 | // Copyright (c) 2012 Cody Krieger. All rights reserved. 7 | // 8 | 9 | #import "UITextView+RACSignalSupport.h" 10 | #import 11 | #import "NSObject+RACDeallocating.h" 12 | #import "NSObject+RACDescription.h" 13 | #import "RACDelegateProxy.h" 14 | #import "RACSignal+Operations.h" 15 | #import "RACTuple.h" 16 | #import 17 | 18 | @implementation UITextView (RACSignalSupport) 19 | 20 | static void RACUseDelegateProxy(UITextView *self) { 21 | if (self.delegate == self.rac_delegateProxy) return; 22 | 23 | self.rac_delegateProxy.rac_proxiedDelegate = self.delegate; 24 | self.delegate = (id)self.rac_delegateProxy; 25 | } 26 | 27 | - (RACDelegateProxy *)rac_delegateProxy { 28 | RACDelegateProxy *proxy = objc_getAssociatedObject(self, _cmd); 29 | if (proxy == nil) { 30 | proxy = [[RACDelegateProxy alloc] initWithProtocol:@protocol(UITextViewDelegate)]; 31 | objc_setAssociatedObject(self, _cmd, proxy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 32 | } 33 | 34 | return proxy; 35 | } 36 | 37 | - (RACSignal *)rac_textSignal { 38 | @weakify(self); 39 | RACSignal *signal = [[[[[RACSignal 40 | defer:^{ 41 | @strongify(self); 42 | return [RACSignal return:RACTuplePack(self)]; 43 | }] 44 | concat:[self.rac_delegateProxy signalForSelector:@selector(textViewDidChange:)]] 45 | reduceEach:^(UITextView *x) { 46 | return x.text; 47 | }] 48 | takeUntil:self.rac_willDeallocSignal] 49 | setNameWithFormat:@"%@ -rac_textSignal", RACDescription(self)]; 50 | 51 | RACUseDelegateProxy(self); 52 | 53 | return signal; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | 21 | #ifndef TARGET_OS_TV 22 | #define TARGET_OS_TV 0 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AFNetworking.h" 14 | #import "AFHTTPSessionManager.h" 15 | #import "AFURLSessionManager.h" 16 | #import "AFNetworkReachabilityManager.h" 17 | #import "AFSecurityPolicy.h" 18 | #import "AFURLRequestSerialization.h" 19 | #import "AFURLResponseSerialization.h" 20 | #import "AFAutoPurgingImageCache.h" 21 | #import "AFImageDownloader.h" 22 | #import "AFNetworkActivityIndicatorManager.h" 23 | #import "UIActivityIndicatorView+AFNetworking.h" 24 | #import "UIButton+AFNetworking.h" 25 | #import "UIImage+AFNetworking.h" 26 | #import "UIImageView+AFNetworking.h" 27 | #import "UIKit+AFNetworking.h" 28 | #import "UIProgressView+AFNetworking.h" 29 | #import "UIRefreshControl+AFNetworking.h" 30 | #import "UIWebView+AFNetworking.h" 31 | 32 | FOUNDATION_EXPORT double AFNetworkingVersionNumber; 33 | FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; 34 | 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.modulemap: -------------------------------------------------------------------------------- 1 | framework module AFNetworking { 2 | umbrella header "AFNetworking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.12 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJRefresh : NSObject 3 | @end 4 | @implementation PodsDummy_MJRefresh 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "MJRefreshAutoFooter.h" 14 | #import "MJRefreshBackFooter.h" 15 | #import "MJRefreshComponent.h" 16 | #import "MJRefreshFooter.h" 17 | #import "MJRefreshHeader.h" 18 | #import "MJRefreshAutoGifFooter.h" 19 | #import "MJRefreshAutoNormalFooter.h" 20 | #import "MJRefreshAutoStateFooter.h" 21 | #import "MJRefreshBackGifFooter.h" 22 | #import "MJRefreshBackNormalFooter.h" 23 | #import "MJRefreshBackStateFooter.h" 24 | #import "MJRefreshGifHeader.h" 25 | #import "MJRefreshNormalHeader.h" 26 | #import "MJRefreshStateHeader.h" 27 | #import "MJRefresh.h" 28 | #import "MJRefreshConst.h" 29 | #import "NSBundle+MJRefresh.h" 30 | #import "UIScrollView+MJExtension.h" 31 | #import "UIScrollView+MJRefresh.h" 32 | #import "UIView+MJExtension.h" 33 | 34 | FOUNDATION_EXPORT double MJRefreshVersionNumber; 35 | FOUNDATION_EXPORT const unsigned char MJRefreshVersionString[]; 36 | 37 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh.modulemap: -------------------------------------------------------------------------------- 1 | framework module MJRefresh { 2 | umbrella header "MJRefresh-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJRefresh 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MJRefresh 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Pods-JSLoadMoreServiceDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JSLoadMoreServiceDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JSLoadMoreServiceDemo 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Pods-JSLoadMoreServiceDemo-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_JSLoadMoreServiceDemoVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_JSLoadMoreServiceDemoVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Pods-JSLoadMoreServiceDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC" "$PODS_CONFIGURATION_BUILD_DIR/YYModel" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC/ReactiveObjC.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/YYModel/YYModel.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "MJRefresh" -framework "ReactiveObjC" -framework "YYModel" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Pods-JSLoadMoreServiceDemo.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_JSLoadMoreServiceDemo { 2 | umbrella header "Pods-JSLoadMoreServiceDemo-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-JSLoadMoreServiceDemo/Pods-JSLoadMoreServiceDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC" "$PODS_CONFIGURATION_BUILD_DIR/YYModel" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking/AFNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC/ReactiveObjC.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/YYModel/YYModel.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "AFNetworking" -framework "MJRefresh" -framework "ReactiveObjC" -framework "YYModel" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ReactiveObjC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ReactiveObjC/ReactiveObjC-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ReactiveObjC : NSObject 3 | @end 4 | @implementation PodsDummy_ReactiveObjC 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ReactiveObjC/ReactiveObjC-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ReactiveObjC/ReactiveObjC.modulemap: -------------------------------------------------------------------------------- 1 | framework module ReactiveObjC { 2 | umbrella header "ReactiveObjC-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ReactiveObjC/ReactiveObjC.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "Foundation" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ReactiveObjC 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YYModel : NSObject 3 | @end 4 | @implementation PodsDummy_YYModel 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "NSObject+YYModel.h" 14 | #import "YYClassInfo.h" 15 | #import "YYModel.h" 16 | 17 | FOUNDATION_EXPORT double YYModelVersionNumber; 18 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[]; 19 | 20 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel.modulemap: -------------------------------------------------------------------------------- 1 | framework module YYModel { 2 | umbrella header "YYModel-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/YYModel/YYModel.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YYModel 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "CoreFoundation" -framework "Foundation" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YYModel 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/YYModel/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ibireme 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/YYModel/YYModel/YYModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // YYModel.h 3 | // YYModel 4 | // 5 | // Created by ibireme on 15/5/10. 6 | // Copyright (c) 2015 ibireme. 7 | // 8 | // This source code is licensed under the MIT-style license found in the 9 | // LICENSE file in the root directory of this source tree. 10 | // 11 | 12 | #import 13 | 14 | #if __has_include() 15 | FOUNDATION_EXPORT double YYModelVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char YYModelVersionString[]; 17 | #import 18 | #import 19 | #else 20 | #import "NSObject+YYModel.h" 21 | #import "YYClassInfo.h" 22 | #endif 23 | --------------------------------------------------------------------------------