├── Pods ├── Headers │ └── Private │ │ ├── RxCocoa │ │ ├── RxCocoa.h │ │ ├── _RX.h │ │ ├── _RXKVOObserver.h │ │ ├── _RXObjCRuntime.h │ │ └── _RXDelegateProxy.h │ │ └── MJExtension │ │ ├── MJExtension.h │ │ ├── MJProperty.h │ │ ├── MJFoundation.h │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyType.h │ │ ├── MJExtensionConst.h │ │ ├── NSObject+MJClass.h │ │ ├── NSObject+MJCoding.h │ │ ├── NSObject+MJKeyValue.h │ │ ├── NSObject+MJProperty.h │ │ └── NSString+MJExtension.h ├── Target Support Files │ ├── RxCocoa │ │ ├── RxCocoa-prefix.pch │ │ ├── RxCocoa.modulemap │ │ ├── RxCocoa-dummy.m │ │ ├── RxCocoa.xcconfig │ │ ├── RxCocoa-umbrella.h │ │ └── Info.plist │ ├── RxSwift │ │ ├── RxSwift-prefix.pch │ │ ├── RxSwift.modulemap │ │ ├── RxSwift-dummy.m │ │ ├── RxSwift-umbrella.h │ │ ├── RxSwift.xcconfig │ │ └── Info.plist │ ├── Alamofire │ │ ├── Alamofire-prefix.pch │ │ ├── Alamofire.modulemap │ │ ├── Alamofire-dummy.m │ │ ├── Alamofire-umbrella.h │ │ ├── Alamofire.xcconfig │ │ └── Info.plist │ ├── RxBlocking │ │ ├── RxBlocking-prefix.pch │ │ ├── RxBlocking.modulemap │ │ ├── RxBlocking-dummy.m │ │ ├── RxBlocking-umbrella.h │ │ ├── RxBlocking.xcconfig │ │ └── Info.plist │ ├── MJExtension │ │ ├── MJExtension-prefix.pch │ │ ├── MJExtension.modulemap │ │ ├── MJExtension-dummy.m │ │ ├── MJExtension.xcconfig │ │ ├── MJExtension-umbrella.h │ │ └── Info.plist │ └── Pods-RxGitHubAPI │ │ ├── Pods-RxGitHubAPI.modulemap │ │ ├── Pods-RxGitHubAPI-dummy.m │ │ ├── Pods-RxGitHubAPI-umbrella.h │ │ ├── Pods-RxGitHubAPI.debug.xcconfig │ │ ├── Pods-RxGitHubAPI.release.xcconfig │ │ └── Info.plist ├── RxCocoa │ ├── RxCocoa │ │ ├── Common │ │ │ ├── _RX.m │ │ │ ├── Observables │ │ │ │ ├── Implementations │ │ │ │ │ ├── DeallocObservable.swift │ │ │ │ │ ├── KVOObserver.swift │ │ │ │ │ └── MessageSentObserver.swift │ │ │ │ ├── NSNotificationCenter+Rx.swift │ │ │ │ ├── NSObject+Rx+KVORepresentable.swift │ │ │ │ └── NSObject+Rx+RawRepresentable.swift │ │ │ ├── _RXDelegateProxy.h │ │ │ ├── Logging.swift │ │ │ ├── CocoaUnits │ │ │ │ └── Driver │ │ │ │ │ ├── Variable+Driver.swift │ │ │ │ │ ├── ControlEvent+Driver.swift │ │ │ │ │ └── ControlProperty+Driver.swift │ │ │ ├── KVORepresentable.swift │ │ │ ├── RxTarget.swift │ │ │ ├── _RXKVOObserver.h │ │ │ ├── Proxies │ │ │ │ └── RxCLLocationManagerDelegateProxy.swift │ │ │ ├── NSLayoutConstraint+Rx.swift │ │ │ ├── _RXKVOObserver.m │ │ │ └── KVORepresentable+CoreGraphics.swift │ │ ├── iOS │ │ │ ├── Events │ │ │ │ └── ItemEvents.swift │ │ │ ├── UISwitch+Rx.swift │ │ │ ├── UIStepper+Rx.swift │ │ │ ├── UISlider+Rx.swift │ │ │ ├── UIDatePicker+Rx.swift │ │ │ ├── UITextField+Rx.swift │ │ │ ├── UISegmentedControl+Rx.swift │ │ │ ├── Protocols │ │ │ │ ├── RxTableViewDataSourceType.swift │ │ │ │ └── RxCollectionViewDataSourceType.swift │ │ │ ├── UIButton+Rx.swift │ │ │ ├── Proxies │ │ │ │ ├── RxSearchBarDelegateProxy.swift │ │ │ │ ├── RxTableViewDelegateProxy.swift │ │ │ │ ├── RxCollectionViewDelegateProxy.swift │ │ │ │ ├── RxTextStorageDelegateProxy.swift │ │ │ │ └── RxTextViewDelegateProxy.swift │ │ │ ├── UIActivityIndicatorView+Rx.swift │ │ │ ├── NSTextStorage+Rx.swift │ │ │ ├── UIView+Rx.swift │ │ │ ├── UILabel+Rx.swift │ │ │ ├── UISearchBar+Rx.swift │ │ │ ├── UITextView+Rx.swift │ │ │ └── UIImageView+Rx.swift │ │ └── RxCocoa.h │ └── LICENSE.md ├── MJExtension │ ├── MJExtension │ │ ├── MJFoundation.h │ │ ├── MJExtension.h │ │ ├── MJPropertyKey.h │ │ ├── MJPropertyKey.m │ │ ├── MJExtensionConst.m │ │ ├── MJPropertyType.h │ │ ├── NSObject+MJCoding.h │ │ ├── NSString+MJExtension.h │ │ ├── MJProperty.h │ │ ├── MJFoundation.m │ │ └── NSObject+MJCoding.m │ └── LICENSE ├── RxSwift │ ├── RxSwift │ │ ├── Disposables │ │ │ ├── NAryDisposable.swift │ │ │ ├── StableCompositeDisposable.swift │ │ │ ├── DisposeBase.swift │ │ │ ├── SubscriptionDisposable.swift │ │ │ ├── NopDisposable.swift │ │ │ ├── BooleanDisposable.swift │ │ │ ├── BinaryDisposable.swift │ │ │ ├── AnonymousDisposable.swift │ │ │ └── ScheduledDisposable.swift │ │ ├── Schedulers │ │ │ ├── Internal │ │ │ │ ├── ScheduledItemType.swift │ │ │ │ ├── InvocableType.swift │ │ │ │ ├── AnonymousInvocable.swift │ │ │ │ ├── InvocableScheduledItem.swift │ │ │ │ └── ScheduledItem.swift │ │ │ ├── HistoricalScheduler.swift │ │ │ ├── DispatchQueueSchedulerQOS.swift │ │ │ └── ImmediateScheduler.swift │ │ ├── Disposable.swift │ │ ├── Concurrency │ │ │ ├── SynchronizedUnsubscribeType.swift │ │ │ ├── LockOwnerType.swift │ │ │ ├── SynchronizedDisposeType.swift │ │ │ ├── SynchronizedOnType.swift │ │ │ └── SynchronizedSubscribeType.swift │ │ ├── Cancelable.swift │ │ ├── Observables │ │ │ ├── Implementations │ │ │ │ ├── Never.swift │ │ │ │ ├── Empty.swift │ │ │ │ ├── Error.swift │ │ │ │ ├── StartWith.swift │ │ │ │ ├── Producer.swift │ │ │ │ ├── Repeat.swift │ │ │ │ ├── Sink.swift │ │ │ │ ├── AddRef.swift │ │ │ │ ├── ToArray.swift │ │ │ │ ├── Do.swift │ │ │ │ ├── DelaySubscription.swift │ │ │ │ ├── AnonymousObservable.swift │ │ │ │ ├── Deferred.swift │ │ │ │ ├── Sequence.swift │ │ │ │ ├── Range.swift │ │ │ │ ├── Filter.swift │ │ │ │ ├── Just.swift │ │ │ │ ├── TakeLast.swift │ │ │ │ ├── Concat.swift │ │ │ │ ├── SubscribeOn.swift │ │ │ │ └── Scan.swift │ │ │ └── Observable+Debug.swift │ │ ├── Extensions │ │ │ └── String+Rx.swift │ │ ├── ObservableConvertibleType.swift │ │ ├── DataStructures │ │ │ └── InfiniteSequence.swift │ │ ├── Subjects │ │ │ ├── SubjectType.swift │ │ │ └── Variable.swift │ │ ├── RxMutableBox.swift │ │ ├── ConnectableObservableType.swift │ │ ├── Observers │ │ │ ├── AnonymousObserver.swift │ │ │ └── ObserverBase.swift │ │ ├── Rx.swift │ │ ├── Observable.swift │ │ ├── ObserverType.swift │ │ ├── Platform │ │ │ └── Platform.Darwin.swift │ │ ├── ImmediateSchedulerType.swift │ │ ├── Errors.swift │ │ ├── ObservableType.swift │ │ ├── Event.swift │ │ └── AnyObserver.swift │ └── LICENSE.md ├── Manifest.lock ├── RxBlocking │ ├── RxBlocking │ │ ├── BlockingObservable.swift │ │ ├── ObservableConvertibleType+Blocking.swift │ │ └── RunLoopLock.swift │ └── LICENSE.md └── Alamofire │ └── LICENSE ├── RxGitHubAPI.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── RxGitHubAPI ├── RxGitHubAPI │ ├── YYGist+Rx.swift │ ├── YYIssueComment+Rx.swift │ ├── YYPublicEvent.swift │ ├── YYWatchEvent.swift │ ├── YYIssueEvent.swift │ ├── YYForkEvent.swift │ ├── YYTree.swift │ ├── YYMemberEvent.swift │ ├── YYCommitCommentEvent.swift │ ├── YYCommitUser.swift │ ├── YYPushCommit+Rx.swift │ ├── YYIssueCommentEvent.swift │ ├── YYPullRequestEvent.swift │ ├── YYPullRequestCommentEvent.swift │ ├── YYEventRepo.swift │ ├── YYCommitParent.swift │ ├── YYPushCommit.swift │ ├── YYSearchUsers.swift │ ├── Dictionary+Extension.swift │ ├── YYCommitDetail.swift │ ├── YYSearchRepos.swift │ ├── YYBranch.swift │ ├── YYIssueComment.swift │ ├── YYRefEvent.swift │ ├── YYEventOrg.swift │ ├── YYEventUser.swift │ ├── YYError.swift │ ├── YYTag.swift │ ├── YYURLHeaderGenerator.swift │ ├── YYPushEvent.swift │ ├── String+Extension.swift │ ├── YYReference.swift │ ├── YYFile.swift │ ├── YYCollaborator.swift │ ├── YYOrganization.swift │ ├── YYTeam.swift │ ├── YYCommitComment.swift │ ├── YYAsset.swift │ ├── YYContent.swift │ ├── YYPullRequestComment.swift │ ├── YYURLGenerator.swift │ ├── YYGist.swift │ ├── YYRelease.swift │ ├── YYCommit.swift │ └── YYIssue.swift ├── ViewController.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json └── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard ├── RxGitHubAPI.xcworkspace └── contents.xcworkspacedata ├── Podfile ├── Podfile.lock ├── RxGitHubAPI.podspec ├── RxGitHubAPITests ├── Info.plist └── RxGitHubAPITests.swift └── .gitignore /Pods/Headers/Private/RxCocoa/RxCocoa.h: -------------------------------------------------------------------------------- 1 | ../../../RxCocoa/RxCocoa/RxCocoa.h -------------------------------------------------------------------------------- /Pods/Headers/Private/RxCocoa/_RX.h: -------------------------------------------------------------------------------- 1 | ../../../RxCocoa/RxCocoa/Common/_RX.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtension.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/RxCocoa/_RXKVOObserver.h: -------------------------------------------------------------------------------- 1 | ../../../RxCocoa/RxCocoa/Common/_RXKVOObserver.h -------------------------------------------------------------------------------- /Pods/Headers/Private/RxCocoa/_RXObjCRuntime.h: -------------------------------------------------------------------------------- 1 | ../../../RxCocoa/RxCocoa/Common/_RXObjCRuntime.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJFoundation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyKey.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJPropertyType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/RxCocoa/_RXDelegateProxy.h: -------------------------------------------------------------------------------- 1 | ../../../RxCocoa/RxCocoa/Common/_RXDelegateProxy.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/MJExtensionConst.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/MJExtensionConst.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJClass.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJClass.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJCoding.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJKeyValue.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJKeyValue.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSObject+MJProperty.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSObject+MJProperty.h -------------------------------------------------------------------------------- /Pods/Headers/Private/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | ../../../MJExtension/MJExtension/NSString+MJExtension.h -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/RxCocoa-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/RxBlocking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/RxCocoa.modulemap: -------------------------------------------------------------------------------- 1 | framework module RxCocoa { 2 | umbrella header "RxCocoa-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift.modulemap: -------------------------------------------------------------------------------- 1 | framework module RxSwift { 2 | umbrella header "RxSwift-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.modulemap: -------------------------------------------------------------------------------- 1 | framework module Alamofire { 2 | umbrella header "Alamofire-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/RxCocoa-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RxCocoa : NSObject 3 | @end 4 | @implementation PodsDummy_RxCocoa 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RxSwift : NSObject 3 | @end 4 | @implementation PodsDummy_RxSwift 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/RxBlocking.modulemap: -------------------------------------------------------------------------------- 1 | framework module RxBlocking { 2 | umbrella header "RxBlocking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Alamofire : NSObject 3 | @end 4 | @implementation PodsDummy_Alamofire 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension.modulemap: -------------------------------------------------------------------------------- 1 | framework module MJExtension { 2 | umbrella header "MJExtension-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJExtension : NSObject 3 | @end 4 | @implementation PodsDummy_MJExtension 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/RxBlocking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_RxBlocking : NSObject 3 | @end 4 | @implementation PodsDummy_RxBlocking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double RxSwiftVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char RxSwiftVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Pods-RxGitHubAPI.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_RxGitHubAPI { 2 | umbrella header "Pods-RxGitHubAPI-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double AlamofireVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Pods-RxGitHubAPI-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_RxGitHubAPI : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_RxGitHubAPI 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/RxBlocking-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double RxBlockingVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char RxBlockingVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/_RX.m: -------------------------------------------------------------------------------- 1 | // 2 | // _RX.m 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import "_RX.h" 10 | 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Pods-RxGitHubAPI-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_RxGitHubAPIVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_RxGitHubAPIVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /RxGitHubAPI.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYGist+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYGist+Rx.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension YYGist{ 12 | 13 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MJExtension" "${PODS_ROOT}/Headers/Public" 3 | PODS_ROOT = ${SRCROOT} 4 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYIssueComment+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYIssueComment+Rx.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension YYIssueComment{ 12 | 13 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPublicEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPublicEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPublicEvent: NSObject { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /RxGitHubAPI.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYWatchEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYWatchEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYWatchEvent: NSObject { 12 | public var action = "" 13 | } 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/RxCocoa.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RxCocoa" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/RxSwift.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RxSwift" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYIssueEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYIssueEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYIssueEvent : NSObject{ 12 | public private(set) var issue = YYIssue() 13 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Alamofire.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Alamofire" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYForkEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYForkEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYForkEvent : NSObject{ 12 | public private(set) var forkee = YYRepository() 13 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/RxBlocking.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RxBlocking" "${PODS_ROOT}/Headers/Public" 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 4 | PODS_ROOT = ${SRCROOT} 5 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MJFoundation : NSObject 12 | + (BOOL)isClassFromFoundation:(Class)c; 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/NAryDisposable.swift: -------------------------------------------------------------------------------- 1 | // This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project 2 | // 3 | // NAryDisposable.swift 4 | // RxSwift 5 | // 6 | // Created by Krunoslav Zaher on 8/20/15. 7 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 8 | // 9 | 10 | import Foundation 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/RxCocoa-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "RxCocoa.h" 4 | #import "_RX.h" 5 | #import "_RXDelegateProxy.h" 6 | #import "_RXKVOObserver.h" 7 | #import "_RXObjCRuntime.h" 8 | 9 | FOUNDATION_EXPORT double RxCocoaVersionNumber; 10 | FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[]; 11 | 12 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '8.0' 3 | use_frameworks! 4 | 5 | target 'RxGitHubAPI' do 6 | 7 | pod 'RxSwift', '~> 2.0.0' 8 | pod 'RxCocoa', '~> 2.0.0' 9 | pod 'RxBlocking', '~> 2.0.0' 10 | pod 'Alamofire', '~> 3.1.4' 11 | pod 'MJExtension' 12 | 13 | end 14 | 15 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Events/ItemEvents.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ItemEvents.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 6/20/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | public typealias ItemMovedEvent = (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYTree.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYTree.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | public class YYTree : NSObject{ 11 | public private(set) var sha = "" 12 | 13 | 14 | //api 15 | var url = "" 16 | 17 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledItemType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol ScheduledItemType 12 | : Cancelable 13 | , InvocableType { 14 | func invoke() 15 | } 16 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYMemberEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYMemberEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYMemberEvent: NSObject { 12 | public private(set) var action = "" 13 | public private(set) var member = YYUser() 14 | } 15 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Disposable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Respresents disposable resource. 13 | */ 14 | public protocol Disposable { 15 | /** 16 | Dispose resource. 17 | */ 18 | func dispose() 19 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommitCommentEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommitCommentEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommitCommentEvent : NSObject{ 12 | public private(set) var action = "" 13 | public private(set) var comment = YYCommitComment() 14 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommitUser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommitUser.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommitUser: NSObject { 12 | public private(set) var name = "" 13 | public private(set) var email = "" 14 | public private(set) var date = "" 15 | } 16 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPushCommit+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPushCommit+Rx.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension YYPushCommit{ 12 | //获取详细的commit 13 | public var yy_commit : Requestable{ 14 | return Requestable(mothod: .GET, url: self.url.yy_clear) 15 | } 16 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedUnsubscribeType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol SynchronizedUnsubscribeType : class { 12 | typealias DisposeKey 13 | 14 | func synchronizedUnsubscribe(disposeKey: DisposeKey) 15 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InvocableType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol InvocableType { 12 | func invoke() 13 | } 14 | 15 | protocol InvocableWithValueType { 16 | typealias Value 17 | 18 | func invoke(value: Value) 19 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYIssueCommentEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYIssueCommentEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYIssueCommentEvent : NSObject{ 12 | public private(set) var action = "" 13 | public private(set) var issue = YYIssue() 14 | public private(set) var comment = YYIssueComment() 15 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPullRequestEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPullRequestEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPullRequestEvent: NSObject { 12 | public private(set) var action = "" 13 | public private(set) var number = 0 14 | public private(set) var pull_request = YYPullRequest() 15 | } 16 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Cancelable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cancelable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents disposable resource with state tracking. 13 | */ 14 | public protocol Cancelable : Disposable { 15 | /** 16 | - returns: Was resource disposed. 17 | */ 18 | var disposed: Bool { get } 19 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Never.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Never.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Never : Producer { 12 | override func subscribe(observer: O) -> Disposable { 13 | return NopDisposable.instance 14 | } 15 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Empty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Empty.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Empty : Producer { 12 | override func subscribe(observer: O) -> Disposable { 13 | observer.on(.Completed) 14 | return NopDisposable.instance 15 | } 16 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPullRequestCommentEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPullRequestCommentEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPullRequestCommentEvent: NSObject { 12 | public private(set) var action = "" 13 | public private(set) var comment = YYPullRequestComment() 14 | public private(set) var pull_request = YYPullRequest() 15 | } 16 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousInvocable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct AnonymousInvocable : InvocableType { 12 | private let _action: () -> () 13 | 14 | init(_ action: () -> ()) { 15 | _action = action 16 | } 17 | 18 | func invoke() { 19 | _action() 20 | } 21 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/StableCompositeDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StableCompositeDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public final class StableCompositeDisposable { 12 | public static func create(disposable1: Disposable, _ disposable2: Disposable) -> Disposable { 13 | return BinaryDisposable(disposable1, disposable2) 14 | } 15 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LockOwnerType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol LockOwnerType : class, Lock { 12 | var _lock: NSRecursiveLock { get } 13 | } 14 | 15 | extension LockOwnerType { 16 | func lock() { 17 | _lock.lock() 18 | } 19 | 20 | func unlock() { 21 | _lock.unlock() 22 | } 23 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYEventRepo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYEventRepo.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYEventRepo : NSObject{ 12 | public private(set) var id = 0 13 | public private(set) var name = "" 14 | 15 | //api 16 | var url = "" 17 | 18 | public var repo : Requestable{ 19 | return Requestable(mothod: .GET, url: self.url.yy_clear) 20 | } 21 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedDisposeType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol SynchronizedDisposeType : class, Disposable, Lock { 12 | func _synchronized_dispose() 13 | } 14 | 15 | extension SynchronizedDisposeType { 16 | func synchronizedDispose() { 17 | lock(); defer { unlock() } 18 | _synchronized_dispose() 19 | } 20 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedOnType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol SynchronizedOnType : class, ObserverType, Lock { 12 | func _synchronized_on(event: Event) 13 | } 14 | 15 | extension SynchronizedOnType { 16 | func synchronizedOn(event: Event) { 17 | lock(); defer { unlock() } 18 | _synchronized_on(event) 19 | } 20 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DisposeBase.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 4/4/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Base class for all disposables. 13 | */ 14 | public class DisposeBase { 15 | init() { 16 | #if TRACE_RESOURCES 17 | AtomicIncrement(&resourceCount) 18 | #endif 19 | } 20 | 21 | deinit { 22 | #if TRACE_RESOURCES 23 | AtomicDecrement(&resourceCount) 24 | #endif 25 | } 26 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/RxCocoa.h: -------------------------------------------------------------------------------- 1 | // 2 | // RxCocoa.h 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 2/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "_RX.h" 11 | #import "_RXDelegateProxy.h" 12 | #import "_RXKVOObserver.h" 13 | #import "_RXObjCRuntime.h" 14 | 15 | //! Project version number for RxCocoa. 16 | FOUNDATION_EXPORT double RxCocoaVersionNumber; 17 | 18 | //! Project version string for RxCocoa. 19 | FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[]; -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommitParent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommitParent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommitParent: NSObject { 12 | public private(set) var sha = "" 13 | public private(set) var html_url = "" 14 | 15 | //api 16 | var url = "" 17 | 18 | public var yy_commit : Requestable{ 19 | return Requestable(mothod: .GET, url: self.url.yy_clear) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPushCommit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPushCommit.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPushCommit : NSObject{ 12 | public private(set) var sha = "" 13 | public private(set) var author_email = "" 14 | public private(set) var author_name = "" 15 | public private(set) var message = "" 16 | public private(set) var distinct = false 17 | 18 | //api 19 | var url = "" 20 | } 21 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/Implementations/DeallocObservable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeallocObservable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | class DeallocObservable { 15 | let _subject = ReplaySubject.create(bufferSize: 1) 16 | 17 | init() { 18 | } 19 | 20 | deinit { 21 | _subject.on(.Next(())) 22 | _subject.on(.Completed) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/MJExtension-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "MJExtension.h" 4 | #import "MJExtensionConst.h" 5 | #import "MJFoundation.h" 6 | #import "MJProperty.h" 7 | #import "MJPropertyKey.h" 8 | #import "MJPropertyType.h" 9 | #import "NSObject+MJClass.h" 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJKeyValue.h" 12 | #import "NSObject+MJProperty.h" 13 | #import "NSString+MJExtension.h" 14 | 15 | FOUNDATION_EXPORT double MJExtensionVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char MJExtensionVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYSearchUsers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYSearchUser.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/29. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYSearchUsers : NSObject{ 12 | public private(set) var total_count = 0 13 | public private(set) var incomplete_results = false 14 | public private(set) var items = [YYUser]() 15 | 16 | public class override func mj_objectClassInArray() -> [NSObject : AnyObject]! { 17 | return ["items":YYUser.self] 18 | } 19 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJExtension.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 代码地址:https://github.com/CoderMJLee/MJExtension 8 | // 代码地址:http://code4app.com/ios/%E5%AD%97%E5%85%B8-JSON-%E4%B8%8E%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%BD%AC%E6%8D%A2/5339992a933bf062608b4c57 9 | 10 | #import "NSObject+MJCoding.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "NSObject+MJClass.h" 13 | #import "NSObject+MJKeyValue.h" 14 | #import "NSString+MJExtension.h" 15 | #import "MJExtensionConst.h" -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/Dictionary+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dictionary+Extension.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | extension Dictionary{ 11 | public func union(other: Dictionary?) -> Dictionary { 12 | guard let other = other else{ 13 | return self 14 | } 15 | var temp = self 16 | for (key,value) in other { 17 | temp.updateValue(value, forKey:key) 18 | } 19 | return temp 20 | } 21 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommitDetail.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommitDetail.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommitDetail: NSObject { 12 | public private(set) var author = YYCommitUser() 13 | public private(set) var committer = YYCommitUser() 14 | public private(set) var message = "" 15 | public private(set) var tree = YYTree() 16 | public private(set) var comment_count = 0 17 | 18 | //api 19 | var url = "" 20 | } 21 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYSearchRepos.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYSearchRepos.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/29. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYSearchRepos : NSObject{ 12 | public private(set) var total_count = 0 13 | public private(set) var incomplete_results = false 14 | public private(set) var items = [YYRepository]() 15 | 16 | public class override func mj_objectClassInArray() -> [NSObject : AnyObject]! { 17 | return ["items":YYRepository.self] 18 | } 19 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYBranch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYBranch.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYBranch : NSObject{ 12 | public private(set) var name = "" 13 | public private(set) var commit_sha = "" 14 | 15 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 16 | return ["commit_sha":"commit.sha","commit_url":"commit.url"] 17 | } 18 | 19 | //api 20 | var commit_url = "" 21 | 22 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYIssueComment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYIssueComment.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYIssueComment: NSObject { 12 | public private(set) var id = 0 13 | public private(set) var html_url = "" 14 | public private(set) var body = "" 15 | public private(set) var user = YYUser() 16 | public private(set) var created_at = "" 17 | public private(set) var updated_at = "" 18 | 19 | //api 20 | var issue_url = "" 21 | } 22 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYRefEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYRefEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYRefEvent : NSObject{ 12 | public var ref = "" 13 | public var ref_type = "" 14 | public var master_branch = "" 15 | public var _description = "" 16 | public var pusher_type = "" 17 | 18 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 19 | return ["_description":"description"] 20 | } 21 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Error.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Error.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Error : Producer { 12 | private let _error: ErrorType 13 | 14 | init(error: ErrorType) { 15 | _error = error 16 | } 17 | 18 | override func subscribe(observer: O) -> Disposable { 19 | observer.on(.Error(_error)) 20 | return NopDisposable.instance 21 | } 22 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InvocableScheduledItem.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct InvocableScheduledItem : InvocableType { 12 | 13 | let _invocable: I 14 | let _state: I.Value 15 | 16 | init(invocable: I, state: I.Value) { 17 | _invocable = invocable 18 | _state = state 19 | } 20 | 21 | func invoke() { 22 | _invocable.invoke(_state) 23 | } 24 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubscriptionDisposable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct SubscriptionDisposable : Disposable { 12 | private let _key: T.DisposeKey 13 | private weak var _owner: T? 14 | 15 | init(owner: T, key: T.DisposeKey) { 16 | _owner = owner 17 | _key = key 18 | } 19 | 20 | func dispose() { 21 | _owner?.synchronizedUnsubscribe(_key) 22 | } 23 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYEventOrg.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYEventOrg.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | public class YYEventOrg : NSObject{ 11 | public private(set) var id = 0 12 | public private(set) var login = "" 13 | public private(set) var gravatar = "" 14 | public private(set) var avatar = "" 15 | 16 | //api 17 | var url = "" 18 | 19 | public var org : Requestable{ 20 | return Requestable(mothod: .GET, url: self.url.yy_clear) 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYEventUser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYEventUser.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYEventUser : NSObject{ 12 | public private(set) var id = 0 13 | public private(set) var login = "" 14 | public private(set) var gravatar = "" 15 | public private(set) var avatar = "" 16 | 17 | //api 18 | var url = "" 19 | 20 | public var user : Requestable{ 21 | return Requestable(mothod: .GET, url: self.url.yy_clear) 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alamofire+Rx.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Alamofire 11 | import RxSwift 12 | import MJExtension 13 | 14 | enum YYError : ErrorType { 15 | case YYNoStatuCode 16 | case YYUnKnowStatuCode(status:Int?,message:String?) 17 | case YYCouldNotMakeObjectError(status:Int?,message:String?) 18 | case YYCouldNotMakeObjectArrayError(status:Int?,message:String?) 19 | case YYUnKnowContent 20 | case YYGitHubErrorJSON(message:String) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/_RXDelegateProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RXDelegateProxy.h 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/4/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface _RXDelegateProxy : NSObject 12 | 13 | @property (nonatomic, assign, readonly) id _forwardToDelegate; 14 | 15 | -(void)_setForwardToDelegate:(id)forwardToDelegate retainDelegate:(BOOL)retainDelegate; 16 | 17 | -(BOOL)hasWiredImplementationForSelector:(SEL)selector; 18 | 19 | -(void)interceptedSelector:(SEL)selector withArguments:(NSArray*)arguments; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYTag.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYTag.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYTag : NSObject{ 12 | public private(set) var name = "" 13 | public private(set) var commit_sha = "" 14 | 15 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 16 | return ["commit_sha":"commit.sha","commit_url":"commit.url"] 17 | } 18 | 19 | //api 20 | var zipball_url = "" 21 | var tarball_url = "" 22 | var commit_url = "" 23 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Logging.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Logging.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 4/3/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Simple logging settings for RxCocoa library. 13 | */ 14 | public struct Logging { 15 | public typealias LogURLRequest = (NSURLRequest) -> Bool 16 | 17 | /** 18 | Log URL requests to standard output in curl format. 19 | */ 20 | public static var URLRequests: LogURLRequest = { _ in 21 | #if DEBUG 22 | return true 23 | #else 24 | return false 25 | #endif 26 | } 27 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYURLHeaderGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYURLHeaderGenerator.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public var RxGitHubUserName = "" 12 | public var RxGitHubPassword = "" 13 | 14 | 15 | //header when request Auth 16 | var AuthHeader : [String:String]{ 17 | let access = "\(RxGitHubUserName):\(RxGitHubPassword)".dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedStringWithOptions(.Encoding64CharacterLineLength) ?? "" 18 | let authorization = "Basic \(access)" 19 | return ["Authorization":authorization] 20 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Extensions/String+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Rx.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension String { 12 | /** 13 | This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` 14 | */ 15 | func lastIndexOf(character: Character) -> Index? { 16 | var last: Index? 17 | for i in startIndex ..< endIndex { 18 | if self[i] == character { 19 | last = i 20 | } 21 | } 22 | 23 | return last 24 | } 25 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObservableConvertibleType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableConvertibleType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 9/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Type that can be converted to observable sequence (`Observer`). 13 | */ 14 | public protocol ObservableConvertibleType { 15 | /** 16 | Type of elements in sequence. 17 | */ 18 | typealias E 19 | 20 | /** 21 | Converts `self` to `Observable` sequence. 22 | 23 | - returns: Observable sequence that represents `self`. 24 | */ 25 | func asObservable() -> Observable 26 | } 27 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedSubscribeType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/25/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | protocol SynchronizedSubscribeType : class, ObservableType, Lock { 12 | func _synchronized_subscribe(observer: O) -> Disposable 13 | } 14 | 15 | extension SynchronizedSubscribeType { 16 | func synchronizedSubscribe(observer: O) -> Disposable { 17 | lock(); defer { unlock() } 18 | return _synchronized_subscribe(observer) 19 | } 20 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPushEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPushEvent.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPushEvent: NSObject { 12 | public private(set) var push_id = "" 13 | public private(set) var size = 0 14 | public private(set) var distinct_size = 0 15 | public private(set) var ref = "" 16 | public private(set) var head = "" 17 | public private(set) var before = "" 18 | public private(set) var commits = [YYPushCommit]() 19 | public private(set) var _public = false 20 | public private(set) var created_at = "" 21 | } 22 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NopDisposable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents a disposable that does nothing on disposal. 13 | 14 | Nop = No Operation 15 | */ 16 | public struct NopDisposable : Disposable { 17 | 18 | /** 19 | Singleton instance of `NopDisposable`. 20 | */ 21 | public static let instance: Disposable = NopDisposable() 22 | 23 | init() { 24 | 25 | } 26 | 27 | /** 28 | Does nothing. 29 | */ 30 | public func dispose() { 31 | } 32 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/String+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Extension.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | extension String{ 11 | var yy_clear : String{ 12 | 13 | let str = (self as NSString) 14 | 15 | var index = str.length 16 | 17 | for var i = 0 ;i < str.length;i++ { 18 | if str.characterAtIndex(i) == ("{" as NSString).characterAtIndex(0){ 19 | index = i 20 | break 21 | } 22 | } 23 | return (self as NSString).substringToIndex(index) 24 | } 25 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYReference.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYReference.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYReference : NSObject{ 12 | public private(set) var ref = "" 13 | public private(set) var object_sha = "" 14 | public private(set) var object_type = "" 15 | 16 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 17 | return ["object_sha":"object.sha","object_type":"object.type","object_url":"object.url"] 18 | } 19 | 20 | //api 21 | var url = "" 22 | var object_url = "" 23 | } -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.5) 3 | - MJExtension (3.0.10) 4 | - RxBlocking (2.0.0): 5 | - RxSwift (~> 2.0) 6 | - RxCocoa (2.0.0): 7 | - RxSwift (~> 2.0) 8 | - RxSwift (2.0.0) 9 | 10 | DEPENDENCIES: 11 | - Alamofire (~> 3.1.4) 12 | - MJExtension 13 | - RxBlocking (~> 2.0.0) 14 | - RxCocoa (~> 2.0.0) 15 | - RxSwift (~> 2.0.0) 16 | 17 | SPEC CHECKSUMS: 18 | Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 19 | MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548 20 | RxBlocking: a95a10ed54eb5d116f6c9a87047ff671e181d07b 21 | RxCocoa: b0ebd70b4f7450bdb3c8987b122f8fd568dc1e2f 22 | RxSwift: d83246efa6f16c50c143bec134649d045498f601 23 | 24 | COCOAPODS: 0.39.0 25 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UISwitch+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UISwitch+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Carlos García on 8/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import UIKit 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | 16 | 17 | extension UISwitch { 18 | 19 | /** 20 | Reactive wrapper for `on` property. 21 | */ 22 | public var rx_value: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.on ?? false 25 | }, setter: { [weak self] value in 26 | self?.on = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYFile.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYFile.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYFile : NSObject{ 12 | public private(set) var sha = "" 13 | public private(set) var filename = "" 14 | public private(set) var status = "" 15 | public private(set) var additions = 0 16 | public private(set) var deletions = 0 17 | public private(set) var changes = 0 18 | public private(set) var blob_url = "" 19 | public private(set) var raw_url = "" 20 | public private(set) var patch = "" 21 | //api 22 | var contents_url = "" 23 | 24 | } -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Alamofire (3.1.5) 3 | - MJExtension (3.0.10) 4 | - RxBlocking (2.0.0): 5 | - RxSwift (~> 2.0) 6 | - RxCocoa (2.0.0): 7 | - RxSwift (~> 2.0) 8 | - RxSwift (2.0.0) 9 | 10 | DEPENDENCIES: 11 | - Alamofire (~> 3.1.4) 12 | - MJExtension 13 | - RxBlocking (~> 2.0.0) 14 | - RxCocoa (~> 2.0.0) 15 | - RxSwift (~> 2.0.0) 16 | 17 | SPEC CHECKSUMS: 18 | Alamofire: 5f730ba29fd113b7ddd71c1e65d0c630acf5d7b0 19 | MJExtension: d86aacb740c87519d20e3cca55b6fa4be6cc7548 20 | RxBlocking: a95a10ed54eb5d116f6c9a87047ff671e181d07b 21 | RxCocoa: b0ebd70b4f7450bdb3c8987b122f8fd568dc1e2f 22 | RxSwift: d83246efa6f16c50c143bec134649d045498f601 23 | 24 | COCOAPODS: 0.39.0 25 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCollaborator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCollaborator.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCollaborator : YYUser{ 12 | 13 | public private(set) var permissions_pull = false 14 | public private(set) var permissions_push = false 15 | public private(set) var permissions_admin = false 16 | 17 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 18 | return ["permissions_pull":"permissions.pull","permissions_push":"permissions.push","permissions_admin":"permissions.admin"] 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/CocoaUnits/Driver/Variable+Driver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Variable+Driver.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension Variable { 15 | /** 16 | Converts `Variable` to `Driver` unit. 17 | 18 | - returns: Driving observable sequence. 19 | */ 20 | @warn_unused_result(message="http://git.io/rxs.uo") 21 | public func asDriver() -> Driver { 22 | let source = self.asObservable() 23 | .observeOn(driverObserveOnScheduler) 24 | return Driver(source) 25 | } 26 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIStepper+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIStepper+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Yuta ToKoRo on 9/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | extension UIStepper { 18 | 19 | /** 20 | Reactive wrapper for `value` property. 21 | */ 22 | public var rx_value: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.value ?? 0 25 | }, setter: { [weak self] value in 26 | self?.value = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /Pods/RxBlocking/RxBlocking/BlockingObservable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BlockingObservable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | /** 15 | `BlockingObservable` is a variety of `Observable` that provides blocking operators. 16 | 17 | It can be useful for testing and demo purposes, but is generally inappropriate for production applications. 18 | 19 | If you think you need to use a `BlockingObservable` this is usually a sign that you should rethink your 20 | design. 21 | */ 22 | public struct BlockingObservable { 23 | let source: Observable 24 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UISlider+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UISlider+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Alexander van der Werff on 28/05/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UISlider { 18 | 19 | /** 20 | Reactive wrapper for `value` property. 21 | */ 22 | public var rx_value: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.value ?? 0.0 25 | }, setter: { [weak self] value in 26 | self?.value = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIDatePicker+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Daniel Tartaglia on 5/31/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UIDatePicker { 18 | 19 | /** 20 | Reactive wrapper for `date` property. 21 | */ 22 | public var rx_date: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.date ?? NSDate() 25 | }, setter: { [weak self] value in 26 | self?.date = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UITextField+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 2/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UITextField { 18 | 19 | /** 20 | Reactive wrapper for `text` property. 21 | */ 22 | public var rx_text: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.text ?? "" 25 | }, setter: { [weak self] value in 26 | self?.text = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum { 12 | MJPropertyKeyTypeDictionary = 0, // 字典的key 13 | MJPropertyKeyTypeArray // 数组的key 14 | } MJPropertyKeyType; 15 | 16 | /** 17 | * 属性的key 18 | */ 19 | @interface MJPropertyKey : NSObject 20 | /** key的名字 */ 21 | @property (copy, nonatomic) NSString *name; 22 | /** key的种类,可能是@"10",可能是@"age" */ 23 | @property (assign, nonatomic) MJPropertyKeyType type; 24 | 25 | /** 26 | * 根据当前的key,也就是name,从object(字典或者数组)中取值 27 | */ 28 | - (id)valueInObject:(id)object; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/RxBlocking/RxBlocking/ObservableConvertibleType+Blocking.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableConvertibleType+Blocking.swift 3 | // RxBlocking 4 | // 5 | // Created by Krunoslav Zaher on 7/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension ObservableConvertibleType { 15 | /** 16 | Converts an Observable into a `BlockingObservable` (an Observable with blocking operators). 17 | 18 | - returns: `BlockingObservable` version of `self` 19 | */ 20 | @warn_unused_result(message="http://git.io/rxs.uo") 21 | public func toBlocking() -> BlockingObservable { 22 | return BlockingObservable(source: self.asObservable()) 23 | } 24 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyKey.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyKey.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/8/11. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJPropertyKey.h" 10 | 11 | @implementation MJPropertyKey 12 | 13 | - (id)valueInObject:(id)object 14 | { 15 | if ([object isKindOfClass:[NSDictionary class]] && self.type == MJPropertyKeyTypeDictionary) { 16 | return object[self.name]; 17 | } else if ([object isKindOfClass:[NSArray class]] && self.type == MJPropertyKeyTypeArray) { 18 | NSArray *array = object; 19 | NSUInteger index = self.name.intValue; 20 | if (index < array.count) return array[index]; 21 | return nil; 22 | } 23 | return nil; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UISegmentedControl+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UISegmentedControl+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Carlos García on 8/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import UIKit 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | 16 | 17 | extension UISegmentedControl { 18 | 19 | /** 20 | Reactive wrapper for `selectedSegmentIndex` property. 21 | */ 22 | public var rx_value: ControlProperty { 23 | return rx_value(getter: { [weak self] in 24 | self?.selectedSegmentIndex ?? 0 25 | }, setter: { [weak self] value in 26 | self?.selectedSegmentIndex = value 27 | }) 28 | } 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYOrganization.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYOrganization.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYOrganization : NSObject{ 12 | public private(set) var login = "" 13 | public private(set) var id = 0 14 | public private(set) var avatar_url = "" 15 | public private(set) var _description = "" 16 | 17 | public override static func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 18 | return ["_description":"description"] 19 | } 20 | 21 | //api 22 | var url = "" 23 | var repos_url = "" 24 | var events_url = "" 25 | var members_url = "" 26 | var public_members_url = "" 27 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYTeam.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYTeam.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYTeam : NSObject{ 12 | public private(set) var id = 0 13 | public private(set) var name = "" 14 | public private(set) var slug = "" 15 | public private(set) var _description = "" 16 | public private(set) var privacy = "" 17 | public private(set) var permission = "" 18 | 19 | public static override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 20 | return ["_description":"description"] 21 | } 22 | 23 | //api 24 | var url = "" 25 | var members_url = "" 26 | var repositories_url = "" 27 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommitComment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommitComment.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommitComment: NSObject { 12 | public private(set) var id = 0 13 | public private(set) var commit_id = "" 14 | public private(set) var position = 0 15 | public private(set) var line = 0 16 | public private(set) var path = "" 17 | public private(set) var html_url = "" 18 | public private(set) var body = "" 19 | public private(set) var user = YYUser() 20 | public private(set) var created_at = "" 21 | public private(set) var updated_at = "" 22 | 23 | 24 | 25 | //api 26 | var url = "" 27 | } 28 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/DataStructures/InfiniteSequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InfiniteSequence.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Sequence that repeats `repeatedValue` infinite number of times. 13 | */ 14 | struct InfiniteSequence : SequenceType { 15 | typealias Element = E 16 | typealias Generator = AnyGenerator 17 | 18 | private let _repeatedValue: E 19 | 20 | init(repeatedValue: E) { 21 | _repeatedValue = repeatedValue 22 | } 23 | 24 | func generate() -> Generator { 25 | let repeatedValue = _repeatedValue 26 | return anyGenerator { 27 | return repeatedValue 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/StartWith.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StartWith.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 4/6/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class StartWith: Producer { 12 | let elements: [Element] 13 | let source: Observable 14 | 15 | init(source: Observable, elements: [Element]) { 16 | self.source = source 17 | self.elements = elements 18 | super.init() 19 | } 20 | 21 | override func run(observer: O) -> Disposable { 22 | for e in elements { 23 | observer.on(.Next(e)) 24 | } 25 | 26 | return source.subscribe(observer) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Subjects/SubjectType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubjectType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents an object that is both an observable sequence as well as an observer. 13 | */ 14 | public protocol SubjectType : ObservableType { 15 | /** 16 | The type of the observer that represents this subject. 17 | 18 | Usually this type is type of subject itself, but it doesn't have to be. 19 | */ 20 | typealias SubjectObserverType : ObserverType 21 | 22 | /** 23 | Returns observer interface for subject. 24 | 25 | - returns: Observer interface for subject. 26 | */ 27 | func asObserver() -> SubjectObserverType 28 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYAsset.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYAsset.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYAsset : NSObject { 12 | public private(set) var browser_download_url = "" 13 | public private(set) var id = 0 14 | public private(set) var name = "" 15 | public private(set) var label = "" 16 | public private(set) var state = "" 17 | public private(set) var content_type = "" 18 | public private(set) var size = 0 19 | public private(set) var download_count = 0 20 | public private(set) var created_at = "" 21 | public private(set) var updated_at = "" 22 | public private(set) var uploader = YYUser() 23 | 24 | //api 25 | var url = "" 26 | } -------------------------------------------------------------------------------- /RxGitHubAPI.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "RxGitHubAPI" 3 | s.version = "1.0.0" 4 | s.summary = "a GiuHub API Kit" 5 | s.description = <<-DESC 6 | 7 | a GiuHub API Kit 8 | 9 | DESC 10 | s.license = 'MIT' 11 | s.author = { "邓锋" => "704292743@qq.com" } 12 | s.homepage = "https://github.com/FengDeng/RxGitHubAPI" 13 | s.source = { :git => "git@github.com:FengDeng/RxGitHubAPI.git",:tag => s.version} 14 | s.platform = :ios, '8.0' 15 | s.requires_arc = true 16 | 17 | s.source_files = 'RxGitHubAPI/RxGitHubAPI/*.swift' 18 | s.frameworks = 'Foundation' 19 | 20 | s.dependency 'RxSwift', '~> 2.0.0' 21 | s.dependency 'RxCocoa', '~> 2.0.0' 22 | s.dependency 'RxBlocking', '~> 2.0.0' 23 | s.dependency 'Alamofire', '~> 3.1.4' 24 | s.dependency 'MJExtension' 25 | 26 | end 27 | -------------------------------------------------------------------------------- /RxGitHubAPITests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoricalScheduler.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/27/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Provides a virtual time scheduler that uses `NSDate` for absolute time and `NSTimeInterval` for relative time. 13 | */ 14 | public class HistoricalScheduler : VirtualTimeScheduler { 15 | 16 | /** 17 | Creates a new historical scheduler with initial clock value. 18 | 19 | - parameter initialClock: Initial value for virtual clock. 20 | */ 21 | public init(initialClock: RxTime = NSDate(timeIntervalSince1970: 0)) { 22 | super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter()) 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/RxMutableBox.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxMutableBox.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/22/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Creates mutable reference wrapper for any type. 13 | */ 14 | class RxMutableBox : CustomDebugStringConvertible { 15 | /** 16 | Wrapped value 17 | */ 18 | var value : T 19 | 20 | /** 21 | Creates reference wrapper for `value`. 22 | 23 | - parameter value: Value to wrap. 24 | */ 25 | init (_ value: T) { 26 | self.value = value 27 | } 28 | } 29 | 30 | extension RxMutableBox { 31 | /** 32 | - returns: Box description. 33 | */ 34 | var debugDescription: String { 35 | get { 36 | return "MutatingBox(\(self.value))" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ConnectableObservableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectableObservableType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. 13 | */ 14 | public protocol ConnectableObservableType : ObservableType { 15 | /** 16 | Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. 17 | 18 | - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. 19 | */ 20 | func connect() -> Disposable 21 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/KVORepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KVORepresentable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Type that is KVO representable (KVO mechanism can be used to observe it). 13 | */ 14 | public protocol KVORepresentable { 15 | /** 16 | Associated KVO type. 17 | */ 18 | typealias KVOType 19 | 20 | /** 21 | Constructs `Self` using KVO value. 22 | */ 23 | init?(KVOValue: KVOType) 24 | } 25 | 26 | extension KVORepresentable { 27 | /** 28 | Initializes `KVORepresentable` with optional value. 29 | */ 30 | init?(KVOValue: KVOType?) { 31 | guard let KVOValue = KVOValue else { 32 | return nil 33 | } 34 | 35 | self.init(KVOValue: KVOValue) 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /RxGitHubAPI/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import RxSwift 11 | import Alamofire 12 | 13 | class ViewController: UIViewController { 14 | 15 | let dis = DisposeBag() 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do any additional setup after loading the view, typically from a nib. 20 | 21 | 22 | RxGitHubAPI.searchRepos("RxSwift").subscribeNext { (searchRepo) -> Void in 23 | print(searchRepo) 24 | } 25 | 26 | } 27 | 28 | override func didReceiveMemoryWarning() { 29 | super.didReceiveMemoryWarning() 30 | // Dispose of any resources that can be recreated. 31 | } 32 | 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Producer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Producer.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/20/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Producer : Observable { 12 | override init() { 13 | super.init() 14 | } 15 | 16 | override func subscribe(observer: O) -> Disposable { 17 | if !CurrentThreadScheduler.isScheduleRequired { 18 | return run(observer) 19 | } 20 | else { 21 | return CurrentThreadScheduler.instance.schedule(()) { _ in 22 | return self.run(observer) 23 | } 24 | } 25 | } 26 | 27 | func run(observer: O) -> Disposable { 28 | abstractMethod() 29 | } 30 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousObserver.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class AnonymousObserver : ObserverBase { 12 | typealias Element = ElementType 13 | 14 | typealias EventHandler = Event -> Void 15 | 16 | private let _eventHandler : EventHandler 17 | 18 | init(_ eventHandler: EventHandler) { 19 | #if TRACE_RESOURCES 20 | AtomicIncrement(&resourceCount) 21 | #endif 22 | _eventHandler = eventHandler 23 | } 24 | 25 | override func onCore(event: Event) { 26 | return _eventHandler(event) 27 | } 28 | 29 | #if TRACE_RESOURCES 30 | deinit { 31 | AtomicDecrement(&resourceCount) 32 | } 33 | #endif 34 | } 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Pods-RxGitHubAPI.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Alamofire.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJExtension.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxBlocking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxCocoa.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "MJExtension" -framework "RxBlocking" -framework "RxCocoa" -framework "RxSwift" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-RxGitHubAPI 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Pods-RxGitHubAPI.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Alamofire.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/MJExtension.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxBlocking.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxCocoa.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/RxSwift.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "MJExtension" -framework "RxBlocking" -framework "RxCocoa" -framework "RxSwift" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-RxGitHubAPI 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/CocoaUnits/Driver/ControlEvent+Driver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ControlEvent+Driver.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 9/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension ControlEvent { 15 | /** 16 | Converts `ControlEvent` to `Driver` unit. 17 | 18 | `ControlEvent` already can't fail, so no special case needs to be handled. 19 | */ 20 | @warn_unused_result(message="http://git.io/rxs.uo") 21 | public func asDriver() -> Driver { 22 | return self.asDriver { (error) -> Driver in 23 | #if DEBUG 24 | rxFatalError("Somehow driver received error from a source that shouldn't fail.") 25 | #else 26 | return Driver.empty() 27 | #endif 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYContent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYContent.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/26. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYContent : NSObject{ 12 | public private(set) var type = "" 13 | public private(set) var encoding = "" 14 | public private(set) var size = 0 15 | public private(set) var name = "" 16 | public private(set) var path = "" 17 | public private(set) var content = "" 18 | public private(set) var sha = "" 19 | public private(set) var html_url = "" 20 | public private(set) var download_url = "" 21 | public private(set) var _links = YYLink() 22 | 23 | //api 24 | var url = "" 25 | var git_url = "" 26 | } 27 | 28 | public class YYLink : NSObject{ 29 | public private(set) var html = "" 30 | 31 | //api 32 | var _self = "" 33 | var git = "" 34 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/CocoaUnits/Driver/ControlProperty+Driver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ControlProperty+Driver.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 9/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension ControlProperty { 15 | /** 16 | Converts `ControlProperty` to `Driver` unit. 17 | 18 | `ControlProperty` already can't fail, so no special case needs to be handled. 19 | */ 20 | @warn_unused_result(message="http://git.io/rxs.uo") 21 | public func asDriver() -> Driver { 22 | return self.asDriver { (error) -> Driver in 23 | #if DEBUG 24 | rxFatalError("Somehow driver received error from a source that shouldn't fail.") 25 | #else 26 | return Driver.empty() 27 | #endif 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYPullRequestComment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYPullRequestComment.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/2/2. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYPullRequestComment : NSObject{ 12 | public private(set) var id = 0 13 | public private(set) var diff_hunk = "" 14 | public private(set) var path = "" 15 | public private(set) var position = 0 16 | public private(set) var original_position = 0 17 | public private(set) var commit_id = "" 18 | public private(set) var original_commit_id = "" 19 | public private(set) var user = YYUser() 20 | public private(set) var body = "" 21 | public private(set) var created_at = "" 22 | public private(set) var updated_at = "" 23 | public private(set) var html_url = "" 24 | 25 | //api 26 | var url = "" 27 | var pull_request_url = "" 28 | 29 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledItem.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 9/2/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct ScheduledItem 12 | : ScheduledItemType 13 | , InvocableType { 14 | typealias Action = T -> Disposable 15 | 16 | private let _action: Action 17 | private let _state: T 18 | 19 | private let _disposable = SingleAssignmentDisposable() 20 | 21 | var disposed: Bool { 22 | get { 23 | return _disposable.disposed 24 | } 25 | } 26 | 27 | init(action: Action, state: T) { 28 | _action = action 29 | _state = state 30 | } 31 | 32 | func invoke() { 33 | _disposable.disposable = _action(_state) 34 | } 35 | 36 | func dispose() { 37 | _disposable.dispose() 38 | } 39 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observers/ObserverBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObserverBase.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ObserverBase : Disposable, ObserverType { 12 | typealias E = ElementType 13 | 14 | private var _isStopped: AtomicInt = 0 15 | 16 | func on(event: Event) { 17 | switch event { 18 | case .Next: 19 | if _isStopped == 0 { 20 | onCore(event) 21 | } 22 | case .Error, .Completed: 23 | 24 | if !AtomicCompareAndSwap(0, 1, &_isStopped) { 25 | return 26 | } 27 | 28 | onCore(event) 29 | } 30 | } 31 | 32 | func onCore(event: Event) { 33 | abstractMethod() 34 | } 35 | 36 | func dispose() { 37 | _isStopped = 1 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYURLGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYURLGenerator.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | let domain = "https://api.github.com" 12 | 13 | 14 | //User 15 | //Get a single user 16 | func kUserURL(username:String)->String{ 17 | return domain + "/users/\(username)" 18 | } 19 | 20 | //search repos 21 | var kSearchReposURL : String{ 22 | return domain + "/search/repositories" 23 | } 24 | //search users 25 | var kSearchUsersURL : String{ 26 | return domain + "/search/users" 27 | } 28 | 29 | enum YYSince : String{ 30 | case Daily = "daily" 31 | case Weekly = "weekly" 32 | case Monthly = "monthly" 33 | } 34 | 35 | //trend 36 | func kTrendRepoURL(since:YYSince,language:String)->String{ 37 | return "http://trending.codehub-app.com/v2/trending?since=\(since.rawValue)&language=\(language)" 38 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/RxTarget.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxTarget.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | class RxTarget : NSObject 15 | , Disposable { 16 | 17 | private var retainSelf: RxTarget? 18 | 19 | override init() { 20 | super.init() 21 | self.retainSelf = self 22 | 23 | #if TRACE_RESOURCES 24 | OSAtomicIncrement32(&resourceCount) 25 | #endif 26 | 27 | #if DEBUG 28 | MainScheduler.ensureExecutingOnScheduler() 29 | #endif 30 | } 31 | 32 | func dispose() { 33 | #if DEBUG 34 | MainScheduler.ensureExecutingOnScheduler() 35 | #endif 36 | self.retainSelf = nil 37 | } 38 | 39 | #if TRACE_RESOURCES 40 | deinit { 41 | OSAtomicDecrement32(&resourceCount) 42 | } 43 | #endif 44 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/RxCocoa/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxSwift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/_RXKVOObserver.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RXKVOObserver.h 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/11/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | ################################################################################ 13 | This file is part of RX private API 14 | ################################################################################ 15 | */ 16 | 17 | typedef void (^KVOCallback)(id); 18 | 19 | // Exists because if written in Swift, reading unowned is disabled during dealloc process 20 | @interface _RXKVOObserver : NSObject 21 | 22 | -(instancetype)initWithTarget:(id)target 23 | retainTarget:(BOOL)retainTarget 24 | keyPath:(NSString*)keyPath 25 | options:(NSKeyValueObservingOptions)options 26 | callback:(KVOCallback)callback; 27 | 28 | -(void)dispose; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Alamofire/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.5 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MJExtension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.10 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/RxBlocking/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-RxGitHubAPI/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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/RxCocoa/RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxTableViewDataSourceType.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 6/26/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | /** 18 | Marks data source as `UITableView` reactive data source enabling it to be used with one of the `bindTo` methods. 19 | */ 20 | public protocol RxTableViewDataSourceType /*: UITableViewDataSource*/ { 21 | 22 | /** 23 | Type of elements that can be bound to table view. 24 | */ 25 | typealias Element 26 | 27 | /** 28 | New observable sequence event observed. 29 | 30 | - parameter tableView: Bound table view. 31 | - parameter observedEvent: Event 32 | */ 33 | func tableView(tableView: UITableView, observedEvent: Event) -> Void 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIButton+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UIButton { 18 | 19 | /** 20 | Reactive wrapper for `TouchUpInside` control event. 21 | */ 22 | public var rx_tap: ControlEvent { 23 | return rx_controlEvent(.TouchUpInside) 24 | } 25 | 26 | } 27 | 28 | #endif 29 | 30 | #if os(tvOS) 31 | 32 | import Foundation 33 | #if !RX_NO_MODULE 34 | import RxSwift 35 | #endif 36 | import UIKit 37 | 38 | extension UIButton { 39 | 40 | /** 41 | Reactive wrapper for `PrimaryActionTriggered` control event. 42 | */ 43 | public var rx_primaryAction: ControlEvent { 44 | return rx_controlEvent(.PrimaryActionTriggered) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJExtensionConst.m: -------------------------------------------------------------------------------- 1 | #ifndef __MJExtensionConst__M__ 2 | #define __MJExtensionConst__M__ 3 | 4 | #import 5 | 6 | /** 7 | * 成员变量类型(属性类型) 8 | */ 9 | NSString *const MJPropertyTypeInt = @"i"; 10 | NSString *const MJPropertyTypeShort = @"s"; 11 | NSString *const MJPropertyTypeFloat = @"f"; 12 | NSString *const MJPropertyTypeDouble = @"d"; 13 | NSString *const MJPropertyTypeLong = @"l"; 14 | NSString *const MJPropertyTypeLongLong = @"q"; 15 | NSString *const MJPropertyTypeChar = @"c"; 16 | NSString *const MJPropertyTypeBOOL1 = @"c"; 17 | NSString *const MJPropertyTypeBOOL2 = @"b"; 18 | NSString *const MJPropertyTypePointer = @"*"; 19 | 20 | NSString *const MJPropertyTypeIvar = @"^{objc_ivar=}"; 21 | NSString *const MJPropertyTypeMethod = @"^{objc_method=}"; 22 | NSString *const MJPropertyTypeBlock = @"@?"; 23 | NSString *const MJPropertyTypeClass = @"#"; 24 | NSString *const MJPropertyTypeSEL = @":"; 25 | NSString *const MJPropertyTypeId = @"@"; 26 | 27 | #endif -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxSearchBarDelegateProxy.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/4/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | class RxSearchBarDelegateProxy : DelegateProxy 18 | , UISearchBarDelegate 19 | , DelegateProxyType { 20 | 21 | class func currentDelegateFor(object: AnyObject) -> AnyObject? { 22 | let searchBar: UISearchBar = castOrFatalError(object) 23 | return searchBar.delegate 24 | } 25 | 26 | class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) { 27 | let searchBar: UISearchBar = castOrFatalError(object) 28 | searchBar.delegate = castOptionalOrFatalError(delegate) 29 | } 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Proxies/RxCLLocationManagerDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxCLLocationManagerDelegateProxy.swift 3 | // RxCocoa 4 | // 5 | // Created by Carlos García on 8/7/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import CoreLocation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | class RxCLLocationManagerDelegateProxy : DelegateProxy 15 | , CLLocationManagerDelegate 16 | , DelegateProxyType { 17 | 18 | class func currentDelegateFor(object: AnyObject) -> AnyObject? { 19 | let locationManager: CLLocationManager = castOrFatalError(object) 20 | return locationManager.delegate 21 | } 22 | 23 | class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) { 24 | let locationManager: CLLocationManager = castOrFatalError(object) 25 | locationManager.delegate = castOptionalOrFatalError(delegate) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxCollectionViewDataSourceType.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 6/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | /** 18 | Marks data source as `UICollectionView` reactive data source enabling it to be used with one of the `bindTo` methods. 19 | */ 20 | public protocol RxCollectionViewDataSourceType /*: UICollectionViewDataSource*/ { 21 | 22 | /** 23 | Type of elements that can be bound to collection view. 24 | */ 25 | typealias Element 26 | 27 | /** 28 | New observable sequence event observed. 29 | 30 | - parameter collectionView: Bound collection view. 31 | - parameter observedEvent: Event 32 | */ 33 | func collectionView(collectionView: UICollectionView, observedEvent: Event) -> Void 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxTableViewDelegateProxy.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 6/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | /** 18 | For more information take a look at `DelegateProxyType`. 19 | */ 20 | public class RxTableViewDelegateProxy 21 | : RxScrollViewDelegateProxy 22 | , UITableViewDelegate { 23 | 24 | 25 | /** 26 | Typed parent object. 27 | */ 28 | public weak private(set) var tableView: UITableView? 29 | 30 | /** 31 | Initializes `RxTableViewDelegateProxy` 32 | 33 | - parameter parentObject: Parent object for delegate proxy. 34 | */ 35 | public required init(parentObject: AnyObject) { 36 | self.tableView = (parentObject as! UITableView) 37 | super.init(parentObject: parentObject) 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+Rx.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/6/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if os(OSX) 12 | import Cocoa 13 | #else 14 | import UIKit 15 | #endif 16 | 17 | #if !RX_NO_MODULE 18 | import RxSwift 19 | #endif 20 | 21 | #if os(iOS) || os(OSX) || os(tvOS) 22 | extension NSLayoutConstraint { 23 | /** 24 | Bindable sink for `constant` property. 25 | */ 26 | public var rx_constant: AnyObserver { 27 | return AnyObserver { [weak self] event in 28 | MainScheduler.ensureExecutingOnScheduler() 29 | 30 | switch event { 31 | case .Next(let value): 32 | self?.constant = value 33 | case .Error(let error): 34 | bindingErrorToInterface(error) 35 | break 36 | case .Completed: 37 | break 38 | } 39 | } 40 | } 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Observable+Debug.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Observable+Debug.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/2/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: debug 12 | 13 | extension ObservableType { 14 | 15 | /** 16 | Prints received events for all observers on standard output. 17 | 18 | - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) 19 | 20 | - parameter identifier: Identifier that is printed together with event description to standard output. 21 | - returns: An observable sequence whose events are printed to standard output. 22 | */ 23 | @warn_unused_result(message="http://git.io/rxs.uo") 24 | public func debug(identifier: String? = nil, file: String = __FILE__, line: UInt = __LINE__, function: String = __FUNCTION__) 25 | -> Observable { 26 | return Debug(source: self.asObservable(), identifier: identifier, file: file, line: line, function: function) 27 | } 28 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/DispatchQueueSchedulerQOS.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DispatchQueueSchedulerQOS.swift 3 | // RxSwift 4 | // 5 | // Created by John C. "Hsoi" Daub on 12/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Identifies one of the global concurrent dispatch queues with specified quality of service class. 13 | */ 14 | public enum DispatchQueueSchedulerQOS { 15 | 16 | /** 17 | Identifies global dispatch queue with `QOS_CLASS_USER_INTERACTIVE` 18 | */ 19 | case UserInteractive 20 | 21 | /** 22 | Identifies global dispatch queue with `QOS_CLASS_USER_INITIATED` 23 | */ 24 | case UserInitiated 25 | 26 | /** 27 | Identifies global dispatch queue with `QOS_CLASS_DEFAULT` 28 | */ 29 | case Default 30 | 31 | /** 32 | Identifies global dispatch queue with `QOS_CLASS_UTILITY` 33 | */ 34 | case Utility 35 | 36 | /** 37 | Identifies global dispatch queue with `QOS_CLASS_BACKGROUND` 38 | */ 39 | case Background 40 | } 41 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYGist.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYGist.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYGist : NSObject{ 12 | 13 | public private(set) var id = "" 14 | public private(set) var _description = "" 15 | public private(set) var _public = false 16 | public private(set) var owner = YYUser() 17 | public private(set) var truncated = false 18 | public private(set) var comments = 0 19 | public private(set) var html_url = "" 20 | public private(set) var git_pull_url = "" 21 | public private(set) var git_push_url = "" 22 | public private(set) var created_at = "" 23 | public private(set) var updated_at = "" 24 | 25 | public override static func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 26 | return ["_description":"description","_public":"public"] 27 | } 28 | 29 | //api 30 | var url = "" 31 | var forks_url = "" 32 | var commits_url = "" 33 | var comments_url = "" 34 | 35 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJPropertyType.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJPropertyType.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 包装一种类型 8 | 9 | #import 10 | 11 | /** 12 | * 包装一种类型 13 | */ 14 | @interface MJPropertyType : NSObject 15 | /** 类型标识符 */ 16 | @property (nonatomic, copy) NSString *code; 17 | 18 | /** 是否为id类型 */ 19 | @property (nonatomic, readonly, getter=isIdType) BOOL idType; 20 | 21 | /** 是否为基本数字类型:int、float等 */ 22 | @property (nonatomic, readonly, getter=isNumberType) BOOL numberType; 23 | 24 | /** 是否为BOOL类型 */ 25 | @property (nonatomic, readonly, getter=isBoolType) BOOL boolType; 26 | 27 | /** 对象类型(如果是基本数据类型,此值为nil) */ 28 | @property (nonatomic, readonly) Class typeClass; 29 | 30 | /** 类型是否来自于Foundation框架,比如NSString、NSArray */ 31 | @property (nonatomic, readonly, getter = isFromFoundation) BOOL fromFoundation; 32 | /** 类型是否不支持KVC */ 33 | @property (nonatomic, readonly, getter = isKVCDisabled) BOOL KVCDisabled; 34 | 35 | /** 36 | * 获得缓存的类型对象 37 | */ 38 | + (instancetype)cachedTypeWithCode:(NSString *)code; 39 | @end -------------------------------------------------------------------------------- /Pods/RxBlocking/LICENSE.md: -------------------------------------------------------------------------------- 1 | **The MIT License** 2 | **Copyright © 2015 Krunoslav Zaher** 3 | **All rights reserved.** 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/RxCocoa/LICENSE.md: -------------------------------------------------------------------------------- 1 | **The MIT License** 2 | **Copyright © 2015 Krunoslav Zaher** 3 | **All rights reserved.** 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIActivityIndicatorView+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIActivityIndicatorView+Rx.swift 3 | // Rx 4 | // 5 | // Created by Ivan Persidskiy on 02/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | import UIKit 11 | 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | 16 | extension UIActivityIndicatorView { 17 | 18 | /** 19 | Bindable sink for `startAnimating()`, `stopAnimating()` methods. 20 | */ 21 | public var rx_animating: AnyObserver { 22 | return AnyObserver {event in 23 | MainScheduler.ensureExecutingOnScheduler() 24 | 25 | switch (event) { 26 | case .Next(let value): 27 | if value { 28 | self.startAnimating() 29 | } else { 30 | self.stopAnimating() 31 | } 32 | case .Error(let error): 33 | bindingErrorToInterface(error) 34 | case .Completed: 35 | break 36 | } 37 | } 38 | } 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Pods/RxSwift/LICENSE.md: -------------------------------------------------------------------------------- 1 | **The MIT License** 2 | **Copyright © 2015 Krunoslav Zaher** 3 | **All rights reserved.** 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxCollectionViewDelegateProxy.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 6/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | /** 18 | For more information take a look at `DelegateProxyType`. 19 | */ 20 | public class RxCollectionViewDelegateProxy 21 | : RxScrollViewDelegateProxy 22 | , UICollectionViewDelegate 23 | , UICollectionViewDelegateFlowLayout { 24 | 25 | /** 26 | Typed parent object. 27 | */ 28 | public weak private(set) var collectionView: UICollectionView? 29 | 30 | /** 31 | Initializes `RxCollectionViewDelegateProxy` 32 | 33 | - parameter parentObject: Parent object for delegate proxy. 34 | */ 35 | public required init(parentObject: AnyObject) { 36 | self.collectionView = (parentObject as! UICollectionView) 37 | super.init(parentObject: parentObject) 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /RxGitHubAPITests/RxGitHubAPITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxGitHubAPITests.swift 3 | // RxGitHubAPITests 4 | // 5 | // Created by 邓锋 on 16/1/27. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RxGitHubAPI 11 | 12 | class RxGitHubAPITests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYRelease.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYRelease.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYRelease : NSObject{ 12 | public private(set) var upload_url = "" 13 | public private(set) var html_url = "" 14 | public private(set) var id = 0 15 | public private(set) var tag_name = "" 16 | public private(set) var target_commitish = "" 17 | public private(set) var name = "" 18 | public private(set) var draft = false 19 | public private(set) var author = YYUser() 20 | public private(set) var prerelease = false 21 | public private(set) var created_at = "" 22 | public private(set) var published_at = "" 23 | public private(set) var assets = [YYAsset]() 24 | public private(set) var body = "" 25 | 26 | 27 | public class override func mj_objectClassInArray() -> [NSObject : AnyObject]! { 28 | return ["assets":YYAsset.self] 29 | } 30 | 31 | //api 32 | var url = "" 33 | var assets_url = "" 34 | var tarball_url = "" 35 | var zipball_url = "" 36 | } -------------------------------------------------------------------------------- /Pods/Alamofire/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014–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/MJExtension/MJExtension/NSObject+MJCoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.h 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | /** 13 | * Codeing协议 14 | */ 15 | @protocol MJCoding 16 | @optional 17 | /** 18 | * 这个数组中的属性名才会进行归档 19 | */ 20 | + (NSArray *)mj_allowedCodingPropertyNames; 21 | /** 22 | * 这个数组中的属性名将会被忽略:不进行归档 23 | */ 24 | + (NSArray *)mj_ignoredCodingPropertyNames; 25 | @end 26 | 27 | @interface NSObject (MJCoding) 28 | /** 29 | * 解码(从文件中解析对象) 30 | */ 31 | - (void)mj_decode:(NSCoder *)decoder; 32 | /** 33 | * 编码(将对象写入文件中) 34 | */ 35 | - (void)mj_encode:(NSCoder *)encoder; 36 | @end 37 | 38 | /** 39 | 归档的实现 40 | */ 41 | #define MJCodingImplementation \ 42 | - (id)initWithCoder:(NSCoder *)decoder \ 43 | { \ 44 | if (self = [super init]) { \ 45 | [self mj_decode:decoder]; \ 46 | } \ 47 | return self; \ 48 | } \ 49 | \ 50 | - (void)encodeWithCoder:(NSCoder *)encoder \ 51 | { \ 52 | [self mj_encode:encoder]; \ 53 | } 54 | 55 | #define MJExtensionCodingImplementation MJCodingImplementation -------------------------------------------------------------------------------- /Pods/MJExtension/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJExtension (https://github.com/CoderMJLee/MJExtension) 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/RxCocoa/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxTextStorageDelegateProxy.swift 3 | // Rx 4 | // 5 | // Created by Segii Shulga on 12/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | public class RxTextStorageDelegateProxy 18 | : DelegateProxy 19 | , DelegateProxyType 20 | , NSTextStorageDelegate { 21 | 22 | 23 | /** 24 | For more information take a look at `DelegateProxyType`. 25 | */ 26 | public class func setCurrentDelegate(delegate: AnyObject?, toObject object: AnyObject) { 27 | let textStorage: NSTextStorage = castOrFatalError(object) 28 | textStorage.delegate = castOptionalOrFatalError(delegate) 29 | } 30 | 31 | /** 32 | For more information take a look at `DelegateProxyType`. 33 | */ 34 | public class func currentDelegateFor(object: AnyObject) -> AnyObject? { 35 | let textStorage: NSTextStorage = castOrFatalError(object) 36 | return textStorage.delegate 37 | } 38 | 39 | 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/RxBlocking/RxBlocking/RunLoopLock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RunLoopLock.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/5/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | class RunLoopLock { 15 | let currentRunLoop: CFRunLoopRef 16 | 17 | init() { 18 | currentRunLoop = CFRunLoopGetCurrent() 19 | } 20 | 21 | func dispatch(action: () -> ()) { 22 | CFRunLoopPerformBlock(currentRunLoop, kCFRunLoopDefaultMode) { 23 | if CurrentThreadScheduler.isScheduleRequired { 24 | CurrentThreadScheduler.instance.schedule(()) { _ in 25 | action() 26 | return NopDisposable.instance 27 | } 28 | } 29 | else { 30 | action() 31 | } 32 | } 33 | CFRunLoopWakeUp(currentRunLoop) 34 | } 35 | 36 | func stop() { 37 | CFRunLoopPerformBlock(currentRunLoop, kCFRunLoopDefaultMode) { 38 | CFRunLoopStop(self.currentRunLoop) 39 | } 40 | CFRunLoopWakeUp(currentRunLoop) 41 | } 42 | 43 | func run() { 44 | CFRunLoopRun() 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/NSNotificationCenter+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSNotificationCenter+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 5/2/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension NSNotificationCenter { 15 | /** 16 | Transforms notifications posted to notification center to observable sequence of notifications. 17 | 18 | - parameter name: Filter notifications by name. 19 | - parameter object: Optional object used to filter notifications. 20 | - returns: Observable sequence of posted notifications. 21 | */ 22 | @warn_unused_result(message="http://git.io/rxs.uo") 23 | public func rx_notification(name: String, object: AnyObject? = nil) -> Observable { 24 | return Observable.create { [weak object] observer in 25 | let nsObserver = self.addObserverForName(name, object: object, queue: nil) { notification in 26 | observer.on(.Next(notification)) 27 | } 28 | 29 | return AnonymousDisposable { 30 | self.removeObserver(nsObserver) 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYCommit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYCommit.swift 3 | // RxGitHubAPI 4 | // 5 | // Created by 邓锋 on 16/1/28. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYCommit : NSObject{ 12 | public private(set) var sha = "" 13 | public private(set) var commit = YYCommitDetail() 14 | public private(set) var html_url = "" 15 | public private(set) var author : YYUser? 16 | public private(set) var committer : YYUser? 17 | public private(set) var parents : [YYCommitParent]? 18 | public private(set) var stats_total = 0 19 | public private(set) var stats_additions = 0 20 | public private(set) var stats_deletions = 0 21 | public private(set) var files : YYFile? 22 | 23 | //api 24 | var url = "" 25 | var comments_url = "" 26 | 27 | public class override func mj_objectClassInArray() -> [NSObject : AnyObject]! { 28 | return ["parents":YYCommitParent.self,"files":YYFile.self] 29 | } 30 | public class override func mj_replacedKeyFromPropertyName() -> [NSObject : AnyObject]! { 31 | return ["stats_total":"stats.total","stats_additions":"stats.additions","stats_deletions":"stats.deletions"] 32 | } 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSString+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MJExtension.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/6/7. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MJExtensionConst.h" 11 | 12 | @interface NSString (MJExtension) 13 | /** 14 | * 驼峰转下划线(loveYou -> love_you) 15 | */ 16 | - (NSString *)mj_underlineFromCamel; 17 | /** 18 | * 下划线转驼峰(love_you -> loveYou) 19 | */ 20 | - (NSString *)mj_camelFromUnderline; 21 | /** 22 | * 首字母变大写 23 | */ 24 | - (NSString *)mj_firstCharUpper; 25 | /** 26 | * 首字母变小写 27 | */ 28 | - (NSString *)mj_firstCharLower; 29 | 30 | - (BOOL)mj_isPureInt; 31 | 32 | - (NSURL *)mj_url; 33 | @end 34 | 35 | @interface NSString (MJExtensionDeprecated_v_2_5_16) 36 | - (NSString *)underlineFromCamel MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 37 | - (NSString *)camelFromUnderline MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 38 | - (NSString *)firstCharUpper MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 39 | - (NSString *)firstCharLower MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 40 | - (BOOL)isPureInt MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 41 | - (NSURL *)url MJExtensionDeprecated("请在方法名前面加上mj_前缀,使用mj_***"); 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BooleanDisposable.swift 3 | // Rx 4 | // 5 | // Created by Junior B. on 10/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents a disposable resource that can be checked for disposal status. 13 | */ 14 | public class BooleanDisposable : Disposable, Cancelable { 15 | 16 | internal static let BooleanDisposableTrue = BooleanDisposable(disposed: true) 17 | private var _disposed = false 18 | 19 | /** 20 | Initializes a new instance of the `BooleanDisposable` class 21 | */ 22 | public init() { 23 | } 24 | 25 | /** 26 | Initializes a new instance of the `BooleanDisposable` class with given value 27 | */ 28 | public init(disposed: Bool) { 29 | self._disposed = disposed 30 | } 31 | 32 | /** 33 | - returns: Was resource disposed. 34 | */ 35 | public var disposed: Bool { 36 | get { 37 | return _disposed 38 | } 39 | } 40 | 41 | /** 42 | Sets the status to disposed, which can be observer through the `disposed` property. 43 | */ 44 | public func dispose() { 45 | _disposed = true 46 | } 47 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/Implementations/KVOObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KVOObserver.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | protocol KVOObservableProtocol { 15 | var target: AnyObject { get } 16 | var keyPath: String { get } 17 | var retainTarget: Bool { get } 18 | var options: NSKeyValueObservingOptions { get } 19 | } 20 | 21 | class KVOObserver : _RXKVOObserver 22 | , Disposable { 23 | typealias Callback = (AnyObject?) -> Void 24 | 25 | var retainSelf: KVOObserver? = nil 26 | 27 | init(parent: KVOObservableProtocol, callback: Callback) { 28 | #if TRACE_RESOURCES 29 | OSAtomicIncrement32(&resourceCount) 30 | #endif 31 | 32 | super.init(target: parent.target, retainTarget: parent.retainTarget, keyPath: parent.keyPath, options: parent.options, callback: callback) 33 | self.retainSelf = self 34 | } 35 | 36 | override func dispose() { 37 | super.dispose() 38 | self.retainSelf = nil 39 | } 40 | 41 | deinit { 42 | #if TRACE_RESOURCES 43 | OSAtomicDecrement32(&resourceCount) 44 | #endif 45 | } 46 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Repeat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Repeat.swift 3 | // RxExample 4 | // 5 | // Created by Krunoslav Zaher on 9/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class RepeatElement : Producer { 12 | private let _element: Element 13 | private let _scheduler: ImmediateSchedulerType 14 | 15 | init(element: Element, scheduler: ImmediateSchedulerType) { 16 | _element = element 17 | _scheduler = scheduler 18 | } 19 | 20 | override func run(observer: O) -> Disposable { 21 | let sink = RepeatElementSink(parent: self, observer: observer) 22 | sink.disposable = sink.run() 23 | 24 | return sink 25 | } 26 | } 27 | 28 | class RepeatElementSink : Sink { 29 | typealias Parent = RepeatElement 30 | 31 | private let _parent: Parent 32 | 33 | init(parent: Parent, observer: O) { 34 | _parent = parent 35 | super.init(observer: observer) 36 | } 37 | 38 | func run() -> Disposable { 39 | return _parent._scheduler.scheduleRecursive(_parent._element) { e, recurse in 40 | self.forwardOn(.Next(e)) 41 | recurse(e) 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Rx.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | #if TRACE_RESOURCES 12 | /** 13 | Counts internal Rx resources (Observables, Observers, Disposables ...). 14 | 15 | It provides a really simple way to detect leaks early during development. 16 | */ 17 | public var resourceCount: AtomicInt = 0 18 | #endif 19 | 20 | // Swift doesn't have a concept of abstract metods. 21 | // This function is being used as a runtime check that abstract methods aren't being called. 22 | @noreturn func abstractMethod() -> Void { 23 | rxFatalError("Abstract method") 24 | } 25 | 26 | @noreturn func rxFatalError(lastMessage: String) { 27 | // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. 28 | fatalError(lastMessage) 29 | } 30 | 31 | func incrementChecked(inout i: Int) throws -> Int { 32 | if i == Int.max { 33 | throw RxError.Overflow 34 | } 35 | let result = i 36 | i += 1 37 | return result 38 | } 39 | 40 | func decrementChecked(inout i: Int) throws -> Int { 41 | if i == Int.min { 42 | throw RxError.Overflow 43 | } 44 | let result = i 45 | i -= 1 46 | return result 47 | } 48 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Observable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | A type-erased `ObservableType`. 13 | 14 | It represents a push style sequence. 15 | */ 16 | public class Observable : ObservableType { 17 | /** 18 | Type of elements in sequence. 19 | */ 20 | public typealias E = Element 21 | 22 | init() { 23 | #if TRACE_RESOURCES 24 | OSAtomicIncrement32(&resourceCount) 25 | #endif 26 | } 27 | 28 | public func subscribe(observer: O) -> Disposable { 29 | abstractMethod() 30 | } 31 | 32 | public func asObservable() -> Observable { 33 | return self 34 | } 35 | 36 | deinit { 37 | #if TRACE_RESOURCES 38 | AtomicDecrement(&resourceCount) 39 | #endif 40 | } 41 | 42 | // this is kind of ugly I know :( 43 | // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ 44 | 45 | /** 46 | Optimizations for map operator 47 | */ 48 | internal func composeMap(selector: Element throws -> R) -> Observable { 49 | return Map(source: self, selector: selector) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Sink.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sink.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class Sink : SingleAssignmentDisposable { 12 | private let _observer: O 13 | 14 | init(observer: O) { 15 | #if TRACE_RESOURCES 16 | AtomicIncrement(&resourceCount) 17 | #endif 18 | _observer = observer 19 | } 20 | 21 | final func forwardOn(event: Event) { 22 | if disposed { 23 | return 24 | } 25 | _observer.on(event) 26 | } 27 | 28 | final func forwarder() -> SinkForward { 29 | return SinkForward(forward: self) 30 | } 31 | 32 | deinit { 33 | #if TRACE_RESOURCES 34 | AtomicDecrement(&resourceCount) 35 | #endif 36 | } 37 | } 38 | 39 | class SinkForward: ObserverType { 40 | typealias E = O.E 41 | 42 | private let _forward: Sink 43 | 44 | init(forward: Sink) { 45 | _forward = forward 46 | } 47 | 48 | func on(event: Event) { 49 | switch event { 50 | case .Next: 51 | _forward._observer.on(event) 52 | case .Error, .Completed: 53 | _forward._observer.on(event) 54 | _forward.dispose() 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImmediateScheduler.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 10/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents an object that schedules units of work to run immediately on the current thread. 13 | */ 14 | private class ImmediateScheduler : ImmediateSchedulerType { 15 | 16 | private let _asyncLock = AsyncLock() 17 | 18 | /** 19 | Schedules an action to be executed immediatelly. 20 | 21 | In case `schedule` is called recursively from inside of `action` callback, scheduled `action` will be enqueued 22 | and executed after current `action`. (`AsyncLock` behavior) 23 | 24 | - parameter state: State passed to the action to be executed. 25 | - parameter action: Action to be executed. 26 | - returns: The disposable object used to cancel the scheduled action (best effort). 27 | */ 28 | func schedule(state: StateType, action: (StateType) -> Disposable) -> Disposable { 29 | let disposable = SingleAssignmentDisposable() 30 | _asyncLock.invoke(AnonymousInvocable { 31 | if disposable.disposed { 32 | return 33 | } 34 | disposable.disposable = action(state) 35 | }) 36 | 37 | return disposable 38 | } 39 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/NSTextStorage+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSTextStorage+Rx.swift 3 | // Rx 4 | // 5 | // Created by Segii Shulga on 12/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | import Foundation 11 | 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension NSTextStorage { 18 | 19 | /** 20 | Reactive wrapper for `delegate`. 21 | 22 | For more information take a look at `DelegateProxyType` protocol documentation. 23 | */ 24 | public var rx_delegate:DelegateProxy { 25 | return proxyForObject(RxTextStorageDelegateProxy.self, self) 26 | } 27 | 28 | /** 29 | Reactive wrapper for `delegate` message. 30 | */ 31 | public var rx_didProcessEditingRangeChangeInLength: Observable<(editedMask:NSTextStorageEditActions, editedRange:NSRange, delta:Int)> { 32 | return rx_delegate 33 | .observe("textStorage:didProcessEditing:range:changeInLength:") 34 | .map { a in 35 | let editedMask = NSTextStorageEditActions(rawValue: try castOrThrow(UInt.self, a[1]) ) 36 | let editedRange = try castOrThrow(NSValue.self, a[2]).rangeValue 37 | let delta = try castOrThrow(Int.self, a[3]) 38 | 39 | return (editedMask, editedRange, delta) 40 | } 41 | } 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /RxGitHubAPI/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObserverType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObserverType.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Supports push-style iteration over an observable sequence. 13 | */ 14 | public protocol ObserverType { 15 | /** 16 | The type of elements in sequence that observer can observe. 17 | */ 18 | typealias E 19 | 20 | /** 21 | Notify observer about sequence event. 22 | 23 | - parameter event: Event that occured. 24 | */ 25 | func on(event: Event) 26 | } 27 | 28 | /** 29 | Convenience API extensions to provide alternate next, error, completed events 30 | */ 31 | public extension ObserverType { 32 | 33 | /** 34 | Convenience method equivalent to `on(.Next(element: E))` 35 | 36 | - parameter element: Next element to send to observer(s) 37 | */ 38 | final func onNext(element: E) { 39 | on(.Next(element)) 40 | } 41 | 42 | /** 43 | Convenience method equivalent to `on(.Completed)` 44 | */ 45 | final func onCompleted() { 46 | on(.Completed) 47 | } 48 | 49 | /** 50 | Convenience method equivalent to `on(.Error(error: ErrorType))` 51 | - parameter error: ErrorType to send to observer(s) 52 | */ 53 | final func onError(error: ErrorType) { 54 | on(.Error(error)) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/AddRef.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AddRef.swift 3 | // Rx 4 | // 5 | // Created by Junior B. on 30/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class AddRefSink : Sink, ObserverType { 12 | typealias Element = O.E 13 | 14 | override init(observer: O) { 15 | super.init(observer: observer) 16 | } 17 | 18 | func on(event: Event) { 19 | switch event { 20 | case .Next(_): 21 | forwardOn(event) 22 | case .Completed, .Error(_): 23 | forwardOn(event) 24 | dispose() 25 | } 26 | } 27 | } 28 | 29 | class AddRef : Producer { 30 | typealias EventHandler = Event throws -> Void 31 | 32 | private let _source: Observable 33 | private let _refCount: RefCountDisposable 34 | 35 | init(source: Observable, refCount: RefCountDisposable) { 36 | _source = source 37 | _refCount = refCount 38 | } 39 | 40 | override func run(observer: O) -> Disposable { 41 | let releaseDisposable = _refCount.retain() 42 | let sink = AddRefSink(observer: observer) 43 | sink.disposable = StableCompositeDisposable.create(releaseDisposable, _source.subscribeSafe(sink)) 44 | 45 | return sink 46 | } 47 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJProperty.h 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 15/4/17. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 包装一个成员属性 8 | 9 | #import 10 | #import 11 | #import "MJPropertyType.h" 12 | #import "MJPropertyKey.h" 13 | 14 | /** 15 | * 包装一个成员 16 | */ 17 | @interface MJProperty : NSObject 18 | /** 成员属性 */ 19 | @property (nonatomic, assign) objc_property_t property; 20 | /** 成员属性的名字 */ 21 | @property (nonatomic, readonly) NSString *name; 22 | 23 | /** 成员属性的类型 */ 24 | @property (nonatomic, readonly) MJPropertyType *type; 25 | /** 成员属性来源于哪个类(可能是父类) */ 26 | @property (nonatomic, assign) Class srcClass; 27 | 28 | /**** 同一个成员属性 - 父类和子类的行为可能不一致(originKey、propertyKeys、objectClassInArray) ****/ 29 | /** 设置最原始的key */ 30 | - (void)setOriginKey:(id)originKey forClass:(Class)c; 31 | /** 对应着字典中的多级key(里面存放的数组,数组里面都是MJPropertyKey对象) */ 32 | - (NSArray *)propertyKeysForClass:(Class)c; 33 | 34 | /** 模型数组中的模型类型 */ 35 | - (void)setObjectClassInArray:(Class)objectClass forClass:(Class)c; 36 | - (Class)objectClassInArrayForClass:(Class)c; 37 | /**** 同一个成员变量 - 父类和子类的行为可能不一致(key、keys、objectClassInArray) ****/ 38 | 39 | /** 40 | * 设置object的成员变量值 41 | */ 42 | - (void)setValue:(id)value forObject:(id)object; 43 | /** 44 | * 得到object的成员属性值 45 | */ 46 | - (id)valueForObject:(id)object; 47 | 48 | /** 49 | * 初始化 50 | */ 51 | + (instancetype)cachedPropertyWithProperty:(objc_property_t)property; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/ToArray.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToArray.swift 3 | // Rx 4 | // 5 | // Created by Junior B. on 20/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ToArraySink : Sink, ObserverType { 12 | typealias Parent = ToArray 13 | 14 | let _parent: Parent 15 | var _list = Array() 16 | 17 | init(parent: Parent, observer: O) { 18 | _parent = parent 19 | 20 | super.init(observer: observer) 21 | } 22 | 23 | func on(event: Event) { 24 | switch event { 25 | case .Next(let value): 26 | self._list.append(value) 27 | case .Error(let e): 28 | forwardOn(.Error(e)) 29 | self.dispose() 30 | case .Completed: 31 | forwardOn(.Next(_list)) 32 | forwardOn(.Completed) 33 | self.dispose() 34 | } 35 | } 36 | } 37 | 38 | class ToArray : Producer<[SourceType]> { 39 | let _source: Observable 40 | 41 | init(source: Observable) { 42 | _source = source 43 | } 44 | 45 | override func run(observer: O) -> Disposable { 46 | let sink = ToArraySink(parent: self, observer: observer) 47 | sink.disposable = _source.subscribe(sink) 48 | return sink 49 | } 50 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIView+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Rx.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/6/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | extension UIView { 18 | /** 19 | Bindable sink for `hidden` property. 20 | */ 21 | public var rx_hidden: AnyObserver { 22 | return AnyObserver { [weak self] event in 23 | MainScheduler.ensureExecutingOnScheduler() 24 | 25 | switch event { 26 | case .Next(let value): 27 | self?.hidden = value 28 | case .Error(let error): 29 | bindingErrorToInterface(error) 30 | break 31 | case .Completed: 32 | break 33 | } 34 | } 35 | } 36 | 37 | /** 38 | Bindable sink for `alpha` property. 39 | */ 40 | public var rx_alpha: AnyObserver { 41 | return AnyObserver { [weak self] event in 42 | MainScheduler.ensureExecutingOnScheduler() 43 | 44 | switch event { 45 | case .Next(let value): 46 | self?.alpha = value 47 | case .Error(let error): 48 | bindingErrorToInterface(error) 49 | break 50 | case .Completed: 51 | break 52 | } 53 | } 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Platform/Platform.Darwin.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Platform.Darwin.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 12/29/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(OSX) || os(iOS) || os(tvOS) || os(watchOS) 10 | 11 | import Darwin 12 | import Foundation 13 | 14 | #if TRACE_RESOURCES 15 | public typealias AtomicInt = Int32 16 | #else 17 | typealias AtomicInt = Int32 18 | #endif 19 | 20 | let AtomicCompareAndSwap = OSAtomicCompareAndSwap32 21 | let AtomicIncrement = OSAtomicIncrement32 22 | let AtomicDecrement = OSAtomicDecrement32 23 | 24 | extension NSThread { 25 | static func setThreadLocalStorageValue(value: T?, forKey key: protocol) { 26 | let currentThread = NSThread.currentThread() 27 | let threadDictionary = currentThread.threadDictionary 28 | 29 | if let newValue = value { 30 | threadDictionary.setObject(newValue, forKey: key) 31 | } 32 | else { 33 | threadDictionary.removeObjectForKey(key) 34 | } 35 | 36 | } 37 | static func getThreadLocalStorageValueForKey(key: protocol) -> T? { 38 | let currentThread = NSThread.currentThread() 39 | let threadDictionary = currentThread.threadDictionary 40 | 41 | return threadDictionary[key] as? T 42 | } 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Do.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Do.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DoSink : Sink, ObserverType { 12 | typealias Element = O.E 13 | typealias Parent = Do 14 | 15 | private let _parent: Parent 16 | 17 | init(parent: Parent, observer: O) { 18 | _parent = parent 19 | super.init(observer: observer) 20 | } 21 | 22 | func on(event: Event) { 23 | do { 24 | try _parent._eventHandler(event) 25 | forwardOn(event) 26 | if event.isStopEvent { 27 | dispose() 28 | } 29 | } 30 | catch let error { 31 | forwardOn(.Error(error)) 32 | dispose() 33 | } 34 | } 35 | } 36 | 37 | class Do : Producer { 38 | typealias EventHandler = Event throws -> Void 39 | 40 | private let _source: Observable 41 | private let _eventHandler: EventHandler 42 | 43 | init(source: Observable, eventHandler: EventHandler) { 44 | _source = source 45 | _eventHandler = eventHandler 46 | } 47 | 48 | override func run(observer: O) -> Disposable { 49 | let sink = DoSink(parent: self, observer: observer) 50 | sink.disposable = _source.subscribe(sink) 51 | return sink 52 | } 53 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/MJFoundation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJFoundation.m 3 | // MJExtensionExample 4 | // 5 | // Created by MJ Lee on 14/7/16. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJFoundation.h" 10 | #import "MJExtensionConst.h" 11 | #import 12 | 13 | static NSSet *foundationClasses_; 14 | 15 | @implementation MJFoundation 16 | 17 | + (NSSet *)foundationClasses 18 | { 19 | if (foundationClasses_ == nil) { 20 | // 集合中没有NSObject,因为几乎所有的类都是继承自NSObject,具体是不是NSObject需要特殊判断 21 | foundationClasses_ = [NSSet setWithObjects: 22 | [NSURL class], 23 | [NSDate class], 24 | [NSValue class], 25 | [NSData class], 26 | [NSError class], 27 | [NSArray class], 28 | [NSDictionary class], 29 | [NSString class], 30 | [NSAttributedString class], nil]; 31 | } 32 | return foundationClasses_; 33 | } 34 | 35 | + (BOOL)isClassFromFoundation:(Class)c 36 | { 37 | if (c == [NSObject class] || c == [NSManagedObject class]) return YES; 38 | 39 | __block BOOL result = NO; 40 | [[self foundationClasses] enumerateObjectsUsingBlock:^(Class foundationClass, BOOL *stop) { 41 | if ([c isSubclassOfClass:foundationClass]) { 42 | result = YES; 43 | *stop = YES; 44 | } 45 | }]; 46 | return result; 47 | } 48 | @end 49 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UILabel+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 4/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UILabel { 18 | 19 | /** 20 | Bindable sink for `text` property. 21 | */ 22 | public var rx_text: AnyObserver { 23 | return AnyObserver { [weak self] event in 24 | MainScheduler.ensureExecutingOnScheduler() 25 | 26 | switch event { 27 | case .Next(let value): 28 | self?.text = value 29 | case .Error(let error): 30 | bindingErrorToInterface(error) 31 | break 32 | case .Completed: 33 | break 34 | } 35 | } 36 | } 37 | 38 | /** 39 | Bindable sink for `attributedText` property. 40 | */ 41 | public var rx_attributedText: AnyObserver { 42 | return AnyObserver { [weak self] event in 43 | MainScheduler.ensureExecutingOnScheduler() 44 | 45 | switch event { 46 | case .Next(let value): 47 | self?.attributedText = value 48 | case .Error(let error): 49 | bindingErrorToInterface(error) 50 | break 51 | case .Completed: 52 | break 53 | } 54 | } 55 | } 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /RxGitHubAPI/RxGitHubAPI/YYIssue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // YYIssue.swift 3 | // RxGitHub 4 | // 5 | // Created by 邓锋 on 16/1/26. 6 | // Copyright © 2016年 fengdeng. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class YYIssue : NSObject{ 12 | public private(set) var id = 0 13 | public private(set) var html_url = "" 14 | public private(set) var title = "" 15 | public private(set) var user = YYUser() 16 | public private(set) var state = "" 17 | public private(set) var created_at = "" 18 | public private(set) var updated_at = "" 19 | public private(set) var closed_at = "" 20 | public private(set) var body = "" 21 | public private(set) var comments = 0 22 | public private(set) var locked = false 23 | public private(set) var closed_by = "" 24 | public private(set) var number = 0 25 | 26 | public private(set) var assignee = YYUser() 27 | public private(set) var pull_request = YYIssuePullRequest() 28 | public private(set) var labels = [YYLabel]() 29 | 30 | //api 31 | var url = "" 32 | var labels_url = "" 33 | var comments_url = "" 34 | var events_url = "" 35 | 36 | } 37 | 38 | public class YYIssuePullRequest : NSObject{ 39 | public private(set) var html_url = "" 40 | public private(set) var diff_url = "" 41 | public private(set) var patch_url = "" 42 | 43 | //api 44 | var url = "" 45 | 46 | } 47 | 48 | 49 | public class YYLabel : NSObject{ 50 | public private(set) var name = "" 51 | public private(set) var color = "" 52 | 53 | //api 54 | var url = "" 55 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BinaryDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents two disposable resources that are disposed together. 13 | */ 14 | public final class BinaryDisposable : DisposeBase, Cancelable { 15 | 16 | private var _disposed: AtomicInt = 0 17 | 18 | // state 19 | private var _disposable1: Disposable? 20 | private var _disposable2: Disposable? 21 | 22 | /** 23 | - returns: Was resource disposed. 24 | */ 25 | public var disposed: Bool { 26 | get { 27 | return _disposed > 0 28 | } 29 | } 30 | 31 | /** 32 | Constructs new binary disposable from two disposables. 33 | 34 | - parameter disposable1: First disposable 35 | - parameter disposable2: Second disposable 36 | */ 37 | init(_ disposable1: Disposable, _ disposable2: Disposable) { 38 | _disposable1 = disposable1 39 | _disposable2 = disposable2 40 | super.init() 41 | } 42 | 43 | /** 44 | Calls the disposal action if and only if the current instance hasn't been disposed yet. 45 | 46 | After invoking disposal action, disposal action will be dereferenced. 47 | */ 48 | public func dispose() { 49 | if AtomicCompareAndSwap(0, 1, &_disposed) { 50 | _disposable1?.dispose() 51 | _disposable2?.dispose() 52 | _disposable1 = nil 53 | _disposable2 = nil 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/DelaySubscription.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DelaySubscription.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DelaySubscriptionSink 12 | : Sink 13 | , ObserverType { 14 | typealias Parent = DelaySubscription 15 | typealias E = O.E 16 | 17 | private let _parent: Parent 18 | 19 | init(parent: Parent, observer: O) { 20 | _parent = parent 21 | super.init(observer: observer) 22 | } 23 | 24 | func on(event: Event) { 25 | forwardOn(event) 26 | if event.isStopEvent { 27 | dispose() 28 | } 29 | } 30 | 31 | } 32 | 33 | class DelaySubscription: Producer { 34 | private let _source: Observable 35 | private let _dueTime: RxTimeInterval 36 | private let _scheduler: SchedulerType 37 | 38 | init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { 39 | _source = source 40 | _dueTime = dueTime 41 | _scheduler = scheduler 42 | } 43 | 44 | override func run(observer: O) -> Disposable { 45 | let sink = DelaySubscriptionSink(parent: self, observer: observer) 46 | sink.disposable = _scheduler.scheduleRelative((), dueTime: _dueTime) { _ in 47 | return self._source.subscribe(sink) 48 | } 49 | 50 | return sink 51 | } 52 | } -------------------------------------------------------------------------------- /.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 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousDisposable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/15/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents an Action-based disposable. 13 | 14 | When dispose method is called, disposal action will be dereferenced. 15 | */ 16 | public final class AnonymousDisposable : DisposeBase, Cancelable { 17 | public typealias DisposeAction = () -> Void 18 | 19 | private var _disposed: AtomicInt = 0 20 | private var _disposeAction: DisposeAction? 21 | 22 | /** 23 | - returns: Was resource disposed. 24 | */ 25 | public var disposed: Bool { 26 | get { 27 | return _disposed == 1 28 | } 29 | } 30 | 31 | /** 32 | Constructs a new disposable with the given action used for disposal. 33 | 34 | - parameter disposeAction: Disposal action which will be run upon calling `dispose`. 35 | */ 36 | public init(_ disposeAction: DisposeAction) { 37 | _disposeAction = disposeAction 38 | super.init() 39 | } 40 | 41 | /** 42 | Calls the disposal action if and only if the current instance hasn't been disposed yet. 43 | 44 | After invoking disposal action, disposal action will be dereferenced. 45 | */ 46 | public func dispose() { 47 | if AtomicCompareAndSwap(0, 1, &_disposed) { 48 | assert(_disposed == 1) 49 | 50 | if let action = _disposeAction { 51 | _disposeAction = nil 52 | action() 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/_RXKVOObserver.m: -------------------------------------------------------------------------------- 1 | // 2 | // _RXKVOObserver.m 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/11/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #import "_RXKVOObserver.h" 10 | 11 | @interface _RXKVOObserver () 12 | 13 | @property (nonatomic, unsafe_unretained) id target; 14 | @property (nonatomic, strong ) id retainedTarget; 15 | @property (nonatomic, copy ) NSString *keyPath; 16 | @property (nonatomic, copy ) KVOCallback callback; 17 | 18 | @end 19 | 20 | @implementation _RXKVOObserver 21 | 22 | -(instancetype)initWithTarget:(id)target 23 | retainTarget:(BOOL)retainTarget 24 | keyPath:(NSString*)keyPath 25 | options:(NSKeyValueObservingOptions)options 26 | callback:(void (^)(id))callback { 27 | self = [super init]; 28 | if (!self) return nil; 29 | 30 | self.target = target; 31 | if (retainTarget) { 32 | self.retainedTarget = target; 33 | } 34 | self.keyPath = keyPath; 35 | self.callback = callback; 36 | 37 | [self.target addObserver:self forKeyPath:self.keyPath options:options context:nil]; 38 | 39 | return self; 40 | } 41 | 42 | -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 43 | self.callback(change[NSKeyValueChangeNewKey]); 44 | } 45 | 46 | -(void)dispose { 47 | [self.target removeObserver:self forKeyPath:self.keyPath context:nil]; 48 | self.target = nil; 49 | self.retainedTarget = nil; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImmediateSchedulerType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 5/31/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents an object that immediately schedules units of work. 13 | */ 14 | public protocol ImmediateSchedulerType { 15 | /** 16 | Schedules an action to be executed immediatelly. 17 | 18 | - parameter state: State passed to the action to be executed. 19 | - parameter action: Action to be executed. 20 | - returns: The disposable object used to cancel the scheduled action (best effort). 21 | */ 22 | func schedule(state: StateType, action: (StateType) -> Disposable) -> Disposable 23 | } 24 | 25 | extension ImmediateSchedulerType { 26 | /** 27 | Schedules an action to be executed recursively. 28 | 29 | - parameter state: State passed to the action to be executed. 30 | - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. 31 | - returns: The disposable object used to cancel the scheduled action (best effort). 32 | */ 33 | public func scheduleRecursive(state: State, action: (state: State, recurse: (State) -> ()) -> ()) -> Disposable { 34 | let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) 35 | 36 | recursiveScheduler.schedule(state) 37 | 38 | return AnonymousDisposable { 39 | recursiveScheduler.dispose() 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RxGitHubAPI/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 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UISearchBar+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UISearchBar+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | 18 | 19 | extension UISearchBar { 20 | 21 | /** 22 | Reactive wrapper for `delegate`. 23 | 24 | For more information take a look at `DelegateProxyType` protocol documentation. 25 | */ 26 | public var rx_delegate: DelegateProxy { 27 | return proxyForObject(RxSearchBarDelegateProxy.self, self) 28 | } 29 | 30 | /** 31 | Reactive wrapper for `text` property. 32 | */ 33 | public var rx_text: ControlProperty { 34 | let source: Observable = Observable.deferred { [weak self] () -> Observable in 35 | let text = self?.text ?? "" 36 | 37 | return (self?.rx_delegate.observe("searchBar:textDidChange:") ?? Observable.empty()) 38 | .map { a in 39 | return a[1] as? String ?? "" 40 | } 41 | .startWith(text) 42 | } 43 | 44 | return ControlProperty(values: source, valueSink: AnyObserver { [weak self] event in 45 | switch event { 46 | case .Next(let value): 47 | self?.text = value 48 | case .Error(let error): 49 | bindingErrorToInterface(error) 50 | case .Completed: 51 | break 52 | } 53 | }) 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/AnonymousObservable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnonymousObservable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class AnonymousObservableSink : Sink, ObserverType { 12 | typealias E = O.E 13 | typealias Parent = AnonymousObservable 14 | 15 | // state 16 | private var _isStopped: AtomicInt = 0 17 | 18 | override init(observer: O) { 19 | super.init(observer: observer) 20 | } 21 | 22 | func on(event: Event) { 23 | switch event { 24 | case .Next: 25 | if _isStopped == 1 { 26 | return 27 | } 28 | forwardOn(event) 29 | case .Error, .Completed: 30 | if AtomicCompareAndSwap(0, 1, &_isStopped) { 31 | forwardOn(event) 32 | dispose() 33 | } 34 | } 35 | } 36 | 37 | func run(parent: Parent) -> Disposable { 38 | return parent._subscribeHandler(AnyObserver(self)) 39 | } 40 | } 41 | 42 | class AnonymousObservable : Producer { 43 | typealias SubscribeHandler = (AnyObserver) -> Disposable 44 | 45 | let _subscribeHandler: SubscribeHandler 46 | 47 | init(_ subscribeHandler: SubscribeHandler) { 48 | _subscribeHandler = subscribeHandler 49 | } 50 | 51 | override func run(observer: O) -> Disposable { 52 | let sink = AnonymousObservableSink(observer: observer) 53 | sink.disposable = sink.run(self) 54 | return sink 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/NSObject+Rx+KVORepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Rx+KVORepresentable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension NSObject { 15 | 16 | /** 17 | Specialization of generic `rx_observe` method. 18 | 19 | This is a special overload because to observe values of some type (for example `Int`), first values of KVO type 20 | need to be observed (`NSNumber`), and then converted to result type. 21 | 22 | For more information take a look at `rx_observe` method. 23 | */ 24 | @warn_unused_result(message="http://git.io/rxs.uo") 25 | public func rx_observe(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial], retainSelf: Bool = true) -> Observable { 26 | return rx_observe(E.KVOType.self, keyPath, options: options, retainSelf: retainSelf) 27 | .map(E.init) 28 | } 29 | } 30 | 31 | #if !DISABLE_SWIZZLING 32 | // KVO 33 | extension NSObject { 34 | /** 35 | Specialization of generic `rx_observeWeakly` method. 36 | 37 | For more information take a look at `rx_observeWeakly` method. 38 | */ 39 | @warn_unused_result(message="http://git.io/rxs.uo") 40 | public func rx_observeWeakly(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial]) -> Observable { 41 | return rx_observeWeakly(E.KVOType.self, keyPath, options: options) 42 | .map(E.init) 43 | } 44 | } 45 | #endif 46 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RxTextViewDelegateProxy.swift 3 | // RxCocoa 4 | // 5 | // Created by Yuta ToKoRo on 7/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | /** 18 | For more information take a look at `DelegateProxyType`. 19 | */ 20 | public class RxTextViewDelegateProxy 21 | : RxScrollViewDelegateProxy 22 | , UITextViewDelegate { 23 | 24 | /** 25 | Typed parent object. 26 | */ 27 | public weak private(set) var textView: UITextView? 28 | 29 | /** 30 | Initializes `RxTextViewDelegateProxy` 31 | 32 | - parameter parentObject: Parent object for delegate proxy. 33 | */ 34 | public required init(parentObject: AnyObject) { 35 | self.textView = (parentObject as! UITextView) 36 | super.init(parentObject: parentObject) 37 | } 38 | 39 | // MARK: delegate methods 40 | 41 | /** 42 | For more information take a look at `DelegateProxyType`. 43 | */ 44 | @objc public func textView(textView: UITextView, shouldChangeTextInRange range: NSRange, replacementText text: String) -> Bool { 45 | /** 46 | We've had some issues with observing text changes. This is here just in case we need the same hack in future and that 47 | we wouldn't need to change the public interface. 48 | */ 49 | let forwardToDelegate = self.forwardToDelegate() as? UITextViewDelegate 50 | return forwardToDelegate?.textView?(textView, 51 | shouldChangeTextInRange: range, 52 | replacementText: text) ?? true 53 | } 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /RxGitHubAPI/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 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Deferred.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 4/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class DeferredSink : Sink, ObserverType { 12 | typealias E = O.E 13 | 14 | private let _observableFactory: () throws -> S 15 | 16 | init(observableFactory: () throws -> S, observer: O) { 17 | _observableFactory = observableFactory 18 | super.init(observer: observer) 19 | } 20 | 21 | func run() -> Disposable { 22 | do { 23 | let result = try _observableFactory() 24 | return result.subscribe(self) 25 | } 26 | catch let e { 27 | forwardOn(.Error(e)) 28 | dispose() 29 | return NopDisposable.instance 30 | } 31 | } 32 | 33 | func on(event: Event) { 34 | forwardOn(event) 35 | 36 | switch event { 37 | case .Next: 38 | break 39 | case .Error: 40 | dispose() 41 | case .Completed: 42 | dispose() 43 | } 44 | } 45 | } 46 | 47 | class Deferred : Producer { 48 | typealias Factory = () throws -> S 49 | 50 | private let _observableFactory : Factory 51 | 52 | init(observableFactory: Factory) { 53 | _observableFactory = observableFactory 54 | } 55 | 56 | override func run(observer: O) -> Disposable { 57 | let sink = DeferredSink(observableFactory: _observableFactory, observer: observer) 58 | sink.disposable = sink.run() 59 | return sink 60 | } 61 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Sequence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Sequence.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SequenceSink : Sink { 12 | typealias Parent = Sequence 13 | 14 | private let _parent: Parent 15 | 16 | init(parent: Parent, observer: O) { 17 | _parent = parent 18 | super.init(observer: observer) 19 | } 20 | 21 | func run() -> Disposable { 22 | return _parent._scheduler!.scheduleRecursive((0, _parent._elements)) { (state, recurse) in 23 | if state.0 < state.1.count { 24 | self.forwardOn(.Next(state.1[state.0])) 25 | recurse((state.0 + 1, state.1)) 26 | } 27 | else { 28 | self.forwardOn(.Completed) 29 | } 30 | } 31 | } 32 | } 33 | 34 | class Sequence : Producer { 35 | private let _elements: [E] 36 | private let _scheduler: ImmediateSchedulerType? 37 | 38 | init(elements: [E], scheduler: ImmediateSchedulerType?) { 39 | _elements = elements 40 | _scheduler = scheduler 41 | } 42 | 43 | override func subscribe(observer: O) -> Disposable { 44 | // optimized version without scheduler 45 | guard _scheduler != nil else { 46 | for element in _elements { 47 | observer.on(.Next(element)) 48 | } 49 | 50 | observer.on(.Completed) 51 | return NopDisposable.instance 52 | } 53 | 54 | let sink = SequenceSink(parent: self, observer: observer) 55 | sink.disposable = sink.run() 56 | return sink 57 | } 58 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Range.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Range.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 9/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class RangeProducer : Producer { 12 | private let _start: E 13 | private let _count: E 14 | private let _scheduler: ImmediateSchedulerType 15 | 16 | init(start: E, count: E, scheduler: ImmediateSchedulerType) { 17 | if count < 0 { 18 | rxFatalError("count can't be negative") 19 | } 20 | 21 | if start &+ (count - 1) < start { 22 | rxFatalError("overflow of count") 23 | } 24 | 25 | _start = start 26 | _count = count 27 | _scheduler = scheduler 28 | } 29 | 30 | override func run(observer: O) -> Disposable { 31 | let sink = RangeSink(parent: self, observer: observer) 32 | sink.disposable = sink.run() 33 | return sink 34 | } 35 | } 36 | 37 | class RangeSink : Sink { 38 | typealias Parent = RangeProducer 39 | 40 | private let _parent: Parent 41 | 42 | init(parent: Parent, observer: O) { 43 | _parent = parent 44 | super.init(observer: observer) 45 | } 46 | 47 | func run() -> Disposable { 48 | return _parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in 49 | if i < self._parent._count { 50 | self.forwardOn(.Next(self._parent._start + i)) 51 | recurse(i + 1) 52 | } 53 | else { 54 | self.forwardOn(.Completed) 55 | self.dispose() 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Subjects/Variable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Variable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Variable is a wrapper for `BehaviorSubject`. 13 | 14 | Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated 15 | it will complete it's observable sequence (`asObservable`). 16 | */ 17 | public class Variable { 18 | 19 | public typealias E = Element 20 | 21 | private let _subject: BehaviorSubject 22 | 23 | private var _lock = SpinLock() 24 | 25 | // state 26 | private var _value: E 27 | 28 | /** 29 | Gets or sets current value of variable. 30 | 31 | If case new value is set, all observers are notified of that change. 32 | 33 | Even is case equal value is set, observers will still be notified. 34 | */ 35 | public var value: E { 36 | get { 37 | _lock.lock(); defer { _lock.unlock() } 38 | return _value 39 | } 40 | set(newValue) { 41 | _lock.lock() 42 | _value = newValue 43 | _lock.unlock() 44 | 45 | _subject.on(.Next(newValue)) 46 | } 47 | } 48 | 49 | /** 50 | Initializes variable with initial value. 51 | 52 | - parameter value: Initial variable value. 53 | */ 54 | public init(_ value: Element) { 55 | _value = value 56 | _subject = BehaviorSubject(value: value) 57 | } 58 | 59 | /** 60 | - returns: Canonical interface for push style sequence 61 | */ 62 | public func asObservable() -> Observable { 63 | return _subject 64 | } 65 | 66 | deinit { 67 | _subject.on(.Completed) 68 | } 69 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScheduledDisposable.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/13/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | private let disposeScheduledDisposable: ScheduledDisposable -> Disposable = { sd in 12 | sd.disposeInner() 13 | return NopDisposable.instance 14 | } 15 | 16 | /** 17 | Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. 18 | */ 19 | public class ScheduledDisposable : Cancelable { 20 | public let scheduler: ImmediateSchedulerType 21 | 22 | private var _disposed: AtomicInt = 0 23 | 24 | // state 25 | private var _disposable: Disposable? 26 | 27 | /** 28 | - returns: Was resource disposed. 29 | */ 30 | public var disposed: Bool { 31 | get { 32 | return _disposed == 1 33 | } 34 | } 35 | 36 | /** 37 | Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. 38 | 39 | - parameter scheduler: Scheduler where the disposable resource will be disposed on. 40 | - parameter disposable: Disposable resource to dispose on the given scheduler. 41 | */ 42 | init(scheduler: ImmediateSchedulerType, disposable: Disposable) { 43 | self.scheduler = scheduler 44 | _disposable = disposable 45 | } 46 | 47 | /** 48 | Disposes the wrapped disposable on the provided scheduler. 49 | */ 50 | public func dispose() { 51 | scheduler.schedule(self, action: disposeScheduledDisposable) 52 | } 53 | 54 | func disposeInner() { 55 | if AtomicCompareAndSwap(0, 1, &_disposed) { 56 | _disposable!.dispose() 57 | _disposable = nil 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UITextView+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Yuta ToKoRo on 7/19/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | import UIKit 13 | #if !RX_NO_MODULE 14 | import RxSwift 15 | #endif 16 | 17 | 18 | 19 | extension UITextView { 20 | 21 | /** 22 | Factory method that enables subclasses to implement their own `rx_delegate`. 23 | 24 | - returns: Instance of delegate proxy that wraps `delegate`. 25 | */ 26 | public override func rx_createDelegateProxy() -> RxScrollViewDelegateProxy { 27 | return RxTextViewDelegateProxy(parentObject: self) 28 | } 29 | 30 | /** 31 | Reactive wrapper for `text` property. 32 | */ 33 | public var rx_text: ControlProperty { 34 | let source: Observable = Observable.deferred { [weak self] in 35 | let text = self?.text ?? "" 36 | 37 | let textChanged = self?.textStorage 38 | .rx_didProcessEditingRangeChangeInLength 39 | .map { _ in 40 | return self?.textStorage.string ?? "" 41 | } 42 | ?? Observable.empty() 43 | 44 | return textChanged 45 | .startWith(text) 46 | .distinctUntilChanged() 47 | } 48 | 49 | return ControlProperty(values: source, valueSink: AnyObserver { [weak self] event in 50 | switch event { 51 | case .Next(let value): 52 | self?.text = value 53 | case .Error(let error): 54 | bindingErrorToInterface(error) 55 | case .Completed: 56 | break 57 | } 58 | }) 59 | } 60 | 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Filter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Filter.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/17/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class FilterSink: Sink, ObserverType { 12 | typealias Predicate = (Element) throws -> Bool 13 | typealias Element = O.E 14 | 15 | typealias Parent = Filter 16 | 17 | private let _predicate: Predicate 18 | 19 | init(predicate: Predicate, observer: O) { 20 | _predicate = predicate 21 | super.init(observer: observer) 22 | } 23 | 24 | func on(event: Event) { 25 | switch event { 26 | case .Next(let value): 27 | do { 28 | let satisfies = try _predicate(value) 29 | if satisfies { 30 | forwardOn(.Next(value)) 31 | } 32 | } 33 | catch let e { 34 | forwardOn(.Error(e)) 35 | dispose() 36 | } 37 | case .Completed, .Error: 38 | forwardOn(event) 39 | dispose() 40 | } 41 | } 42 | } 43 | 44 | class Filter : Producer { 45 | typealias Predicate = (Element) throws -> Bool 46 | 47 | private let _source: Observable 48 | private let _predicate: Predicate 49 | 50 | init(source: Observable, predicate: Predicate) { 51 | _source = source 52 | _predicate = predicate 53 | } 54 | 55 | override func run(observer: O) -> Disposable { 56 | let sink = FilterSink(predicate: _predicate, observer: observer) 57 | sink.disposable = _source.subscribe(sink) 58 | return sink 59 | } 60 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Just.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Just.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 8/30/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class JustScheduledSink : Sink { 12 | typealias Parent = JustScheduled 13 | 14 | private let _parent: Parent 15 | 16 | init(parent: Parent, observer: O) { 17 | _parent = parent 18 | super.init(observer: observer) 19 | } 20 | 21 | func run() -> Disposable { 22 | let scheduler = _parent._scheduler 23 | return scheduler.schedule(_parent._element) { element in 24 | self.forwardOn(.Next(element)) 25 | return scheduler.schedule(()) { _ in 26 | self.forwardOn(.Completed) 27 | return NopDisposable.instance 28 | } 29 | } 30 | } 31 | } 32 | 33 | class JustScheduled : Producer { 34 | private let _scheduler: ImmediateSchedulerType 35 | private let _element: Element 36 | 37 | init(element: Element, scheduler: ImmediateSchedulerType) { 38 | _scheduler = scheduler 39 | _element = element 40 | } 41 | 42 | override func subscribe(observer: O) -> Disposable { 43 | let sink = JustScheduledSink(parent: self, observer: observer) 44 | sink.disposable = sink.run() 45 | return sink 46 | } 47 | } 48 | 49 | class Just : Producer { 50 | private let _element: Element 51 | 52 | init(element: Element) { 53 | _element = element 54 | } 55 | 56 | override func subscribe(observer: O) -> Disposable { 57 | observer.on(.Next(_element)) 58 | observer.on(.Completed) 59 | return NopDisposable.instance 60 | } 61 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Errors.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Errors.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | let RxErrorDomain = "RxErrorDomain" 12 | let RxCompositeFailures = "RxCompositeFailures" 13 | 14 | /** 15 | Generic Rx error codes. 16 | */ 17 | public enum RxError 18 | : ErrorType 19 | , CustomDebugStringConvertible { 20 | /** 21 | Unknown error occured. 22 | */ 23 | case Unknown 24 | /** 25 | Performing an action on disposed object. 26 | */ 27 | case Disposed(object: AnyObject) 28 | /** 29 | Aritmetic overflow error. 30 | */ 31 | case Overflow 32 | /** 33 | Argument out of range error. 34 | */ 35 | case ArgumentOutOfRange 36 | /** 37 | Sequence doesn't contain any element. 38 | */ 39 | case NoElements 40 | /** 41 | Sequence contains more then one element. 42 | */ 43 | case MoreThanOneElement 44 | /** 45 | Timeout error. 46 | */ 47 | case Timeout 48 | } 49 | 50 | public extension RxError { 51 | /** 52 | A textual representation of `self`, suitable for debugging. 53 | */ 54 | public var debugDescription: String { 55 | switch self { 56 | case .Unknown: 57 | return "Unknown error occured." 58 | case .Disposed(let object): 59 | return "Object `\(object)` was already disposed." 60 | case .Overflow: 61 | return "Arithmetic overflow occured." 62 | case .ArgumentOutOfRange: 63 | return "Argument out of range." 64 | case .NoElements: 65 | return "Sequence doesn't contain any element." 66 | case .MoreThanOneElement: 67 | return "Sequence contains more then one element." 68 | case .Timeout: 69 | return "Sequence timeout" 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/ObservableType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObservableType.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 8/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | Represents a push style sequence. 13 | */ 14 | public protocol ObservableType : ObservableConvertibleType { 15 | /** 16 | Type of elements in sequence. 17 | */ 18 | typealias E 19 | 20 | /** 21 | Subscribes `observer` to receive events for this sequence. 22 | 23 | ### Grammar 24 | 25 | **Next\* (Error | Completed)?** 26 | 27 | * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` 28 | * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other element 29 | 30 | It is possible that events are sent from different threads, but no two events can be sent concurrently to 31 | `observer`. 32 | 33 | ### Resource Management 34 | 35 | When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements 36 | will be freed. 37 | 38 | To cancel production of sequence elements and free resources immediatelly, call `dispose` on returned 39 | subscription. 40 | 41 | - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. 42 | */ 43 | @warn_unused_result(message="http://git.io/rxs.ud") 44 | func subscribe(observer: O) -> Disposable 45 | 46 | } 47 | 48 | extension ObservableType { 49 | 50 | /** 51 | Default implementation of converting `ObservableType` to `Observable`. 52 | */ 53 | @warn_unused_result(message="http://git.io/rxs.uo") 54 | public func asObservable() -> Observable { 55 | return Observable.create(self.subscribe) 56 | } 57 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/TakeLast.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TakeLast.swift 3 | // Rx 4 | // 5 | // Created by Tomi Koskinen on 25/10/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class TakeLastSink : Sink, ObserverType { 13 | typealias Parent = TakeLast 14 | typealias E = ElementType 15 | 16 | private let _parent: Parent 17 | 18 | private var _elements: Queue 19 | 20 | init(parent: Parent, observer: O) { 21 | _parent = parent 22 | _elements = Queue(capacity: parent._count + 1) 23 | super.init(observer: observer) 24 | } 25 | 26 | func on(event: Event) { 27 | switch event { 28 | case .Next(let value): 29 | _elements.enqueue(value) 30 | if _elements.count > self._parent._count { 31 | _elements.dequeue() 32 | } 33 | case .Error: 34 | forwardOn(event) 35 | dispose() 36 | case .Completed: 37 | for e in _elements { 38 | forwardOn(.Next(e)) 39 | } 40 | forwardOn(.Completed) 41 | dispose() 42 | } 43 | } 44 | } 45 | 46 | class TakeLast: Producer { 47 | private let _source: Observable 48 | private let _count: Int 49 | 50 | init(source: Observable, count: Int) { 51 | if count < 0 { 52 | rxFatalError("count can't be negative") 53 | } 54 | _source = source 55 | _count = count 56 | } 57 | 58 | override func run(observer: O) -> Disposable { 59 | let sink = TakeLastSink(parent: self, observer: observer) 60 | sink.disposable = _source.subscribe(sink) 61 | return sink 62 | } 63 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Concat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Concat.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 3/21/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class ConcatSink 13 | : TailRecursiveSink 14 | , ObserverType { 15 | typealias Element = O.E 16 | 17 | override init(observer: O) { 18 | super.init(observer: observer) 19 | } 20 | 21 | func on(event: Event){ 22 | switch event { 23 | case .Next: 24 | forwardOn(event) 25 | case .Error: 26 | forwardOn(event) 27 | dispose() 28 | case .Completed: 29 | schedule(.MoveNext) 30 | } 31 | } 32 | 33 | override func subscribeToNext(source: Observable) -> Disposable { 34 | return source.subscribe(self) 35 | } 36 | 37 | override func extract(observable: Observable) -> SequenceGenerator? { 38 | if let source = observable as? Concat { 39 | return (source._sources.generate(), source._count) 40 | } 41 | else { 42 | return nil 43 | } 44 | } 45 | } 46 | 47 | class Concat : Producer { 48 | typealias Element = S.Generator.Element.E 49 | 50 | private let _sources: S 51 | private let _count: IntMax? 52 | 53 | init(sources: S, count: IntMax?) { 54 | _sources = sources 55 | _count = count 56 | } 57 | 58 | override func run(observer: O) -> Disposable { 59 | let sink = ConcatSink(observer: observer) 60 | sink.disposable = sink.run((_sources.generate(), _count)) 61 | return sink 62 | } 63 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/iOS/UIImageView+Rx.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Rx.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 4/1/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import Foundation 12 | #if !RX_NO_MODULE 13 | import RxSwift 14 | #endif 15 | import UIKit 16 | 17 | extension UIImageView { 18 | 19 | /** 20 | Bindable sink for `image` property. 21 | */ 22 | public var rx_image: AnyObserver { 23 | return self.rx_imageAnimated(nil) 24 | } 25 | 26 | /** 27 | Bindable sink for `image` property. 28 | 29 | - parameter transitionType: Optional transition type while setting the image (kCATransitionFade, kCATransitionMoveIn, ...) 30 | */ 31 | public func rx_imageAnimated(transitionType: String?) -> AnyObserver { 32 | return AnyObserver { [weak self] event in 33 | MainScheduler.ensureExecutingOnScheduler() 34 | 35 | switch event { 36 | case .Next(let value): 37 | if let transitionType = transitionType { 38 | if value != nil { 39 | let transition = CATransition() 40 | transition.duration = 0.25 41 | transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 42 | transition.type = transitionType 43 | self?.layer.addAnimation(transition, forKey: kCATransition) 44 | } 45 | } 46 | else { 47 | self?.layer.removeAllAnimations() 48 | } 49 | self?.image = value 50 | case .Error(let error): 51 | bindingErrorToInterface(error) 52 | break 53 | case .Completed: 54 | break 55 | } 56 | } 57 | } 58 | 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/SubscribeOn.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SubscribeOn.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class SubscribeOnSink : Sink, ObserverType { 12 | typealias Element = O.E 13 | typealias Parent = SubscribeOn 14 | 15 | let parent: Parent 16 | 17 | init(parent: Parent, observer: O) { 18 | self.parent = parent 19 | super.init(observer: observer) 20 | } 21 | 22 | func on(event: Event) { 23 | forwardOn(event) 24 | 25 | if event.isStopEvent { 26 | self.dispose() 27 | } 28 | } 29 | 30 | func run() -> Disposable { 31 | let disposeEverything = SerialDisposable() 32 | let cancelSchedule = SingleAssignmentDisposable() 33 | 34 | disposeEverything.disposable = cancelSchedule 35 | 36 | cancelSchedule.disposable = parent.scheduler.schedule(()) { (_) -> Disposable in 37 | let subscription = self.parent.source.subscribe(self) 38 | disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) 39 | return NopDisposable.instance 40 | } 41 | 42 | return disposeEverything 43 | } 44 | } 45 | 46 | class SubscribeOn : Producer { 47 | let source: Ob 48 | let scheduler: ImmediateSchedulerType 49 | 50 | init(source: Ob, scheduler: ImmediateSchedulerType) { 51 | self.source = source 52 | self.scheduler = scheduler 53 | } 54 | 55 | override func run(observer: O) -> Disposable { 56 | let sink = SubscribeOnSink(parent: self, observer: observer) 57 | sink.disposable = sink.run() 58 | return sink 59 | } 60 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/KVORepresentable+CoreGraphics.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KVORepresentable+CoreGraphics.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | import CoreGraphics 14 | 15 | #if arch(x86_64) || arch(arm64) 16 | let CGRectType = "{CGRect={CGPoint=dd}{CGSize=dd}}" 17 | let CGSizeType = "{CGSize=dd}" 18 | let CGPointType = "{CGPoint=dd}" 19 | #elseif arch(i386) || arch(arm) 20 | let CGRectType = "{CGRect={CGPoint=ff}{CGSize=ff}}" 21 | let CGSizeType = "{CGSize=ff}" 22 | let CGPointType = "{CGPoint=ff}" 23 | #endif 24 | 25 | extension CGRect : KVORepresentable { 26 | public typealias KVOType = NSValue 27 | 28 | /** 29 | Constructs self from `NSValue`. 30 | */ 31 | public init?(KVOValue: KVOType) { 32 | if strcmp(KVOValue.objCType, CGRectType) != 0 { 33 | return nil 34 | } 35 | var typedValue = CGRect(x: 0, y: 0, width: 0, height: 0) 36 | KVOValue.getValue(&typedValue) 37 | self = typedValue 38 | } 39 | } 40 | 41 | extension CGPoint : KVORepresentable { 42 | public typealias KVOType = NSValue 43 | 44 | /** 45 | Constructs self from `NSValue`. 46 | */ 47 | public init?(KVOValue: KVOType) { 48 | if strcmp(KVOValue.objCType, CGPointType) != 0 { 49 | return nil 50 | } 51 | var typedValue = CGPoint(x: 0, y: 0) 52 | KVOValue.getValue(&typedValue) 53 | self = typedValue 54 | } 55 | } 56 | 57 | extension CGSize : KVORepresentable { 58 | public typealias KVOType = NSValue 59 | 60 | /** 61 | Constructs self from `NSValue`. 62 | */ 63 | public init?(KVOValue: KVOType) { 64 | if strcmp(KVOValue.objCType, CGSizeType) != 0 { 65 | return nil 66 | } 67 | var typedValue = CGSize(width: 0, height: 0) 68 | KVOValue.getValue(&typedValue) 69 | self = typedValue 70 | } 71 | } -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/Implementations/MessageSentObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MessageSentObserver.swift 3 | // RxCocoa 4 | // 5 | // Created by Krunoslav Zaher on 7/12/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | #if !DISABLE_SWIZZLING 15 | 16 | class DeallocatingObservable 17 | : ObservableConvertibleType 18 | , RXMessageSentObserver { 19 | typealias E = () 20 | 21 | private let _subject = ReplaySubject<()>.create(bufferSize: 1) 22 | 23 | @objc var targetImplementation: IMP = RX_default_target_implementation() 24 | 25 | var isActive: Bool { 26 | return targetImplementation != RX_default_target_implementation() 27 | } 28 | 29 | init() { 30 | } 31 | 32 | @objc func messageSentWithParameters(parameters: [AnyObject]) -> Void { 33 | _subject.on(.Next()) 34 | } 35 | 36 | func asObservable() -> Observable<()> { 37 | return _subject 38 | } 39 | 40 | deinit { 41 | _subject.on(.Completed) 42 | } 43 | } 44 | 45 | class MessageSentObservable 46 | : ObservableConvertibleType 47 | , RXMessageSentObserver { 48 | typealias E = [AnyObject] 49 | 50 | private let _subject = PublishSubject<[AnyObject]>() 51 | 52 | @objc var targetImplementation: IMP = RX_default_target_implementation() 53 | 54 | var isActive: Bool { 55 | return targetImplementation != RX_default_target_implementation() 56 | } 57 | 58 | init() { 59 | } 60 | 61 | @objc func messageSentWithParameters(parameters: [AnyObject]) -> Void { 62 | _subject.on(.Next(parameters)) 63 | } 64 | 65 | func asObservable() -> Observable<[AnyObject]> { 66 | return _subject 67 | } 68 | 69 | deinit { 70 | _subject.on(.Completed) 71 | } 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Pods/RxCocoa/RxCocoa/Common/Observables/NSObject+Rx+RawRepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Rx+RawRepresentable.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 11/9/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | #if !RX_NO_MODULE 11 | import RxSwift 12 | #endif 13 | 14 | extension NSObject { 15 | /** 16 | Specialization of generic `rx_observe` method. 17 | 18 | This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value. 19 | 20 | It is useful for observing bridged ObjC enum values. 21 | 22 | For more information take a look at `rx_observe` method. 23 | */ 24 | @warn_unused_result(message="http://git.io/rxs.uo") 25 | public func rx_observe(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial], retainSelf: Bool = true) -> Observable { 26 | return rx_observe(E.RawValue.KVOType.self, keyPath, options: options, retainSelf: retainSelf) 27 | .map(E.init) 28 | } 29 | } 30 | 31 | #if !DISABLE_SWIZZLING 32 | 33 | // rx_observeWeakly + RawRepresentable 34 | extension NSObject { 35 | 36 | /** 37 | Specialization of generic `rx_observeWeakly` method. 38 | 39 | This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value. 40 | 41 | It is useful for observing bridged ObjC enum values. 42 | 43 | For more information take a look at `rx_observeWeakly` method. 44 | */ 45 | @warn_unused_result(message="http://git.io/rxs.uo") 46 | public func rx_observeWeakly(type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.New, .Initial]) -> Observable { 47 | return rx_observeWeakly(E.RawValue.KVOType.self, keyPath, options: options) 48 | .map(E.init) 49 | } 50 | } 51 | #endif 52 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Event.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Event.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/8/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | /** 13 | Represents sequence event 14 | 15 | Sequence grammar: 16 | Next\* (Error | Completed) 17 | */ 18 | public enum Event : CustomDebugStringConvertible { 19 | /** 20 | Next element is produced 21 | */ 22 | case Next(Element) 23 | 24 | /** 25 | Sequence terminates with error 26 | */ 27 | case Error(ErrorType) 28 | 29 | /** 30 | Sequence completes sucessfully 31 | */ 32 | case Completed 33 | } 34 | 35 | extension Event { 36 | /** 37 | - returns: Description of event 38 | */ 39 | public var debugDescription: String { 40 | get { 41 | switch self { 42 | case .Next(let value): 43 | return "Next(\(value))" 44 | case .Error(let error): 45 | return "Error(\(error))" 46 | case .Completed: 47 | return "Completed" 48 | } 49 | } 50 | } 51 | } 52 | 53 | extension Event { 54 | /** 55 | - returns: Is `Completed` or `Error` event 56 | */ 57 | public var isStopEvent: Bool { 58 | get { 59 | switch self { 60 | case .Next: return false 61 | case .Error, .Completed: return true 62 | } 63 | } 64 | } 65 | 66 | /** 67 | - returns: If `Next` event, returns element value. 68 | */ 69 | public var element: Element? { 70 | get { 71 | if case .Next(let value) = self { 72 | return value 73 | } 74 | return nil 75 | } 76 | } 77 | 78 | /** 79 | - returns: If `Error` event, returns error. 80 | */ 81 | public var error: ErrorType? { 82 | get { 83 | if case .Error(let error) = self { 84 | return error 85 | } 86 | return nil 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /Pods/MJExtension/MJExtension/NSObject+MJCoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MJCoding.m 3 | // MJExtension 4 | // 5 | // Created by mj on 14-1-15. 6 | // Copyright (c) 2014年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MJCoding.h" 10 | #import "NSObject+MJClass.h" 11 | #import "NSObject+MJProperty.h" 12 | #import "MJProperty.h" 13 | 14 | @implementation NSObject (MJCoding) 15 | 16 | - (void)mj_encode:(NSCoder *)encoder 17 | { 18 | Class clazz = [self class]; 19 | 20 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 21 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 22 | 23 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 24 | // 检测是否被忽略 25 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 26 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 27 | 28 | id value = [property valueForObject:self]; 29 | if (value == nil) return; 30 | [encoder encodeObject:value forKey:property.name]; 31 | }]; 32 | } 33 | 34 | - (void)mj_decode:(NSCoder *)decoder 35 | { 36 | Class clazz = [self class]; 37 | 38 | NSArray *allowedCodingPropertyNames = [clazz mj_totalAllowedCodingPropertyNames]; 39 | NSArray *ignoredCodingPropertyNames = [clazz mj_totalIgnoredCodingPropertyNames]; 40 | 41 | [clazz mj_enumerateProperties:^(MJProperty *property, BOOL *stop) { 42 | // 检测是否被忽略 43 | if (allowedCodingPropertyNames.count && ![allowedCodingPropertyNames containsObject:property.name]) return; 44 | if ([ignoredCodingPropertyNames containsObject:property.name]) return; 45 | 46 | id value = [decoder decodeObjectForKey:property.name]; 47 | if (value == nil) { // 兼容以前的MJExtension版本 48 | value = [decoder decodeObjectForKey:[@"_" stringByAppendingString:property.name]]; 49 | } 50 | if (value == nil) return; 51 | [property setValue:value forObject:self]; 52 | }]; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/Observables/Implementations/Scan.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Scan.swift 3 | // RxSwift 4 | // 5 | // Created by Krunoslav Zaher on 6/14/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class ScanSink : Sink, ObserverType { 12 | typealias Parent = Scan 13 | typealias E = ElementType 14 | 15 | private let _parent: Parent 16 | private var _accumulate: Accumulate 17 | 18 | init(parent: Parent, observer: O) { 19 | _parent = parent 20 | _accumulate = parent._seed 21 | super.init(observer: observer) 22 | } 23 | 24 | func on(event: Event) { 25 | switch event { 26 | case .Next(let element): 27 | do { 28 | _accumulate = try _parent._accumulator(_accumulate, element) 29 | forwardOn(.Next(_accumulate)) 30 | } 31 | catch let error { 32 | forwardOn(.Error(error)) 33 | dispose() 34 | } 35 | case .Error(let error): 36 | forwardOn(.Error(error)) 37 | dispose() 38 | case .Completed: 39 | forwardOn(.Completed) 40 | dispose() 41 | } 42 | } 43 | 44 | } 45 | 46 | class Scan: Producer { 47 | typealias Accumulator = (Accumulate, Element) throws -> Accumulate 48 | 49 | private let _source: Observable 50 | private let _seed: Accumulate 51 | private let _accumulator: Accumulator 52 | 53 | init(source: Observable, seed: Accumulate, accumulator: Accumulator) { 54 | _source = source 55 | _seed = seed 56 | _accumulator = accumulator 57 | } 58 | 59 | override func run(observer: O) -> Disposable { 60 | let sink = ScanSink(parent: self, observer: observer) 61 | sink.disposable = _source.subscribe(sink) 62 | return sink 63 | } 64 | } -------------------------------------------------------------------------------- /Pods/RxSwift/RxSwift/AnyObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnyObserver.swift 3 | // Rx 4 | // 5 | // Created by Krunoslav Zaher on 2/28/15. 6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /** 12 | A type-erased `ObserverType`. 13 | 14 | Forwards operations to an arbitrary underlying observer with the same `Element` type, hiding the specifics of the underlying observer type. 15 | */ 16 | public struct AnyObserver : ObserverType { 17 | /** 18 | The type of elements in sequence that observer can observe. 19 | */ 20 | public typealias E = Element 21 | 22 | /** 23 | Anonymous event handler type. 24 | */ 25 | public typealias EventHandler = (Event) -> Void 26 | 27 | public let observer: EventHandler 28 | 29 | /** 30 | Construct an instance whose `on(event)` calls `eventHandler(event)` 31 | 32 | - parameter eventHandler: Event handler that observes sequences events. 33 | */ 34 | public init(eventHandler: EventHandler) { 35 | self.observer = eventHandler 36 | } 37 | 38 | /** 39 | Construct an instance whose `on(event)` calls `observer.on(event)` 40 | 41 | - parameter observer: Observer that receives sequence events. 42 | */ 43 | public init(_ observer: O) { 44 | self.observer = observer.on 45 | } 46 | 47 | /** 48 | Send `event` to this observer. 49 | 50 | - parameter event: Event instance. 51 | */ 52 | public func on(event: Event) { 53 | return self.observer(event) 54 | } 55 | 56 | /** 57 | Erases type of observer and returns canonical observer. 58 | 59 | - returns: type erased observer. 60 | */ 61 | public func asObserver() -> AnyObserver { 62 | return self 63 | } 64 | } 65 | 66 | extension ObserverType { 67 | /** 68 | Erases type of observer and returns canonical observer. 69 | 70 | - returns: type erased observer. 71 | */ 72 | public func asObserver() -> AnyObserver { 73 | return AnyObserver(self) 74 | } 75 | } --------------------------------------------------------------------------------