diff --git a/Podfile b/Podfile index 2ff3fcf..8f765ec 100644 --- a/Podfile +++ b/Podfile @@ -9,6 +9,10 @@ target 'ShadowsocksX-NG' do pod 'Alamofire', '~> 4.2.0' pod "GCDWebServer", "~> 3.0" pod 'MASShortcut', '~> 2' + + # https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md + pod 'RxSwift', '~> 3.0' + pod 'RxCocoa', '~> 3.0' target 'ShadowsocksX-NGTests' do inherit! :search_paths diff --git a/Podfile.lock b/Podfile.lock index 0fde6da..a21e804 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -5,19 +5,26 @@ PODS: - GCDWebServer/Core (= 3.3.3) - GCDWebServer/Core (3.3.3) - MASShortcut (2.3.6) + - RxCocoa (3.1.0): + - RxSwift (~> 3.1) + - RxSwift (3.1.0) DEPENDENCIES: - Alamofire (~> 4.2.0) - BRLOptionParser (~> 0.3.1) - GCDWebServer (~> 3.0) - MASShortcut (~> 2) + - RxCocoa (~> 3.0) + - RxSwift (~> 3.0) SPEC CHECKSUMS: Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe BRLOptionParser: a03256a8ff003ca1f5376c55f55f210e085a3958 GCDWebServer: 1c39a1f0763e4eb492bee021e4270fce097d3555 MASShortcut: 9c215e8a8a78f3d01ce56da48e2730ab66b538fa + RxCocoa: 50d7564866da9299161e86a263ce12a0873904d8 + RxSwift: 83ff553e7593fdfdcb2562933a64c0284dffdadc -PODFILE CHECKSUM: e8b6cac515675274e39470f4662a5082eedee9e8 +PODFILE CHECKSUM: e59f622df37d0fe135432c1ccda243973c311def COCOAPODS: 1.2.0 diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 0fde6da..a21e804 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -5,19 +5,26 @@ PODS: - GCDWebServer/Core (= 3.3.3) - GCDWebServer/Core (3.3.3) - MASShortcut (2.3.6) + - RxCocoa (3.1.0): + - RxSwift (~> 3.1) + - RxSwift (3.1.0) DEPENDENCIES: - Alamofire (~> 4.2.0) - BRLOptionParser (~> 0.3.1) - GCDWebServer (~> 3.0) - MASShortcut (~> 2) + - RxCocoa (~> 3.0) + - RxSwift (~> 3.0) SPEC CHECKSUMS: Alamofire: aa2e09d871c9160ac53c90e83c68064a94e3dfbe BRLOptionParser: a03256a8ff003ca1f5376c55f55f210e085a3958 GCDWebServer: 1c39a1f0763e4eb492bee021e4270fce097d3555 MASShortcut: 9c215e8a8a78f3d01ce56da48e2730ab66b538fa + RxCocoa: 50d7564866da9299161e86a263ce12a0873904d8 + RxSwift: 83ff553e7593fdfdcb2562933a64c0284dffdadc -PODFILE CHECKSUM: e8b6cac515675274e39470f4662a5082eedee9e8 +PODFILE CHECKSUM: e59f622df37d0fe135432c1ccda243973c311def COCOAPODS: 1.2.0 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 964d307..3864cc6 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -7,127 +7,362 @@ objects = { /* Begin PBXBuildFile section */ - 008D88E94858B0B8190DD42951253AD2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 015A2D47B6DA8E170E4E64108EC177CA /* GCDWebServerFileRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 281F888B9FFA5F230A528564E73518DF /* GCDWebServerFileRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 03810806C0578A750613717248DC37CC /* GCDWebServerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 521DF5ED2D6DDCC2CD0241C6758A82E8 /* GCDWebServerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 0551162B7568A0F3028CF7CE13E9C1C7 /* GCDWebServerURLEncodedFormRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D354B988E94145D21D7ACC846F6E3A69 /* GCDWebServerURLEncodedFormRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 098AA417A5494FC829E777DC5CF06ECC /* GCDWebServerURLEncodedFormRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 08089D3F4CC12076D2D2B8794E4BC321 /* GCDWebServerURLEncodedFormRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0A402C97D8A2855E4F69D8E2BFEE752E /* BRLOptionParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DA31567241C5316DE5F728BA3DE8DA6 /* BRLOptionParser.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 0B8140968914C908CFB4949F67745DD7 /* GCDWebServerFileResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = B47B95553B8446AB4C05DB6C787C1923 /* GCDWebServerFileResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBB13842D20339B1AA4DBC88598BE195 /* Timeline.swift */; }; - 12149EA10608B7DE38879E6242D2826C /* ko.lproj in Resources */ = {isa = PBXBuildFile; fileRef = AF1D2790CBE48EA409C37174C263BBBB /* ko.lproj */; }; - 1568BC317134F1902AB76EE65E0A18CE /* GCDWebServerDataResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7F511A7BB871D77D80C8B376050327 /* GCDWebServerDataResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 157AE1FBA8F6C3B710CDE90F86492010 /* MASShortcut.m in Sources */ = {isa = PBXBuildFile; fileRef = 7769179E7E99FFDE1312346DF91A8A1D /* MASShortcut.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 008D88E94858B0B8190DD42951253AD2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 00B490DFDC8E910BDF676C7E9EC0F7F8 /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 692C39EEB847B6865E05154D699B5A0D /* ImmediateSchedulerType.swift */; }; + 015A2D47B6DA8E170E4E64108EC177CA /* GCDWebServerFileRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 89157B205B92DB7240F198AAAE3E1D23 /* GCDWebServerFileRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 02759E469AF7E37C6C2B662D2A8DBB99 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5093D2110C7158AE638018A9970FA168 /* InfiniteSequence.swift */; }; + 02FCBABDD1B23C59A7B119F1DAE88D7D /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3747A52D98BA28FA152080DA132B4955 /* DispatchQueue+Extensions.swift */; }; + 032DDE7C99BFEF759E6AD96D49AC2222 /* Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12DA49F9E5238CF2A4EBB5A83A1AE3DA /* Zip+arity.swift */; }; + 03810806C0578A750613717248DC37CC /* GCDWebServerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 54065E050A33BF7D4D54D1A31297F2F1 /* GCDWebServerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 0551162B7568A0F3028CF7CE13E9C1C7 /* GCDWebServerURLEncodedFormRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 619730E0F7D114E0BBB3773020DBC95D /* GCDWebServerURLEncodedFormRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 077F6DB761D1176638A57167293DA6BA /* ScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D539E4E6C4E295220FA4FAE74031789 /* ScheduledItem.swift */; }; + 08067F41CEECB56CE74FFCA481092E8D /* RxCocoaRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = E258DC88C29E64BF1A3523D2FFF806B5 /* RxCocoaRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 08DB29E8F7F7FF81D87DCFB7869ECC45 /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76DBA6E4CB608131ADBA7D7DFF8A4E6C /* CombineLatest.swift */; }; + 09713E4AD4F8DB9EBD22A77AA12509B7 /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF02268A49529C89CA28BBD728A4864A /* SerialDisposable.swift */; }; + 098AA417A5494FC829E777DC5CF06ECC /* GCDWebServerURLEncodedFormRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AFDA86F88F40BFA89B3B2A729B2F24 /* GCDWebServerURLEncodedFormRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0A402C97D8A2855E4F69D8E2BFEE752E /* BRLOptionParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E0E8FB6DEC7DDD0F6FEEE86CCDFBC820 /* BRLOptionParser.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 0B39234B888575182CA99B07AFC81BA5 /* Variable+SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B87C81B82992789E3611469980A1778 /* Variable+SharedSequence.swift */; }; + 0B8140968914C908CFB4949F67745DD7 /* GCDWebServerFileResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = CB4B9ED2B1EB569789C066F34F7123A4 /* GCDWebServerFileResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0ED25A1662826BF961671ECD0C67522D /* RefCountDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E19D18DB5C1EA9E63E6DBF428B35C892 /* RefCountDisposable.swift */; }; + 0F56DF85092077222EFE85B49CED711F /* DelaySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = C62AFA43EC9E39C9901C2014FBF75441 /* DelaySubscription.swift */; }; + 107E34C884D6DAEDA56024FF80F83CF6 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B3C30C8BD2ECEF438E4A7E02A0C36B6 /* Platform.Linux.swift */; }; + 1094573AE70DF26E438020148CAA752E /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F52D2218ED1A55107BC548E297E9CB /* String+Rx.swift */; }; + 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 315C104108C26A838CCC718E8258B44A /* Timeline.swift */; }; + 12149EA10608B7DE38879E6242D2826C /* ko.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 625F1E39F5E196BA50F36BE994C84724 /* ko.lproj */; }; + 1243B6888974A6BE9D7D77B1D5402D73 /* SubjectType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30F42D2E6C0B7C15B64F1081749B8FF /* SubjectType.swift */; }; + 143F5EA30D8845DE6EBA2E7E9619D2E9 /* _RX.m in Sources */ = {isa = PBXBuildFile; fileRef = 70BBD10E3B649EA0755AD083EA7CDFB9 /* _RX.m */; }; + 1568BC317134F1902AB76EE65E0A18CE /* GCDWebServerDataResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 8D64CB474F7D1B9FDD19465A43A61164 /* GCDWebServerDataResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 157AE1FBA8F6C3B710CDE90F86492010 /* MASShortcut.m in Sources */ = {isa = PBXBuildFile; fileRef = AA881E4DA90F807751C146D7483CDEC3 /* MASShortcut.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 165F7D403C750ABB5648860CBA92049E /* AddRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9007D55BF01790E2E753C6B70C41179 /* AddRef.swift */; }; + 181168219B048D50E6CA6E785240FFAD /* InvocableScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 460823F894F0F79E2B8E8992A02BFB25 /* InvocableScheduledItem.swift */; }; + 18AD86C96492EFC58855F4DD89D50EE8 /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF5E4BD0EF6C6C73284552531F108886 /* Window.swift */; }; + 1A12CE731D866F4B25F4C05CB262773A /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F42FF8098EE07E0972506FA879BAED /* Scan.swift */; }; 1AB0577134E333EA71DCCE332191A260 /* Pods-ShadowsocksX-NGTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46662EB64876AD1C891F548C69A89E89 /* Pods-ShadowsocksX-NGTests-dummy.m */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2622E50F246A10BAC80FCFDF60CDB349 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1EF1D9B948C91F3CAD0F2998F3765D8B /* GCDWebServerErrorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 15B24A5DDAD858CD6616DD64178BB7A6 /* GCDWebServerErrorResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 20887597017160017549465EBFB7E977 /* zh-Hant.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 97959737DD67EFD1D7AB5F26607875F2 /* zh-Hant.lproj */; }; - 2527F62CEADDA5CE60852E0C067D3438 /* GCDWebServerResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8739A57CFBA2B252B9323870F7F914 /* GCDWebServerResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2545E11592C408516EA9AC047FFD47FD /* BRLOptionParser-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CCB68427884134CB40644A07D36C7213 /* BRLOptionParser-dummy.m */; }; - 286A79B0F2405FD08804042FE30407B1 /* GCDWebServerMultiPartFormRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F9A804E1EB5515485FBC3A8075FCDFF /* GCDWebServerMultiPartFormRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 1ACC904BF6C39CB0520384B81B1A59A3 /* RxCocoaObjCRuntimeError+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 917C99A8833B2D56222425A6F84CA5DA /* RxCocoaObjCRuntimeError+Extensions.swift */; }; + 1B9C61B405FA747D9223222AA652AF6D /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C260F4B4F6F3E5961E3A49C5B05520CD /* DisposeBase.swift */; }; + 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 48352BD4C4E074FC479B0513B92EA7F9 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1CA6B3BA315902F58D2A539D524D6C3C /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1135B3B4D2DC6F16A992DFB33D540AA /* ConcurrentMainScheduler.swift */; }; + 1E1D791396A3F447B3ADE321ECC7E39E /* RxCocoa-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ADA9A70ECA885B87CA7B20916DC7BC6F /* RxCocoa-dummy.m */; }; + 1E97944F114E25922076ED80748DF4BC /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ABF695E08E23D093300EE17154AD46 /* Sequence.swift */; }; + 1E9B353B6011A05BC8A967B4F679AC99 /* HistoricalSchedulerTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38DB6F5263618374E7A97C5A4E497A1 /* HistoricalSchedulerTimeConverter.swift */; }; + 1EF1D9B948C91F3CAD0F2998F3765D8B /* GCDWebServerErrorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 64B15D82041B7A6840823B8A9F3751FD /* GCDWebServerErrorResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F149FBBBB20187B527A87592E7D1D65 /* SingleAssignmentDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEF9DEF3F2FE69B0036DA832678E66F /* SingleAssignmentDisposable.swift */; }; + 202855689CF5074E834DC4C377C1C21F /* AnonymousInvocable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 671D0C35D77C5534BD266C99699798F7 /* AnonymousInvocable.swift */; }; + 203C8C15986DB48FBFB72F65D4837A0F /* Observable+StandardSequenceOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 843FB1118D1974CEF717BE490B13366C /* Observable+StandardSequenceOperators.swift */; }; + 20887597017160017549465EBFB7E977 /* zh-Hant.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 49E673D8031F864FAD63560EA564B5DD /* zh-Hant.lproj */; }; + 21924D3337F7B20AE94DE0A020D38183 /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A232E9660CB723A1D128D3DFF830596 /* Catch.swift */; }; + 21EB6E0D77F98AC3A30680A90B8656D4 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A6F87048375FCF10848872558242925 /* Platform.Darwin.swift */; }; + 2259DC05FD87D673C2FE695869381DBC /* KVORepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 895C03FCA3BCF07DBDA8A858302D9662 /* KVORepresentable.swift */; }; + 23741DAA4F354BEEAD1B4EE11EECBF82 /* SingleAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817BBAF28AF5DD16F4C657AB7AD305BF /* SingleAsync.swift */; }; + 247AA094C4DE12FB3B5B4761C9FDECE8 /* NSObject+Rx+RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D63CEEDC1A1E689C53BE5B8FB80BBB4F /* NSObject+Rx+RawRepresentable.swift */; }; + 2527F62CEADDA5CE60852E0C067D3438 /* GCDWebServerResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = AF5498021A404BB1ACCA140C4B62871C /* GCDWebServerResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2545E11592C408516EA9AC047FFD47FD /* BRLOptionParser-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C507512A0FC2103B39A0C7761B19968E /* BRLOptionParser-dummy.m */; }; + 282D05FE9B69BDF19B9573DAD9F3EE9A /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = C22A091C89D7A9C2B736EF1A49C54280 /* TextInput.swift */; }; + 286A79B0F2405FD08804042FE30407B1 /* GCDWebServerMultiPartFormRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0AA9F9CD0EB270DDA2ED76FD3446F305 /* GCDWebServerMultiPartFormRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 287F5692A9ECEE55B0A9E4A033992626 /* CombineLatest+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A4EC64F789C4F631F887DA33498D8C /* CombineLatest+Collection.swift */; }; + 291963FA0138FBBFE13F98B6F3980E28 /* Skip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99BD77B66B1E1355C1E30439B72937EB /* Skip.swift */; }; + 2990102CBE66DC047A22C1CBF937DB6E /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0D8E8F499BC8AD11FA423052AD2B91A /* Rx.swift */; }; + 2B2DD472D5ADDCFEB20E2715B76C497F /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576B7DEFF20932FE127908D3A5F4A54D /* Lock.swift */; }; + 2C16189485F3647493E5E74E8C629E54 /* Pods-ShadowsocksX-NG-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A9EC2BB1EC6484018A5EB4B9B2C231 /* Pods-ShadowsocksX-NG-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2CF894F29E1A7E1C5F7F9501934E0059 /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D5F5CEA32B2510E42A4A7976F27CCE /* PublishSubject.swift */; }; 2DBAC0452D6B85DF3E41E3AEFB4EEC16 /* Pods-ShadowsocksX-NGTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D7E8128F302CF60BEF206008CE11F6D3 /* Pods-ShadowsocksX-NGTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3076DFAD05E4F7F0356153478F071D74 /* MASShortcut-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = DEA37CFFE5FCF2A505A2EC3468C0E635 /* MASShortcut-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 30E2A73CDE464DC6C23D3524F07FBB9F /* GCDWebServer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9681E05358DC8416C0EE292B3047C10E /* GCDWebServer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 33669A1E8FF6BB34131FB94871DDF908 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 35B3DA850A250223EE5CEB9DB04D1FC4 /* GCDWebServerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = C03AA4D681FDF11A4D5D92CE754BB78E /* GCDWebServerResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53A014B3A6C4E5CFA3E4DE307B90604A /* TaskDelegate.swift */; }; - 36E0FA5FE4424D20F0215B1C2CD85D90 /* GCDWebServerRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A9CAB6031EE58AA1643806530AAA4DDD /* GCDWebServerRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 382EEA9832CF0E0860B998EAD0EE66E1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F581A519A535CA5FCC23235961004C18 /* SystemConfiguration.framework */; }; - 38974DB132715266ADE00F2E3DFBB320 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 396153660EE28DAAF20B789B5EB65104 /* Pods-ShadowsocksX-NG-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 24B01D81E3D7058FA14A053EC19874D0 /* Pods-ShadowsocksX-NG-dummy.m */; }; - 3DD0362B0B6B939B5D087A150121A4B1 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 3E715DFE443524EB6ADE892E4A676224 /* GCDWebServerMultiPartFormRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 332ACCF53DA56255BCDB92E92475A51E /* GCDWebServerMultiPartFormRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 48FE45BD7BF4ABB32A024550ED96B4C6 /* GCDWebServerStreamedResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = CD639ADC8DEDEF3134D5CC65E9481B1B /* GCDWebServerStreamedResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 4A6AF0A712D4C473177BE88389D15D2A /* MASDictionaryTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C6391EC74D8F0B20D3C7B23F409A79 /* MASDictionaryTransformer.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 4EDE49009B5B68074CD71F8B362F0DDC /* GCDWebServerDataRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D83581D01E98E7FBCE531F4D826138A /* GCDWebServerDataRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 51358F3E24AC8F1A4172E388769FF1FA /* MASShortcutView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BC10337C8AD93957F289E193D30644F /* MASShortcutView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C3DFC72D09E04176703E5C47943F521 /* Request.swift */; }; - 53D63A17DB43C044EFBAA17337600276 /* GCDWebServerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7262F05AABD2F2F8116F28E4444730 /* GCDWebServerRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 58CE04D9C6CAC7243825ABF4AB20EF32 /* MASShortcutValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 67E329D8A58E01DFEDEBC4ECB73BCB04 /* MASShortcutValidator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 5A30DAB76BB1814664FA7DC30939DA24 /* MASShortcutBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3D222C908B57140B734E3CF98FBE99 /* MASShortcutBinder.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 5F1FA9D431587CD257C703AF16134030 /* ja.lproj in Resources */ = {isa = PBXBuildFile; fileRef = C75B3D4578ADA314E1C779DB5ECAA89B /* ja.lproj */; }; - 5FF7D42F51FEAEB192E61355AAEAC6DE /* MASShortcutMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 8134B11FCAB921895AB127714E70D06F /* MASShortcutMonitor.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A78ADD0E2187A79B80359263F8D58DC /* DispatchQueue+Alamofire.swift */; }; - 618D3C71663174E07B65950421C46D48 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7A60DCFEEFE6028E803545102BA75B1 /* AppKit.framework */; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048EA0F03DC206107638B14EB0B22590 /* ServerTrustPolicy.swift */; }; - 66AD0D86950A5C05121AE482F5257717 /* GCDWebServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 883FD374D1F5406153C9E25ED24B8921 /* GCDWebServerConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 66DEB394C39F5DCCD70A27ECEF274983 /* de.lproj in Resources */ = {isa = PBXBuildFile; fileRef = AB0D38FFE12F18677596FC69DB07A5BC /* de.lproj */; }; - 6747832B85949C75C746C2EA6792B0C8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 6B4361F5ADC6268E7953732371174FE9 /* MASShortcut-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 73446AD40BC622BA16D088399746703A /* MASShortcut-dummy.m */; }; - 6C62ACD1AF9B80626023D3E654D3E77B /* GCDWebServerStreamedResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A824D6AF73605FD4B0434931B70C7CE /* GCDWebServerStreamedResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 74EFCC6DC65CEBCF60B106F7FBB14EA2 /* MASShortcutMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = BA3485D194A4B9E4D8751BC5A5321E9B /* MASShortcutMonitor.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 751AC207B038ADC338015FD80AA54B76 /* MASLocalization.h in Headers */ = {isa = PBXBuildFile; fileRef = D03A4819F4C6095A9477FED1229B7A77 /* MASLocalization.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 76537FCDFF46E2EAA84E9632DB6A21ED /* MASKeyMasks.h in Headers */ = {isa = PBXBuildFile; fileRef = C55C71D66BDD301C849C60D2C5DC9C23 /* MASKeyMasks.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E4066248D5CB3239512D186B38644FD /* SessionDelegate.swift */; }; - 7B70A32CB535894B889DC0400D0DE4B5 /* GCDWebServerDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 69EABE25139B92E133ACB9E48FB95497 /* GCDWebServerDataRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 7C46C6DFBF9F5A96C6BCE1C93052B63D /* GCDWebServerHTTPStatusCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 8D782BF889898D9E5258D79D2A4DA8EC /* GCDWebServerHTTPStatusCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6439601D189D6EA4EE34BBB5E8D1B9 /* Result.swift */; }; - 7E20F5346ADC8F4F5C069EDDE10897FD /* MASShortcut.h in Headers */ = {isa = PBXBuildFile; fileRef = EB80202EEB9A104B8394F02CC078ADFC /* MASShortcut.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 81B6397FECC803695902CEDB37CB4DFA /* MASShortcutBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = A419B812B106CBEFA00870784818213C /* MASShortcutBinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 886E89D85907BBD7A8C8BAA088D23E3D /* GCDWebServerFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C4942853CFF0AF10EE0507A6DB64F7B /* GCDWebServerFileResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 8C5EA18EEE22A60BF10955E38F0D3A75 /* MASShortcutValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26798DB74F28DE87259D2EC77916C658 /* MASShortcutValidator.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8FFA3A6A77962B3A36B009A49634D081 /* MASHotKey.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9FE21981CBAA8F5535A05127F08FFD /* MASHotKey.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 95EE31BA6E30FA4FF0F07AE21C5F45D7 /* Pods-ShadowsocksX-NG-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A9EC2BB1EC6484018A5EB4B9B2C231 /* Pods-ShadowsocksX-NG-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 97B374490F695A6ECB06271EF080EB6C /* nl.lproj in Resources */ = {isa = PBXBuildFile; fileRef = AFB4B923C938302D83D3C7BBB013CC39 /* nl.lproj */; }; - 9B622302DDDA1881AC9ABA9EA4C81564 /* BRLOptionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = DB80A4130B50AF90720FF211504FB9E9 /* BRLOptionParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DB91F7B392D045AB8451F515D20D649 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB0EBA1E1100F179EBAE135039DE532C /* AFError.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 253E551C1B9859C14CFA9C52573A09F5 /* NetworkReachabilityManager.swift */; }; - A4DBF0AB2E88B1A9D1078042F47618B0 /* ru.lproj in Resources */ = {isa = PBXBuildFile; fileRef = EDE850D2C845A4E04C32A0E8943E5168 /* ru.lproj */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 844CBFCCA003D23AC4446B0970F5FF96 /* Alamofire-dummy.m */; }; - AA7CDF00DFA1EAFF7F28CAF33FE5BC37 /* MASHotKey.h in Headers */ = {isa = PBXBuildFile; fileRef = AECF9A29B7AECE459E5A34AC4DB91488 /* MASHotKey.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ACBE29C4BF8BAEA483D6EEA940FE5314 /* MASShortcutView+Bindings.m in Sources */ = {isa = PBXBuildFile; fileRef = 38100CF1A92136DA8A810B1CD5D9D2B4 /* MASShortcutView+Bindings.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 2F4DC6EE9D2D04DD2501C702C782FF87 /* KVORepresentable+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E39C3D16733CDCB7BAD80752EC7D239 /* KVORepresentable+Swift.swift */; }; + 2F51EBD27184D6642521531C30C2A078 /* Observable+Concurrency.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4752DE1461395A71AEFA91856BB6469 /* Observable+Concurrency.swift */; }; + 3076DFAD05E4F7F0356153478F071D74 /* MASShortcut-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CEB1670F4E8A8FED505B32B7F7DADD3 /* MASShortcut-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 30E2A73CDE464DC6C23D3524F07FBB9F /* GCDWebServer-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 892156754A7EF53FE3D80BC00C1975AB /* GCDWebServer-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3161617D6E3095F41E350F916D918355 /* RetryWhen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0621C0B43DFC90DF41B61359E759D5D3 /* RetryWhen.swift */; }; + 320FD242550FBA6C940056D6191EF150 /* AnonymousObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61C799F1F6F393193FDEB6E8B261E48C /* AnonymousObservable.swift */; }; + 330A0CDDD45D8019380AE257A5946541 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8B36ED31A6E3C49C77F55E2561C966D /* InfiniteSequence.swift */; }; + 33432041A2F2B22595A953DADFB962AA /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BB0F5D8F0F27F31636D82187890CC43 /* Map.swift */; }; + 33669A1E8FF6BB34131FB94871DDF908 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 35B3DA850A250223EE5CEB9DB04D1FC4 /* GCDWebServerResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = A1E6CC9C6785132EA7807744DE0ED408 /* GCDWebServerResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FD1D9CC9BD0DB820CE56BBDE2B6E01F /* TaskDelegate.swift */; }; + 3631BBE242189BD75BEF9E010BC27E21 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26339E7D90E6D149F805C377419D25BA /* Disposables.swift */; }; + 36E0FA5FE4424D20F0215B1C2CD85D90 /* GCDWebServerRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 89B67DFE619069B6AD5E1D0FAA0BB8E2 /* GCDWebServerRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 370087A98B47E0ED6C36574B16D871A5 /* Observable+Bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E83A23DEF6EC644ABA3997BE70BFA85 /* Observable+Bind.swift */; }; + 382EEA9832CF0E0860B998EAD0EE66E1 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FEC4B8DFE8753A9B1DE598293568F30 /* SystemConfiguration.framework */; }; + 38974DB132715266ADE00F2E3DFBB320 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 38DB62A5AD3079471CDF2E9D0D3028FA /* Variable+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 375E8496E1F8683C57FE684DE6D592C1 /* Variable+Driver.swift */; }; + 3B5E0C8C1AB83BD7BBBCAE6073F09AFC /* NSTextField+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9654A33B220127C74EC683B98310281D /* NSTextField+Rx.swift */; }; + 3CB44363DC3691947BA8E9882053BC4A /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EBEE1150AB7FFCE3B2375F0351703C4 /* ObservableType.swift */; }; + 3DD0362B0B6B939B5D087A150121A4B1 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 3E6DF7443FD313551869E084C684729A /* TakeUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CB76F5333C4E30B9798A7CB70CCB81F /* TakeUntil.swift */; }; + 3E715DFE443524EB6ADE892E4A676224 /* GCDWebServerMultiPartFormRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = DB9CD6FE2DD142EFA2C41E21AB227946 /* GCDWebServerMultiPartFormRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 419D4559CBA3D1470729743B06641C8C /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D0F0E4B2FD793BE40FBBE96FD380D21 /* SynchronizedUnsubscribeType.swift */; }; + 41A0D57F7581AE6A50FE1B0EFE59019C /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00C649D6C2694F89369C6E4BFDF7020D /* AnonymousObserver.swift */; }; + 420C2F4BDB11DD8CF3D550D0857ECD6B /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7953F0BF7911F293599BC38510760E46 /* Timer.swift */; }; + 424673BDBA8D006E6179215F52C5E941 /* SerialDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8038341863E5188ED05DCC1BA2CF7CCD /* SerialDispatchQueueScheduler.swift */; }; + 432E16210E58159994078E2AC4CC5E2A /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 686894AC6B1777DEFA921D960D8B519D /* Cancelable.swift */; }; + 43F8377C7AD6791017DCD42341075D28 /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = F41DBC7F2E4B382CC91B8B28EF579853 /* RxMutableBox.swift */; }; + 450010E10778B36C2FEEC4B9FBB70AC5 /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23863CFA627473DC27B67457C49C2E18 /* SchedulerType.swift */; }; + 467BF71F9AA158F2EA6212221B8E757D /* DelegateProxyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AD4268847B9453CE579C41B609E22B7 /* DelegateProxyType.swift */; }; + 46E18CE0A69856E82A7BF5DF5C4129D2 /* _RXDelegateProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E6D1E113A8A1E690491F2E3F8A2201 /* _RXDelegateProxy.m */; }; + 47351D20CCCBF94578D448CC836C33FD /* SynchronizedOnType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6824046BB6F6BA5DA145A55756FCE843 /* SynchronizedOnType.swift */; }; + 48FE45BD7BF4ABB32A024550ED96B4C6 /* GCDWebServerStreamedResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = C4532CD920B79E94F7B61A2B9A63FCAD /* GCDWebServerStreamedResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 49F778DEAC864BEE58A4B6E734B9BADC /* LockOwnerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5FF1DE565E7A0E50A3F648C38E95C78 /* LockOwnerType.swift */; }; + 4A6AF0A712D4C473177BE88389D15D2A /* MASDictionaryTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = AADDE7423A968810AADD026BD63867B0 /* MASDictionaryTransformer.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 4B4CE0B02143614597D6DF7AA4BA3DBD /* _RXObjCRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF29FABA8C360B08D7C7424360D6666 /* _RXObjCRuntime.m */; }; + 4EA689C03ECF1236D3D9D63B2BB5F4FC /* Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 765B2B823783215A2E954FAB4853AC93 /* Driver.swift */; }; + 4EDE49009B5B68074CD71F8B362F0DDC /* GCDWebServerDataRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AA937C432E0F9441C102162B7D3DE77 /* GCDWebServerDataRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4F4FD0070DB81A8EB981334462E930F1 /* ShareReplay1.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5049BF3275B506081D6290C03107F75 /* ShareReplay1.swift */; }; + 4FCC38C464EC116DA2EDA928A5AFC90A /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA3F63B120DCD2B0AD8CA5A75890A10 /* AsyncLock.swift */; }; + 50AE3AC1A51BD92B7D417D6783719D10 /* SharedSequence+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CD18D2965F9753B545A1B1BA54828CB /* SharedSequence+Operators.swift */; }; + 51358F3E24AC8F1A4172E388769FF1FA /* MASShortcutView.h in Headers */ = {isa = PBXBuildFile; fileRef = 90398724ED993172FCE73E50A7D35827 /* MASShortcutView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 525A56AD52E77A0678127239A93BA759 /* Observable+Aggregate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 207CF7A03B53C4DF00C68FBBF1C6E8F7 /* Observable+Aggregate.swift */; }; + 528F931DA3394230226A64A342C7CE2F /* ObservableConvertibleType+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0543E52D336EE3D670FA0326B542D1AD /* ObservableConvertibleType+Driver.swift */; }; + 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA9688D287B1F197714D74B40DBE8680 /* Request.swift */; }; + 53D63A17DB43C044EFBAA17337600276 /* GCDWebServerRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 46722F0D8851A939625EFF1E910938E4 /* GCDWebServerRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 58CE04D9C6CAC7243825ABF4AB20EF32 /* MASShortcutValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = B91619B91E70B0C5E6FAC0131E42FD7E /* MASShortcutValidator.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 595666EBE1975A65C6968591FED3477E /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6CAD2064683A8B0C403939B2A81D812 /* Sample.swift */; }; + 59B0C5CEEBC23AF2B21649600F99188D /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F715D3AF178663A8CE6B81C0A481755 /* TakeLast.swift */; }; + 5A30DAB76BB1814664FA7DC30939DA24 /* MASShortcutBinder.m in Sources */ = {isa = PBXBuildFile; fileRef = 14FD2EAF92039F913842A87BA5122B62 /* MASShortcutBinder.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 5CD1BCE580E7AD73C116C419387F753E /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A7A9E967BF724C11ED0D7AECD827B2 /* Amb.swift */; }; + 5D43FA1C64865954BCD55736B89C62C4 /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53556765457290978538C38D5C2FDA48 /* AnyObserver.swift */; }; + 5DA42242F35744E48EC08C6DEE5725B3 /* Observable+Single.swift in Sources */ = {isa = PBXBuildFile; fileRef = 351ED3EC72E752AF671FC28B61B82EBB /* Observable+Single.swift */; }; + 5E0E60641191E835765F082F3986230F /* InvocableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1633F46EA774BF24EF9CCD7B8CB200E8 /* InvocableType.swift */; }; + 5E7DA63F3D502ECE812E041AC672D187 /* Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75DFF226271D0F445274C3B660ADEE2A /* Merge.swift */; }; + 5F1FA9D431587CD257C703AF16134030 /* ja.lproj in Resources */ = {isa = PBXBuildFile; fileRef = F1B18A75522A9348284094E1A906CFDB /* ja.lproj */; }; + 5F6DF5ECECD40261F4E10979C038EEB1 /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C31186BA3198D89D82D666FBB1905C /* Empty.swift */; }; + 5FF7D42F51FEAEB192E61355AAEAC6DE /* MASShortcutMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 25054C0604BDF8F039586E1B8351F0C6 /* MASShortcutMonitor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 611B03B39A3C1DE850DF21D39CE21095 /* NSSlider+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406F80B90F80B783BD73B5494D32BF6E /* NSSlider+Rx.swift */; }; + 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABDA9F0531A7A7502BDE85649B058DFB /* DispatchQueue+Alamofire.swift */; }; + 6152ECE63A673F74B40C9BA5A851B4ED /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58E912F80E74F9E3D04FE3EAF217CBD /* Platform.Darwin.swift */; }; + 618D3C71663174E07B65950421C46D48 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 139134EE845E284F4B3ED2EF2F9A302B /* AppKit.framework */; }; + 626A7B01D3D6B6EA0869551ACE82FB8B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 62BCF246203C0F0872F6ABB6A1620D32 /* Observable+Time.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0C535339357CC5D93CA927CECB123F0 /* Observable+Time.swift */; }; + 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C0D3B37EBF8F2D69675B140D08F2C2 /* ServerTrustPolicy.swift */; }; + 6353703943D7D2312070AFD17CCB65AD /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F592655CCDF43D1184F7DCC5E7E4FD4 /* Optional.swift */; }; + 636D056E73695F4C9DB7721E8064A02E /* VirtualTimeConverterType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09404441C1943A1C1C15699C71F33D2D /* VirtualTimeConverterType.swift */; }; + 648C55C1798400EC2622AD90E7BB4A7C /* NSView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE98592A8E669C3B96D3E19120FC821 /* NSView+Rx.swift */; }; + 64995C953E64C6F7105B3728672E316F /* Observable+Multiple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 810CEE92287B0EBC821481019F3339CA /* Observable+Multiple.swift */; }; + 65AC91F0CD9F560A7904BFAABD92C60B /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E82A0897F8223FF68BA4F995D79C8D /* Logging.swift */; }; + 66AD0D86950A5C05121AE482F5257717 /* GCDWebServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 041B57D22A62A24545E85A4646383BA5 /* GCDWebServerConnection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 66DEB394C39F5DCCD70A27ECEF274983 /* de.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 96A80BADDCAF42068E3B168DD679B06E /* de.lproj */; }; + 68924F5463C83413FAB0AF1EF9A13CBC /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 714CAF0BEC8075917C6E5B21A40F51DC /* ScheduledDisposable.swift */; }; + 699AFBBF79B3202D7B230A0A22DABB18 /* Zip+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = F297CA1E051508BD3B6024498BC6FC3C /* Zip+Collection.swift */; }; + 6A7E08A902C0F36A9AC0CFFE7F868C4A /* ControlEvent+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E94EA62172D30A25E824EE75E3D9C0B /* ControlEvent+Driver.swift */; }; + 6A93DF12A8D132337D0B6944A54C7B03 /* Multicast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430720C6D9B5E4034976BD314857E51E /* Multicast.swift */; }; + 6B023721711ECBB4969FF35AF43D542F /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB6E0C832D664BB3933B743E204615D /* Never.swift */; }; + 6B4361F5ADC6268E7953732371174FE9 /* MASShortcut-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7840085CAB4823FE9A3BE2CB2174BC31 /* MASShortcut-dummy.m */; }; + 6C62ACD1AF9B80626023D3E654D3E77B /* GCDWebServerStreamedResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D1C7024A81399E15CEE5B8F618A68E /* GCDWebServerStreamedResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6CE3F1A01E6DE8F58A874B780C66A6FA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 6D1B82733CCD35C7B720D8B306969DB2 /* _RXObjCRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 145175C8AA8A892EBA0AEC97F7612D90 /* _RXObjCRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6D6E7ADEA922698A850B81747EDE156A /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = F49B97A2DDE155335D9A857CBCC1443E /* Repeat.swift */; }; + 7269959C7F25D3669B4CCC0BEFC43EFB /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B12421F65E2E98C029ADC1ADEC949D /* Event.swift */; }; + 72DE99612A83DF8C807353F1A9ACAB4E /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B53BE22700435344F5040D7A34438C79 /* DispatchQueue+Extensions.swift */; }; + 73F0143CB5E58D6201A6FBA2252858F4 /* Take.swift in Sources */ = {isa = PBXBuildFile; fileRef = C28A12A58B667D3534761E41E833AD91 /* Take.swift */; }; + 74EFCC6DC65CEBCF60B106F7FBB14EA2 /* MASShortcutMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 3446B97BEC82628B5B70EBA865321925 /* MASShortcutMonitor.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 751AC207B038ADC338015FD80AA54B76 /* MASLocalization.h in Headers */ = {isa = PBXBuildFile; fileRef = D22C2E880EC2CBCA5E33F7C18A7C28E5 /* MASLocalization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 756E3D696CCD8F588DF9292AFF378C4E /* AnonymousDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78DB8C39B2ECE834500856BA7F87808B /* AnonymousDisposable.swift */; }; + 75780983A83E65A597525566173E3C7C /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B792280B7BC7CA44B5D7090C8F732A0D /* RxSwift.framework */; }; + 76537FCDFF46E2EAA84E9632DB6A21ED /* MASKeyMasks.h in Headers */ = {isa = PBXBuildFile; fileRef = 734A36BDD429097E76987966DC4ED7AF /* MASKeyMasks.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 77C70A22F2B4145CF5341817585C134B /* SharedSequence+Operators+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 992670FA98E8ED847E3131B73896D8ED /* SharedSequence+Operators+arity.swift */; }; + 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D741EA049F662EB20482A9A330B6FAE0 /* SessionDelegate.swift */; }; + 7B70A32CB535894B889DC0400D0DE4B5 /* GCDWebServerDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5804C71C9D97BB10B0FFE80E795CD85E /* GCDWebServerDataRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 7C2510201C3D043BAF6D7D3E3D68CB3A /* BinaryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B2A679FC3BFF4F53FC9DF5CD71C6E75 /* BinaryDisposable.swift */; }; + 7C46C6DFBF9F5A96C6BCE1C93052B63D /* GCDWebServerHTTPStatusCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C3DED13280C0FE73368A82866875B7 /* GCDWebServerHTTPStatusCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7C71E95D2740D598A7B8B42EF962B00F /* ScheduledItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3B86E229BBF998819417BA1EF0B5A5D /* ScheduledItemType.swift */; }; + 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4865DDF25A3AA8BBC5BE34A85F18D17C /* Result.swift */; }; + 7DDE276EE3BD477C709DBCD1C38B03E0 /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C28568E6E85CA37FC088179660CE6A /* SynchronizedDisposeType.swift */; }; + 7E20F5346ADC8F4F5C069EDDE10897FD /* MASShortcut.h in Headers */ = {isa = PBXBuildFile; fileRef = 43F1B63559BBFA7E83623D1C9AC8E633 /* MASShortcut.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7F2467C9E8CB2CBC330D331CB6C8BB98 /* SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B8CB36B3783E2A2310ADFB4CC33864 /* SharedSequence.swift */; }; + 80B90DB44C8F9D684F4E301E9C0AC090 /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1CDAA1E9C8D90D41A2E7EDD9164500F /* Throttle.swift */; }; + 81B6397FECC803695902CEDB37CB4DFA /* MASShortcutBinder.h in Headers */ = {isa = PBXBuildFile; fileRef = CD17E58327299EAC195D109A1B69B917 /* MASShortcutBinder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 84A972377538A384D469D5B3799DFC3F /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = E809E90945E9BE1B60403F66019B3FF4 /* Just.swift */; }; + 84EB655E0AD1E3646633D47C0D047EBC /* Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79D3FF68C5D11A301F7C27AC3B626AB1 /* Timeout.swift */; }; + 8605C5332B728C31426A255BCF14FBA9 /* ObserveOnSerialDispatchQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 855CC0FE8F67377D0E604979734C70A7 /* ObserveOnSerialDispatchQueue.swift */; }; + 86F7FE179A98E2787500CA0DD68F2574 /* _RX.h in Headers */ = {isa = PBXBuildFile; fileRef = DEB9C9F773C5584C1A64134DF28D78E2 /* _RX.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 876D3351B96DD42235328028C5EA685A /* BehaviorSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = D42C0F905B71E4F428236353DE12928B /* BehaviorSubject.swift */; }; + 87E9A539E61AE876EACCBEDB8233D9C4 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 732EEA83B671AC91F7FF52CDA4C2835E /* Zip.swift */; }; + 880C6F044DF17CD72542B4A20C22F70B /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C62E07D7645966D27B953E4580313A3D /* ToArray.swift */; }; + 886E89D85907BBD7A8C8BAA088D23E3D /* GCDWebServerFileResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 7568784246140565AB9D65499F73D5CF /* GCDWebServerFileResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 889D4A9563783DAD50090FB7AA14D591 /* KVORepresentable+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44AB1ECD0CB22EBDA55B3C604C16B84E /* KVORepresentable+CoreGraphics.swift */; }; + 8C1524EFD8466D86020C1F2C6A922D84 /* ControlTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDF7D11C29F998B81F2EC67417F7E5E4 /* ControlTarget.swift */; }; + 8C5EA18EEE22A60BF10955E38F0D3A75 /* MASShortcutValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = DFE42161A598BDA23E054E467E3BBBCD /* MASShortcutValidator.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8CC77692B2147DAEBBFB618C179C4175 /* NSImageView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBC6E0B59D4E0A8264EF5775E962781 /* NSImageView+Rx.swift */; }; + 8D465F56E6992ECD6D7985B7D7D519C3 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6650CEB7DB19C31BA4430E3E4A0B54 /* SkipWhile.swift */; }; + 8D8907394B54F53C73E1D71ABE09BC66 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8A6200FBBE9F05CEF009C65C0AE129 /* Platform.Linux.swift */; }; + 8DB189E11E752F521E1387EB147BC5CB /* RxSwift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AA25737DC8326205335C494D261A558 /* RxSwift-dummy.m */; }; + 8DC023486CE85BB68B5545EF5409FB71 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 792F8486AB9FF811EC6308B78C9E71B0 /* Error.swift */; }; + 8FEBDE87BFA67E4AD0EC88774A1097F2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 8FFA3A6A77962B3A36B009A49634D081 /* MASHotKey.m in Sources */ = {isa = PBXBuildFile; fileRef = C21DA07175E00F9652FEE28ACB8A721E /* MASHotKey.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 94273CE6C30D0DB5BBF8579D0A97CA9F /* OperationQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55881B24D12F75F02F1EF97DBE920CF9 /* OperationQueueScheduler.swift */; }; + 95AC8562635870772E618499EF083802 /* Reduce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78697A689E989F8760B7F115D0F15A40 /* Reduce.swift */; }; + 95B3765B29823D808D7E7CDC32980CC8 /* SchedulerServices+Emulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E01D49455ED5C62F58BBAE0983AEB788 /* SchedulerServices+Emulation.swift */; }; + 95DFDB38DB26CBCCFF296D8ED3E77940 /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DF6EBFF755554CC9AB8962CD97A8DC3 /* DistinctUntilChanged.swift */; }; + 965B1E00C33296E80367B418D31E72CE /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EE36FCA3C6A386A888AD56E20DFF50C /* Observable.swift */; }; + 97B374490F695A6ECB06271EF080EB6C /* nl.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 36D63AB3B2F8729D38D2243E79FA9D37 /* nl.lproj */; }; + 9A551C74F80912EFDFC942535ECA28BE /* RxCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 08BD28C9755413291F8752D325956F13 /* RxCocoa.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9B622302DDDA1881AC9ABA9EA4C81564 /* BRLOptionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E109F0988D784B0B51149C9E0CFB7E /* BRLOptionParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DB91F7B392D045AB8451F515D20D649 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F30225997CEEA64CC0BDB9D5483A203 /* AFError.swift */; }; + 9FA3673BE87BC7DFE277B6A540465F3B /* Generate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF6A784C26C191A7BB651A20F9FE09C2 /* Generate.swift */; }; + A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 156BD4BE88EBFE3B4B75AB2159FFEA69 /* NetworkReachabilityManager.swift */; }; + A4DB0F25CD590C73E2EA2586822D54FD /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD85B8D01C25C718B7106EE598B59F05 /* Queue.swift */; }; + A4DBF0AB2E88B1A9D1078042F47618B0 /* ru.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 1E8F8E501B0EEF1A98B9B7557686F4DC /* ru.lproj */; }; + A7B470FCCAD399F59B3627257F78D6D6 /* Sink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F13DE488DCBBAE4BDBC0CFC97574078 /* Sink.swift */; }; + A95A82AE1BBE7BF8A32F427F5263EDC0 /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7C5FEA0C034019250F845D696DCCC6 /* PriorityQueue.swift */; }; + A97DC783F3BF2BB7191E451487A7830D /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = FECDA2B834D431A94C10FFDA1E53F33E /* PriorityQueue.swift */; }; + A980984343A8FBB1666C9DC5A50760B4 /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED83F972951546FF54141DCDFFA0A699 /* ObservableType+Extensions.swift */; }; + A9E59702B924D5C4228A7E7C0D256DDC /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E65A0563A25A9BC5540C5C6752AFB8F /* Switch.swift */; }; + A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E6312D7CA68889DE662535E01249EE7 /* Alamofire-dummy.m */; }; + AA7CDF00DFA1EAFF7F28CAF33FE5BC37 /* MASHotKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DCF2459B4B59AA53E371B3303793795 /* MASHotKey.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AAE9C0157B2A7C8FA1437AE63D7A7281 /* MainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = C63E884ADD906BC90F3C32DB52CC398D /* MainScheduler.swift */; }; + ACBE29C4BF8BAEA483D6EEA940FE5314 /* MASShortcutView+Bindings.m in Sources */ = {isa = PBXBuildFile; fileRef = B2A49B7D2E244535BCE8E120F0D8D070 /* MASShortcutView+Bindings.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + ACD3D417D834EBD534A3E18B3C01B597 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26580914BABDC16C8FB464FE319029B4 /* Disposable.swift */; }; + ACE988968174554A0ED558154694E95E /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FDB1E75DB13288544C739E40C5BE9EF /* ObservableConvertibleType.swift */; }; + ADD593AFC898ADE7B8FC61DF7BAA4964 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33BF1B946B229E3493A637930A931DA2 /* Range.swift */; }; ADE45FBACDF07286A544DC20605FE624 /* Pods-proxy_conf_helper-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CE50445A73ECB9A2ED31A6FF93D45808 /* Pods-proxy_conf_helper-dummy.m */; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B35228496116138E6C03F6FB1876BD1D /* SessionManager.swift */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15EC031236E7C3009E6DD401034BC35C /* MultipartFormData.swift */; }; - B7EF65DA3A34ABF3B41F50ADCD198BDC /* GCDWebServerFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BC7E8CD72FA119611A23DE041B5140C /* GCDWebServerFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43B60DA8283067C12C45F7338A462531 /* Validation.swift */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5E61ED6EF54C18FAE2F06428E22B93 /* ParameterEncoding.swift */; }; - C06EE84D23391E9FA94864DEDE34F548 /* fr.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 90E14D041108C5A6D6FAFADB704613D9 /* fr.lproj */; }; - C50FA5B211B8916770FBE55623B83DA4 /* MASLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = E4E079712B84EA33FBDC4B6E81D8D79E /* MASLocalization.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - C96E54153198E59FF0F8B9F7408523E0 /* GCDWebServerDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = C43BE7EB97552AD3EE8563CFD356D50F /* GCDWebServerDataResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567D8F212F4A6315C60FB1515F8887A2 /* Response.swift */; }; - CD97073476795E5EAA07C91A7F7890D2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */; }; - D2B04C075D6CA6AF10C35D8BF7DEF0D3 /* GCDWebServerFileRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 530C22E2895216346F4F87BF7F436BC7 /* GCDWebServerFileRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - D63E514E26A060F7C90A92AE8E9B49F9 /* GCDWebServer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 13CA6609061354DCC3F02C0EB2CEE5D0 /* GCDWebServer-dummy.m */; }; - D6EA93219364CDC135BAFE63084F6361 /* es.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 53D5DAAB111208B30EE6665B457791CA /* es.lproj */; }; - D7524216B4C0994A50624825DFB7CB6B /* GCDWebServerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = ACFB62D4A50AD45388DA32F0097C2241 /* GCDWebServerConnection.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - DE24C629B3DB152EE4924B56E3CC59F5 /* pl.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 1456802B211CB503F6773EFFB0E476EC /* pl.lproj */; }; - DFA6E4455415B3EB3BB38A9F48EEB044 /* Shortcut.h in Headers */ = {isa = PBXBuildFile; fileRef = F9FDACFE0997D2388C81600CA61071F2 /* Shortcut.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E5312C0FED7C61135F252D3A7A112990 /* MASShortcutView.m in Sources */ = {isa = PBXBuildFile; fileRef = B5DFF804A6D3BFC409429DA682703A50 /* MASShortcutView.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - E560A21728B29AF234BD0F37AFE16F36 /* en.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 9173DC735D07558D20262553791D744B /* en.lproj */; }; - E62DD91C60246BD1E4E8A0AF5D7BF0E7 /* GCDWebServerErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 88148F9C1CEE4F1EEF82261BBF938A56 /* GCDWebServerErrorResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - E66F7AFACFC665B23022A09E46815B5C /* it.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 8695AB6FAA639E36640736E4AE90D07C /* it.lproj */; }; - E97573A653DE3A4CB8BAC26FB7B3E9A9 /* MASShortcutView+Bindings.h in Headers */ = {isa = PBXBuildFile; fileRef = 59772212BCB28ACB3B10D04732ED8F8D /* MASShortcutView+Bindings.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EA6D2E46B967F447FFC46520EC328B5E /* GCDWebServer.h in Headers */ = {isa = PBXBuildFile; fileRef = B3C847943F2CAD8774184593F62DEC64 /* GCDWebServer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EE3A79FAA60A198321767854B60B772F /* MASDictionaryTransformer.h in Headers */ = {isa = PBXBuildFile; fileRef = CB1D03EE623DEF2B8C167F389083A657 /* MASDictionaryTransformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EE85F313D5EC70842C812EB16038F4F2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 422368F6E15C06536EA1297767A63D08 /* Carbon.framework */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387EBC243C3CB5EBDADEFA39399C8A31 /* Notifications.swift */; }; - EFFA4247C90B98FD9160F30905A64569 /* cs.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 523EB4117774721D3A84582CA66D9CCA /* cs.lproj */; }; - F359857602B1D4C91B4AC3D1A2CDFE1B /* GCDWebServerFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 734ECD2C008F0A0CDEA641B3EF6983D3 /* GCDWebServerFunctions.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - F44386819D44846A436139CEF3D372A5 /* zh-Hans.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 52A033C0DC8B549D3F002F7D4207F0BC /* zh-Hans.lproj */; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E1D63EDF5C7E2D22DA611D440AE114 /* ResponseSerialization.swift */; }; - F8815ECB42FCF09BBC99D3730DFD577C /* MASShortcut.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8F6AD8817DCDF5C429973DFDE855650C /* MASShortcut.bundle */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C5576728407128F3BE8D96B7922923 /* Alamofire.swift */; }; - F94ACA6AA0DD416E5BF05E2425E5F2A6 /* MASKeyCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BB03A2A83487FFAD6E394F39AFE570EA /* MASKeyCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FBF219CBB84DD6F373B818708C889C9D /* GCDWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0ED1AABBB1434105BE0249A77C1D5435 /* GCDWebServer.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + ADE52CEC3C99C491579C84EAD1E9A3AC /* Producer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DBFE4A2BEA99797EECA6F80B01CDD6C /* Producer.swift */; }; + AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F62634DC9F384C9CC41CEDA292858659 /* SessionManager.swift */; }; + AFD698CCB4B270EA10CA5674A7C5FEE7 /* URLSession+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84CA690C1F208F1306162397DEABE31E /* URLSession+Rx.swift */; }; + B2B321D56AF649DAC3D75F6A020ADD55 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B17A240A53E7810AEDB4E2936154C885 /* DispatchQueueConfiguration.swift */; }; + B32863B4B34268AE9E40AEFE5A0C648A /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0356020230831FEF31796FF613BF8AC /* ReplaySubject.swift */; }; + B424B5ADC87DCB8566E2DF93378702C4 /* Debunce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E154A2F60883D6C1571925AC73829D7 /* Debunce.swift */; }; + B537A51B17BDBA5000C8AFBF5F5D644C /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C8902E07EA5E5DE5E621971E1B5762 /* Debug.swift */; }; + B58863122018B82BEDE5700BFA85D96D /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8BCA33BF99DD786DF82E4D02D5E7F3D /* TailRecursiveSink.swift */; }; + B6113F6876CC1EC5942329D951F51F99 /* ImmediateScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B79A9D696C3F4750347FA86B4C4CC412 /* ImmediateScheduler.swift */; }; + B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 637833F0E5DBD5017099EF0583351872 /* MultipartFormData.swift */; }; + B6B0BFAA4B2EDC9B19FFFFF98535A30B /* BooleanDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCFD4F040A53B3A3EF03BEB2CC74220 /* BooleanDisposable.swift */; }; + B738E54C921B7EB262AAFE452EF5E5B9 /* Using.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DC76F872C5CE141D7A381C3ED86F83 /* Using.swift */; }; + B7CD8326E8B8F502F56AF37EE47E1F2E /* ObserveOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049B3D3D49998DB466FEB6A07B58CE38 /* ObserveOn.swift */; }; + B7D1CCC7182ED2604819332A6B26BC1C /* TakeWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6510627A459986B2675C9DF04BB19716 /* TakeWhile.swift */; }; + B7EF65DA3A34ABF3B41F50ADCD198BDC /* GCDWebServerFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BADCC46C21E3D39AF50D9AEC5800CFC /* GCDWebServerFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B99557A2D1CECD83B2AC7D8EE83E2162 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191592A653EE5E76F4D61D104274AA51 /* Errors.swift */; }; + BAC1B51CD0A87789B317FBD5BB06552A /* DelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3624B117D9AC549B1CAED71ACDA6FD /* DelegateProxy.swift */; }; + BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0A9B8CFF8FE0E517E372F3A135E25 /* Validation.swift */; }; + BD9A8D8F883436D80DAA180092826F59 /* ControlEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF1D18BE7EFD12AA66C3376332FEF003 /* ControlEvent.swift */; }; + BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AB8F8AA0CF2C7D1D506FB9347CAD420 /* ParameterEncoding.swift */; }; + BF9CC03D9F304A3B5882DA4C27AB4B49 /* SectionedViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23AF045F391083D9003B490F27BEF7D5 /* SectionedViewDataSourceType.swift */; }; + BFEA88B702838FD3731D4A289FDC060E /* VirtualTimeScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07FDE0C81FDCEF30B795BD32553111FA /* VirtualTimeScheduler.swift */; }; + C06EE84D23391E9FA94864DEDE34F548 /* fr.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 681AD0AD3FE6075FD0C745A2368127DB /* fr.lproj */; }; + C22C6ECD95AFB9E35C25D316E25D5F7C /* NSLayoutConstraint+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A283ECB7F07204392F8B86F905B1B7A /* NSLayoutConstraint+Rx.swift */; }; + C50FA5B211B8916770FBE55623B83DA4 /* MASLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EA43362B8170DE6F84E11B91A09EC32 /* MASLocalization.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C54AAB75EA7AEA2EC09044E5673A0C34 /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AA715B5CFDDF37B623E756474221F9 /* CompositeDisposable.swift */; }; + C6B37A8FF222504586343B2DFA9AEF7A /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = D12E7DBD1E1B501117F95768ED20BBEC /* SubscribeOn.swift */; }; + C83FB3FA4A1BEC6F9C237CDDDECA76A5 /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9350C02E503091FE07AEC409372D8DA0 /* NopDisposable.swift */; }; + C92206868B5A8ABFC32E91D7A830C8FF /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F76C18CDD50BC726A1A9F9713808F70 /* ObserverType.swift */; }; + C96E54153198E59FF0F8B9F7408523E0 /* GCDWebServerDataResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = CD9A1A157A1A6F85D6AAE2A82E930E2C /* GCDWebServerDataResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + C9D831152A4A9CC9A0AD132C27727ADD /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FFD8762948A54487F18FE67BEE8F77F /* ElementAt.swift */; }; + CA3A97285A08BEC4505C953D548660FB /* ControlProperty+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CF036C948FB845526B616E2A9485814 /* ControlProperty+Driver.swift */; }; + CA3B4A6F5154DA40B8713EF5A2AFDA20 /* NSButton+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61722C6F303EAAE1C5638EE5B33DD66A /* NSButton+Rx.swift */; }; + CA4D925D276335F92C0476A4BB100312 /* Observable+Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8959F53CCE7B042DCD8B664A46438B /* Observable+Debug.swift */; }; + CA65999C4112C3EC6D71C5C8E70EA9D5 /* RecursiveScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CAAF792369765F875B4FABB87ECE3EE /* RecursiveScheduler.swift */; }; + CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 877E161F31772E123DCD4BC8EAA3EB75 /* Response.swift */; }; + CB921D3307D0CEE4CD1472946BFC184E /* ConnectableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB043A7F7ED4CC26A55E3EAF07D57BC /* ConnectableObservable.swift */; }; + CD97073476795E5EAA07C91A7F7890D2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */; }; + D0E12AD3CCD78DC53A391809FC085C69 /* WithLatestFrom.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51CD43BBF9E07B471180B3C6A10EC0C /* WithLatestFrom.swift */; }; + D1E502592E9BE6AC042E2BCF0CA546E4 /* ObserverBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A563269DDD44C5472F388FE17CF34B /* ObserverBase.swift */; }; + D2B04C075D6CA6AF10C35D8BF7DEF0D3 /* GCDWebServerFileRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A9743EE40CDB23A5B902DCA0EACD4F8 /* GCDWebServerFileRequest.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D3117D8EA464B11367A3111EC49F544A /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E58577DB359E44ED81D9764E891B1E47 /* Variable.swift */; }; + D427A2DEF72EE38F35E0180E6CEA7836 /* UIBindingObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A487D891BF9234985AA4099272A55F /* UIBindingObserver.swift */; }; + D4B59D90C107A21A4E79D5F1E438791A /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07CBE0BD61056E4192366A2BEB5035FF /* DisposeBag.swift */; }; + D5E905369D09381D329C16B04EB087DB /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD14A3E25D58B573F248D9BAEFB1FD96 /* Filter.swift */; }; + D63E514E26A060F7C90A92AE8E9B49F9 /* GCDWebServer-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3934F71A55252BAEC1B840B4FB0F5831 /* GCDWebServer-dummy.m */; }; + D6E485F4B677A8530CE25D81F2F21BE4 /* CurrentThreadScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 399C88A36ABC21E580DC529BB5ABD62D /* CurrentThreadScheduler.swift */; }; + D6EA93219364CDC135BAFE63084F6361 /* es.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 5CC992AE60F80ABE4AF96D7FB5D21FE1 /* es.lproj */; }; + D7524216B4C0994A50624825DFB7CB6B /* GCDWebServerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED1793F25CA7EA6496FF4ACB5360784 /* GCDWebServerConnection.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + D96B27ACC1B194C3E1B658E67687C195 /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB026E9D4AF4C5FBA8F291E002660852 /* ConnectableObservableType.swift */; }; + DA4140910A4A22776536B76470DF9A1B /* RxTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = D99D4398615AB6F4E3F9A978A1FBBBD1 /* RxTarget.swift */; }; + DB94D782C6F193FB6F56D52926F2A84B /* RxCocoa-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F4B4BFA85D88E0779216DDD104D2F899 /* RxCocoa-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DCEB8485F9DF589F1052AC9BAF1BF386 /* SkipUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77550063B64F014D70901594CE2B8AD /* SkipUntil.swift */; }; + DDA9DBF8AD0279173E5FCB78BAA1FBF1 /* Concat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C4D7DBC6617F730997D93E6D496A63 /* Concat.swift */; }; + DE24C629B3DB152EE4924B56E3CC59F5 /* pl.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 4FA5AD2B9A1E8DE99434B14B3549E0B9 /* pl.lproj */; }; + DF2762B53F71DBC62F8CE6D5A89E7461 /* _RXDelegateProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5378A3AA30126867581EB3932CC75611 /* _RXDelegateProxy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DFA6E4455415B3EB3BB38A9F48EEB044 /* Shortcut.h in Headers */ = {isa = PBXBuildFile; fileRef = AD4ECEBBCA289543D5E13C73371BCCB3 /* Shortcut.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DFD85B645794CFCD77427C115F61B528 /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAE504DB6511ED954C7F3F53D78EFE96 /* Reactive.swift */; }; + E0A7C2B4EF093E65496C31BE8AE154EF /* ShareReplay1WhileConnected.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8E064CAF79139120E3D4F21DB6061FE /* ShareReplay1WhileConnected.swift */; }; + E2B2B2682B2F4AD8A0BF7F9007AFFE2E /* ObservableConvertibleType+SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6581F3ACC8B4396727CEB2528B37F04 /* ObservableConvertibleType+SharedSequence.swift */; }; + E33E79B8BBB9FDCA0B0CAA15B335CF18 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = F774A8AA7CF1C667887EFD6BB875DBBD /* Bag.swift */; }; + E4EF88D306B62375F97BFE1AF85C8CED /* ControlProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB870B11C1F6D4D44DFD74BC9A31C93 /* ControlProperty.swift */; }; + E5312C0FED7C61135F252D3A7A112990 /* MASShortcutView.m in Sources */ = {isa = PBXBuildFile; fileRef = EB98EC4AC6562F031A89D824210E36CF /* MASShortcutView.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E560A21728B29AF234BD0F37AFE16F36 /* en.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 92D90F1E9B3DB74E13DAEE89D729C388 /* en.lproj */; }; + E5FCD7D6CC4A3267A6DBCD636BFBCB90 /* NSObject+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BF8977C2D21F0E3E6B4809F5512A9B6 /* NSObject+Rx.swift */; }; + E62DD91C60246BD1E4E8A0AF5D7BF0E7 /* GCDWebServerErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 296DBD7B4C2829639C9DF408009E61C1 /* GCDWebServerErrorResponse.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E650654EFC351E571C296AE3E66B8CBC /* Driver+Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E84CF71B17BFE084E0D16395EDB8885 /* Driver+Subscription.swift */; }; + E66F7AFACFC665B23022A09E46815B5C /* it.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 454D73DC3052FCEF303D57FAB12CC353 /* it.lproj */; }; + E8BA7E89E83AD1FF70C0B8D690CE7EEF /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91CFF9598EE190FD0A1231111991540B /* ConcurrentDispatchQueueScheduler.swift */; }; + E97573A653DE3A4CB8BAC26FB7B3E9A9 /* MASShortcutView+Bindings.h in Headers */ = {isa = PBXBuildFile; fileRef = 64D4E87F4D1E140147BC9F1FD6C31A64 /* MASShortcutView+Bindings.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EA6D2E46B967F447FFC46520EC328B5E /* GCDWebServer.h in Headers */ = {isa = PBXBuildFile; fileRef = C7BA15653BA24C8CB2D6A810BD172EB4 /* GCDWebServer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EBEBC8730F86241C0D7D2BD8BB4A4F5F /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A27E7196730EA8A4F03EECF2B8D2643A /* SubscriptionDisposable.swift */; }; + EBEFF85070E25F0A581B7BA1E08138AC /* Pods-ShadowsocksX-NG-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 24B01D81E3D7058FA14A053EC19874D0 /* Pods-ShadowsocksX-NG-dummy.m */; }; + EC499031542915CA54C314AE2781C6BA /* _RXKVOObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = DDF9D2AC2FD4CD42F8B089BAFDE4C6BD /* _RXKVOObserver.m */; }; + ED084F37DBC7F8C6BF80DB85883C67D4 /* SynchronizedSubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52FF9201C9E5F013F957000A1108C6E9 /* SynchronizedSubscribeType.swift */; }; + EDC71599268E09BB4590CCB4E9921855 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE0E8A058AF30A041E8DB6F051BBDE16 /* Queue.swift */; }; + EE3A79FAA60A198321767854B60B772F /* MASDictionaryTransformer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB5237BDF54A20103EBE82BDC80B5C6 /* MASDictionaryTransformer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EE85F313D5EC70842C812EB16038F4F2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EFD468F10CD22B3EFAB406DAC3FCC7C9 /* Carbon.framework */; }; + EF0DEE821A473B32E266EA6F4AE03A8B /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC1640F774F19AE41AEC0772358B7D1 /* Bag+Rx.swift */; }; + EF34AC8DFCCDA7E37B2BAFB23B8CC208 /* Deferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5BA2BD2D1A8648107C13AA73BCF0AE2 /* Deferred.swift */; }; + EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EBE7C5174BB4B63F44349A15EE826AF /* Notifications.swift */; }; + EFFA4247C90B98FD9160F30905A64569 /* cs.lproj in Resources */ = {isa = PBXBuildFile; fileRef = EBF2BBFDA4F26C440DB709FAC5D3F25C /* cs.lproj */; }; + F13411F6487E4AE13417D98635C36FB1 /* Buffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F03278787D78510DCEEDDFAB06AD42F6 /* Buffer.swift */; }; + F192F14395D111EAE279D849E233CA6B /* NSControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CF90C9854898D2869D0FA04F6FEFD51 /* NSControl+Rx.swift */; }; + F1FC058E962CB5A786654E301515F175 /* RxCocoa.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF832054667391DF7219EEC7E1426BFB /* RxCocoa.swift */; }; + F20BC8E29804469E866991EBEE2C81B9 /* NSObject+Rx+KVORepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FF24549EBA19FE3868F5A0F0A65C24 /* NSObject+Rx+KVORepresentable.swift */; }; + F2853E97BDDC82B8F91AE2954D27F775 /* RxSwift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 32333F64D65C89D5A002F9CB80C2CDE2 /* RxSwift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F2FFE741AC2834ABDA25E19C4B553B6E /* RefCount.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFA24FA42F80B63EFCE3B8D7EAEEB17E /* RefCount.swift */; }; + F359857602B1D4C91B4AC3D1A2CDFE1B /* GCDWebServerFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 261510805F67C14BBF23BD04C18168E9 /* GCDWebServerFunctions.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + F44386819D44846A436139CEF3D372A5 /* zh-Hans.lproj in Resources */ = {isa = PBXBuildFile; fileRef = D55A3EC1AA96E83A76F91664C4C2F29D /* zh-Hans.lproj */; }; + F4AF312CC6AFB71721D0F16DDED1028C /* StartWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = D318C435E4EBC421BC050713E69DE0D2 /* StartWith.swift */; }; + F4DE46050B00D9C5E0D8AFB79C9BBF96 /* HistoricalScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA7BED190A171843822577606510B95 /* HistoricalScheduler.swift */; }; + F6069304E6720CD883040BD4C6348423 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2EC79DAE53D1D70A47EBAFD39ED862E /* Bag.swift */; }; + F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2EF9DEF408D295E5391455E123DD67 /* ResponseSerialization.swift */; }; + F7319C5D6B81343F0D43A8CD903AD9D1 /* CombineLatest+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1240BCF9D45671D109A354E1255C9D0C /* CombineLatest+arity.swift */; }; + F75888E0217E015253A9C120DF4E31D3 /* Observable+Creation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C64F36BE9F05BDE74A3E670E69A4432E /* Observable+Creation.swift */; }; + F8815ECB42FCF09BBC99D3730DFD577C /* MASShortcut.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 288F0992DFCC5E6027AA31FD385C34D6 /* MASShortcut.bundle */; }; + F88CA5676D6FEE75F80D102E13BFB568 /* Observable+Binding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 230CC565B82B68200C82450AC93A5CE6 /* Observable+Binding.swift */; }; + F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EA1AA7BA748C2B699B5B73C3E690211 /* Alamofire.swift */; }; + F94ACA6AA0DD416E5BF05E2425E5F2A6 /* MASKeyCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = DDB7132E575EAC0CA9B48A0425DAAD21 /* MASKeyCodes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FBF219CBB84DD6F373B818708C889C9D /* GCDWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = C743F524B10FDE01231455A0541D06DC /* GCDWebServer.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + FC2A6E0CEAD8E453D54189928819140D /* Do.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30522BE8DC862EF75E5D63648F9179F3 /* Do.swift */; }; + FC558372E13AAD8016536702B3964C0D /* NSNotificationCenter+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E92EE455CBA70E47FF6E1B2A8A8F10 /* NSNotificationCenter+Rx.swift */; }; + FD09105291CBA39191AF89BACC9F1538 /* Delay.swift in Sources */ = {isa = PBXBuildFile; fileRef = A131F62F3B9E538F5835420C712C9967 /* Delay.swift */; }; + FF647F4502B0AE29095FA14A256612EE /* _RXKVOObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 30EACF50723CFE5FA01F06A95D09A211 /* _RXKVOObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 0C759341A52320E6F69A83D0A2CA9706 /* PBXContainerItemProxy */ = { + 3C966E4001966C610E2B35B4896D0EA0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9759FFB1455B05FE96A5765890590110; + remoteInfo = RxSwift; + }; + 3F9C089DC9458E35616C2D072F1349CE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; + remoteInfo = Alamofire; + }; + 5A421F3FED66CE2F7D5D41431FD05426 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 50DA2BB85DEBA27DDBB9E2D53E8E2A1A; + remoteInfo = RxCocoa; + }; + 73B1C6F65534B8F327FD1E3C4EFB4D79 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; remoteGlobalIDString = 5B8B0ED1046111D92895FC95F12DBC10; remoteInfo = GCDWebServer; }; - 8C9C31725D43E9B51254EF5E8D6D91FB /* PBXContainerItemProxy */ = { + 7BF76F7FBFF9CC917BC74620BE20739E /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; remoteGlobalIDString = 00C94ED0B49A44FBF0C4E2F6C875CFFC; remoteInfo = MASShortcut; }; + 9AAE001A73362881B10E1F0C00EDCC5C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9759FFB1455B05FE96A5765890590110; + remoteInfo = RxSwift; + }; A7708F6CFFF6E4FD2E6FDB5109CDF5E7 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; @@ -135,13 +370,6 @@ remoteGlobalIDString = D6E5ED8DAF7CA937C8F68F342C48B26E; remoteInfo = "MASShortcut-MASShortcut"; }; - CC7BBA37399118CF89A7E1A674EF83EE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; FDE579D9762D0D9F86EDB1DE6EADE62F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; @@ -152,149 +380,364 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 048EA0F03DC206107638B14EB0B22590 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + 00C649D6C2694F89369C6E4BFDF7020D /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; + 041B57D22A62A24545E85A4646383BA5 /* GCDWebServerConnection.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerConnection.h; path = GCDWebServer/Core/GCDWebServerConnection.h; sourceTree = ""; }; + 049B3D3D49998DB466FEB6A07B58CE38 /* ObserveOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOn.swift; path = RxSwift/Observables/Implementations/ObserveOn.swift; sourceTree = ""; }; + 04A06344257808FD1937BDB41F18B407 /* MASShortcut-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MASShortcut-prefix.pch"; sourceTree = ""; }; + 0543E52D336EE3D670FA0326B542D1AD /* ObservableConvertibleType+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+Driver.swift"; path = "RxCocoa/CocoaUnits/Driver/ObservableConvertibleType+Driver.swift"; sourceTree = ""; }; 054C3E84057CD06DB85D99E7AD207F48 /* Pods-proxy_conf_helper.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-proxy_conf_helper.debug.xcconfig"; sourceTree = ""; }; - 08089D3F4CC12076D2D2B8794E4BC321 /* GCDWebServerURLEncodedFormRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerURLEncodedFormRequest.h; path = GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h; sourceTree = ""; }; - 084AC6693EA56EA74BB4D3AC5F654C90 /* BRLOptionParser.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = BRLOptionParser.xcconfig; sourceTree = ""; }; + 0621C0B43DFC90DF41B61359E759D5D3 /* RetryWhen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RetryWhen.swift; path = RxSwift/Observables/Implementations/RetryWhen.swift; sourceTree = ""; }; + 07C3DED13280C0FE73368A82866875B7 /* GCDWebServerHTTPStatusCodes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerHTTPStatusCodes.h; path = GCDWebServer/Core/GCDWebServerHTTPStatusCodes.h; sourceTree = ""; }; + 07CBE0BD61056E4192366A2BEB5035FF /* DisposeBag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBag.swift; path = RxSwift/Disposables/DisposeBag.swift; sourceTree = ""; }; + 07FDE0C81FDCEF30B795BD32553111FA /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; 089EB7E66F64D3A19BB7681AFCE91031 /* Pods-ShadowsocksX-NG.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ShadowsocksX-NG.release.xcconfig"; sourceTree = ""; }; - 0A7F223B1591E9E8650F297A91EA618B /* GCDWebServer.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GCDWebServer.xcconfig; sourceTree = ""; }; - 0C3DFC72D09E04176703E5C47943F521 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 0C5179B0059EA422CE3E0CD9D544A9B1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 08BD28C9755413291F8752D325956F13 /* RxCocoa.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RxCocoa.h; path = RxCocoa/RxCocoa.h; sourceTree = ""; }; + 09404441C1943A1C1C15699C71F33D2D /* VirtualTimeConverterType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeConverterType.swift; path = RxSwift/Schedulers/VirtualTimeConverterType.swift; sourceTree = ""; }; + 0A9743EE40CDB23A5B902DCA0EACD4F8 /* GCDWebServerFileRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFileRequest.m; path = GCDWebServer/Requests/GCDWebServerFileRequest.m; sourceTree = ""; }; + 0AA9F9CD0EB270DDA2ED76FD3446F305 /* GCDWebServerMultiPartFormRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerMultiPartFormRequest.m; path = GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m; sourceTree = ""; }; + 0AD4268847B9453CE579C41B609E22B7 /* DelegateProxyType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelegateProxyType.swift; path = RxCocoa/Common/DelegateProxyType.swift; sourceTree = ""; }; + 0B87C81B82992789E3611469980A1778 /* Variable+SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Variable+SharedSequence.swift"; path = "RxCocoa/CocoaUnits/SharedSequence/Variable+SharedSequence.swift"; sourceTree = ""; }; + 0C8A6200FBBE9F05CEF009C65C0AE129 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; + 0DF6EBFF755554CC9AB8962CD97A8DC3 /* DistinctUntilChanged.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DistinctUntilChanged.swift; path = RxSwift/Observables/Implementations/DistinctUntilChanged.swift; sourceTree = ""; }; + 0E84CF71B17BFE084E0D16395EDB8885 /* Driver+Subscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Driver+Subscription.swift"; path = "RxCocoa/CocoaUnits/Driver/Driver+Subscription.swift"; sourceTree = ""; }; 0E8A27A8C9BD6FF9AE3DCBC4050CCD76 /* Pods-ShadowsocksX-NGTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ShadowsocksX-NGTests-frameworks.sh"; sourceTree = ""; }; - 0ED1AABBB1434105BE0249A77C1D5435 /* GCDWebServer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServer.m; path = GCDWebServer/Core/GCDWebServer.m; sourceTree = ""; }; - 107BD367638AFAC8F3E01D42A0D1DECE /* Pods_ShadowsocksX_NGTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ShadowsocksX_NGTests.framework; path = "Pods-ShadowsocksX-NGTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 0F592655CCDF43D1184F7DCC5E7E4FD4 /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Implementations/Optional.swift; sourceTree = ""; }; + 0FB5237BDF54A20103EBE82BDC80B5C6 /* MASDictionaryTransformer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASDictionaryTransformer.h; path = Framework/MASDictionaryTransformer.h; sourceTree = ""; }; + 1240BCF9D45671D109A354E1255C9D0C /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/Implementations/CombineLatest+arity.swift"; sourceTree = ""; }; + 12DA49F9E5238CF2A4EBB5A83A1AE3DA /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Implementations/Zip+arity.swift"; sourceTree = ""; }; 13333F29A08390FCEFECA0FDCDDC919F /* Pods-ShadowsocksX-NG-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ShadowsocksX-NG-frameworks.sh"; sourceTree = ""; }; - 13CA6609061354DCC3F02C0EB2CEE5D0 /* GCDWebServer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GCDWebServer-dummy.m"; sourceTree = ""; }; - 1456802B211CB503F6773EFFB0E476EC /* pl.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = pl.lproj; sourceTree = ""; }; + 139134EE845E284F4B3ED2EF2F9A302B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = DEVELOPER_DIR; }; + 13DC76F872C5CE141D7A381C3ED86F83 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Implementations/Using.swift; sourceTree = ""; }; + 145175C8AA8A892EBA0AEC97F7612D90 /* _RXObjCRuntime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXObjCRuntime.h; path = RxCocoa/Runtime/include/_RXObjCRuntime.h; sourceTree = ""; }; 14A9EC2BB1EC6484018A5EB4B9B2C231 /* Pods-ShadowsocksX-NG-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ShadowsocksX-NG-umbrella.h"; sourceTree = ""; }; - 15B24A5DDAD858CD6616DD64178BB7A6 /* GCDWebServerErrorResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerErrorResponse.h; path = GCDWebServer/Responses/GCDWebServerErrorResponse.h; sourceTree = ""; }; - 15EC031236E7C3009E6DD401034BC35C /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - 1854166C986170C7CC1EC2E0441FBB08 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 14FD2EAF92039F913842A87BA5122B62 /* MASShortcutBinder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutBinder.m; path = Framework/MASShortcutBinder.m; sourceTree = ""; }; + 156BD4BE88EBFE3B4B75AB2159FFEA69 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 1633F46EA774BF24EF9CCD7B8CB200E8 /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; + 18C31186BA3198D89D82D666FBB1905C /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Implementations/Empty.swift; sourceTree = ""; }; + 191592A653EE5E76F4D61D104274AA51 /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = RxSwift/Errors.swift; sourceTree = ""; }; 1A8CE48109F7ED7873F4FF9D2D3603AD /* Pods-proxy_conf_helper-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-proxy_conf_helper-acknowledgements.markdown"; sourceTree = ""; }; - 1E4066248D5CB3239512D186B38644FD /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; + 1B2EF9DEF408D295E5391455E123DD67 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 1B9E3352BCF62F8787D5BBC941EEA516 /* RxCocoa.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = RxCocoa.modulemap; sourceTree = ""; }; + 1CB76F5333C4E30B9798A7CB70CCB81F /* TakeUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeUntil.swift; path = RxSwift/Observables/Implementations/TakeUntil.swift; sourceTree = ""; }; + 1DB870B11C1F6D4D44DFD74BC9A31C93 /* ControlProperty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlProperty.swift; path = RxCocoa/CocoaUnits/ControlProperty.swift; sourceTree = ""; }; + 1DCF2459B4B59AA53E371B3303793795 /* MASHotKey.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASHotKey.h; path = Framework/MASHotKey.h; sourceTree = ""; }; + 1E6D6DE4E89E068F148B72C3C94E25CF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1E8F8E501B0EEF1A98B9B7557686F4DC /* ru.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ru.lproj; sourceTree = ""; }; + 1EA1AA7BA748C2B699B5B73C3E690211 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; 1F162D37B7B6534A6D80FEE301F586EE /* Pods-ShadowsocksX-NGTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ShadowsocksX-NGTests-acknowledgements.plist"; sourceTree = ""; }; - 1F7F511A7BB871D77D80C8B376050327 /* GCDWebServerDataResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerDataResponse.h; path = GCDWebServer/Responses/GCDWebServerDataResponse.h; sourceTree = ""; }; - 2301425B249CDDF65E3D16C6A2C1948F /* GCDWebServer.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = GCDWebServer.modulemap; sourceTree = ""; }; + 207CF7A03B53C4DF00C68FBBF1C6E8F7 /* Observable+Aggregate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Aggregate.swift"; path = "RxSwift/Observables/Observable+Aggregate.swift"; sourceTree = ""; }; + 230CC565B82B68200C82450AC93A5CE6 /* Observable+Binding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Binding.swift"; path = "RxSwift/Observables/Observable+Binding.swift"; sourceTree = ""; }; + 23863CFA627473DC27B67457C49C2E18 /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; + 23AF045F391083D9003B490F27BEF7D5 /* SectionedViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SectionedViewDataSourceType.swift; path = RxCocoa/Common/SectionedViewDataSourceType.swift; sourceTree = ""; }; 24B01D81E3D7058FA14A053EC19874D0 /* Pods-ShadowsocksX-NG-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ShadowsocksX-NG-dummy.m"; sourceTree = ""; }; - 253E551C1B9859C14CFA9C52573A09F5 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - 2622E50F246A10BAC80FCFDF60CDB349 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 26798DB74F28DE87259D2EC77916C658 /* MASShortcutValidator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutValidator.h; path = Framework/MASShortcutValidator.h; sourceTree = ""; }; - 26D435359785FE007E5ACEC4D7D21967 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - 281F888B9FFA5F230A528564E73518DF /* GCDWebServerFileRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFileRequest.h; path = GCDWebServer/Requests/GCDWebServerFileRequest.h; sourceTree = ""; }; + 25054C0604BDF8F039586E1B8351F0C6 /* MASShortcutMonitor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutMonitor.h; path = Framework/MASShortcutMonitor.h; sourceTree = ""; }; + 261510805F67C14BBF23BD04C18168E9 /* GCDWebServerFunctions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFunctions.m; path = GCDWebServer/Core/GCDWebServerFunctions.m; sourceTree = ""; }; + 26339E7D90E6D149F805C377419D25BA /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; + 26580914BABDC16C8FB464FE319029B4 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = RxSwift/Disposable.swift; sourceTree = ""; }; + 288F0992DFCC5E6027AA31FD385C34D6 /* MASShortcut.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MASShortcut.bundle; path = MASShortcut.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 28A7A9E967BF724C11ED0D7AECD827B2 /* Amb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Amb.swift; path = RxSwift/Observables/Implementations/Amb.swift; sourceTree = ""; }; 28D7F65F9E64735E3320A028DCDDDD90 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 29C6391EC74D8F0B20D3C7B23F409A79 /* MASDictionaryTransformer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASDictionaryTransformer.m; path = Framework/MASDictionaryTransformer.m; sourceTree = ""; }; - 2A824D6AF73605FD4B0434931B70C7CE /* GCDWebServerStreamedResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerStreamedResponse.h; path = GCDWebServer/Responses/GCDWebServerStreamedResponse.h; sourceTree = ""; }; - 2BC7E8CD72FA119611A23DE041B5140C /* GCDWebServerFunctions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFunctions.h; path = GCDWebServer/Core/GCDWebServerFunctions.h; sourceTree = ""; }; - 2F9A804E1EB5515485FBC3A8075FCDFF /* GCDWebServerMultiPartFormRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerMultiPartFormRequest.m; path = GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.m; sourceTree = ""; }; - 332ACCF53DA56255BCDB92E92475A51E /* GCDWebServerMultiPartFormRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerMultiPartFormRequest.h; path = GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h; sourceTree = ""; }; + 296DBD7B4C2829639C9DF408009E61C1 /* GCDWebServerErrorResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerErrorResponse.m; path = GCDWebServer/Responses/GCDWebServerErrorResponse.m; sourceTree = ""; }; + 2AA25737DC8326205335C494D261A558 /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; + 2E65A0563A25A9BC5540C5C6752AFB8F /* Switch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Switch.swift; path = RxSwift/Observables/Implementations/Switch.swift; sourceTree = ""; }; + 2FD1D9CC9BD0DB820CE56BBDE2B6E01F /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + 30522BE8DC862EF75E5D63648F9179F3 /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Implementations/Do.swift; sourceTree = ""; }; + 30EACF50723CFE5FA01F06A95D09A211 /* _RXKVOObserver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXKVOObserver.h; path = RxCocoa/Runtime/include/_RXKVOObserver.h; sourceTree = ""; }; + 315C104108C26A838CCC718E8258B44A /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + 32333F64D65C89D5A002F9CB80C2CDE2 /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; + 32F52D2218ED1A55107BC548E297E9CB /* String+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+Rx.swift"; path = "RxSwift/Extensions/String+Rx.swift"; sourceTree = ""; }; 3358F45A5BEC1A7F725167CD1969EDC8 /* Pods-ShadowsocksX-NG-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ShadowsocksX-NG-acknowledgements.markdown"; sourceTree = ""; }; - 36E1D63EDF5C7E2D22DA611D440AE114 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MASShortcut.xcconfig; sourceTree = ""; }; - 38100CF1A92136DA8A810B1CD5D9D2B4 /* MASShortcutView+Bindings.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MASShortcutView+Bindings.m"; path = "Framework/MASShortcutView+Bindings.m"; sourceTree = ""; }; - 387EBC243C3CB5EBDADEFA39399C8A31 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 3A7262F05AABD2F2F8116F28E4444730 /* GCDWebServerRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerRequest.m; path = GCDWebServer/Core/GCDWebServerRequest.m; sourceTree = ""; }; - 3A74752374CF19171D7037E55F877396 /* MASShortcut.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = MASShortcut.modulemap; sourceTree = ""; }; - 422368F6E15C06536EA1297767A63D08 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Carbon.framework; sourceTree = DEVELOPER_DIR; }; - 43B60DA8283067C12C45F7338A462531 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 33BF1B946B229E3493A637930A931DA2 /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = RxSwift/Observables/Implementations/Range.swift; sourceTree = ""; }; + 3446B97BEC82628B5B70EBA865321925 /* MASShortcutMonitor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutMonitor.m; path = Framework/MASShortcutMonitor.m; sourceTree = ""; }; + 351ED3EC72E752AF671FC28B61B82EBB /* Observable+Single.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Single.swift"; path = "RxSwift/Observables/Observable+Single.swift"; sourceTree = ""; }; + 35C4D7DBC6617F730997D93E6D496A63 /* Concat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Concat.swift; path = RxSwift/Observables/Implementations/Concat.swift; sourceTree = ""; }; + 35C565B4B8F119EF72E6D99AE6C5FE4E /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 36D63AB3B2F8729D38D2243E79FA9D37 /* nl.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = nl.lproj; sourceTree = ""; }; + 3747A52D98BA28FA152080DA132B4955 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; + 375E8496E1F8683C57FE684DE6D592C1 /* Variable+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Variable+Driver.swift"; path = "RxCocoa/CocoaUnits/Driver/Variable+Driver.swift"; sourceTree = ""; }; + 3934F71A55252BAEC1B840B4FB0F5831 /* GCDWebServer-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GCDWebServer-dummy.m"; sourceTree = ""; }; + 399C88A36ABC21E580DC529BB5ABD62D /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; + 3A283ECB7F07204392F8B86F905B1B7A /* NSLayoutConstraint+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSLayoutConstraint+Rx.swift"; path = "RxCocoa/Common/NSLayoutConstraint+Rx.swift"; sourceTree = ""; }; + 3B2A679FC3BFF4F53FC9DF5CD71C6E75 /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; + 3BADCC46C21E3D39AF50D9AEC5800CFC /* GCDWebServerFunctions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFunctions.h; path = GCDWebServer/Core/GCDWebServerFunctions.h; sourceTree = ""; }; + 3CF036C948FB845526B616E2A9485814 /* ControlProperty+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ControlProperty+Driver.swift"; path = "RxCocoa/CocoaUnits/Driver/ControlProperty+Driver.swift"; sourceTree = ""; }; + 3E154A2F60883D6C1571925AC73829D7 /* Debunce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debunce.swift; path = RxSwift/Observables/Implementations/Debunce.swift; sourceTree = ""; }; + 3E39C3D16733CDCB7BAD80752EC7D239 /* KVORepresentable+Swift.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "KVORepresentable+Swift.swift"; path = "RxCocoa/Foundation/KVORepresentable+Swift.swift"; sourceTree = ""; }; + 3E83A23DEF6EC644ABA3997BE70BFA85 /* Observable+Bind.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Bind.swift"; path = "RxCocoa/Common/Observable+Bind.swift"; sourceTree = ""; }; + 3E94EA62172D30A25E824EE75E3D9C0B /* ControlEvent+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ControlEvent+Driver.swift"; path = "RxCocoa/CocoaUnits/Driver/ControlEvent+Driver.swift"; sourceTree = ""; }; + 3F13DE488DCBBAE4BDBC0CFC97574078 /* Sink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sink.swift; path = RxSwift/Observables/Implementations/Sink.swift; sourceTree = ""; }; + 3F8959F53CCE7B042DCD8B664A46438B /* Observable+Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Debug.swift"; path = "RxSwift/Observables/Observable+Debug.swift"; sourceTree = ""; }; + 4010445B50195F4EB7E0DD32DD2162C8 /* BRLOptionParser-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "BRLOptionParser-prefix.pch"; sourceTree = ""; }; + 406F80B90F80B783BD73B5494D32BF6E /* NSSlider+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSSlider+Rx.swift"; path = "RxCocoa/macOS/NSSlider+Rx.swift"; sourceTree = ""; }; + 430720C6D9B5E4034976BD314857E51E /* Multicast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Multicast.swift; path = RxSwift/Observables/Implementations/Multicast.swift; sourceTree = ""; }; + 43C28568E6E85CA37FC088179660CE6A /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; + 43F1B63559BBFA7E83623D1C9AC8E633 /* MASShortcut.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcut.h; path = Framework/MASShortcut.h; sourceTree = ""; }; + 44AB1ECD0CB22EBDA55B3C604C16B84E /* KVORepresentable+CoreGraphics.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "KVORepresentable+CoreGraphics.swift"; path = "RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift"; sourceTree = ""; }; + 44F0FB436EC76D655A87DDCE3F993478 /* RxCocoa-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxCocoa-prefix.pch"; sourceTree = ""; }; + 454D73DC3052FCEF303D57FAB12CC353 /* it.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = it.lproj; sourceTree = ""; }; + 456ACDE36340325DBB10D0B916626C43 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 460823F894F0F79E2B8E8992A02BFB25 /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableScheduledItem.swift; path = RxSwift/Schedulers/Internal/InvocableScheduledItem.swift; sourceTree = ""; }; 46662EB64876AD1C891F548C69A89E89 /* Pods-ShadowsocksX-NGTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-ShadowsocksX-NGTests-dummy.m"; sourceTree = ""; }; - 4779AB5A8E8180D6F562A9859A27095A /* ResourceBundle-MASShortcut-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-MASShortcut-Info.plist"; sourceTree = ""; }; - 4A78ADD0E2187A79B80359263F8D58DC /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 4BC10337C8AD93957F289E193D30644F /* MASShortcutView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutView.h; path = Framework/MASShortcutView.h; sourceTree = ""; }; - 4D83581D01E98E7FBCE531F4D826138A /* GCDWebServerDataRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerDataRequest.h; path = GCDWebServer/Requests/GCDWebServerDataRequest.h; sourceTree = ""; }; - 516F91C50535F8F6F640F67E641997A3 /* GCDWebServer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GCDWebServer.framework; path = GCDWebServer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 521DF5ED2D6DDCC2CD0241C6758A82E8 /* GCDWebServerPrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerPrivate.h; path = GCDWebServer/Core/GCDWebServerPrivate.h; sourceTree = ""; }; - 523EB4117774721D3A84582CA66D9CCA /* cs.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = cs.lproj; sourceTree = ""; }; - 52A033C0DC8B549D3F002F7D4207F0BC /* zh-Hans.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = "zh-Hans.lproj"; sourceTree = ""; }; + 46722F0D8851A939625EFF1E910938E4 /* GCDWebServerRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerRequest.m; path = GCDWebServer/Core/GCDWebServerRequest.m; sourceTree = ""; }; + 47E82A0897F8223FF68BA4F995D79C8D /* Logging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Logging.swift; path = RxCocoa/Foundation/Logging.swift; sourceTree = ""; }; + 48352BD4C4E074FC479B0513B92EA7F9 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + 4865DDF25A3AA8BBC5BE34A85F18D17C /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 49E673D8031F864FAD63560EA564B5DD /* zh-Hant.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = "zh-Hant.lproj"; sourceTree = ""; }; + 4F715D3AF178663A8CE6B81C0A481755 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/Implementations/TakeLast.swift; sourceTree = ""; }; + 4FA5AD2B9A1E8DE99434B14B3549E0B9 /* pl.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = pl.lproj; sourceTree = ""; }; + 4FEC4B8DFE8753A9B1DE598293568F30 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + 5093D2110C7158AE638018A9970FA168 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; + 50EDCCCDD718AFFEA7DF382AA8F0B9AD /* GCDWebServer-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GCDWebServer-prefix.pch"; sourceTree = ""; }; + 526ACD42F8C85B5E06999E3EC17B3AE9 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MASShortcut.xcconfig; sourceTree = ""; }; 52F51F94701ABD692BFFC9F92AE2E115 /* Pods-ShadowsocksX-NG-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-ShadowsocksX-NG-acknowledgements.plist"; sourceTree = ""; }; - 530C22E2895216346F4F87BF7F436BC7 /* GCDWebServerFileRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFileRequest.m; path = GCDWebServer/Requests/GCDWebServerFileRequest.m; sourceTree = ""; }; - 53A014B3A6C4E5CFA3E4DE307B90604A /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - 53D5DAAB111208B30EE6665B457791CA /* es.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = es.lproj; sourceTree = ""; }; - 567D8F212F4A6315C60FB1515F8887A2 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 59772212BCB28ACB3B10D04732ED8F8D /* MASShortcutView+Bindings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASShortcutView+Bindings.h"; path = "Framework/MASShortcutView+Bindings.h"; sourceTree = ""; }; - 5C4942853CFF0AF10EE0507A6DB64F7B /* GCDWebServerFileResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFileResponse.m; path = GCDWebServer/Responses/GCDWebServerFileResponse.m; sourceTree = ""; }; + 52FF9201C9E5F013F957000A1108C6E9 /* SynchronizedSubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedSubscribeType.swift; path = RxSwift/Concurrency/SynchronizedSubscribeType.swift; sourceTree = ""; }; + 53556765457290978538C38D5C2FDA48 /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; + 5378A3AA30126867581EB3932CC75611 /* _RXDelegateProxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXDelegateProxy.h; path = RxCocoa/Runtime/include/_RXDelegateProxy.h; sourceTree = ""; }; + 53D1C7024A81399E15CEE5B8F618A68E /* GCDWebServerStreamedResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerStreamedResponse.h; path = GCDWebServer/Responses/GCDWebServerStreamedResponse.h; sourceTree = ""; }; + 54065E050A33BF7D4D54D1A31297F2F1 /* GCDWebServerPrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerPrivate.h; path = GCDWebServer/Core/GCDWebServerPrivate.h; sourceTree = ""; }; + 55881B24D12F75F02F1EF97DBE920CF9 /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OperationQueueScheduler.swift; path = RxSwift/Schedulers/OperationQueueScheduler.swift; sourceTree = ""; }; + 566053EA157CE20DAA58DA72F901EAF3 /* GCDWebServer.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = GCDWebServer.modulemap; sourceTree = ""; }; + 576B7DEFF20932FE127908D3A5F4A54D /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; + 5804C71C9D97BB10B0FFE80E795CD85E /* GCDWebServerDataRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerDataRequest.m; path = GCDWebServer/Requests/GCDWebServerDataRequest.m; sourceTree = ""; }; + 5A232E9660CB723A1D128D3DFF830596 /* Catch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Catch.swift; path = RxSwift/Observables/Implementations/Catch.swift; sourceTree = ""; }; + 5AF29FABA8C360B08D7C7424360D6666 /* _RXObjCRuntime.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXObjCRuntime.m; path = RxCocoa/Runtime/_RXObjCRuntime.m; sourceTree = ""; }; + 5C8B549DF38B641E23F436DE84A1AB1F /* BRLOptionParser.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = BRLOptionParser.xcconfig; sourceTree = ""; }; + 5CA3F63B120DCD2B0AD8CA5A75890A10 /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; + 5CC992AE60F80ABE4AF96D7FB5D21FE1 /* es.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = es.lproj; sourceTree = ""; }; 5D84D92D27CE8A6F5C45E8A03155C1CF /* Pods-proxy_conf_helper-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-proxy_conf_helper-frameworks.sh"; sourceTree = ""; }; - 5DA31567241C5316DE5F728BA3DE8DA6 /* BRLOptionParser.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = BRLOptionParser.m; path = BRLOptionParser/BRLOptionParser.m; sourceTree = ""; }; - 67E329D8A58E01DFEDEBC4ECB73BCB04 /* MASShortcutValidator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutValidator.m; path = Framework/MASShortcutValidator.m; sourceTree = ""; }; - 69EABE25139B92E133ACB9E48FB95497 /* GCDWebServerDataRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerDataRequest.m; path = GCDWebServer/Requests/GCDWebServerDataRequest.m; sourceTree = ""; }; - 6B3D222C908B57140B734E3CF98FBE99 /* MASShortcutBinder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutBinder.m; path = Framework/MASShortcutBinder.m; sourceTree = ""; }; - 6E747DD2399CCE1B2803AD47C858B840 /* Pods_ShadowsocksX_NG.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ShadowsocksX_NG.framework; path = "Pods-ShadowsocksX-NG.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 73446AD40BC622BA16D088399746703A /* MASShortcut-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MASShortcut-dummy.m"; sourceTree = ""; }; - 734ECD2C008F0A0CDEA641B3EF6983D3 /* GCDWebServerFunctions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFunctions.m; path = GCDWebServer/Core/GCDWebServerFunctions.m; sourceTree = ""; }; - 7769179E7E99FFDE1312346DF91A8A1D /* MASShortcut.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcut.m; path = Framework/MASShortcut.m; sourceTree = ""; }; - 8134B11FCAB921895AB127714E70D06F /* MASShortcutMonitor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutMonitor.h; path = Framework/MASShortcutMonitor.h; sourceTree = ""; }; - 81A5C0C5F96747880A33B1404380A4FF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5DBFE4A2BEA99797EECA6F80B01CDD6C /* Producer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Producer.swift; path = RxSwift/Observables/Implementations/Producer.swift; sourceTree = ""; }; + 5E6312D7CA68889DE662535E01249EE7 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 5EA43362B8170DE6F84E11B91A09EC32 /* MASLocalization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLocalization.m; path = Framework/MASLocalization.m; sourceTree = ""; }; + 602C7742B3313DB6FEDFF9DD997B84AF /* RxSwift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-prefix.pch"; sourceTree = ""; }; + 61722C6F303EAAE1C5638EE5B33DD66A /* NSButton+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSButton+Rx.swift"; path = "RxCocoa/macOS/NSButton+Rx.swift"; sourceTree = ""; }; + 619730E0F7D114E0BBB3773020DBC95D /* GCDWebServerURLEncodedFormRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerURLEncodedFormRequest.m; path = GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.m; sourceTree = ""; }; + 61C799F1F6F393193FDEB6E8B261E48C /* AnonymousObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObservable.swift; path = RxSwift/Observables/Implementations/AnonymousObservable.swift; sourceTree = ""; }; + 625F1E39F5E196BA50F36BE994C84724 /* ko.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ko.lproj; sourceTree = ""; }; + 637833F0E5DBD5017099EF0583351872 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + 64B15D82041B7A6840823B8A9F3751FD /* GCDWebServerErrorResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerErrorResponse.h; path = GCDWebServer/Responses/GCDWebServerErrorResponse.h; sourceTree = ""; }; + 64D4E87F4D1E140147BC9F1FD6C31A64 /* MASShortcutView+Bindings.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASShortcutView+Bindings.h"; path = "Framework/MASShortcutView+Bindings.h"; sourceTree = ""; }; + 6510627A459986B2675C9DF04BB19716 /* TakeWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeWhile.swift; path = RxSwift/Observables/Implementations/TakeWhile.swift; sourceTree = ""; }; + 671D0C35D77C5534BD266C99699798F7 /* AnonymousInvocable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousInvocable.swift; path = RxSwift/Schedulers/Internal/AnonymousInvocable.swift; sourceTree = ""; }; + 681AD0AD3FE6075FD0C745A2368127DB /* fr.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = fr.lproj; sourceTree = ""; }; + 6824046BB6F6BA5DA145A55756FCE843 /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; + 686894AC6B1777DEFA921D960D8B519D /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; + 692C39EEB847B6865E05154D699B5A0D /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; + 6A6F87048375FCF10848872558242925 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; + 6BC1640F774F19AE41AEC0772358B7D1 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; + 6F30225997CEEA64CC0BDB9D5483A203 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + 6F76C18CDD50BC726A1A9F9713808F70 /* ObserverType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverType.swift; path = RxSwift/ObserverType.swift; sourceTree = ""; }; + 6FDB1E75DB13288544C739E40C5BE9EF /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; + 70BBD10E3B649EA0755AD083EA7CDFB9 /* _RX.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RX.m; path = RxCocoa/Runtime/_RX.m; sourceTree = ""; }; + 70F68C0A07F092F38A775533EA9D0AAD /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; + 714CAF0BEC8075917C6E5B21A40F51DC /* ScheduledDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledDisposable.swift; path = RxSwift/Disposables/ScheduledDisposable.swift; sourceTree = ""; }; + 732EEA83B671AC91F7FF52CDA4C2835E /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Implementations/Zip.swift; sourceTree = ""; }; + 734A36BDD429097E76987966DC4ED7AF /* MASKeyMasks.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASKeyMasks.h; path = Framework/MASKeyMasks.h; sourceTree = ""; }; + 7568784246140565AB9D65499F73D5CF /* GCDWebServerFileResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerFileResponse.m; path = GCDWebServer/Responses/GCDWebServerFileResponse.m; sourceTree = ""; }; + 75DFF226271D0F445274C3B660ADEE2A /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Implementations/Merge.swift; sourceTree = ""; }; + 765B2B823783215A2E954FAB4853AC93 /* Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Driver.swift; path = RxCocoa/CocoaUnits/Driver/Driver.swift; sourceTree = ""; }; + 76DBA6E4CB608131ADBA7D7DFF8A4E6C /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/Implementations/CombineLatest.swift; sourceTree = ""; }; + 7840085CAB4823FE9A3BE2CB2174BC31 /* MASShortcut-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MASShortcut-dummy.m"; sourceTree = ""; }; + 78697A689E989F8760B7F115D0F15A40 /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Implementations/Reduce.swift; sourceTree = ""; }; + 78DB8C39B2ECE834500856BA7F87808B /* AnonymousDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousDisposable.swift; path = RxSwift/Disposables/AnonymousDisposable.swift; sourceTree = ""; }; + 792F8486AB9FF811EC6308B78C9E71B0 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Implementations/Error.swift; sourceTree = ""; }; + 7953F0BF7911F293599BC38510760E46 /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Implementations/Timer.swift; sourceTree = ""; }; + 79AFDA86F88F40BFA89B3B2A729B2F24 /* GCDWebServerURLEncodedFormRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerURLEncodedFormRequest.h; path = GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.h; sourceTree = ""; }; + 79D3FF68C5D11A301F7C27AC3B626AB1 /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Implementations/Timeout.swift; sourceTree = ""; }; + 7A7C5FEA0C034019250F845D696DCCC6 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; + 7B3C30C8BD2ECEF438E4A7E02A0C36B6 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; + 7B63AB91C9378BEF83982ADCC82E9770 /* GCDWebServer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = GCDWebServer.framework; path = GCDWebServer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7BB0F5D8F0F27F31636D82187890CC43 /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Implementations/Map.swift; sourceTree = ""; }; + 7CD18D2965F9753B545A1B1BA54828CB /* SharedSequence+Operators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SharedSequence+Operators.swift"; path = "RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators.swift"; sourceTree = ""; }; + 7CF90C9854898D2869D0FA04F6FEFD51 /* NSControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSControl+Rx.swift"; path = "RxCocoa/macOS/NSControl+Rx.swift"; sourceTree = ""; }; + 7ED1793F25CA7EA6496FF4ACB5360784 /* GCDWebServerConnection.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerConnection.m; path = GCDWebServer/Core/GCDWebServerConnection.m; sourceTree = ""; }; + 7FFD8762948A54487F18FE67BEE8F77F /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/Implementations/ElementAt.swift; sourceTree = ""; }; + 8038341863E5188ED05DCC1BA2CF7CCD /* SerialDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDispatchQueueScheduler.swift; path = RxSwift/Schedulers/SerialDispatchQueueScheduler.swift; sourceTree = ""; }; + 810CEE92287B0EBC821481019F3339CA /* Observable+Multiple.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Multiple.swift"; path = "RxSwift/Observables/Observable+Multiple.swift"; sourceTree = ""; }; + 817BBAF28AF5DD16F4C657AB7AD305BF /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/Implementations/SingleAsync.swift; sourceTree = ""; }; 83323A1A2936BBA3D386DCC078E3821E /* Pods-ShadowsocksX-NGTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-ShadowsocksX-NGTests-acknowledgements.markdown"; sourceTree = ""; }; - 844CBFCCA003D23AC4446B0970F5FF96 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 8695AB6FAA639E36640736E4AE90D07C /* it.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = it.lproj; sourceTree = ""; }; - 88148F9C1CEE4F1EEF82261BBF938A56 /* GCDWebServerErrorResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerErrorResponse.m; path = GCDWebServer/Responses/GCDWebServerErrorResponse.m; sourceTree = ""; }; - 883FD374D1F5406153C9E25ED24B8921 /* GCDWebServerConnection.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerConnection.h; path = GCDWebServer/Core/GCDWebServerConnection.h; sourceTree = ""; }; - 8B5E61ED6EF54C18FAE2F06428E22B93 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 843FB1118D1974CEF717BE490B13366C /* Observable+StandardSequenceOperators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+StandardSequenceOperators.swift"; path = "RxSwift/Observables/Observable+StandardSequenceOperators.swift"; sourceTree = ""; }; + 84CA690C1F208F1306162397DEABE31E /* URLSession+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "URLSession+Rx.swift"; path = "RxCocoa/Foundation/URLSession+Rx.swift"; sourceTree = ""; }; + 855CC0FE8F67377D0E604979734C70A7 /* ObserveOnSerialDispatchQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOnSerialDispatchQueue.swift; path = RxSwift/Observables/Implementations/ObserveOnSerialDispatchQueue.swift; sourceTree = ""; }; + 877E161F31772E123DCD4BC8EAA3EB75 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + 88A487D891BF9234985AA4099272A55F /* UIBindingObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = UIBindingObserver.swift; path = RxCocoa/CocoaUnits/UIBindingObserver.swift; sourceTree = ""; }; + 89157B205B92DB7240F198AAAE3E1D23 /* GCDWebServerFileRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFileRequest.h; path = GCDWebServer/Requests/GCDWebServerFileRequest.h; sourceTree = ""; }; + 892156754A7EF53FE3D80BC00C1975AB /* GCDWebServer-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GCDWebServer-umbrella.h"; sourceTree = ""; }; + 895C03FCA3BCF07DBDA8A858302D9662 /* KVORepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KVORepresentable.swift; path = RxCocoa/Foundation/KVORepresentable.swift; sourceTree = ""; }; + 89B67DFE619069B6AD5E1D0FAA0BB8E2 /* GCDWebServerRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerRequest.h; path = GCDWebServer/Core/GCDWebServerRequest.h; sourceTree = ""; }; + 8AA937C432E0F9441C102162B7D3DE77 /* GCDWebServerDataRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerDataRequest.h; path = GCDWebServer/Requests/GCDWebServerDataRequest.h; sourceTree = ""; }; 8CDD45C6D7A038F415A78787317E931A /* Pods-proxy_conf_helper-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-proxy_conf_helper-resources.sh"; sourceTree = ""; }; - 8D782BF889898D9E5258D79D2A4DA8EC /* GCDWebServerHTTPStatusCodes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerHTTPStatusCodes.h; path = GCDWebServer/Core/GCDWebServerHTTPStatusCodes.h; sourceTree = ""; }; - 8F6AD8817DCDF5C429973DFDE855650C /* MASShortcut.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = MASShortcut.bundle; path = MASShortcut.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; - 90E14D041108C5A6D6FAFADB704613D9 /* fr.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = fr.lproj; sourceTree = ""; }; - 9173DC735D07558D20262553791D744B /* en.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = en.lproj; sourceTree = ""; }; + 8D0F0E4B2FD793BE40FBBE96FD380D21 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; + 8D64CB474F7D1B9FDD19465A43A61164 /* GCDWebServerDataResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerDataResponse.h; path = GCDWebServer/Responses/GCDWebServerDataResponse.h; sourceTree = ""; }; + 8EBE7C5174BB4B63F44349A15EE826AF /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + 8EBEE1150AB7FFCE3B2375F0351703C4 /* ObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableType.swift; path = RxSwift/ObservableType.swift; sourceTree = ""; }; + 8EE24E5283B182B30014870DA91C3874 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 90398724ED993172FCE73E50A7D35827 /* MASShortcutView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutView.h; path = Framework/MASShortcutView.h; sourceTree = ""; }; + 917C99A8833B2D56222425A6F84CA5DA /* RxCocoaObjCRuntimeError+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "RxCocoaObjCRuntimeError+Extensions.swift"; path = "RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift"; sourceTree = ""; }; + 91CFF9598EE190FD0A1231111991540B /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentDispatchQueueScheduler.swift; path = RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift; sourceTree = ""; }; + 92D90F1E9B3DB74E13DAEE89D729C388 /* en.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = en.lproj; sourceTree = ""; }; + 9350C02E503091FE07AEC409372D8DA0 /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9681E05358DC8416C0EE292B3047C10E /* GCDWebServer-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GCDWebServer-umbrella.h"; sourceTree = ""; }; - 97959737DD67EFD1D7AB5F26607875F2 /* zh-Hant.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = "zh-Hant.lproj"; sourceTree = ""; }; + 96452244B9CFEFBA70877833E181A983 /* RxSwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.xcconfig; sourceTree = ""; }; + 9654A33B220127C74EC683B98310281D /* NSTextField+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSTextField+Rx.swift"; path = "RxCocoa/macOS/NSTextField+Rx.swift"; sourceTree = ""; }; + 96A80BADDCAF42068E3B168DD679B06E /* de.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = de.lproj; sourceTree = ""; }; 98522BF2EB25C0255284080F9CA3E195 /* Pods-ShadowsocksX-NG.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ShadowsocksX-NG.debug.xcconfig"; sourceTree = ""; }; + 992670FA98E8ED847E3131B73896D8ED /* SharedSequence+Operators+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SharedSequence+Operators+arity.swift"; path = "RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators+arity.swift"; sourceTree = ""; }; + 99BD77B66B1E1355C1E30439B72937EB /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Implementations/Skip.swift; sourceTree = ""; }; + 9AB8F8AA0CF2C7D1D506FB9347CAD420 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 9B6ACACC69C2EA2681770741535F1D69 /* MASShortcut.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MASShortcut.framework; path = MASShortcut.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9B8B5CBA357BDB968C73E8F58DFBC74C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9BA2A0099476E08B6CC8026BDF0C603E /* Pods-ShadowsocksX-NGTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ShadowsocksX-NGTests.debug.xcconfig"; sourceTree = ""; }; - 9C4B2C128C8F507F0E716EC512D532D2 /* MASShortcut-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MASShortcut-prefix.pch"; sourceTree = ""; }; - A419B812B106CBEFA00870784818213C /* MASShortcutBinder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutBinder.h; path = Framework/MASShortcutBinder.h; sourceTree = ""; }; + 9BEF9DEF3F2FE69B0036DA832678E66F /* SingleAssignmentDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAssignmentDisposable.swift; path = RxSwift/Disposables/SingleAssignmentDisposable.swift; sourceTree = ""; }; + 9BF8977C2D21F0E3E6B4809F5512A9B6 /* NSObject+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx.swift"; path = "RxCocoa/Foundation/NSObject+Rx.swift"; sourceTree = ""; }; + 9CAAF792369765F875B4FABB87ECE3EE /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; + 9CEB1670F4E8A8FED505B32B7F7DADD3 /* MASShortcut-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MASShortcut-umbrella.h"; sourceTree = ""; }; + 9D539E4E6C4E295220FA4FAE74031789 /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; + 9E41B98DB7C06E244630AEDD27EB9878 /* MASShortcut.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = MASShortcut.modulemap; sourceTree = ""; }; + 9EE36FCA3C6A386A888AD56E20DFF50C /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; + A131F62F3B9E538F5835420C712C9967 /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Implementations/Delay.swift; sourceTree = ""; }; + A1CDAA1E9C8D90D41A2E7EDD9164500F /* Throttle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Throttle.swift; path = RxSwift/Observables/Implementations/Throttle.swift; sourceTree = ""; }; + A1E6CC9C6785132EA7807744DE0ED408 /* GCDWebServerResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerResponse.m; path = GCDWebServer/Core/GCDWebServerResponse.m; sourceTree = ""; }; + A27E7196730EA8A4F03EECF2B8D2643A /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionDisposable.swift; path = RxSwift/Disposables/SubscriptionDisposable.swift; sourceTree = ""; }; + A3C8902E07EA5E5DE5E621971E1B5762 /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Implementations/Debug.swift; sourceTree = ""; }; A5055B8EFFFBEDE50909E935D4BCA446 /* Pods-proxy_conf_helper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-proxy_conf_helper.release.xcconfig"; sourceTree = ""; }; - A9CAB6031EE58AA1643806530AAA4DDD /* GCDWebServerRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerRequest.h; path = GCDWebServer/Core/GCDWebServerRequest.h; sourceTree = ""; }; - AB0D38FFE12F18677596FC69DB07A5BC /* de.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = de.lproj; sourceTree = ""; }; - ACFB62D4A50AD45388DA32F0097C2241 /* GCDWebServerConnection.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerConnection.m; path = GCDWebServer/Core/GCDWebServerConnection.m; sourceTree = ""; }; + A51CD43BBF9E07B471180B3C6A10EC0C /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/Implementations/WithLatestFrom.swift; sourceTree = ""; }; + A58E912F80E74F9E3D04FE3EAF217CBD /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; + A8B36ED31A6E3C49C77F55E2561C966D /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; + A9C0D3B37EBF8F2D69675B140D08F2C2 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + AA881E4DA90F807751C146D7483CDEC3 /* MASShortcut.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcut.m; path = Framework/MASShortcut.m; sourceTree = ""; }; + AADDE7423A968810AADD026BD63867B0 /* MASDictionaryTransformer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASDictionaryTransformer.m; path = Framework/MASDictionaryTransformer.m; sourceTree = ""; }; + ABBC6E0B59D4E0A8264EF5775E962781 /* NSImageView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSImageView+Rx.swift"; path = "RxCocoa/macOS/NSImageView+Rx.swift"; sourceTree = ""; }; + ABDA9F0531A7A7502BDE85649B058DFB /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + AD4ECEBBCA289543D5E13C73371BCCB3 /* Shortcut.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Shortcut.h; path = Framework/Shortcut.h; sourceTree = ""; }; + ADA9A70ECA885B87CA7B20916DC7BC6F /* RxCocoa-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxCocoa-dummy.m"; sourceTree = ""; }; AE6E689502E4366B125481CD898B947E /* Pods-proxy_conf_helper-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-proxy_conf_helper-acknowledgements.plist"; sourceTree = ""; }; - AECF9A29B7AECE459E5A34AC4DB91488 /* MASHotKey.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASHotKey.h; path = Framework/MASHotKey.h; sourceTree = ""; }; - AF1D2790CBE48EA409C37174C263BBBB /* ko.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ko.lproj; sourceTree = ""; }; - AFB4B923C938302D83D3C7BBB013CC39 /* nl.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = nl.lproj; sourceTree = ""; }; + AF5498021A404BB1ACCA140C4B62871C /* GCDWebServerResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerResponse.h; path = GCDWebServer/Core/GCDWebServerResponse.h; sourceTree = ""; }; + B0FC490145F0D2AD9B833C41F78CA818 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxCocoa.framework; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B17A240A53E7810AEDB4E2936154C885 /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DispatchQueueConfiguration.swift; path = RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift; sourceTree = ""; }; + B2A49B7D2E244535BCE8E120F0D8D070 /* MASShortcutView+Bindings.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "MASShortcutView+Bindings.m"; path = "Framework/MASShortcutView+Bindings.m"; sourceTree = ""; }; B30805F63C611810B322187824EBC4A5 /* Pods-ShadowsocksX-NGTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ShadowsocksX-NGTests-resources.sh"; sourceTree = ""; }; - B35228496116138E6C03F6FB1876BD1D /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - B3C847943F2CAD8774184593F62DEC64 /* GCDWebServer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServer.h; path = GCDWebServer/Core/GCDWebServer.h; sourceTree = ""; }; - B47B95553B8446AB4C05DB6C787C1923 /* GCDWebServerFileResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFileResponse.h; path = GCDWebServer/Responses/GCDWebServerFileResponse.h; sourceTree = ""; }; - B5DFF804A6D3BFC409429DA682703A50 /* MASShortcutView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutView.m; path = Framework/MASShortcutView.m; sourceTree = ""; }; - BA3485D194A4B9E4D8751BC5A5321E9B /* MASShortcutMonitor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutMonitor.m; path = Framework/MASShortcutMonitor.m; sourceTree = ""; }; - BB03A2A83487FFAD6E394F39AFE570EA /* MASKeyCodes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASKeyCodes.h; path = Framework/MASKeyCodes.h; sourceTree = ""; }; + B4AA715B5CFDDF37B623E756474221F9 /* CompositeDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompositeDisposable.swift; path = RxSwift/Disposables/CompositeDisposable.swift; sourceTree = ""; }; + B53BE22700435344F5040D7A34438C79 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; + B792280B7BC7CA44B5D7090C8F732A0D /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B79A9D696C3F4750347FA86B4C4CC412 /* ImmediateScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateScheduler.swift; path = RxSwift/Schedulers/ImmediateScheduler.swift; sourceTree = ""; }; + B9007D55BF01790E2E753C6B70C41179 /* AddRef.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AddRef.swift; path = RxSwift/Observables/Implementations/AddRef.swift; sourceTree = ""; }; + B91619B91E70B0C5E6FAC0131E42FD7E /* MASShortcutValidator.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutValidator.m; path = Framework/MASShortcutValidator.m; sourceTree = ""; }; + BA9688D287B1F197714D74B40DBE8680 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + BAE504DB6511ED954C7F3F53D78EFE96 /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; + BBB043A7F7ED4CC26A55E3EAF07D57BC /* ConnectableObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservable.swift; path = RxSwift/Observables/Implementations/ConnectableObservable.swift; sourceTree = ""; }; + BD3624B117D9AC549B1CAED71ACDA6FD /* DelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelegateProxy.swift; path = RxCocoa/Common/DelegateProxy.swift; sourceTree = ""; }; + BD85B8D01C25C718B7106EE598B59F05 /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; BE672B43951C625CA5F89E448A620AB0 /* Pods-ShadowsocksX-NGTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ShadowsocksX-NGTests.modulemap"; sourceTree = ""; }; - BE8739A57CFBA2B252B9323870F7F914 /* GCDWebServerResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerResponse.h; path = GCDWebServer/Core/GCDWebServerResponse.h; sourceTree = ""; }; - C03AA4D681FDF11A4D5D92CE754BB78E /* GCDWebServerResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerResponse.m; path = GCDWebServer/Core/GCDWebServerResponse.m; sourceTree = ""; }; - C2B3BEE547EDC92417A8E332AF53292F /* libPods-proxy_conf_helper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-proxy_conf_helper.a"; path = "libPods-proxy_conf_helper.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - C43BE7EB97552AD3EE8563CFD356D50F /* GCDWebServerDataResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerDataResponse.m; path = GCDWebServer/Responses/GCDWebServerDataResponse.m; sourceTree = ""; }; - C55C71D66BDD301C849C60D2C5DC9C23 /* MASKeyMasks.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASKeyMasks.h; path = Framework/MASKeyMasks.h; sourceTree = ""; }; - C75B3D4578ADA314E1C779DB5ECAA89B /* ja.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ja.lproj; sourceTree = ""; }; - CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; - CB1D03EE623DEF2B8C167F389083A657 /* MASDictionaryTransformer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASDictionaryTransformer.h; path = Framework/MASDictionaryTransformer.h; sourceTree = ""; }; - CB2E5FAB2E41A523334D78A648DA85BD /* libBRLOptionParser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libBRLOptionParser.a; path = libBRLOptionParser.a; sourceTree = BUILT_PRODUCTS_DIR; }; - CBB13842D20339B1AA4DBC88598BE195 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - CCB68427884134CB40644A07D36C7213 /* BRLOptionParser-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "BRLOptionParser-dummy.m"; sourceTree = ""; }; - CD639ADC8DEDEF3134D5CC65E9481B1B /* GCDWebServerStreamedResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerStreamedResponse.m; path = GCDWebServer/Responses/GCDWebServerStreamedResponse.m; sourceTree = ""; }; - CDA7F4E570344BA6692850FAD6D5DF52 /* BRLOptionParser-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "BRLOptionParser-prefix.pch"; sourceTree = ""; }; + BF02268A49529C89CA28BBD728A4864A /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; + BF541EB164C2E45EC80ADBE338F2D325 /* Pods_ShadowsocksX_NG.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ShadowsocksX_NG.framework; path = "Pods-ShadowsocksX-NG.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + BF6A784C26C191A7BB651A20F9FE09C2 /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Implementations/Generate.swift; sourceTree = ""; }; + C0E55BD2346FA928953EF952CED22364 /* ResourceBundle-MASShortcut-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-MASShortcut-Info.plist"; sourceTree = ""; }; + C0FF24549EBA19FE3868F5A0F0A65C24 /* NSObject+Rx+KVORepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx+KVORepresentable.swift"; path = "RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift"; sourceTree = ""; }; + C1135B3B4D2DC6F16A992DFB33D540AA /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentMainScheduler.swift; path = RxSwift/Schedulers/ConcurrentMainScheduler.swift; sourceTree = ""; }; + C21DA07175E00F9652FEE28ACB8A721E /* MASHotKey.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASHotKey.m; path = Framework/MASHotKey.m; sourceTree = ""; }; + C22A091C89D7A9C2B736EF1A49C54280 /* TextInput.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TextInput.swift; path = RxCocoa/Common/TextInput.swift; sourceTree = ""; }; + C260F4B4F6F3E5961E3A49C5B05520CD /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; + C28A12A58B667D3534761E41E833AD91 /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Implementations/Take.swift; sourceTree = ""; }; + C2E109F0988D784B0B51149C9E0CFB7E /* BRLOptionParser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BRLOptionParser.h; path = BRLOptionParser/BRLOptionParser.h; sourceTree = ""; }; + C2E92EE455CBA70E47FF6E1B2A8A8F10 /* NSNotificationCenter+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Rx.swift"; path = "RxCocoa/Foundation/NSNotificationCenter+Rx.swift"; sourceTree = ""; }; + C30F42D2E6C0B7C15B64F1081749B8FF /* SubjectType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubjectType.swift; path = RxSwift/Subjects/SubjectType.swift; sourceTree = ""; }; + C4532CD920B79E94F7B61A2B9A63FCAD /* GCDWebServerStreamedResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerStreamedResponse.m; path = GCDWebServer/Responses/GCDWebServerStreamedResponse.m; sourceTree = ""; }; + C47B091EB868220FDDF555507F5A2254 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C507512A0FC2103B39A0C7761B19968E /* BRLOptionParser-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "BRLOptionParser-dummy.m"; sourceTree = ""; }; + C5BA2BD2D1A8648107C13AA73BCF0AE2 /* Deferred.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deferred.swift; path = RxSwift/Observables/Implementations/Deferred.swift; sourceTree = ""; }; + C5D5F5CEA32B2510E42A4A7976F27CCE /* PublishSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishSubject.swift; path = RxSwift/Subjects/PublishSubject.swift; sourceTree = ""; }; + C62AFA43EC9E39C9901C2014FBF75441 /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/Implementations/DelaySubscription.swift; sourceTree = ""; }; + C62E07D7645966D27B953E4580313A3D /* ToArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToArray.swift; path = RxSwift/Observables/Implementations/ToArray.swift; sourceTree = ""; }; + C63E884ADD906BC90F3C32DB52CC398D /* MainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MainScheduler.swift; path = RxSwift/Schedulers/MainScheduler.swift; sourceTree = ""; }; + C64F36BE9F05BDE74A3E670E69A4432E /* Observable+Creation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Creation.swift"; path = "RxSwift/Observables/Observable+Creation.swift"; sourceTree = ""; }; + C6581F3ACC8B4396727CEB2528B37F04 /* ObservableConvertibleType+SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+SharedSequence.swift"; path = "RxCocoa/CocoaUnits/SharedSequence/ObservableConvertibleType+SharedSequence.swift"; sourceTree = ""; }; + C743F524B10FDE01231455A0541D06DC /* GCDWebServer.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServer.m; path = GCDWebServer/Core/GCDWebServer.m; sourceTree = ""; }; + C760BAF596F45988BF95E5D3C10BA670 /* libBRLOptionParser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libBRLOptionParser.a; path = libBRLOptionParser.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C77550063B64F014D70901594CE2B8AD /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/Implementations/SkipUntil.swift; sourceTree = ""; }; + C7BA15653BA24C8CB2D6A810BD172EB4 /* GCDWebServer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServer.h; path = GCDWebServer/Core/GCDWebServer.h; sourceTree = ""; }; + CB4B9ED2B1EB569789C066F34F7123A4 /* GCDWebServerFileResponse.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerFileResponse.h; path = GCDWebServer/Responses/GCDWebServerFileResponse.h; sourceTree = ""; }; + CD17E58327299EAC195D109A1B69B917 /* MASShortcutBinder.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutBinder.h; path = Framework/MASShortcutBinder.h; sourceTree = ""; }; + CD9A1A157A1A6F85D6AAE2A82E930E2C /* GCDWebServerDataResponse.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerDataResponse.m; path = GCDWebServer/Responses/GCDWebServerDataResponse.m; sourceTree = ""; }; CE50445A73ECB9A2ED31A6FF93D45808 /* Pods-proxy_conf_helper-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-proxy_conf_helper-dummy.m"; sourceTree = ""; }; - D0279E4819926ED0B736DB036058CD11 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D03A4819F4C6095A9477FED1229B7A77 /* MASLocalization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASLocalization.h; path = Framework/MASLocalization.h; sourceTree = ""; }; - D354B988E94145D21D7ACC846F6E3A69 /* GCDWebServerURLEncodedFormRequest.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GCDWebServerURLEncodedFormRequest.m; path = GCDWebServer/Requests/GCDWebServerURLEncodedFormRequest.m; sourceTree = ""; }; - D3DC4D6EBE59976B5E4AC12E8E959231 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - D58DAAC44590953C26FC71CE97BBB28F /* MASShortcut.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MASShortcut.framework; path = MASShortcut.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CEA7BED190A171843822577606510B95 /* HistoricalScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalScheduler.swift; path = RxSwift/Schedulers/HistoricalScheduler.swift; sourceTree = ""; }; + D0531FFA0D5305257F668D1D12A1411F /* Pods_ShadowsocksX_NGTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_ShadowsocksX_NGTests.framework; path = "Pods-ShadowsocksX-NGTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + D0F0A9B8CFF8FE0E517E372F3A135E25 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + D12E7DBD1E1B501117F95768ED20BBEC /* SubscribeOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscribeOn.swift; path = RxSwift/Observables/Implementations/SubscribeOn.swift; sourceTree = ""; }; + D22C2E880EC2CBCA5E33F7C18A7C28E5 /* MASLocalization.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASLocalization.h; path = Framework/MASLocalization.h; sourceTree = ""; }; + D2A563269DDD44C5472F388FE17CF34B /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; + D318C435E4EBC421BC050713E69DE0D2 /* StartWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StartWith.swift; path = RxSwift/Observables/Implementations/StartWith.swift; sourceTree = ""; }; + D3B86E229BBF998819417BA1EF0B5A5D /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; + D42C0F905B71E4F428236353DE12928B /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; + D5049BF3275B506081D6290C03107F75 /* ShareReplay1.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplay1.swift; path = RxSwift/Observables/Implementations/ShareReplay1.swift; sourceTree = ""; }; + D55A3EC1AA96E83A76F91664C4C2F29D /* zh-Hans.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = "zh-Hans.lproj"; sourceTree = ""; }; + D5ABF695E08E23D093300EE17154AD46 /* Sequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sequence.swift; path = RxSwift/Observables/Implementations/Sequence.swift; sourceTree = ""; }; + D5B12421F65E2E98C029ADC1ADEC949D /* Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Event.swift; path = RxSwift/Event.swift; sourceTree = ""; }; + D5F42FF8098EE07E0972506FA879BAED /* Scan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scan.swift; path = RxSwift/Observables/Implementations/Scan.swift; sourceTree = ""; }; + D5FF1DE565E7A0E50A3F648C38E95C78 /* LockOwnerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LockOwnerType.swift; path = RxSwift/Concurrency/LockOwnerType.swift; sourceTree = ""; }; + D63CEEDC1A1E689C53BE5B8FB80BBB4F /* NSObject+Rx+RawRepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx+RawRepresentable.swift"; path = "RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift"; sourceTree = ""; }; + D741EA049F662EB20482A9A330B6FAE0 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; D7E8128F302CF60BEF206008CE11F6D3 /* Pods-ShadowsocksX-NGTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-ShadowsocksX-NGTests-umbrella.h"; sourceTree = ""; }; - DB6439601D189D6EA4EE34BBB5E8D1B9 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - DB80A4130B50AF90720FF211504FB9E9 /* BRLOptionParser.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = BRLOptionParser.h; path = BRLOptionParser/BRLOptionParser.h; sourceTree = ""; }; + D8E064CAF79139120E3D4F21DB6061FE /* ShareReplay1WhileConnected.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplay1WhileConnected.swift; path = RxSwift/Observables/Implementations/ShareReplay1WhileConnected.swift; sourceTree = ""; }; + D95E797893870454BDD396AD03752C2A /* RxCocoa.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxCocoa.xcconfig; sourceTree = ""; }; + D99D4398615AB6F4E3F9A978A1FBBBD1 /* RxTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTarget.swift; path = RxCocoa/Common/RxTarget.swift; sourceTree = ""; }; + DB6650CEB7DB19C31BA4430E3E4A0B54 /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/Implementations/SkipWhile.swift; sourceTree = ""; }; + DB9CD6FE2DD142EFA2C41E21AB227946 /* GCDWebServerMultiPartFormRequest.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCDWebServerMultiPartFormRequest.h; path = GCDWebServer/Requests/GCDWebServerMultiPartFormRequest.h; sourceTree = ""; }; DC250BF8313F337272DBC9DE1FB6DB6B /* Pods-ShadowsocksX-NG.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-ShadowsocksX-NG.modulemap"; sourceTree = ""; }; - DEA37CFFE5FCF2A505A2EC3468C0E635 /* MASShortcut-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MASShortcut-umbrella.h"; sourceTree = ""; }; - E13D6DE7B7967B4C983579F0E5E686F7 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E4E079712B84EA33FBDC4B6E81D8D79E /* MASLocalization.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLocalization.m; path = Framework/MASLocalization.m; sourceTree = ""; }; - E7A60DCFEEFE6028E803545102BA75B1 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = DEVELOPER_DIR; }; + DD14A3E25D58B573F248D9BAEFB1FD96 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Implementations/Filter.swift; sourceTree = ""; }; + DD4766C097C60C5A8CBF72F3E935D01D /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = RxSwift.modulemap; sourceTree = ""; }; + DDB7132E575EAC0CA9B48A0425DAAD21 /* MASKeyCodes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASKeyCodes.h; path = Framework/MASKeyCodes.h; sourceTree = ""; }; + DDCFD4F040A53B3A3EF03BEB2CC74220 /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; + DDF7D11C29F998B81F2EC67417F7E5E4 /* ControlTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlTarget.swift; path = RxCocoa/Common/ControlTarget.swift; sourceTree = ""; }; + DDF9D2AC2FD4CD42F8B089BAFDE4C6BD /* _RXKVOObserver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXKVOObserver.m; path = RxCocoa/Runtime/_RXKVOObserver.m; sourceTree = ""; }; + DEB9C9F773C5584C1A64134DF28D78E2 /* _RX.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RX.h; path = RxCocoa/Runtime/include/_RX.h; sourceTree = ""; }; + DFE42161A598BDA23E054E467E3BBBCD /* MASShortcutValidator.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcutValidator.h; path = Framework/MASShortcutValidator.h; sourceTree = ""; }; + E01D49455ED5C62F58BBAE0983AEB788 /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; + E0356020230831FEF31796FF613BF8AC /* ReplaySubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ReplaySubject.swift; path = RxSwift/Subjects/ReplaySubject.swift; sourceTree = ""; }; + E0C535339357CC5D93CA927CECB123F0 /* Observable+Time.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Time.swift"; path = "RxSwift/Observables/Observable+Time.swift"; sourceTree = ""; }; + E0CF346DBA2C8BDB54C4D65E01BE83B4 /* libPods-proxy_conf_helper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-proxy_conf_helper.a"; path = "libPods-proxy_conf_helper.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + E0D8E8F499BC8AD11FA423052AD2B91A /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; + E0E8FB6DEC7DDD0F6FEEE86CCDFBC820 /* BRLOptionParser.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = BRLOptionParser.m; path = BRLOptionParser/BRLOptionParser.m; sourceTree = ""; }; + E15756B54614ACA75251861D700E1946 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E19D18DB5C1EA9E63E6DBF428B35C892 /* RefCountDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCountDisposable.swift; path = RxSwift/Disposables/RefCountDisposable.swift; sourceTree = ""; }; + E258DC88C29E64BF1A3523D2FFF806B5 /* RxCocoaRuntime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RxCocoaRuntime.h; path = RxCocoa/Runtime/include/RxCocoaRuntime.h; sourceTree = ""; }; + E4B8CB36B3783E2A2310ADFB4CC33864 /* SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SharedSequence.swift; path = RxCocoa/CocoaUnits/SharedSequence/SharedSequence.swift; sourceTree = ""; }; + E58577DB359E44ED81D9764E891B1E47 /* Variable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Variable.swift; path = RxSwift/Subjects/Variable.swift; sourceTree = ""; }; + E7AC2CB247486E6770E163434DEC2B56 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + E809E90945E9BE1B60403F66019B3FF4 /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Implementations/Just.swift; sourceTree = ""; }; + E8BCA33BF99DD786DF82E4D02D5E7F3D /* TailRecursiveSink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TailRecursiveSink.swift; path = RxSwift/Observers/TailRecursiveSink.swift; sourceTree = ""; }; + E8E6D1E113A8A1E690491F2E3F8A2201 /* _RXDelegateProxy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXDelegateProxy.m; path = RxCocoa/Runtime/_RXDelegateProxy.m; sourceTree = ""; }; EA41BEE3B4D9F1A89F0135CA91A7F472 /* Pods-ShadowsocksX-NG-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-ShadowsocksX-NG-resources.sh"; sourceTree = ""; }; - EB80202EEB9A104B8394F02CC078ADFC /* MASShortcut.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASShortcut.h; path = Framework/MASShortcut.h; sourceTree = ""; }; - EDE850D2C845A4E04C32A0E8943E5168 /* ru.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ru.lproj; sourceTree = ""; }; - F1CC0A417713CD6705E37B71B89C3B9A /* GCDWebServer-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GCDWebServer-prefix.pch"; sourceTree = ""; }; - F3C5576728407128F3BE8D96B7922923 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - F581A519A535CA5FCC23235961004C18 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; + EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = DEVELOPER_DIR; }; + EAB6E0C832D664BB3933B743E204615D /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Implementations/Never.swift; sourceTree = ""; }; + EB98EC4AC6562F031A89D824210E36CF /* MASShortcutView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASShortcutView.m; path = Framework/MASShortcutView.m; sourceTree = ""; }; + EBF2BBFDA4F26C440DB709FAC5D3F25C /* cs.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = cs.lproj; sourceTree = ""; }; + ED83F972951546FF54141DCDFFA0A699 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; + EE0E8A058AF30A041E8DB6F051BBDE16 /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; + EEE98592A8E669C3B96D3E19120FC821 /* NSView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSView+Rx.swift"; path = "RxCocoa/macOS/NSView+Rx.swift"; sourceTree = ""; }; + EF1D18BE7EFD12AA66C3376332FEF003 /* ControlEvent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlEvent.swift; path = RxCocoa/CocoaUnits/ControlEvent.swift; sourceTree = ""; }; + EF5E4BD0EF6C6C73284552531F108886 /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Implementations/Window.swift; sourceTree = ""; }; + EF832054667391DF7219EEC7E1426BFB /* RxCocoa.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCocoa.swift; path = RxCocoa/RxCocoa.swift; sourceTree = ""; }; + EFD468F10CD22B3EFAB406DAC3FCC7C9 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Carbon.framework; sourceTree = DEVELOPER_DIR; }; + EFE14E99FE3CC24013D01106E3710A5A /* GCDWebServer.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GCDWebServer.xcconfig; sourceTree = ""; }; + F03278787D78510DCEEDDFAB06AD42F6 /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Implementations/Buffer.swift; sourceTree = ""; }; + F1B18A75522A9348284094E1A906CFDB /* ja.lproj */ = {isa = PBXFileReference; includeInIndex = 1; path = ja.lproj; sourceTree = ""; }; + F297CA1E051508BD3B6024498BC6FC3C /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Implementations/Zip+Collection.swift"; sourceTree = ""; }; + F2EC79DAE53D1D70A47EBAFD39ED862E /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; + F38DB6F5263618374E7A97C5A4E497A1 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; + F41DBC7F2E4B382CC91B8B28EF579853 /* RxMutableBox.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxMutableBox.swift; path = RxSwift/RxMutableBox.swift; sourceTree = ""; }; + F4752DE1461395A71AEFA91856BB6469 /* Observable+Concurrency.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Concurrency.swift"; path = "RxSwift/Observables/Observable+Concurrency.swift"; sourceTree = ""; }; + F49B97A2DDE155335D9A857CBCC1443E /* Repeat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Repeat.swift; path = RxSwift/Observables/Implementations/Repeat.swift; sourceTree = ""; }; + F4B4BFA85D88E0779216DDD104D2F899 /* RxCocoa-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxCocoa-umbrella.h"; sourceTree = ""; }; + F62634DC9F384C9CC41CEDA292858659 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; F67191B1F87DA238C4D87250DFBE43DD /* Pods-ShadowsocksX-NGTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-ShadowsocksX-NGTests.release.xcconfig"; sourceTree = ""; }; - F9FDACFE0997D2388C81600CA61071F2 /* Shortcut.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Shortcut.h; path = Framework/Shortcut.h; sourceTree = ""; }; - FB0EBA1E1100F179EBAE135039DE532C /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - FE9FE21981CBAA8F5535A05127F08FFD /* MASHotKey.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASHotKey.m; path = Framework/MASHotKey.m; sourceTree = ""; }; + F6CAD2064683A8B0C403939B2A81D812 /* Sample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sample.swift; path = RxSwift/Observables/Implementations/Sample.swift; sourceTree = ""; }; + F774A8AA7CF1C667887EFD6BB875DBBD /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; + F9A4EC64F789C4F631F887DA33498D8C /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/Implementations/CombineLatest+Collection.swift"; sourceTree = ""; }; + FB026E9D4AF4C5FBA8F291E002660852 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; + FBAF339F33C80576683D76394CA51047 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FECDA2B834D431A94C10FFDA1E53F33E /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; + FFA24FA42F80B63EFCE3B8D7EAEEB17E /* RefCount.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCount.swift; path = RxSwift/Observables/Implementations/RefCount.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -305,11 +748,19 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 684E640573B267856B0161607461C7DE /* Frameworks */ = { + 4F131864F47901DC9547FC3861CAA756 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6747832B85949C75C746C2EA6792B0C8 /* Cocoa.framework in Frameworks */, + 6CE3F1A01E6DE8F58A874B780C66A6FA /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 656F921478BE483858A20165B6945F4A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 626A7B01D3D6B6EA0869551ACE82FB8B /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -322,6 +773,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + AC6EF4DCF3427EDD23A06A9ACE60D1CB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8FEBDE87BFA67E4AD0EC88774A1097F2 /* Cocoa.framework in Frameworks */, + 75780983A83E65A597525566173E3C7C /* RxSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B14D21A682C80219D90189FAC9A7DDDF /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -385,116 +845,191 @@ path = "Target Support Files/Pods-ShadowsocksX-NGTests"; sourceTree = ""; }; - 1CE12A13544A7DE01DC4914BF965B363 /* MASShortcut */ = { + 34FFC41A803A1DE1AD2BA42E08949249 /* Support Files */ = { isa = PBXGroup; children = ( - CB1D03EE623DEF2B8C167F389083A657 /* MASDictionaryTransformer.h */, - 29C6391EC74D8F0B20D3C7B23F409A79 /* MASDictionaryTransformer.m */, - AECF9A29B7AECE459E5A34AC4DB91488 /* MASHotKey.h */, - FE9FE21981CBAA8F5535A05127F08FFD /* MASHotKey.m */, - BB03A2A83487FFAD6E394F39AFE570EA /* MASKeyCodes.h */, - C55C71D66BDD301C849C60D2C5DC9C23 /* MASKeyMasks.h */, - D03A4819F4C6095A9477FED1229B7A77 /* MASLocalization.h */, - E4E079712B84EA33FBDC4B6E81D8D79E /* MASLocalization.m */, - EB80202EEB9A104B8394F02CC078ADFC /* MASShortcut.h */, - 7769179E7E99FFDE1312346DF91A8A1D /* MASShortcut.m */, - A419B812B106CBEFA00870784818213C /* MASShortcutBinder.h */, - 6B3D222C908B57140B734E3CF98FBE99 /* MASShortcutBinder.m */, - 8134B11FCAB921895AB127714E70D06F /* MASShortcutMonitor.h */, - BA3485D194A4B9E4D8751BC5A5321E9B /* MASShortcutMonitor.m */, - 26798DB74F28DE87259D2EC77916C658 /* MASShortcutValidator.h */, - 67E329D8A58E01DFEDEBC4ECB73BCB04 /* MASShortcutValidator.m */, - 4BC10337C8AD93957F289E193D30644F /* MASShortcutView.h */, - B5DFF804A6D3BFC409429DA682703A50 /* MASShortcutView.m */, - 59772212BCB28ACB3B10D04732ED8F8D /* MASShortcutView+Bindings.h */, - 38100CF1A92136DA8A810B1CD5D9D2B4 /* MASShortcutView+Bindings.m */, - F9FDACFE0997D2388C81600CA61071F2 /* Shortcut.h */, - 86057877B32BFFC4B6076D4A04C85086 /* Resources */, - 75B675F8514C4C085687D6AF166C4255 /* Support Files */, - ); - name = MASShortcut; - path = MASShortcut; - sourceTree = ""; - }; - 49FADCCE8DEE183085171E48794799D0 /* Products */ = { - isa = PBXGroup; - children = ( - 0C5179B0059EA422CE3E0CD9D544A9B1 /* Alamofire.framework */, - 516F91C50535F8F6F640F67E641997A3 /* GCDWebServer.framework */, - CB2E5FAB2E41A523334D78A648DA85BD /* libBRLOptionParser.a */, - C2B3BEE547EDC92417A8E332AF53292F /* libPods-proxy_conf_helper.a */, - 8F6AD8817DCDF5C429973DFDE855650C /* MASShortcut.bundle */, - D58DAAC44590953C26FC71CE97BBB28F /* MASShortcut.framework */, - 6E747DD2399CCE1B2803AD47C858B840 /* Pods_ShadowsocksX_NG.framework */, - 107BD367638AFAC8F3E01D42A0D1DECE /* Pods_ShadowsocksX_NGTests.framework */, - ); - name = Products; - sourceTree = ""; - }; - 5EFAC6B44ACA5F9FCD30CF1C69EECBD0 /* Alamofire */ = { - isa = PBXGroup; - children = ( - FB0EBA1E1100F179EBAE135039DE532C /* AFError.swift */, - F3C5576728407128F3BE8D96B7922923 /* Alamofire.swift */, - 4A78ADD0E2187A79B80359263F8D58DC /* DispatchQueue+Alamofire.swift */, - 15EC031236E7C3009E6DD401034BC35C /* MultipartFormData.swift */, - 253E551C1B9859C14CFA9C52573A09F5 /* NetworkReachabilityManager.swift */, - 387EBC243C3CB5EBDADEFA39399C8A31 /* Notifications.swift */, - 8B5E61ED6EF54C18FAE2F06428E22B93 /* ParameterEncoding.swift */, - 0C3DFC72D09E04176703E5C47943F521 /* Request.swift */, - 567D8F212F4A6315C60FB1515F8887A2 /* Response.swift */, - 36E1D63EDF5C7E2D22DA611D440AE114 /* ResponseSerialization.swift */, - DB6439601D189D6EA4EE34BBB5E8D1B9 /* Result.swift */, - 048EA0F03DC206107638B14EB0B22590 /* ServerTrustPolicy.swift */, - 1E4066248D5CB3239512D186B38644FD /* SessionDelegate.swift */, - B35228496116138E6C03F6FB1876BD1D /* SessionManager.swift */, - 53A014B3A6C4E5CFA3E4DE307B90604A /* TaskDelegate.swift */, - CBB13842D20339B1AA4DBC88598BE195 /* Timeline.swift */, - 43B60DA8283067C12C45F7338A462531 /* Validation.swift */, - F718DC23BBB105D5C81C85C15A0BD222 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; - 61779C21A0BC42D1B2D2F40D3C2B9F96 /* Support Files */ = { - isa = PBXGroup; - children = ( - 2301425B249CDDF65E3D16C6A2C1948F /* GCDWebServer.modulemap */, - 0A7F223B1591E9E8650F297A91EA618B /* GCDWebServer.xcconfig */, - 13CA6609061354DCC3F02C0EB2CEE5D0 /* GCDWebServer-dummy.m */, - F1CC0A417713CD6705E37B71B89C3B9A /* GCDWebServer-prefix.pch */, - 9681E05358DC8416C0EE292B3047C10E /* GCDWebServer-umbrella.h */, - E13D6DE7B7967B4C983579F0E5E686F7 /* Info.plist */, + 566053EA157CE20DAA58DA72F901EAF3 /* GCDWebServer.modulemap */, + EFE14E99FE3CC24013D01106E3710A5A /* GCDWebServer.xcconfig */, + 3934F71A55252BAEC1B840B4FB0F5831 /* GCDWebServer-dummy.m */, + 50EDCCCDD718AFFEA7DF382AA8F0B9AD /* GCDWebServer-prefix.pch */, + 892156754A7EF53FE3D80BC00C1975AB /* GCDWebServer-umbrella.h */, + 35C565B4B8F119EF72E6D99AE6C5FE4E /* Info.plist */, ); name = "Support Files"; path = "../Target Support Files/GCDWebServer"; sourceTree = ""; }; - 650931D2C5A3A6D4D1B55AD505D6594D /* Pods */ = { + 4C61D7F456D10FA95D42971061996162 /* RxSwift */ = { isa = PBXGroup; children = ( - 5EFAC6B44ACA5F9FCD30CF1C69EECBD0 /* Alamofire */, - 7C36140EB6EC0CD2744ADE7A7952F26F /* BRLOptionParser */, - F5C902D47EBB0891F881D6456F064038 /* GCDWebServer */, - 1CE12A13544A7DE01DC4914BF965B363 /* MASShortcut */, + B9007D55BF01790E2E753C6B70C41179 /* AddRef.swift */, + 28A7A9E967BF724C11ED0D7AECD827B2 /* Amb.swift */, + 78DB8C39B2ECE834500856BA7F87808B /* AnonymousDisposable.swift */, + 671D0C35D77C5534BD266C99699798F7 /* AnonymousInvocable.swift */, + 61C799F1F6F393193FDEB6E8B261E48C /* AnonymousObservable.swift */, + 00C649D6C2694F89369C6E4BFDF7020D /* AnonymousObserver.swift */, + 53556765457290978538C38D5C2FDA48 /* AnyObserver.swift */, + 5CA3F63B120DCD2B0AD8CA5A75890A10 /* AsyncLock.swift */, + F774A8AA7CF1C667887EFD6BB875DBBD /* Bag.swift */, + 6BC1640F774F19AE41AEC0772358B7D1 /* Bag+Rx.swift */, + D42C0F905B71E4F428236353DE12928B /* BehaviorSubject.swift */, + 3B2A679FC3BFF4F53FC9DF5CD71C6E75 /* BinaryDisposable.swift */, + DDCFD4F040A53B3A3EF03BEB2CC74220 /* BooleanDisposable.swift */, + F03278787D78510DCEEDDFAB06AD42F6 /* Buffer.swift */, + 686894AC6B1777DEFA921D960D8B519D /* Cancelable.swift */, + 5A232E9660CB723A1D128D3DFF830596 /* Catch.swift */, + 76DBA6E4CB608131ADBA7D7DFF8A4E6C /* CombineLatest.swift */, + 1240BCF9D45671D109A354E1255C9D0C /* CombineLatest+arity.swift */, + F9A4EC64F789C4F631F887DA33498D8C /* CombineLatest+Collection.swift */, + B4AA715B5CFDDF37B623E756474221F9 /* CompositeDisposable.swift */, + 35C4D7DBC6617F730997D93E6D496A63 /* Concat.swift */, + 91CFF9598EE190FD0A1231111991540B /* ConcurrentDispatchQueueScheduler.swift */, + C1135B3B4D2DC6F16A992DFB33D540AA /* ConcurrentMainScheduler.swift */, + BBB043A7F7ED4CC26A55E3EAF07D57BC /* ConnectableObservable.swift */, + FB026E9D4AF4C5FBA8F291E002660852 /* ConnectableObservableType.swift */, + 399C88A36ABC21E580DC529BB5ABD62D /* CurrentThreadScheduler.swift */, + A3C8902E07EA5E5DE5E621971E1B5762 /* Debug.swift */, + 3E154A2F60883D6C1571925AC73829D7 /* Debunce.swift */, + C5BA2BD2D1A8648107C13AA73BCF0AE2 /* Deferred.swift */, + A131F62F3B9E538F5835420C712C9967 /* Delay.swift */, + C62AFA43EC9E39C9901C2014FBF75441 /* DelaySubscription.swift */, + B53BE22700435344F5040D7A34438C79 /* DispatchQueue+Extensions.swift */, + B17A240A53E7810AEDB4E2936154C885 /* DispatchQueueConfiguration.swift */, + 26580914BABDC16C8FB464FE319029B4 /* Disposable.swift */, + 26339E7D90E6D149F805C377419D25BA /* Disposables.swift */, + 07CBE0BD61056E4192366A2BEB5035FF /* DisposeBag.swift */, + C260F4B4F6F3E5961E3A49C5B05520CD /* DisposeBase.swift */, + 0DF6EBFF755554CC9AB8962CD97A8DC3 /* DistinctUntilChanged.swift */, + 30522BE8DC862EF75E5D63648F9179F3 /* Do.swift */, + 7FFD8762948A54487F18FE67BEE8F77F /* ElementAt.swift */, + 18C31186BA3198D89D82D666FBB1905C /* Empty.swift */, + 792F8486AB9FF811EC6308B78C9E71B0 /* Error.swift */, + 191592A653EE5E76F4D61D104274AA51 /* Errors.swift */, + D5B12421F65E2E98C029ADC1ADEC949D /* Event.swift */, + DD14A3E25D58B573F248D9BAEFB1FD96 /* Filter.swift */, + BF6A784C26C191A7BB651A20F9FE09C2 /* Generate.swift */, + CEA7BED190A171843822577606510B95 /* HistoricalScheduler.swift */, + F38DB6F5263618374E7A97C5A4E497A1 /* HistoricalSchedulerTimeConverter.swift */, + B79A9D696C3F4750347FA86B4C4CC412 /* ImmediateScheduler.swift */, + 692C39EEB847B6865E05154D699B5A0D /* ImmediateSchedulerType.swift */, + A8B36ED31A6E3C49C77F55E2561C966D /* InfiniteSequence.swift */, + 460823F894F0F79E2B8E8992A02BFB25 /* InvocableScheduledItem.swift */, + 1633F46EA774BF24EF9CCD7B8CB200E8 /* InvocableType.swift */, + E809E90945E9BE1B60403F66019B3FF4 /* Just.swift */, + 576B7DEFF20932FE127908D3A5F4A54D /* Lock.swift */, + D5FF1DE565E7A0E50A3F648C38E95C78 /* LockOwnerType.swift */, + C63E884ADD906BC90F3C32DB52CC398D /* MainScheduler.swift */, + 7BB0F5D8F0F27F31636D82187890CC43 /* Map.swift */, + 75DFF226271D0F445274C3B660ADEE2A /* Merge.swift */, + 430720C6D9B5E4034976BD314857E51E /* Multicast.swift */, + EAB6E0C832D664BB3933B743E204615D /* Never.swift */, + 9350C02E503091FE07AEC409372D8DA0 /* NopDisposable.swift */, + 9EE36FCA3C6A386A888AD56E20DFF50C /* Observable.swift */, + 207CF7A03B53C4DF00C68FBBF1C6E8F7 /* Observable+Aggregate.swift */, + 230CC565B82B68200C82450AC93A5CE6 /* Observable+Binding.swift */, + F4752DE1461395A71AEFA91856BB6469 /* Observable+Concurrency.swift */, + C64F36BE9F05BDE74A3E670E69A4432E /* Observable+Creation.swift */, + 3F8959F53CCE7B042DCD8B664A46438B /* Observable+Debug.swift */, + 810CEE92287B0EBC821481019F3339CA /* Observable+Multiple.swift */, + 351ED3EC72E752AF671FC28B61B82EBB /* Observable+Single.swift */, + 843FB1118D1974CEF717BE490B13366C /* Observable+StandardSequenceOperators.swift */, + E0C535339357CC5D93CA927CECB123F0 /* Observable+Time.swift */, + 6FDB1E75DB13288544C739E40C5BE9EF /* ObservableConvertibleType.swift */, + 8EBEE1150AB7FFCE3B2375F0351703C4 /* ObservableType.swift */, + ED83F972951546FF54141DCDFFA0A699 /* ObservableType+Extensions.swift */, + 049B3D3D49998DB466FEB6A07B58CE38 /* ObserveOn.swift */, + 855CC0FE8F67377D0E604979734C70A7 /* ObserveOnSerialDispatchQueue.swift */, + D2A563269DDD44C5472F388FE17CF34B /* ObserverBase.swift */, + 6F76C18CDD50BC726A1A9F9713808F70 /* ObserverType.swift */, + 55881B24D12F75F02F1EF97DBE920CF9 /* OperationQueueScheduler.swift */, + 0F592655CCDF43D1184F7DCC5E7E4FD4 /* Optional.swift */, + A58E912F80E74F9E3D04FE3EAF217CBD /* Platform.Darwin.swift */, + 7B3C30C8BD2ECEF438E4A7E02A0C36B6 /* Platform.Linux.swift */, + 7A7C5FEA0C034019250F845D696DCCC6 /* PriorityQueue.swift */, + 5DBFE4A2BEA99797EECA6F80B01CDD6C /* Producer.swift */, + C5D5F5CEA32B2510E42A4A7976F27CCE /* PublishSubject.swift */, + BD85B8D01C25C718B7106EE598B59F05 /* Queue.swift */, + 33BF1B946B229E3493A637930A931DA2 /* Range.swift */, + BAE504DB6511ED954C7F3F53D78EFE96 /* Reactive.swift */, + 9CAAF792369765F875B4FABB87ECE3EE /* RecursiveScheduler.swift */, + 78697A689E989F8760B7F115D0F15A40 /* Reduce.swift */, + FFA24FA42F80B63EFCE3B8D7EAEEB17E /* RefCount.swift */, + E19D18DB5C1EA9E63E6DBF428B35C892 /* RefCountDisposable.swift */, + F49B97A2DDE155335D9A857CBCC1443E /* Repeat.swift */, + E0356020230831FEF31796FF613BF8AC /* ReplaySubject.swift */, + 0621C0B43DFC90DF41B61359E759D5D3 /* RetryWhen.swift */, + E0D8E8F499BC8AD11FA423052AD2B91A /* Rx.swift */, + F41DBC7F2E4B382CC91B8B28EF579853 /* RxMutableBox.swift */, + F6CAD2064683A8B0C403939B2A81D812 /* Sample.swift */, + D5F42FF8098EE07E0972506FA879BAED /* Scan.swift */, + 714CAF0BEC8075917C6E5B21A40F51DC /* ScheduledDisposable.swift */, + 9D539E4E6C4E295220FA4FAE74031789 /* ScheduledItem.swift */, + D3B86E229BBF998819417BA1EF0B5A5D /* ScheduledItemType.swift */, + E01D49455ED5C62F58BBAE0983AEB788 /* SchedulerServices+Emulation.swift */, + 23863CFA627473DC27B67457C49C2E18 /* SchedulerType.swift */, + D5ABF695E08E23D093300EE17154AD46 /* Sequence.swift */, + 8038341863E5188ED05DCC1BA2CF7CCD /* SerialDispatchQueueScheduler.swift */, + BF02268A49529C89CA28BBD728A4864A /* SerialDisposable.swift */, + D5049BF3275B506081D6290C03107F75 /* ShareReplay1.swift */, + D8E064CAF79139120E3D4F21DB6061FE /* ShareReplay1WhileConnected.swift */, + 9BEF9DEF3F2FE69B0036DA832678E66F /* SingleAssignmentDisposable.swift */, + 817BBAF28AF5DD16F4C657AB7AD305BF /* SingleAsync.swift */, + 3F13DE488DCBBAE4BDBC0CFC97574078 /* Sink.swift */, + 99BD77B66B1E1355C1E30439B72937EB /* Skip.swift */, + C77550063B64F014D70901594CE2B8AD /* SkipUntil.swift */, + DB6650CEB7DB19C31BA4430E3E4A0B54 /* SkipWhile.swift */, + D318C435E4EBC421BC050713E69DE0D2 /* StartWith.swift */, + 32F52D2218ED1A55107BC548E297E9CB /* String+Rx.swift */, + C30F42D2E6C0B7C15B64F1081749B8FF /* SubjectType.swift */, + D12E7DBD1E1B501117F95768ED20BBEC /* SubscribeOn.swift */, + A27E7196730EA8A4F03EECF2B8D2643A /* SubscriptionDisposable.swift */, + 2E65A0563A25A9BC5540C5C6752AFB8F /* Switch.swift */, + 43C28568E6E85CA37FC088179660CE6A /* SynchronizedDisposeType.swift */, + 6824046BB6F6BA5DA145A55756FCE843 /* SynchronizedOnType.swift */, + 52FF9201C9E5F013F957000A1108C6E9 /* SynchronizedSubscribeType.swift */, + 8D0F0E4B2FD793BE40FBBE96FD380D21 /* SynchronizedUnsubscribeType.swift */, + E8BCA33BF99DD786DF82E4D02D5E7F3D /* TailRecursiveSink.swift */, + C28A12A58B667D3534761E41E833AD91 /* Take.swift */, + 4F715D3AF178663A8CE6B81C0A481755 /* TakeLast.swift */, + 1CB76F5333C4E30B9798A7CB70CCB81F /* TakeUntil.swift */, + 6510627A459986B2675C9DF04BB19716 /* TakeWhile.swift */, + A1CDAA1E9C8D90D41A2E7EDD9164500F /* Throttle.swift */, + 79D3FF68C5D11A301F7C27AC3B626AB1 /* Timeout.swift */, + 7953F0BF7911F293599BC38510760E46 /* Timer.swift */, + C62E07D7645966D27B953E4580313A3D /* ToArray.swift */, + 13DC76F872C5CE141D7A381C3ED86F83 /* Using.swift */, + E58577DB359E44ED81D9764E891B1E47 /* Variable.swift */, + 09404441C1943A1C1C15699C71F33D2D /* VirtualTimeConverterType.swift */, + 07FDE0C81FDCEF30B795BD32553111FA /* VirtualTimeScheduler.swift */, + EF5E4BD0EF6C6C73284552531F108886 /* Window.swift */, + A51CD43BBF9E07B471180B3C6A10EC0C /* WithLatestFrom.swift */, + 732EEA83B671AC91F7FF52CDA4C2835E /* Zip.swift */, + 12DA49F9E5238CF2A4EBB5A83A1AE3DA /* Zip+arity.swift */, + F297CA1E051508BD3B6024498BC6FC3C /* Zip+Collection.swift */, + 98D6D29A6358FC51F6699762365905E4 /* Support Files */, ); - name = Pods; + name = RxSwift; + path = RxSwift; sourceTree = ""; }; - 75B675F8514C4C085687D6AF166C4255 /* Support Files */ = { + 596E070C58CFB10BC812CAD8C72703E5 /* Resources */ = { isa = PBXGroup; children = ( - D0279E4819926ED0B736DB036058CD11 /* Info.plist */, - 3A74752374CF19171D7037E55F877396 /* MASShortcut.modulemap */, - 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */, - 73446AD40BC622BA16D088399746703A /* MASShortcut-dummy.m */, - 9C4B2C128C8F507F0E716EC512D532D2 /* MASShortcut-prefix.pch */, - DEA37CFFE5FCF2A505A2EC3468C0E635 /* MASShortcut-umbrella.h */, - 4779AB5A8E8180D6F562A9859A27095A /* ResourceBundle-MASShortcut-Info.plist */, + EBF2BBFDA4F26C440DB709FAC5D3F25C /* cs.lproj */, + 96A80BADDCAF42068E3B168DD679B06E /* de.lproj */, + 92D90F1E9B3DB74E13DAEE89D729C388 /* en.lproj */, + 5CC992AE60F80ABE4AF96D7FB5D21FE1 /* es.lproj */, + 681AD0AD3FE6075FD0C745A2368127DB /* fr.lproj */, + 454D73DC3052FCEF303D57FAB12CC353 /* it.lproj */, + F1B18A75522A9348284094E1A906CFDB /* ja.lproj */, + 625F1E39F5E196BA50F36BE994C84724 /* ko.lproj */, + 36D63AB3B2F8729D38D2243E79FA9D37 /* nl.lproj */, + 4FA5AD2B9A1E8DE99434B14B3549E0B9 /* pl.lproj */, + 1E8F8E501B0EEF1A98B9B7557686F4DC /* ru.lproj */, + D55A3EC1AA96E83A76F91664C4C2F29D /* zh-Hans.lproj */, + 49E673D8031F864FAD63560EA564B5DD /* zh-Hant.lproj */, ); - name = "Support Files"; - path = "../Target Support Files/MASShortcut"; + name = Resources; sourceTree = ""; }; 785842678515C4CDC9428DD20DCD752D /* Targets Support Files */ = { @@ -507,46 +1042,155 @@ name = "Targets Support Files"; sourceTree = ""; }; - 7C36140EB6EC0CD2744ADE7A7952F26F /* BRLOptionParser */ = { + 7A633D619ABA3EAE06DBE3C3518CD402 /* Alamofire */ = { isa = PBXGroup; children = ( - DB80A4130B50AF90720FF211504FB9E9 /* BRLOptionParser.h */, - 5DA31567241C5316DE5F728BA3DE8DA6 /* BRLOptionParser.m */, - 9CAAA39B0E0963CC3C1A25313BEA6EFF /* Support Files */, + 6F30225997CEEA64CC0BDB9D5483A203 /* AFError.swift */, + 1EA1AA7BA748C2B699B5B73C3E690211 /* Alamofire.swift */, + ABDA9F0531A7A7502BDE85649B058DFB /* DispatchQueue+Alamofire.swift */, + 637833F0E5DBD5017099EF0583351872 /* MultipartFormData.swift */, + 156BD4BE88EBFE3B4B75AB2159FFEA69 /* NetworkReachabilityManager.swift */, + 8EBE7C5174BB4B63F44349A15EE826AF /* Notifications.swift */, + 9AB8F8AA0CF2C7D1D506FB9347CAD420 /* ParameterEncoding.swift */, + BA9688D287B1F197714D74B40DBE8680 /* Request.swift */, + 877E161F31772E123DCD4BC8EAA3EB75 /* Response.swift */, + 1B2EF9DEF408D295E5391455E123DD67 /* ResponseSerialization.swift */, + 4865DDF25A3AA8BBC5BE34A85F18D17C /* Result.swift */, + A9C0D3B37EBF8F2D69675B140D08F2C2 /* ServerTrustPolicy.swift */, + D741EA049F662EB20482A9A330B6FAE0 /* SessionDelegate.swift */, + F62634DC9F384C9CC41CEDA292858659 /* SessionManager.swift */, + 2FD1D9CC9BD0DB820CE56BBDE2B6E01F /* TaskDelegate.swift */, + 315C104108C26A838CCC718E8258B44A /* Timeline.swift */, + D0F0A9B8CFF8FE0E517E372F3A135E25 /* Validation.swift */, + 8BA2AD8787883059BF2ABA887EAA32C4 /* Support Files */, ); - name = BRLOptionParser; - path = BRLOptionParser; + name = Alamofire; + path = Alamofire; sourceTree = ""; }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - CD75D5B60FCA72FBF7F9C770460B2C26 /* Frameworks */, - 650931D2C5A3A6D4D1B55AD505D6594D /* Pods */, - 49FADCCE8DEE183085171E48794799D0 /* Products */, + D9727D7444B8CA54728F850F99A13C9F /* Frameworks */, + C7E2B68BC8DB477F03CE845072F368E9 /* Pods */, + AEB9320F726BCC1999DC9E6198BA9F1C /* Products */, 785842678515C4CDC9428DD20DCD752D /* Targets Support Files */, ); sourceTree = ""; }; - 86057877B32BFFC4B6076D4A04C85086 /* Resources */ = { + 845CD43128EA477D183663496430A9E3 /* Core */ = { isa = PBXGroup; children = ( - 523EB4117774721D3A84582CA66D9CCA /* cs.lproj */, - AB0D38FFE12F18677596FC69DB07A5BC /* de.lproj */, - 9173DC735D07558D20262553791D744B /* en.lproj */, - 53D5DAAB111208B30EE6665B457791CA /* es.lproj */, - 90E14D041108C5A6D6FAFADB704613D9 /* fr.lproj */, - 8695AB6FAA639E36640736E4AE90D07C /* it.lproj */, - C75B3D4578ADA314E1C779DB5ECAA89B /* ja.lproj */, - AF1D2790CBE48EA409C37174C263BBBB /* ko.lproj */, - AFB4B923C938302D83D3C7BBB013CC39 /* nl.lproj */, - 1456802B211CB503F6773EFFB0E476EC /* pl.lproj */, - EDE850D2C845A4E04C32A0E8943E5168 /* ru.lproj */, - 52A033C0DC8B549D3F002F7D4207F0BC /* zh-Hans.lproj */, - 97959737DD67EFD1D7AB5F26607875F2 /* zh-Hant.lproj */, + C7BA15653BA24C8CB2D6A810BD172EB4 /* GCDWebServer.h */, + C743F524B10FDE01231455A0541D06DC /* GCDWebServer.m */, + 041B57D22A62A24545E85A4646383BA5 /* GCDWebServerConnection.h */, + 7ED1793F25CA7EA6496FF4ACB5360784 /* GCDWebServerConnection.m */, + 8AA937C432E0F9441C102162B7D3DE77 /* GCDWebServerDataRequest.h */, + 5804C71C9D97BB10B0FFE80E795CD85E /* GCDWebServerDataRequest.m */, + 8D64CB474F7D1B9FDD19465A43A61164 /* GCDWebServerDataResponse.h */, + CD9A1A157A1A6F85D6AAE2A82E930E2C /* GCDWebServerDataResponse.m */, + 64B15D82041B7A6840823B8A9F3751FD /* GCDWebServerErrorResponse.h */, + 296DBD7B4C2829639C9DF408009E61C1 /* GCDWebServerErrorResponse.m */, + 89157B205B92DB7240F198AAAE3E1D23 /* GCDWebServerFileRequest.h */, + 0A9743EE40CDB23A5B902DCA0EACD4F8 /* GCDWebServerFileRequest.m */, + CB4B9ED2B1EB569789C066F34F7123A4 /* GCDWebServerFileResponse.h */, + 7568784246140565AB9D65499F73D5CF /* GCDWebServerFileResponse.m */, + 3BADCC46C21E3D39AF50D9AEC5800CFC /* GCDWebServerFunctions.h */, + 261510805F67C14BBF23BD04C18168E9 /* GCDWebServerFunctions.m */, + 07C3DED13280C0FE73368A82866875B7 /* GCDWebServerHTTPStatusCodes.h */, + DB9CD6FE2DD142EFA2C41E21AB227946 /* GCDWebServerMultiPartFormRequest.h */, + 0AA9F9CD0EB270DDA2ED76FD3446F305 /* GCDWebServerMultiPartFormRequest.m */, + 54065E050A33BF7D4D54D1A31297F2F1 /* GCDWebServerPrivate.h */, + 89B67DFE619069B6AD5E1D0FAA0BB8E2 /* GCDWebServerRequest.h */, + 46722F0D8851A939625EFF1E910938E4 /* GCDWebServerRequest.m */, + AF5498021A404BB1ACCA140C4B62871C /* GCDWebServerResponse.h */, + A1E6CC9C6785132EA7807744DE0ED408 /* GCDWebServerResponse.m */, + 53D1C7024A81399E15CEE5B8F618A68E /* GCDWebServerStreamedResponse.h */, + C4532CD920B79E94F7B61A2B9A63FCAD /* GCDWebServerStreamedResponse.m */, + 79AFDA86F88F40BFA89B3B2A729B2F24 /* GCDWebServerURLEncodedFormRequest.h */, + 619730E0F7D114E0BBB3773020DBC95D /* GCDWebServerURLEncodedFormRequest.m */, ); - name = Resources; + name = Core; + sourceTree = ""; + }; + 8BA2AD8787883059BF2ABA887EAA32C4 /* Support Files */ = { + isa = PBXGroup; + children = ( + 70F68C0A07F092F38A775533EA9D0AAD /* Alamofire.modulemap */, + E7AC2CB247486E6770E163434DEC2B56 /* Alamofire.xcconfig */, + 5E6312D7CA68889DE662535E01249EE7 /* Alamofire-dummy.m */, + 8EE24E5283B182B30014870DA91C3874 /* Alamofire-prefix.pch */, + 48352BD4C4E074FC479B0513B92EA7F9 /* Alamofire-umbrella.h */, + 526ACD42F8C85B5E06999E3EC17B3AE9 /* Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/Alamofire"; + sourceTree = ""; + }; + 933FA5BA35FA903ACC3F21095CFB4950 /* RxCocoa */ = { + isa = PBXGroup; + children = ( + DEB9C9F773C5584C1A64134DF28D78E2 /* _RX.h */, + 70BBD10E3B649EA0755AD083EA7CDFB9 /* _RX.m */, + 5378A3AA30126867581EB3932CC75611 /* _RXDelegateProxy.h */, + E8E6D1E113A8A1E690491F2E3F8A2201 /* _RXDelegateProxy.m */, + 30EACF50723CFE5FA01F06A95D09A211 /* _RXKVOObserver.h */, + DDF9D2AC2FD4CD42F8B089BAFDE4C6BD /* _RXKVOObserver.m */, + 145175C8AA8A892EBA0AEC97F7612D90 /* _RXObjCRuntime.h */, + 5AF29FABA8C360B08D7C7424360D6666 /* _RXObjCRuntime.m */, + F2EC79DAE53D1D70A47EBAFD39ED862E /* Bag.swift */, + EF1D18BE7EFD12AA66C3376332FEF003 /* ControlEvent.swift */, + 3E94EA62172D30A25E824EE75E3D9C0B /* ControlEvent+Driver.swift */, + 1DB870B11C1F6D4D44DFD74BC9A31C93 /* ControlProperty.swift */, + 3CF036C948FB845526B616E2A9485814 /* ControlProperty+Driver.swift */, + DDF7D11C29F998B81F2EC67417F7E5E4 /* ControlTarget.swift */, + BD3624B117D9AC549B1CAED71ACDA6FD /* DelegateProxy.swift */, + 0AD4268847B9453CE579C41B609E22B7 /* DelegateProxyType.swift */, + 3747A52D98BA28FA152080DA132B4955 /* DispatchQueue+Extensions.swift */, + 765B2B823783215A2E954FAB4853AC93 /* Driver.swift */, + 0E84CF71B17BFE084E0D16395EDB8885 /* Driver+Subscription.swift */, + 5093D2110C7158AE638018A9970FA168 /* InfiniteSequence.swift */, + 895C03FCA3BCF07DBDA8A858302D9662 /* KVORepresentable.swift */, + 44AB1ECD0CB22EBDA55B3C604C16B84E /* KVORepresentable+CoreGraphics.swift */, + 3E39C3D16733CDCB7BAD80752EC7D239 /* KVORepresentable+Swift.swift */, + 47E82A0897F8223FF68BA4F995D79C8D /* Logging.swift */, + 61722C6F303EAAE1C5638EE5B33DD66A /* NSButton+Rx.swift */, + 7CF90C9854898D2869D0FA04F6FEFD51 /* NSControl+Rx.swift */, + ABBC6E0B59D4E0A8264EF5775E962781 /* NSImageView+Rx.swift */, + 3A283ECB7F07204392F8B86F905B1B7A /* NSLayoutConstraint+Rx.swift */, + C2E92EE455CBA70E47FF6E1B2A8A8F10 /* NSNotificationCenter+Rx.swift */, + 9BF8977C2D21F0E3E6B4809F5512A9B6 /* NSObject+Rx.swift */, + C0FF24549EBA19FE3868F5A0F0A65C24 /* NSObject+Rx+KVORepresentable.swift */, + D63CEEDC1A1E689C53BE5B8FB80BBB4F /* NSObject+Rx+RawRepresentable.swift */, + 406F80B90F80B783BD73B5494D32BF6E /* NSSlider+Rx.swift */, + 9654A33B220127C74EC683B98310281D /* NSTextField+Rx.swift */, + EEE98592A8E669C3B96D3E19120FC821 /* NSView+Rx.swift */, + 3E83A23DEF6EC644ABA3997BE70BFA85 /* Observable+Bind.swift */, + 0543E52D336EE3D670FA0326B542D1AD /* ObservableConvertibleType+Driver.swift */, + C6581F3ACC8B4396727CEB2528B37F04 /* ObservableConvertibleType+SharedSequence.swift */, + 6A6F87048375FCF10848872558242925 /* Platform.Darwin.swift */, + 0C8A6200FBBE9F05CEF009C65C0AE129 /* Platform.Linux.swift */, + FECDA2B834D431A94C10FFDA1E53F33E /* PriorityQueue.swift */, + EE0E8A058AF30A041E8DB6F051BBDE16 /* Queue.swift */, + 08BD28C9755413291F8752D325956F13 /* RxCocoa.h */, + EF832054667391DF7219EEC7E1426BFB /* RxCocoa.swift */, + 917C99A8833B2D56222425A6F84CA5DA /* RxCocoaObjCRuntimeError+Extensions.swift */, + E258DC88C29E64BF1A3523D2FFF806B5 /* RxCocoaRuntime.h */, + D99D4398615AB6F4E3F9A978A1FBBBD1 /* RxTarget.swift */, + 23AF045F391083D9003B490F27BEF7D5 /* SectionedViewDataSourceType.swift */, + E4B8CB36B3783E2A2310ADFB4CC33864 /* SharedSequence.swift */, + 7CD18D2965F9753B545A1B1BA54828CB /* SharedSequence+Operators.swift */, + 992670FA98E8ED847E3131B73896D8ED /* SharedSequence+Operators+arity.swift */, + C22A091C89D7A9C2B736EF1A49C54280 /* TextInput.swift */, + 88A487D891BF9234985AA4099272A55F /* UIBindingObserver.swift */, + 84CA690C1F208F1306162397DEABE31E /* URLSession+Rx.swift */, + 375E8496E1F8683C57FE684DE6D592C1 /* Variable+Driver.swift */, + 0B87C81B82992789E3611469980A1778 /* Variable+SharedSequence.swift */, + BD68FB905BE00C76233C5B7F077B07D3 /* Support Files */, + ); + name = RxCocoa; + path = RxCocoa; sourceTree = ""; }; 93AB896DD6AD247E69959A4B8C06F5AC /* Pods-ShadowsocksX-NG */ = { @@ -567,26 +1211,56 @@ path = "Target Support Files/Pods-ShadowsocksX-NG"; sourceTree = ""; }; - 9CAAA39B0E0963CC3C1A25313BEA6EFF /* Support Files */ = { + 94F23F332E9AF6CFB1AE598A25825D20 /* GCDWebServer */ = { isa = PBXGroup; children = ( - 084AC6693EA56EA74BB4D3AC5F654C90 /* BRLOptionParser.xcconfig */, - CCB68427884134CB40644A07D36C7213 /* BRLOptionParser-dummy.m */, - CDA7F4E570344BA6692850FAD6D5DF52 /* BRLOptionParser-prefix.pch */, + 845CD43128EA477D183663496430A9E3 /* Core */, + 34FFC41A803A1DE1AD2BA42E08949249 /* Support Files */, + ); + name = GCDWebServer; + path = GCDWebServer; + sourceTree = ""; + }; + 98D6D29A6358FC51F6699762365905E4 /* Support Files */ = { + isa = PBXGroup; + children = ( + C47B091EB868220FDDF555507F5A2254 /* Info.plist */, + DD4766C097C60C5A8CBF72F3E935D01D /* RxSwift.modulemap */, + 96452244B9CFEFBA70877833E181A983 /* RxSwift.xcconfig */, + 2AA25737DC8326205335C494D261A558 /* RxSwift-dummy.m */, + 602C7742B3313DB6FEDFF9DD997B84AF /* RxSwift-prefix.pch */, + 32333F64D65C89D5A002F9CB80C2CDE2 /* RxSwift-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/RxSwift"; + sourceTree = ""; + }; + A0E044ABBAEE4668550471527F21760A /* Support Files */ = { + isa = PBXGroup; + children = ( + 5C8B549DF38B641E23F436DE84A1AB1F /* BRLOptionParser.xcconfig */, + C507512A0FC2103B39A0C7761B19968E /* BRLOptionParser-dummy.m */, + 4010445B50195F4EB7E0DD32DD2162C8 /* BRLOptionParser-prefix.pch */, ); name = "Support Files"; path = "../Target Support Files/BRLOptionParser"; sourceTree = ""; }; - B2A5ED6BF1F3BA8632F2BF072B1D797C /* OS X */ = { + AEB9320F726BCC1999DC9E6198BA9F1C /* Products */ = { isa = PBXGroup; children = ( - E7A60DCFEEFE6028E803545102BA75B1 /* AppKit.framework */, - 422368F6E15C06536EA1297767A63D08 /* Carbon.framework */, - CA08FE5653C839C9C87AB4FE9A9AAEB3 /* Cocoa.framework */, - F581A519A535CA5FCC23235961004C18 /* SystemConfiguration.framework */, + FBAF339F33C80576683D76394CA51047 /* Alamofire.framework */, + 7B63AB91C9378BEF83982ADCC82E9770 /* GCDWebServer.framework */, + C760BAF596F45988BF95E5D3C10BA670 /* libBRLOptionParser.a */, + E0CF346DBA2C8BDB54C4D65E01BE83B4 /* libPods-proxy_conf_helper.a */, + 288F0992DFCC5E6027AA31FD385C34D6 /* MASShortcut.bundle */, + 9B6ACACC69C2EA2681770741535F1D69 /* MASShortcut.framework */, + BF541EB164C2E45EC80ADBE338F2D325 /* Pods_ShadowsocksX_NG.framework */, + D0531FFA0D5305257F668D1D12A1411F /* Pods_ShadowsocksX_NGTests.framework */, + B0FC490145F0D2AD9B833C41F78CA818 /* RxCocoa.framework */, + E15756B54614ACA75251861D700E1946 /* RxSwift.framework */, ); - name = "OS X"; + name = Products; sourceTree = ""; }; B5020B0A649E766997C633601AD85F17 /* Pods-proxy_conf_helper */ = { @@ -604,84 +1278,113 @@ path = "Target Support Files/Pods-proxy_conf_helper"; sourceTree = ""; }; - CAE8AB766B9BF9B05A5D96F39189E945 /* Core */ = { + BD68FB905BE00C76233C5B7F077B07D3 /* Support Files */ = { isa = PBXGroup; children = ( - B3C847943F2CAD8774184593F62DEC64 /* GCDWebServer.h */, - 0ED1AABBB1434105BE0249A77C1D5435 /* GCDWebServer.m */, - 883FD374D1F5406153C9E25ED24B8921 /* GCDWebServerConnection.h */, - ACFB62D4A50AD45388DA32F0097C2241 /* GCDWebServerConnection.m */, - 4D83581D01E98E7FBCE531F4D826138A /* GCDWebServerDataRequest.h */, - 69EABE25139B92E133ACB9E48FB95497 /* GCDWebServerDataRequest.m */, - 1F7F511A7BB871D77D80C8B376050327 /* GCDWebServerDataResponse.h */, - C43BE7EB97552AD3EE8563CFD356D50F /* GCDWebServerDataResponse.m */, - 15B24A5DDAD858CD6616DD64178BB7A6 /* GCDWebServerErrorResponse.h */, - 88148F9C1CEE4F1EEF82261BBF938A56 /* GCDWebServerErrorResponse.m */, - 281F888B9FFA5F230A528564E73518DF /* GCDWebServerFileRequest.h */, - 530C22E2895216346F4F87BF7F436BC7 /* GCDWebServerFileRequest.m */, - B47B95553B8446AB4C05DB6C787C1923 /* GCDWebServerFileResponse.h */, - 5C4942853CFF0AF10EE0507A6DB64F7B /* GCDWebServerFileResponse.m */, - 2BC7E8CD72FA119611A23DE041B5140C /* GCDWebServerFunctions.h */, - 734ECD2C008F0A0CDEA641B3EF6983D3 /* GCDWebServerFunctions.m */, - 8D782BF889898D9E5258D79D2A4DA8EC /* GCDWebServerHTTPStatusCodes.h */, - 332ACCF53DA56255BCDB92E92475A51E /* GCDWebServerMultiPartFormRequest.h */, - 2F9A804E1EB5515485FBC3A8075FCDFF /* GCDWebServerMultiPartFormRequest.m */, - 521DF5ED2D6DDCC2CD0241C6758A82E8 /* GCDWebServerPrivate.h */, - A9CAB6031EE58AA1643806530AAA4DDD /* GCDWebServerRequest.h */, - 3A7262F05AABD2F2F8116F28E4444730 /* GCDWebServerRequest.m */, - BE8739A57CFBA2B252B9323870F7F914 /* GCDWebServerResponse.h */, - C03AA4D681FDF11A4D5D92CE754BB78E /* GCDWebServerResponse.m */, - 2A824D6AF73605FD4B0434931B70C7CE /* GCDWebServerStreamedResponse.h */, - CD639ADC8DEDEF3134D5CC65E9481B1B /* GCDWebServerStreamedResponse.m */, - 08089D3F4CC12076D2D2B8794E4BC321 /* GCDWebServerURLEncodedFormRequest.h */, - D354B988E94145D21D7ACC846F6E3A69 /* GCDWebServerURLEncodedFormRequest.m */, + 456ACDE36340325DBB10D0B916626C43 /* Info.plist */, + 1B9E3352BCF62F8787D5BBC941EEA516 /* RxCocoa.modulemap */, + D95E797893870454BDD396AD03752C2A /* RxCocoa.xcconfig */, + ADA9A70ECA885B87CA7B20916DC7BC6F /* RxCocoa-dummy.m */, + 44F0FB436EC76D655A87DDCE3F993478 /* RxCocoa-prefix.pch */, + F4B4BFA85D88E0779216DDD104D2F899 /* RxCocoa-umbrella.h */, ); - name = Core; + name = "Support Files"; + path = "../Target Support Files/RxCocoa"; sourceTree = ""; }; - CD75D5B60FCA72FBF7F9C770460B2C26 /* Frameworks */ = { + BE3D3838C8B84A3CEF2E935A8409A3E6 /* Support Files */ = { isa = PBXGroup; children = ( - B2A5ED6BF1F3BA8632F2BF072B1D797C /* OS X */, + 1E6D6DE4E89E068F148B72C3C94E25CF /* Info.plist */, + 9E41B98DB7C06E244630AEDD27EB9878 /* MASShortcut.modulemap */, + 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */, + 7840085CAB4823FE9A3BE2CB2174BC31 /* MASShortcut-dummy.m */, + 04A06344257808FD1937BDB41F18B407 /* MASShortcut-prefix.pch */, + 9CEB1670F4E8A8FED505B32B7F7DADD3 /* MASShortcut-umbrella.h */, + C0E55BD2346FA928953EF952CED22364 /* ResourceBundle-MASShortcut-Info.plist */, + ); + name = "Support Files"; + path = "../Target Support Files/MASShortcut"; + sourceTree = ""; + }; + BF8DBFAA295EDD4508C57565E7584442 /* MASShortcut */ = { + isa = PBXGroup; + children = ( + 0FB5237BDF54A20103EBE82BDC80B5C6 /* MASDictionaryTransformer.h */, + AADDE7423A968810AADD026BD63867B0 /* MASDictionaryTransformer.m */, + 1DCF2459B4B59AA53E371B3303793795 /* MASHotKey.h */, + C21DA07175E00F9652FEE28ACB8A721E /* MASHotKey.m */, + DDB7132E575EAC0CA9B48A0425DAAD21 /* MASKeyCodes.h */, + 734A36BDD429097E76987966DC4ED7AF /* MASKeyMasks.h */, + D22C2E880EC2CBCA5E33F7C18A7C28E5 /* MASLocalization.h */, + 5EA43362B8170DE6F84E11B91A09EC32 /* MASLocalization.m */, + 43F1B63559BBFA7E83623D1C9AC8E633 /* MASShortcut.h */, + AA881E4DA90F807751C146D7483CDEC3 /* MASShortcut.m */, + CD17E58327299EAC195D109A1B69B917 /* MASShortcutBinder.h */, + 14FD2EAF92039F913842A87BA5122B62 /* MASShortcutBinder.m */, + 25054C0604BDF8F039586E1B8351F0C6 /* MASShortcutMonitor.h */, + 3446B97BEC82628B5B70EBA865321925 /* MASShortcutMonitor.m */, + DFE42161A598BDA23E054E467E3BBBCD /* MASShortcutValidator.h */, + B91619B91E70B0C5E6FAC0131E42FD7E /* MASShortcutValidator.m */, + 90398724ED993172FCE73E50A7D35827 /* MASShortcutView.h */, + EB98EC4AC6562F031A89D824210E36CF /* MASShortcutView.m */, + 64D4E87F4D1E140147BC9F1FD6C31A64 /* MASShortcutView+Bindings.h */, + B2A49B7D2E244535BCE8E120F0D8D070 /* MASShortcutView+Bindings.m */, + AD4ECEBBCA289543D5E13C73371BCCB3 /* Shortcut.h */, + 596E070C58CFB10BC812CAD8C72703E5 /* Resources */, + BE3D3838C8B84A3CEF2E935A8409A3E6 /* Support Files */, + ); + name = MASShortcut; + path = MASShortcut; + sourceTree = ""; + }; + C07959C695700E8E160113D13009F59E /* BRLOptionParser */ = { + isa = PBXGroup; + children = ( + C2E109F0988D784B0B51149C9E0CFB7E /* BRLOptionParser.h */, + E0E8FB6DEC7DDD0F6FEEE86CCDFBC820 /* BRLOptionParser.m */, + A0E044ABBAEE4668550471527F21760A /* Support Files */, + ); + name = BRLOptionParser; + path = BRLOptionParser; + sourceTree = ""; + }; + C7E2B68BC8DB477F03CE845072F368E9 /* Pods */ = { + isa = PBXGroup; + children = ( + 7A633D619ABA3EAE06DBE3C3518CD402 /* Alamofire */, + C07959C695700E8E160113D13009F59E /* BRLOptionParser */, + 94F23F332E9AF6CFB1AE598A25825D20 /* GCDWebServer */, + BF8DBFAA295EDD4508C57565E7584442 /* MASShortcut */, + 933FA5BA35FA903ACC3F21095CFB4950 /* RxCocoa */, + 4C61D7F456D10FA95D42971061996162 /* RxSwift */, + ); + name = Pods; + sourceTree = ""; + }; + D9727D7444B8CA54728F850F99A13C9F /* Frameworks */ = { + isa = PBXGroup; + children = ( + B792280B7BC7CA44B5D7090C8F732A0D /* RxSwift.framework */, + E2E3EA611324A191E7D403B061C56915 /* OS X */, ); name = Frameworks; sourceTree = ""; }; - F5C902D47EBB0891F881D6456F064038 /* GCDWebServer */ = { + E2E3EA611324A191E7D403B061C56915 /* OS X */ = { isa = PBXGroup; children = ( - CAE8AB766B9BF9B05A5D96F39189E945 /* Core */, - 61779C21A0BC42D1B2D2F40D3C2B9F96 /* Support Files */, + 139134EE845E284F4B3ED2EF2F9A302B /* AppKit.framework */, + EFD468F10CD22B3EFAB406DAC3FCC7C9 /* Carbon.framework */, + EA9A1A86E1594EEC96C2B7214E16E50F /* Cocoa.framework */, + 4FEC4B8DFE8753A9B1DE598293568F30 /* SystemConfiguration.framework */, ); - name = GCDWebServer; - path = GCDWebServer; - sourceTree = ""; - }; - F718DC23BBB105D5C81C85C15A0BD222 /* Support Files */ = { - isa = PBXGroup; - children = ( - D3DC4D6EBE59976B5E4AC12E8E959231 /* Alamofire.modulemap */, - 1854166C986170C7CC1EC2E0441FBB08 /* Alamofire.xcconfig */, - 844CBFCCA003D23AC4446B0970F5FF96 /* Alamofire-dummy.m */, - 26D435359785FE007E5ACEC4D7D21967 /* Alamofire-prefix.pch */, - 2622E50F246A10BAC80FCFDF60CDB349 /* Alamofire-umbrella.h */, - 81A5C0C5F96747880A33B1404380A4FF /* Info.plist */, - ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; + name = "OS X"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 0B2513FB1B010E6777FDD31E5713B882 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 95EE31BA6E30FA4FF0F07AE21C5F45D7 /* Pods-ShadowsocksX-NG-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 49E47E8FB0395F70E77651B02346BF41 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -690,6 +1393,22 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 515CC0B658FC2F28D886B75DF18D212D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F2853E97BDDC82B8F91AE2954D27F775 /* RxSwift-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 532B704827707EAEFF5F8967E662D4F7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 2C16189485F3647493E5E74E8C629E54 /* Pods-ShadowsocksX-NG-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 68FE8321E00587BF5072825A5E9B4704 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -733,6 +1452,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 8D0544708D493A52C828804099AE01DC /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 86F7FE179A98E2787500CA0DD68F2574 /* _RX.h in Headers */, + DF2762B53F71DBC62F8CE6D5A89E7461 /* _RXDelegateProxy.h in Headers */, + FF647F4502B0AE29095FA14A256612EE /* _RXKVOObserver.h in Headers */, + 6D1B82733CCD35C7B720D8B306969DB2 /* _RXObjCRuntime.h in Headers */, + DB94D782C6F193FB6F56D52926F2A84B /* RxCocoa-umbrella.h in Headers */, + 9A551C74F80912EFDFC942535ECA28BE /* RxCocoa.h in Headers */, + 08067F41CEECB56CE74FFCA481092E8D /* RxCocoaRuntime.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -768,7 +1501,7 @@ ); name = MASShortcut; productName = MASShortcut; - productReference = D58DAAC44590953C26FC71CE97BBB28F /* MASShortcut.framework */; + productReference = 9B6ACACC69C2EA2681770741535F1D69 /* MASShortcut.framework */; productType = "com.apple.product-type.framework"; }; 05800FAF969AA3CD7F8AEB1C36988B53 /* Pods-proxy_conf_helper */ = { @@ -785,7 +1518,7 @@ ); name = "Pods-proxy_conf_helper"; productName = "Pods-proxy_conf_helper"; - productReference = C2B3BEE547EDC92417A8E332AF53292F /* libPods-proxy_conf_helper.a */; + productReference = E0CF346DBA2C8BDB54C4D65E01BE83B4 /* libPods-proxy_conf_helper.a */; productType = "com.apple.product-type.library.static"; }; 339CC546E4A1696296EFEDC2FA79ADE0 /* Pods-ShadowsocksX-NGTests */ = { @@ -802,7 +1535,7 @@ ); name = "Pods-ShadowsocksX-NGTests"; productName = "Pods-ShadowsocksX-NGTests"; - productReference = 107BD367638AFAC8F3E01D42A0D1DECE /* Pods_ShadowsocksX_NGTests.framework */; + productReference = D0531FFA0D5305257F668D1D12A1411F /* Pods_ShadowsocksX_NGTests.framework */; productType = "com.apple.product-type.framework"; }; 3CB2B8006B2B1ACAF9ADCA1DC82E2290 /* BRLOptionParser */ = { @@ -819,9 +1552,27 @@ ); name = BRLOptionParser; productName = BRLOptionParser; - productReference = CB2E5FAB2E41A523334D78A648DA85BD /* libBRLOptionParser.a */; + productReference = C760BAF596F45988BF95E5D3C10BA670 /* libBRLOptionParser.a */; productType = "com.apple.product-type.library.static"; }; + 50DA2BB85DEBA27DDBB9E2D53E8E2A1A /* RxCocoa */ = { + isa = PBXNativeTarget; + buildConfigurationList = D913F5C08F647E9FCC34C3A5B3030BD5 /* Build configuration list for PBXNativeTarget "RxCocoa" */; + buildPhases = ( + A6A7F41BC3E054BC310066CAAE0C98AE /* Sources */, + AC6EF4DCF3427EDD23A06A9ACE60D1CB /* Frameworks */, + 8D0544708D493A52C828804099AE01DC /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + 3AB65F40E1512A92325180D6E33602FE /* PBXTargetDependency */, + ); + name = RxCocoa; + productName = RxCocoa; + productReference = B0FC490145F0D2AD9B833C41F78CA818 /* RxCocoa.framework */; + productType = "com.apple.product-type.framework"; + }; 5B8B0ED1046111D92895FC95F12DBC10 /* GCDWebServer */ = { isa = PBXNativeTarget; buildConfigurationList = 010811070A86F912EA0CD2BB98136CD9 /* Build configuration list for PBXNativeTarget "GCDWebServer" */; @@ -836,27 +1587,29 @@ ); name = GCDWebServer; productName = GCDWebServer; - productReference = 516F91C50535F8F6F640F67E641997A3 /* GCDWebServer.framework */; + productReference = 7B63AB91C9378BEF83982ADCC82E9770 /* GCDWebServer.framework */; productType = "com.apple.product-type.framework"; }; - 6171F54AD4A331758CFCF8E97F355EFB /* Pods-ShadowsocksX-NG */ = { + 88D587684BF4E7ECC675C83B7E824D75 /* Pods-ShadowsocksX-NG */ = { isa = PBXNativeTarget; - buildConfigurationList = 2C4B50829655C633ABF135903133D7BA /* Build configuration list for PBXNativeTarget "Pods-ShadowsocksX-NG" */; + buildConfigurationList = E185892330EBDCF4E8B37928210771A9 /* Build configuration list for PBXNativeTarget "Pods-ShadowsocksX-NG" */; buildPhases = ( - DB9AB46C1A759CB0B12EFF0927D8735C /* Sources */, - 684E640573B267856B0161607461C7DE /* Frameworks */, - 0B2513FB1B010E6777FDD31E5713B882 /* Headers */, + 904AEEA871CD0088ACE9F674EED25700 /* Sources */, + 4F131864F47901DC9547FC3861CAA756 /* Frameworks */, + 532B704827707EAEFF5F8967E662D4F7 /* Headers */, ); buildRules = ( ); dependencies = ( - 19B0119E12F2C523EAD90C0093B3CE34 /* PBXTargetDependency */, - B0EEE3BF50F58EF6333DF85A94484C40 /* PBXTargetDependency */, - 28917DA5B45CD6AC906D6AA28EC2F7C9 /* PBXTargetDependency */, + 333E7BAB0E0DB09E26646BD8E93FFDCE /* PBXTargetDependency */, + 3E1EF8FCF446C8D86D778D5D1ABFA9CD /* PBXTargetDependency */, + 895CE87A9D309D30CEFBF51BA07CDBEA /* PBXTargetDependency */, + C65B838B24FDE9D70E5E870D8780B5EB /* PBXTargetDependency */, + D9D65FB37163F6C00197A5C036F871E6 /* PBXTargetDependency */, ); name = "Pods-ShadowsocksX-NG"; productName = "Pods-ShadowsocksX-NG"; - productReference = 6E747DD2399CCE1B2803AD47C858B840 /* Pods_ShadowsocksX_NG.framework */; + productReference = BF541EB164C2E45EC80ADBE338F2D325 /* Pods_ShadowsocksX_NG.framework */; productType = "com.apple.product-type.framework"; }; 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { @@ -873,7 +1626,24 @@ ); name = Alamofire; productName = Alamofire; - productReference = 0C5179B0059EA422CE3E0CD9D544A9B1 /* Alamofire.framework */; + productReference = FBAF339F33C80576683D76394CA51047 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + 9759FFB1455B05FE96A5765890590110 /* RxSwift */ = { + isa = PBXNativeTarget; + buildConfigurationList = C3C04E339BA1928DBC29CEFD07DC6ADF /* Build configuration list for PBXNativeTarget "RxSwift" */; + buildPhases = ( + BA3900128DCA208B2F7C8EB0B042D0B3 /* Sources */, + 656F921478BE483858A20165B6945F4A /* Frameworks */, + 515CC0B658FC2F28D886B75DF18D212D /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RxSwift; + productName = RxSwift; + productReference = E15756B54614ACA75251861D700E1946 /* RxSwift.framework */; productType = "com.apple.product-type.framework"; }; D6E5ED8DAF7CA937C8F68F342C48B26E /* MASShortcut-MASShortcut */ = { @@ -890,7 +1660,7 @@ ); name = "MASShortcut-MASShortcut"; productName = "MASShortcut-MASShortcut"; - productReference = 8F6AD8817DCDF5C429973DFDE855650C /* MASShortcut.bundle */; + productReference = 288F0992DFCC5E6027AA31FD385C34D6 /* MASShortcut.bundle */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ @@ -910,7 +1680,7 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 49FADCCE8DEE183085171E48794799D0 /* Products */; + productRefGroup = AEB9320F726BCC1999DC9E6198BA9F1C /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( @@ -920,8 +1690,10 @@ 00C94ED0B49A44FBF0C4E2F6C875CFFC /* MASShortcut */, D6E5ED8DAF7CA937C8F68F342C48B26E /* MASShortcut-MASShortcut */, 05800FAF969AA3CD7F8AEB1C36988B53 /* Pods-proxy_conf_helper */, - 6171F54AD4A331758CFCF8E97F355EFB /* Pods-ShadowsocksX-NG */, + 88D587684BF4E7ECC675C83B7E824D75 /* Pods-ShadowsocksX-NG */, 339CC546E4A1696296EFEDC2FA79ADE0 /* Pods-ShadowsocksX-NGTests */, + 50DA2BB85DEBA27DDBB9E2D53E8E2A1A /* RxCocoa */, + 9759FFB1455B05FE96A5765890590110 /* RxSwift */, ); }; /* End PBXProject section */ @@ -1030,6 +1802,72 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 904AEEA871CD0088ACE9F674EED25700 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EBEFF85070E25F0A581B7BA1E08138AC /* Pods-ShadowsocksX-NG-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A6A7F41BC3E054BC310066CAAE0C98AE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 143F5EA30D8845DE6EBA2E7E9619D2E9 /* _RX.m in Sources */, + 46E18CE0A69856E82A7BF5DF5C4129D2 /* _RXDelegateProxy.m in Sources */, + EC499031542915CA54C314AE2781C6BA /* _RXKVOObserver.m in Sources */, + 4B4CE0B02143614597D6DF7AA4BA3DBD /* _RXObjCRuntime.m in Sources */, + F6069304E6720CD883040BD4C6348423 /* Bag.swift in Sources */, + 6A7E08A902C0F36A9AC0CFFE7F868C4A /* ControlEvent+Driver.swift in Sources */, + BD9A8D8F883436D80DAA180092826F59 /* ControlEvent.swift in Sources */, + CA3A97285A08BEC4505C953D548660FB /* ControlProperty+Driver.swift in Sources */, + E4EF88D306B62375F97BFE1AF85C8CED /* ControlProperty.swift in Sources */, + 8C1524EFD8466D86020C1F2C6A922D84 /* ControlTarget.swift in Sources */, + BAC1B51CD0A87789B317FBD5BB06552A /* DelegateProxy.swift in Sources */, + 467BF71F9AA158F2EA6212221B8E757D /* DelegateProxyType.swift in Sources */, + 02FCBABDD1B23C59A7B119F1DAE88D7D /* DispatchQueue+Extensions.swift in Sources */, + E650654EFC351E571C296AE3E66B8CBC /* Driver+Subscription.swift in Sources */, + 4EA689C03ECF1236D3D9D63B2BB5F4FC /* Driver.swift in Sources */, + 02759E469AF7E37C6C2B662D2A8DBB99 /* InfiniteSequence.swift in Sources */, + 889D4A9563783DAD50090FB7AA14D591 /* KVORepresentable+CoreGraphics.swift in Sources */, + 2F4DC6EE9D2D04DD2501C702C782FF87 /* KVORepresentable+Swift.swift in Sources */, + 2259DC05FD87D673C2FE695869381DBC /* KVORepresentable.swift in Sources */, + 65AC91F0CD9F560A7904BFAABD92C60B /* Logging.swift in Sources */, + CA3B4A6F5154DA40B8713EF5A2AFDA20 /* NSButton+Rx.swift in Sources */, + F192F14395D111EAE279D849E233CA6B /* NSControl+Rx.swift in Sources */, + 8CC77692B2147DAEBBFB618C179C4175 /* NSImageView+Rx.swift in Sources */, + C22C6ECD95AFB9E35C25D316E25D5F7C /* NSLayoutConstraint+Rx.swift in Sources */, + FC558372E13AAD8016536702B3964C0D /* NSNotificationCenter+Rx.swift in Sources */, + F20BC8E29804469E866991EBEE2C81B9 /* NSObject+Rx+KVORepresentable.swift in Sources */, + 247AA094C4DE12FB3B5B4761C9FDECE8 /* NSObject+Rx+RawRepresentable.swift in Sources */, + E5FCD7D6CC4A3267A6DBCD636BFBCB90 /* NSObject+Rx.swift in Sources */, + 611B03B39A3C1DE850DF21D39CE21095 /* NSSlider+Rx.swift in Sources */, + 3B5E0C8C1AB83BD7BBBCAE6073F09AFC /* NSTextField+Rx.swift in Sources */, + 648C55C1798400EC2622AD90E7BB4A7C /* NSView+Rx.swift in Sources */, + 370087A98B47E0ED6C36574B16D871A5 /* Observable+Bind.swift in Sources */, + 528F931DA3394230226A64A342C7CE2F /* ObservableConvertibleType+Driver.swift in Sources */, + E2B2B2682B2F4AD8A0BF7F9007AFFE2E /* ObservableConvertibleType+SharedSequence.swift in Sources */, + 21EB6E0D77F98AC3A30680A90B8656D4 /* Platform.Darwin.swift in Sources */, + 8D8907394B54F53C73E1D71ABE09BC66 /* Platform.Linux.swift in Sources */, + A97DC783F3BF2BB7191E451487A7830D /* PriorityQueue.swift in Sources */, + EDC71599268E09BB4590CCB4E9921855 /* Queue.swift in Sources */, + 1E1D791396A3F447B3ADE321ECC7E39E /* RxCocoa-dummy.m in Sources */, + F1FC058E962CB5A786654E301515F175 /* RxCocoa.swift in Sources */, + 1ACC904BF6C39CB0520384B81B1A59A3 /* RxCocoaObjCRuntimeError+Extensions.swift in Sources */, + DA4140910A4A22776536B76470DF9A1B /* RxTarget.swift in Sources */, + BF9CC03D9F304A3B5882DA4C27AB4B49 /* SectionedViewDataSourceType.swift in Sources */, + 77C70A22F2B4145CF5341817585C134B /* SharedSequence+Operators+arity.swift in Sources */, + 50AE3AC1A51BD92B7D417D6783719D10 /* SharedSequence+Operators.swift in Sources */, + 7F2467C9E8CB2CBC330D331CB6C8BB98 /* SharedSequence.swift in Sources */, + 282D05FE9B69BDF19B9573DAD9F3EE9A /* TextInput.swift in Sources */, + D427A2DEF72EE38F35E0180E6CEA7836 /* UIBindingObserver.swift in Sources */, + AFD698CCB4B270EA10CA5674A7C5FEE7 /* URLSession+Rx.swift in Sources */, + 38DB62A5AD3079471CDF2E9D0D3028FA /* Variable+Driver.swift in Sources */, + 0B39234B888575182CA99B07AFC81BA5 /* Variable+SharedSequence.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; AFD9223E8E59CD878E1C56F1407DA2C8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1046,6 +1884,158 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BA3900128DCA208B2F7C8EB0B042D0B3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 165F7D403C750ABB5648860CBA92049E /* AddRef.swift in Sources */, + 5CD1BCE580E7AD73C116C419387F753E /* Amb.swift in Sources */, + 756E3D696CCD8F588DF9292AFF378C4E /* AnonymousDisposable.swift in Sources */, + 202855689CF5074E834DC4C377C1C21F /* AnonymousInvocable.swift in Sources */, + 320FD242550FBA6C940056D6191EF150 /* AnonymousObservable.swift in Sources */, + 41A0D57F7581AE6A50FE1B0EFE59019C /* AnonymousObserver.swift in Sources */, + 5D43FA1C64865954BCD55736B89C62C4 /* AnyObserver.swift in Sources */, + 4FCC38C464EC116DA2EDA928A5AFC90A /* AsyncLock.swift in Sources */, + EF0DEE821A473B32E266EA6F4AE03A8B /* Bag+Rx.swift in Sources */, + E33E79B8BBB9FDCA0B0CAA15B335CF18 /* Bag.swift in Sources */, + 876D3351B96DD42235328028C5EA685A /* BehaviorSubject.swift in Sources */, + 7C2510201C3D043BAF6D7D3E3D68CB3A /* BinaryDisposable.swift in Sources */, + B6B0BFAA4B2EDC9B19FFFFF98535A30B /* BooleanDisposable.swift in Sources */, + F13411F6487E4AE13417D98635C36FB1 /* Buffer.swift in Sources */, + 432E16210E58159994078E2AC4CC5E2A /* Cancelable.swift in Sources */, + 21924D3337F7B20AE94DE0A020D38183 /* Catch.swift in Sources */, + F7319C5D6B81343F0D43A8CD903AD9D1 /* CombineLatest+arity.swift in Sources */, + 287F5692A9ECEE55B0A9E4A033992626 /* CombineLatest+Collection.swift in Sources */, + 08DB29E8F7F7FF81D87DCFB7869ECC45 /* CombineLatest.swift in Sources */, + C54AAB75EA7AEA2EC09044E5673A0C34 /* CompositeDisposable.swift in Sources */, + DDA9DBF8AD0279173E5FCB78BAA1FBF1 /* Concat.swift in Sources */, + E8BA7E89E83AD1FF70C0B8D690CE7EEF /* ConcurrentDispatchQueueScheduler.swift in Sources */, + 1CA6B3BA315902F58D2A539D524D6C3C /* ConcurrentMainScheduler.swift in Sources */, + CB921D3307D0CEE4CD1472946BFC184E /* ConnectableObservable.swift in Sources */, + D96B27ACC1B194C3E1B658E67687C195 /* ConnectableObservableType.swift in Sources */, + D6E485F4B677A8530CE25D81F2F21BE4 /* CurrentThreadScheduler.swift in Sources */, + B537A51B17BDBA5000C8AFBF5F5D644C /* Debug.swift in Sources */, + B424B5ADC87DCB8566E2DF93378702C4 /* Debunce.swift in Sources */, + EF34AC8DFCCDA7E37B2BAFB23B8CC208 /* Deferred.swift in Sources */, + FD09105291CBA39191AF89BACC9F1538 /* Delay.swift in Sources */, + 0F56DF85092077222EFE85B49CED711F /* DelaySubscription.swift in Sources */, + 72DE99612A83DF8C807353F1A9ACAB4E /* DispatchQueue+Extensions.swift in Sources */, + B2B321D56AF649DAC3D75F6A020ADD55 /* DispatchQueueConfiguration.swift in Sources */, + ACD3D417D834EBD534A3E18B3C01B597 /* Disposable.swift in Sources */, + 3631BBE242189BD75BEF9E010BC27E21 /* Disposables.swift in Sources */, + D4B59D90C107A21A4E79D5F1E438791A /* DisposeBag.swift in Sources */, + 1B9C61B405FA747D9223222AA652AF6D /* DisposeBase.swift in Sources */, + 95DFDB38DB26CBCCFF296D8ED3E77940 /* DistinctUntilChanged.swift in Sources */, + FC2A6E0CEAD8E453D54189928819140D /* Do.swift in Sources */, + C9D831152A4A9CC9A0AD132C27727ADD /* ElementAt.swift in Sources */, + 5F6DF5ECECD40261F4E10979C038EEB1 /* Empty.swift in Sources */, + 8DC023486CE85BB68B5545EF5409FB71 /* Error.swift in Sources */, + B99557A2D1CECD83B2AC7D8EE83E2162 /* Errors.swift in Sources */, + 7269959C7F25D3669B4CCC0BEFC43EFB /* Event.swift in Sources */, + D5E905369D09381D329C16B04EB087DB /* Filter.swift in Sources */, + 9FA3673BE87BC7DFE277B6A540465F3B /* Generate.swift in Sources */, + F4DE46050B00D9C5E0D8AFB79C9BBF96 /* HistoricalScheduler.swift in Sources */, + 1E9B353B6011A05BC8A967B4F679AC99 /* HistoricalSchedulerTimeConverter.swift in Sources */, + B6113F6876CC1EC5942329D951F51F99 /* ImmediateScheduler.swift in Sources */, + 00B490DFDC8E910BDF676C7E9EC0F7F8 /* ImmediateSchedulerType.swift in Sources */, + 330A0CDDD45D8019380AE257A5946541 /* InfiniteSequence.swift in Sources */, + 181168219B048D50E6CA6E785240FFAD /* InvocableScheduledItem.swift in Sources */, + 5E0E60641191E835765F082F3986230F /* InvocableType.swift in Sources */, + 84A972377538A384D469D5B3799DFC3F /* Just.swift in Sources */, + 2B2DD472D5ADDCFEB20E2715B76C497F /* Lock.swift in Sources */, + 49F778DEAC864BEE58A4B6E734B9BADC /* LockOwnerType.swift in Sources */, + AAE9C0157B2A7C8FA1437AE63D7A7281 /* MainScheduler.swift in Sources */, + 33432041A2F2B22595A953DADFB962AA /* Map.swift in Sources */, + 5E7DA63F3D502ECE812E041AC672D187 /* Merge.swift in Sources */, + 6A93DF12A8D132337D0B6944A54C7B03 /* Multicast.swift in Sources */, + 6B023721711ECBB4969FF35AF43D542F /* Never.swift in Sources */, + C83FB3FA4A1BEC6F9C237CDDDECA76A5 /* NopDisposable.swift in Sources */, + 525A56AD52E77A0678127239A93BA759 /* Observable+Aggregate.swift in Sources */, + F88CA5676D6FEE75F80D102E13BFB568 /* Observable+Binding.swift in Sources */, + 2F51EBD27184D6642521531C30C2A078 /* Observable+Concurrency.swift in Sources */, + F75888E0217E015253A9C120DF4E31D3 /* Observable+Creation.swift in Sources */, + CA4D925D276335F92C0476A4BB100312 /* Observable+Debug.swift in Sources */, + 64995C953E64C6F7105B3728672E316F /* Observable+Multiple.swift in Sources */, + 5DA42242F35744E48EC08C6DEE5725B3 /* Observable+Single.swift in Sources */, + 203C8C15986DB48FBFB72F65D4837A0F /* Observable+StandardSequenceOperators.swift in Sources */, + 62BCF246203C0F0872F6ABB6A1620D32 /* Observable+Time.swift in Sources */, + 965B1E00C33296E80367B418D31E72CE /* Observable.swift in Sources */, + ACE988968174554A0ED558154694E95E /* ObservableConvertibleType.swift in Sources */, + A980984343A8FBB1666C9DC5A50760B4 /* ObservableType+Extensions.swift in Sources */, + 3CB44363DC3691947BA8E9882053BC4A /* ObservableType.swift in Sources */, + B7CD8326E8B8F502F56AF37EE47E1F2E /* ObserveOn.swift in Sources */, + 8605C5332B728C31426A255BCF14FBA9 /* ObserveOnSerialDispatchQueue.swift in Sources */, + D1E502592E9BE6AC042E2BCF0CA546E4 /* ObserverBase.swift in Sources */, + C92206868B5A8ABFC32E91D7A830C8FF /* ObserverType.swift in Sources */, + 94273CE6C30D0DB5BBF8579D0A97CA9F /* OperationQueueScheduler.swift in Sources */, + 6353703943D7D2312070AFD17CCB65AD /* Optional.swift in Sources */, + 6152ECE63A673F74B40C9BA5A851B4ED /* Platform.Darwin.swift in Sources */, + 107E34C884D6DAEDA56024FF80F83CF6 /* Platform.Linux.swift in Sources */, + A95A82AE1BBE7BF8A32F427F5263EDC0 /* PriorityQueue.swift in Sources */, + ADE52CEC3C99C491579C84EAD1E9A3AC /* Producer.swift in Sources */, + 2CF894F29E1A7E1C5F7F9501934E0059 /* PublishSubject.swift in Sources */, + A4DB0F25CD590C73E2EA2586822D54FD /* Queue.swift in Sources */, + ADD593AFC898ADE7B8FC61DF7BAA4964 /* Range.swift in Sources */, + DFD85B645794CFCD77427C115F61B528 /* Reactive.swift in Sources */, + CA65999C4112C3EC6D71C5C8E70EA9D5 /* RecursiveScheduler.swift in Sources */, + 95AC8562635870772E618499EF083802 /* Reduce.swift in Sources */, + F2FFE741AC2834ABDA25E19C4B553B6E /* RefCount.swift in Sources */, + 0ED25A1662826BF961671ECD0C67522D /* RefCountDisposable.swift in Sources */, + 6D6E7ADEA922698A850B81747EDE156A /* Repeat.swift in Sources */, + B32863B4B34268AE9E40AEFE5A0C648A /* ReplaySubject.swift in Sources */, + 3161617D6E3095F41E350F916D918355 /* RetryWhen.swift in Sources */, + 2990102CBE66DC047A22C1CBF937DB6E /* Rx.swift in Sources */, + 43F8377C7AD6791017DCD42341075D28 /* RxMutableBox.swift in Sources */, + 8DB189E11E752F521E1387EB147BC5CB /* RxSwift-dummy.m in Sources */, + 595666EBE1975A65C6968591FED3477E /* Sample.swift in Sources */, + 1A12CE731D866F4B25F4C05CB262773A /* Scan.swift in Sources */, + 68924F5463C83413FAB0AF1EF9A13CBC /* ScheduledDisposable.swift in Sources */, + 077F6DB761D1176638A57167293DA6BA /* ScheduledItem.swift in Sources */, + 7C71E95D2740D598A7B8B42EF962B00F /* ScheduledItemType.swift in Sources */, + 95B3765B29823D808D7E7CDC32980CC8 /* SchedulerServices+Emulation.swift in Sources */, + 450010E10778B36C2FEEC4B9FBB70AC5 /* SchedulerType.swift in Sources */, + 1E97944F114E25922076ED80748DF4BC /* Sequence.swift in Sources */, + 424673BDBA8D006E6179215F52C5E941 /* SerialDispatchQueueScheduler.swift in Sources */, + 09713E4AD4F8DB9EBD22A77AA12509B7 /* SerialDisposable.swift in Sources */, + 4F4FD0070DB81A8EB981334462E930F1 /* ShareReplay1.swift in Sources */, + E0A7C2B4EF093E65496C31BE8AE154EF /* ShareReplay1WhileConnected.swift in Sources */, + 1F149FBBBB20187B527A87592E7D1D65 /* SingleAssignmentDisposable.swift in Sources */, + 23741DAA4F354BEEAD1B4EE11EECBF82 /* SingleAsync.swift in Sources */, + A7B470FCCAD399F59B3627257F78D6D6 /* Sink.swift in Sources */, + 291963FA0138FBBFE13F98B6F3980E28 /* Skip.swift in Sources */, + DCEB8485F9DF589F1052AC9BAF1BF386 /* SkipUntil.swift in Sources */, + 8D465F56E6992ECD6D7985B7D7D519C3 /* SkipWhile.swift in Sources */, + F4AF312CC6AFB71721D0F16DDED1028C /* StartWith.swift in Sources */, + 1094573AE70DF26E438020148CAA752E /* String+Rx.swift in Sources */, + 1243B6888974A6BE9D7D77B1D5402D73 /* SubjectType.swift in Sources */, + C6B37A8FF222504586343B2DFA9AEF7A /* SubscribeOn.swift in Sources */, + EBEBC8730F86241C0D7D2BD8BB4A4F5F /* SubscriptionDisposable.swift in Sources */, + A9E59702B924D5C4228A7E7C0D256DDC /* Switch.swift in Sources */, + 7DDE276EE3BD477C709DBCD1C38B03E0 /* SynchronizedDisposeType.swift in Sources */, + 47351D20CCCBF94578D448CC836C33FD /* SynchronizedOnType.swift in Sources */, + ED084F37DBC7F8C6BF80DB85883C67D4 /* SynchronizedSubscribeType.swift in Sources */, + 419D4559CBA3D1470729743B06641C8C /* SynchronizedUnsubscribeType.swift in Sources */, + B58863122018B82BEDE5700BFA85D96D /* TailRecursiveSink.swift in Sources */, + 73F0143CB5E58D6201A6FBA2252858F4 /* Take.swift in Sources */, + 59B0C5CEEBC23AF2B21649600F99188D /* TakeLast.swift in Sources */, + 3E6DF7443FD313551869E084C684729A /* TakeUntil.swift in Sources */, + B7D1CCC7182ED2604819332A6B26BC1C /* TakeWhile.swift in Sources */, + 80B90DB44C8F9D684F4E301E9C0AC090 /* Throttle.swift in Sources */, + 84EB655E0AD1E3646633D47C0D047EBC /* Timeout.swift in Sources */, + 420C2F4BDB11DD8CF3D550D0857ECD6B /* Timer.swift in Sources */, + 880C6F044DF17CD72542B4A20C22F70B /* ToArray.swift in Sources */, + B738E54C921B7EB262AAFE452EF5E5B9 /* Using.swift in Sources */, + D3117D8EA464B11367A3111EC49F544A /* Variable.swift in Sources */, + 636D056E73695F4C9DB7721E8064A02E /* VirtualTimeConverterType.swift in Sources */, + BFEA88B702838FD3731D4A289FDC060E /* VirtualTimeScheduler.swift in Sources */, + 18AD86C96492EFC58855F4DD89D50EE8 /* Window.swift in Sources */, + D0E12AD3CCD78DC53A391809FC085C69 /* WithLatestFrom.swift in Sources */, + 032DDE7C99BFEF759E6AD96D49AC2222 /* Zip+arity.swift in Sources */, + 699AFBBF79B3202D7B230A0A22DABB18 /* Zip+Collection.swift in Sources */, + 87E9A539E61AE876EACCBEDB8233D9C4 /* Zip.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; C85081056E3DF73EFBB147D8F01CDE65 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1053,28 +2043,26 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DB9AB46C1A759CB0B12EFF0927D8735C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 396153660EE28DAAF20B789B5EB65104 /* Pods-ShadowsocksX-NG-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 19B0119E12F2C523EAD90C0093B3CE34 /* PBXTargetDependency */ = { + 333E7BAB0E0DB09E26646BD8E93FFDCE /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Alamofire; target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = CC7BBA37399118CF89A7E1A674EF83EE /* PBXContainerItemProxy */; + targetProxy = 3F9C089DC9458E35616C2D072F1349CE /* PBXContainerItemProxy */; }; - 28917DA5B45CD6AC906D6AA28EC2F7C9 /* PBXTargetDependency */ = { + 3AB65F40E1512A92325180D6E33602FE /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = MASShortcut; - target = 00C94ED0B49A44FBF0C4E2F6C875CFFC /* MASShortcut */; - targetProxy = 8C9C31725D43E9B51254EF5E8D6D91FB /* PBXContainerItemProxy */; + name = RxSwift; + target = 9759FFB1455B05FE96A5765890590110 /* RxSwift */; + targetProxy = 3C966E4001966C610E2B35B4896D0EA0 /* PBXContainerItemProxy */; + }; + 3E1EF8FCF446C8D86D778D5D1ABFA9CD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GCDWebServer; + target = 5B8B0ED1046111D92895FC95F12DBC10 /* GCDWebServer */; + targetProxy = 73B1C6F65534B8F327FD1E3C4EFB4D79 /* PBXContainerItemProxy */; }; 6D8935AB78317EC6C1ABBB09EA86C5FB /* PBXTargetDependency */ = { isa = PBXTargetDependency; @@ -1088,18 +2076,30 @@ target = 3CB2B8006B2B1ACAF9ADCA1DC82E2290 /* BRLOptionParser */; targetProxy = FDE579D9762D0D9F86EDB1DE6EADE62F /* PBXContainerItemProxy */; }; - B0EEE3BF50F58EF6333DF85A94484C40 /* PBXTargetDependency */ = { + 895CE87A9D309D30CEFBF51BA07CDBEA /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = GCDWebServer; - target = 5B8B0ED1046111D92895FC95F12DBC10 /* GCDWebServer */; - targetProxy = 0C759341A52320E6F69A83D0A2CA9706 /* PBXContainerItemProxy */; + name = MASShortcut; + target = 00C94ED0B49A44FBF0C4E2F6C875CFFC /* MASShortcut */; + targetProxy = 7BF76F7FBFF9CC917BC74620BE20739E /* PBXContainerItemProxy */; + }; + C65B838B24FDE9D70E5E870D8780B5EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RxCocoa; + target = 50DA2BB85DEBA27DDBB9E2D53E8E2A1A /* RxCocoa */; + targetProxy = 5A421F3FED66CE2F7D5D41431FD05426 /* PBXContainerItemProxy */; + }; + D9D65FB37163F6C00197A5C036F871E6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RxSwift; + target = 9759FFB1455B05FE96A5765890590110 /* RxSwift */; + targetProxy = 9AAE001A73362881B10E1F0C00EDCC5C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 02E195CBAB30A9CBC71B668C0E2C5F60 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1854166C986170C7CC1EC2E0441FBB08 /* Alamofire.xcconfig */; + baseConfigurationReference = E7AC2CB247486E6770E163434DEC2B56 /* Alamofire.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1194,9 +2194,44 @@ }; name = Release; }; + 3E78636AE74B59428E5A0935753CC17C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 96452244B9CFEFBA70877833E181A983 /* RxSwift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = RxSwift; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; 454A1980F630934367D478DF55211291 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 084AC6693EA56EA74BB4D3AC5F654C90 /* BRLOptionParser.xcconfig */; + baseConfigurationReference = 5C8B549DF38B641E23F436DE84A1AB1F /* BRLOptionParser.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1220,7 +2255,7 @@ }; 4F50769607A8A1A40CFF74C962A6EC0C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */; + baseConfigurationReference = 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1254,7 +2289,7 @@ }; 581B7E690A5A7F5E7DF616728F5651C1 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1854166C986170C7CC1EC2E0441FBB08 /* Alamofire.xcconfig */; + baseConfigurationReference = E7AC2CB247486E6770E163434DEC2B56 /* Alamofire.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1286,6 +2321,40 @@ }; name = Release; }; + 5BBF011CC3651D848A68DA27DF8ECC7D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D95E797893870454BDD396AD03752C2A /* RxCocoa.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/RxCocoa/RxCocoa-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxCocoa/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MODULEMAP_FILE = "Target Support Files/RxCocoa/RxCocoa.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = RxCocoa; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 5D622BA00757EC20ADAD24C580904C04 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1326,9 +2395,116 @@ }; name = Release; }; + 5E76D5F0E34012DBB44CB075BFB0007D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 98522BF2EB25C0255284080F9CA3E195 /* Pods-ShadowsocksX-NG.debug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-ShadowsocksX-NG/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MODULEMAP_FILE = "Target Support Files/Pods-ShadowsocksX-NG/Pods-ShadowsocksX-NG.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_ShadowsocksX_NG; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 69C0AC77C660068E1F05164BAC26E89F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D95E797893870454BDD396AD03752C2A /* RxCocoa.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/RxCocoa/RxCocoa-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxCocoa/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MODULEMAP_FILE = "Target Support Files/RxCocoa/RxCocoa.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = RxCocoa; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 6F5040456E9D7C1CBF0FC8D4AE544E8E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 96452244B9CFEFBA70877833E181A983 /* RxSwift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = RxSwift; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 7F85541659A067CF326B2DF15039555D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */; + baseConfigurationReference = 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; @@ -1347,7 +2523,7 @@ }; 81B74614E7B351BBFADF2489179A00EE /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 084AC6693EA56EA74BB4D3AC5F654C90 /* BRLOptionParser.xcconfig */; + baseConfigurationReference = 5C8B549DF38B641E23F436DE84A1AB1F /* BRLOptionParser.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1371,7 +2547,7 @@ }; 85EFB31300ECD852FAD5DE392B6CDD3A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0A7F223B1591E9E8650F297A91EA618B /* GCDWebServer.xcconfig */; + baseConfigurationReference = EFE14E99FE3CC24013D01106E3710A5A /* GCDWebServer.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1430,7 +2606,7 @@ }; 9F61FD28CA790C68C44F0E823C9A301A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */; + baseConfigurationReference = 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */; buildSettings = { CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; @@ -1543,98 +2719,7 @@ }; name = Debug; }; - D31CF0210DF137AB6AD05BE9C89BAB0A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 98522BF2EB25C0255284080F9CA3E195 /* Pods-ShadowsocksX-NG.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_VERSION = A; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-ShadowsocksX-NG/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MODULEMAP_FILE = "Target Support Files/Pods-ShadowsocksX-NG/Pods-ShadowsocksX-NG.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_ShadowsocksX_NG; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - EEC1F7D47739588099958DDE9B22FEEB /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0A7F223B1591E9E8650F297A91EA618B /* GCDWebServer.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - FRAMEWORK_VERSION = A; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/GCDWebServer/GCDWebServer-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/GCDWebServer/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.7; - MODULEMAP_FILE = "Target Support Files/GCDWebServer/GCDWebServer.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = GCDWebServer; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - F1B067679E8618A86DA283BCD4698C6D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 377C2ACAFEEAD6082C6CD6A735FB07A4 /* MASShortcut.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - COMBINE_HIDPI_IMAGES = YES; - CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/MASShortcut"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/MASShortcut/ResourceBundle-MASShortcut-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - MACOSX_DEPLOYMENT_TARGET = 10.6; - PRODUCT_NAME = MASShortcut; - SDKROOT = macosx; - SKIP_INSTALL = YES; - WRAPPER_EXTENSION = bundle; - }; - name = Debug; - }; - FE86A92C0D32E1AF8110698F1794A319 /* Release */ = { + D7792E19C106FDF752BCD3F1B45DC02D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 089EB7E66F64D3A19BB7681AFCE91031 /* Pods-ShadowsocksX-NG.release.xcconfig */; buildSettings = { @@ -1671,6 +2756,59 @@ }; name = Release; }; + EEC1F7D47739588099958DDE9B22FEEB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EFE14E99FE3CC24013D01106E3710A5A /* GCDWebServer.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/GCDWebServer/GCDWebServer-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/GCDWebServer/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.7; + MODULEMAP_FILE = "Target Support Files/GCDWebServer/GCDWebServer.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = GCDWebServer; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + F1B067679E8618A86DA283BCD4698C6D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 527905F83B340CE24BD35C08B5A42EE5 /* MASShortcut.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/MASShortcut"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/MASShortcut/ResourceBundle-MASShortcut-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + PRODUCT_NAME = MASShortcut; + SDKROOT = macosx; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1692,15 +2830,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2C4B50829655C633ABF135903133D7BA /* Build configuration list for PBXNativeTarget "Pods-ShadowsocksX-NG" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D31CF0210DF137AB6AD05BE9C89BAB0A /* Debug */, - FE86A92C0D32E1AF8110698F1794A319 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1755,6 +2884,33 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C3C04E339BA1928DBC29CEFD07DC6ADF /* Build configuration list for PBXNativeTarget "RxSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3E78636AE74B59428E5A0935753CC17C /* Debug */, + 6F5040456E9D7C1CBF0FC8D4AE544E8E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D913F5C08F647E9FCC34C3A5B3030BD5 /* Build configuration list for PBXNativeTarget "RxCocoa" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 69C0AC77C660068E1F05164BAC26E89F /* Debug */, + 5BBF011CC3651D848A68DA27DF8ECC7D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E185892330EBDCF4E8B37928210771A9 /* Build configuration list for PBXNativeTarget "Pods-ShadowsocksX-NG" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5E76D5F0E34012DBB44CB075BFB0007D /* Debug */, + D7792E19C106FDF752BCD3F1B45DC02D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; diff --git a/Pods/RxCocoa/LICENSE.md b/Pods/RxCocoa/LICENSE.md new file mode 100644 index 0000000..d6765d9 --- /dev/null +++ b/Pods/RxCocoa/LICENSE.md @@ -0,0 +1,9 @@ +**The MIT License** +**Copyright © 2015 Krunoslav Zaher** +**All rights reserved.** + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/Pods/RxCocoa/Platform/DataStructures/Bag.swift b/Pods/RxCocoa/Platform/DataStructures/Bag.swift new file mode 100644 index 0000000..4ab6f94 --- /dev/null +++ b/Pods/RxCocoa/Platform/DataStructures/Bag.swift @@ -0,0 +1,167 @@ +// +// Bag.swift +// Platform +// +// Created by Krunoslav Zaher on 2/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Swift + +let arrayDictionaryMaxSize = 30 + +struct BagKey { + /** + Unique identifier for object added to `Bag`. + + It's underlying type is UInt64. If we assume there in an idealized CPU that works at 4GHz, + it would take ~150 years of continuous running time for it to overflow. + */ + fileprivate let rawValue: UInt64 +} + +/** +Data structure that represents a bag of elements typed `T`. + +Single element can be stored multiple times. + +Time and space complexity of insertion an deletion is O(n). + +It is suitable for storing small number of elements. +*/ +struct Bag : CustomDebugStringConvertible { + /// Type of identifier for inserted elements. + typealias KeyType = BagKey + + typealias Entry = (key: BagKey, value: T) + + fileprivate var _nextKey: BagKey = BagKey(rawValue: 0) + + // data + + // first fill inline variables + var _key0: BagKey? = nil + var _value0: T? = nil + + // last is sparse dictionary + var _dictionary: [BagKey : T]? = nil + + var _onlyFastPath = true + + /// Creates new empty `Bag`. + init() { + } + + /** + Inserts `value` into bag. + + - parameter element: Element to insert. + - returns: Key that can be used to remove element from bag. + */ + mutating func insert(_ element: T) -> BagKey { + let key = _nextKey + + _nextKey = BagKey(rawValue: _nextKey.rawValue &+ 1) + + if _key0 == nil { + _key0 = key + _value0 = element + return key + } + + _onlyFastPath = false + + if _dictionary != nil { + _dictionary![key] = element + return key + } + + if _dictionary == nil { + _dictionary = [:] + } + + _dictionary![key] = element + + return key + } + + /// - returns: Number of elements in bag. + var count: Int { + let dictionaryCount: Int = _dictionary?.count ?? 0 + return (_value0 != nil ? 1 : 0) + dictionaryCount + } + + /// Removes all elements from bag and clears capacity. + mutating func removeAll() { + _key0 = nil + _value0 = nil + + _dictionary?.removeAll(keepingCapacity: false) + } + + /** + Removes element with a specific `key` from bag. + + - parameter key: Key that identifies element to remove from bag. + - returns: Element that bag contained, or nil in case element was already removed. + */ + mutating func removeKey(_ key: BagKey) -> T? { + if _key0 == key { + _key0 = nil + let value = _value0! + _value0 = nil + return value + } + + if let existingObject = _dictionary?.removeValue(forKey: key) { + return existingObject + } + + return nil + } +} + +extension Bag { + /// A textual representation of `self`, suitable for debugging. + var debugDescription : String { + return "\(self.count) elements in Bag" + } +} + +extension Bag { + /// Enumerates elements inside the bag. + /// + /// - parameter action: Enumeration closure. + func forEach(_ action: (T) -> Void) { + if _onlyFastPath { + if let value0 = _value0 { + action(value0) + } + return + } + + let value0 = _value0 + let dictionary = _dictionary + + if let value0 = value0 { + action(value0) + } + + if dictionary?.count ?? 0 > 0 { + for element in dictionary!.values { + action(element) + } + } + } +} + +extension BagKey: Hashable { + var hashValue: Int { + return rawValue.hashValue + } +} + +func ==(lhs: BagKey, rhs: BagKey) -> Bool { + return lhs.rawValue == rhs.rawValue +} diff --git a/Pods/RxCocoa/Platform/DataStructures/InfiniteSequence.swift b/Pods/RxCocoa/Platform/DataStructures/InfiniteSequence.swift new file mode 100644 index 0000000..5fad383 --- /dev/null +++ b/Pods/RxCocoa/Platform/DataStructures/InfiniteSequence.swift @@ -0,0 +1,28 @@ +// +// InfiniteSequence.swift +// Platform +// +// Created by Krunoslav Zaher on 6/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Sequence that repeats `repeatedValue` infinite number of times. +struct InfiniteSequence : Sequence { + typealias Element = E + typealias Iterator = AnyIterator + + private let _repeatedValue: E + + init(repeatedValue: E) { + _repeatedValue = repeatedValue + } + + func makeIterator() -> Iterator { + let repeatedValue = _repeatedValue + return AnyIterator { + return repeatedValue + } + } +} diff --git a/Pods/RxCocoa/Platform/DataStructures/PriorityQueue.swift b/Pods/RxCocoa/Platform/DataStructures/PriorityQueue.swift new file mode 100644 index 0000000..725feef --- /dev/null +++ b/Pods/RxCocoa/Platform/DataStructures/PriorityQueue.swift @@ -0,0 +1,114 @@ +// +// PriorityQueue.swift +// Platform +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct PriorityQueue { + private let _hasHigherPriority: (Element, Element) -> Bool + private let _isEqual: (Element, Element) -> Bool + + fileprivate var _elements = [Element]() + + init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) { + _hasHigherPriority = hasHigherPriority + _isEqual = isEqual + } + + mutating func enqueue(_ element: Element) { + _elements.append(element) + bubbleToHigherPriority(_elements.count - 1) + } + + func peek() -> Element? { + return _elements.first + } + + var isEmpty: Bool { + return _elements.count == 0 + } + + mutating func dequeue() -> Element? { + guard let front = peek() else { + return nil + } + + removeAt(0) + + return front + } + + mutating func remove(_ element: Element) { + for i in 0 ..< _elements.count { + if _isEqual(_elements[i], element) { + removeAt(i) + return + } + } + } + + private mutating func removeAt(_ index: Int) { + let removingLast = index == _elements.count - 1 + if !removingLast { + swap(&_elements[index], &_elements[_elements.count - 1]) + } + + _ = _elements.popLast() + + if !removingLast { + bubbleToHigherPriority(index) + bubbleToLowerPriority(index) + } + } + + private mutating func bubbleToHigherPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + + while unbalancedIndex > 0 { + let parentIndex = (unbalancedIndex - 1) / 2 + guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break } + + swap(&_elements[unbalancedIndex], &_elements[parentIndex]) + unbalancedIndex = parentIndex + } + } + + private mutating func bubbleToLowerPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + while true { + let leftChildIndex = unbalancedIndex * 2 + 1 + let rightChildIndex = unbalancedIndex * 2 + 2 + + var highestPriorityIndex = unbalancedIndex + + if leftChildIndex < _elements.count && _hasHigherPriority(_elements[leftChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = leftChildIndex + } + + if rightChildIndex < _elements.count && _hasHigherPriority(_elements[rightChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = rightChildIndex + } + + guard highestPriorityIndex != unbalancedIndex else { break } + + swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex]) + unbalancedIndex = highestPriorityIndex + } + } +} + +extension PriorityQueue : CustomDebugStringConvertible { + var debugDescription: String { + return _elements.debugDescription + } +} diff --git a/Pods/RxCocoa/Platform/DataStructures/Queue.swift b/Pods/RxCocoa/Platform/DataStructures/Queue.swift new file mode 100644 index 0000000..cfe3df4 --- /dev/null +++ b/Pods/RxCocoa/Platform/DataStructures/Queue.swift @@ -0,0 +1,154 @@ +// +// Queue.swift +// Platform +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** +Data structure that represents queue. + +Complexity of `enqueue`, `dequeue` is O(1) when number of operations is +averaged over N operations. + +Complexity of `peek` is O(1). +*/ +struct Queue: Sequence { + /// Type of generator. + typealias Generator = AnyIterator + + private let _resizeFactor = 2 + + private var _storage: ContiguousArray + private var _count = 0 + private var _pushNextIndex = 0 + private let _initialCapacity: Int + + /** + Creates new queue. + + - parameter capacity: Capacity of newly created queue. + */ + init(capacity: Int) { + _initialCapacity = capacity + + _storage = ContiguousArray(repeating: nil, count: capacity) + } + + private var dequeueIndex: Int { + let index = _pushNextIndex - count + return index < 0 ? index + _storage.count : index + } + + /// - returns: Is queue empty. + var isEmpty: Bool { + return count == 0 + } + + /// - returns: Number of elements inside queue. + var count: Int { + return _count + } + + /// - returns: Element in front of a list of elements to `dequeue`. + func peek() -> T { + precondition(count > 0) + + return _storage[dequeueIndex]! + } + + mutating private func resizeTo(_ size: Int) { + var newStorage = ContiguousArray(repeating: nil, count: size) + + let count = _count + + let dequeueIndex = self.dequeueIndex + let spaceToEndOfQueue = _storage.count - dequeueIndex + + // first batch is from dequeue index to end of array + let countElementsInFirstBatch = Swift.min(count, spaceToEndOfQueue) + // second batch is wrapped from start of array to end of queue + let numberOfElementsInSecondBatch = count - countElementsInFirstBatch + + newStorage[0 ..< countElementsInFirstBatch] = _storage[dequeueIndex ..< (dequeueIndex + countElementsInFirstBatch)] + newStorage[countElementsInFirstBatch ..< (countElementsInFirstBatch + numberOfElementsInSecondBatch)] = _storage[0 ..< numberOfElementsInSecondBatch] + + _count = count + _pushNextIndex = count + _storage = newStorage + } + + /// Enqueues `element`. + /// + /// - parameter element: Element to enqueue. + mutating func enqueue(_ element: T) { + if count == _storage.count { + resizeTo(Swift.max(_storage.count, 1) * _resizeFactor) + } + + _storage[_pushNextIndex] = element + _pushNextIndex += 1 + _count += 1 + + if _pushNextIndex >= _storage.count { + _pushNextIndex -= _storage.count + } + } + + private mutating func dequeueElementOnly() -> T { + precondition(count > 0) + + let index = dequeueIndex + + defer { + _storage[index] = nil + _count -= 1 + } + + return _storage[index]! + } + + /// Dequeues element or throws an exception in case queue is empty. + /// + /// - returns: Dequeued element. + mutating func dequeue() -> T? { + if self.count == 0 { + return nil + } + + defer { + let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor) + if _count < downsizeLimit && downsizeLimit >= _initialCapacity { + resizeTo(_storage.count / _resizeFactor) + } + } + + return dequeueElementOnly() + } + + /// - returns: Generator of contained elements. + func makeIterator() -> AnyIterator { + var i = dequeueIndex + var count = _count + + return AnyIterator { + if count == 0 { + return nil + } + + defer { + count -= 1 + i += 1 + } + + if i >= self._storage.count { + i -= self._storage.count + } + + return self._storage[i] + } + } +} diff --git a/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift b/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift new file mode 100644 index 0000000..0df1ce7 --- /dev/null +++ b/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift @@ -0,0 +1,22 @@ +// +// DispatchQueue+Extensions.swift +// Platform +// +// Created by Krunoslav Zaher on 10/22/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +extension DispatchQueue { + private static var token: DispatchSpecificKey<()> = { + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + return key + }() + + static var isMain: Bool { + return DispatchQueue.getSpecific(key: token) != nil + } +} diff --git a/Pods/RxCocoa/Platform/Platform.Darwin.swift b/Pods/RxCocoa/Platform/Platform.Darwin.swift new file mode 100644 index 0000000..e0d7f0d --- /dev/null +++ b/Pods/RxCocoa/Platform/Platform.Darwin.swift @@ -0,0 +1,49 @@ +// +// Platform.Darwin.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) + + import Darwin + import Foundation + + typealias AtomicInt = Int32 + + let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier + let AtomicIncrement = OSAtomicIncrement32Barrier + let AtomicDecrement = OSAtomicDecrement32Barrier + + extension Thread { + + static func setThreadLocalStorageValue(_ value: T?, forKey key: String + ) { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + + } + static func getThreadLocalStorageValueForKey(_ key: String) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + + extension AtomicInt { + func valueSnapshot() -> Int32 { + return self + } + } + +#endif diff --git a/Pods/RxCocoa/Platform/Platform.Linux.swift b/Pods/RxCocoa/Platform/Platform.Linux.swift new file mode 100644 index 0000000..ae5a49d --- /dev/null +++ b/Pods/RxCocoa/Platform/Platform.Linux.swift @@ -0,0 +1,97 @@ +// +// Platform.Linux.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(Linux) + //////////////////////////////////////////////////////////////////////////////// + // This is not the greatest API in the world, this is just a tribute. + // !!! Proof of concept until libdispatch becomes operational. !!! + //////////////////////////////////////////////////////////////////////////////// + + import Foundation + import XCTest + import Glibc + import SwiftShims + + final class AtomicInt { + typealias IntegerLiteralType = Int + fileprivate var value: Int32 = 0 + fileprivate var _lock = NSRecursiveLock() + + func lock() { + _lock.lock() + } + func unlock() { + _lock.unlock() + } + + func valueSnapshot() -> Int32 { + return value + } + } + + extension AtomicInt: ExpressibleByIntegerLiteral { + convenience init(integerLiteral value: Int) { + self.init() + self.value = Int32(value) + } + } + + func >(lhs: AtomicInt, rhs: Int32) -> Bool { + return lhs.value > rhs + } + func ==(lhs: AtomicInt, rhs: Int32) -> Bool { + return lhs.value == rhs + } + + func AtomicIncrement(_ atomic: inout AtomicInt) -> Int32 { + atomic.lock(); defer { atomic.unlock() } + atomic.value += 1 + return atomic.value + } + + func AtomicDecrement(_ atomic: inout AtomicInt) -> Int32 { + atomic.lock(); defer { atomic.unlock() } + atomic.value -= 1 + return atomic.value + } + + func AtomicCompareAndSwap(_ l: Int32, _ r: Int32, _ atomic: inout AtomicInt) -> Bool { + atomic.lock(); defer { atomic.unlock() } + if atomic.value == l { + atomic.value = r + return true + } + + return false + } + + extension Thread { + + static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { + let currentThread = Thread.current + var threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + + currentThread.threadDictionary = threadDictionary + } + + static func getThreadLocalStorageValueForKey(_ key: String) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + +#endif diff --git a/Pods/RxCocoa/README.md b/Pods/RxCocoa/README.md new file mode 100644 index 0000000..c80e351 --- /dev/null +++ b/Pods/RxCocoa/README.md @@ -0,0 +1,208 @@ +Miss Electric Eel 2016 RxSwift: ReactiveX for Swift +====================================== + +[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-333333.svg) ![pod](https://img.shields.io/cocoapods/v/RxSwift.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) + +## About Rx + +**:warning: This readme describes RxSwift 3.0 version that requires Swift 3.0.** + +**:warning: If you are looking for Swift 2.3 compatible version, please take a look at RxSwift ~> 2.0 versions and [swift-2.3](https://github.com/ReactiveX/RxSwift/tree/rxswift-2.0) branch.** + +Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable` interface. + +This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET). + +It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment. + +Cross platform documentation can be found on [ReactiveX.io](http://reactivex.io/). + +Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams. + +KVO observing, async operations and streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful. + +## I came here because I want to ... + +###### ... understand + +* [why use rx?](Documentation/Why.md) +* [the basics, getting started with RxSwift](Documentation/GettingStarted.md) +* [units](Documentation/Units.md) - what is `Driver`, `ControlProperty`, and `Variable` ... and why do they exist? +* [testing](Documentation/UnitTests.md) +* [tips and common errors](Documentation/Tips.md) +* [debugging](Documentation/GettingStarted.md#debugging) +* [the math behind Rx](Documentation/MathBehindRx.md) +* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md) + +###### ... install + +* Integrate RxSwift/RxCocoa with my app. [Installation Guide](#installation) + +###### ... hack around + +* with the example app. [Running Example App](Documentation/ExampleApp.md) +* with operators in playgrounds. [Playgrounds](Documentation/Playgrounds.md) + +###### ... interact + +* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences.
[![Slack channel](http://rxswift-slack.herokuapp.com/badge.svg)](http://slack.rxswift.org) [Join Slack Channel](http://rxswift-slack.herokuapp.com) +* Report a problem using the library. [Open an Issue With Bug Template](.github/ISSUE_TEMPLATE.md) +* Request a new feature. [Open an Issue With Feature Request Template](Documentation/NewFeatureRequestTemplate.md) + + +###### ... compare + +* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). + + +###### ... find compatible + +* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity). +* [Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift). + +###### ... see the broader vision + +* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava) +* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx. + +## Usage + + + + + + + + + + + + + + + + + + + +
Here's an exampleIn Action
Define search for GitHub repositories ...
+let searchResults = searchBar.rx.text.orEmpty
+    .throttle(0.3, scheduler: MainScheduler.instance)
+    .distinctUntilChanged()
+    .flatMapLatest { query -> Observable<[Repository]> in
+        if query.isEmpty {
+            return .just([])
+        }
+
+        return searchGitHub(query)
+            .catchErrorJustReturn([])
+    }
+    .observeOn(MainScheduler.instance)
... then bind the results to your tableview
+searchResults
+    .bindTo(tableView.rx.items(cellIdentifier: "Cell")) {
+        (index, repository: Repository, cell) in
+        cell.textLabel?.text = repository.name
+        cell.detailTextLabel?.text = repository.url
+    }
+    .addDisposableTo(disposeBag)
+ + +## Requirements + +* Xcode 8.0 +* Swift 3.0 + +## Installation + +Rx doesn't contain any external dependencies. + +These are currently the supported options: + +### Manual + +Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run the sample app + +### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) + +**Tested with `pod --version`: `1.1.1`** + +``` +# Podfile +use_frameworks! + +target 'YOUR_TARGET_NAME' do + pod 'RxSwift', '~> 3.0' + pod 'RxCocoa', '~> 3.0' +end + +# RxTests and RxBlocking make the most sense in the context of unit/integration tests +target 'YOUR_TESTING_TARGET' do + pod 'RxBlocking', '~> 3.0' + pod 'RxTest', '~> 3.0' +end +``` + +Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: + +``` +$ pod install +``` + +### [Carthage](https://github.com/Carthage/Carthage) + +**Tested with `carthage version`: `0.18.1`** + +Add this to `Cartfile` + +``` +github "ReactiveX/RxSwift" ~> 3.0 +``` + +``` +$ carthage update +``` + +### [Swift Package Manager](https://github.com/apple/swift-package-manager) + +**Tested with `swift build --version`: `3.0.0 (swiftpm-19)`** + +Create a `Package.swift` file. + +``` +import PackageDescription + +let package = Package( + name: "RxTestProject", + targets: [], + dependencies: [ + .Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3) + ] +) +``` + +``` +$ swift build +``` + +### Manually using git submodules + +* Add RxSwift as a submodule + +``` +$ git submodule add git@github.com:ReactiveX/RxSwift.git +``` + +* Drag `Rx.xcodeproj` into Project Navigator +* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets + + +## References + +* [http://reactivex.io/](http://reactivex.io/) +* [Reactive Extensions GitHub (GitHub)](https://github.com/Reactive-Extensions) +* [Erik Meijer (Wikipedia)](http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29) +* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://youtu.be/looJcaeboBY) +* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc) +* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf) +* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/) +* [Haskell](https://www.haskell.org/) diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlEvent.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlEvent.swift new file mode 100644 index 0000000..ef8d430 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlEvent.swift @@ -0,0 +1,72 @@ +// +// ControlEvent.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 8/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +/// Protocol that enables extension of `ControlEvent`. +public protocol ControlEventType : ObservableType { + + /// - returns: `ControlEvent` interface + func asControlEvent() -> ControlEvent +} + +/** + Unit for `Observable`/`ObservableType` that represents event on UI element. + + It's properties are: + + - it never fails + - it won't send any initial value on subscription + - it will `Complete` sequence on control being deallocated + - it never errors out + - it delivers events on `MainScheduler.instance` + + **The implementation of `ControlEvent` will ensure that sequence of events is being subscribed on main scheduler + (`subscribeOn(ConcurrentMainScheduler.instance)` behavior).** + + **It is implementor's responsibility to make sure that that all other properties enumerated above are satisfied.** + + **If they aren't, then using this unit communicates wrong properties and could potentially break someone's code.** + + **In case `events` observable sequence that is being passed into initializer doesn't satisfy all enumerated + properties, please don't use this unit.** +*/ +public struct ControlEvent : ControlEventType { + public typealias E = PropertyType + + let _events: Observable + + /// Initializes control event with a observable sequence that represents events. + /// + /// - parameter events: Observable sequence that represents events. + /// - returns: Control event created with a observable sequence of events. + public init(events: Ev) where Ev.E == E { + _events = events.subscribeOn(ConcurrentMainScheduler.instance) + } + + /// Subscribes an observer to control events. + /// + /// - parameter observer: Observer to subscribe to events. + /// - returns: Disposable object that can be used to unsubscribe the observer from receiving control events. + public func subscribe(_ observer: O) -> Disposable where O.E == E { + return _events.subscribe(observer) + } + + /// - returns: `Observable` interface. + public func asObservable() -> Observable { + return _events + } + + /// - returns: `ControlEvent` interface. + public func asControlEvent() -> ControlEvent { + return self + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlProperty.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlProperty.swift new file mode 100644 index 0000000..6cb2c61 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/ControlProperty.swift @@ -0,0 +1,124 @@ +// +// ControlProperty.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 8/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +/// Protocol that enables extension of `ControlProperty`. +public protocol ControlPropertyType : ObservableType, ObserverType { + + /// - returns: `ControlProperty` interface + func asControlProperty() -> ControlProperty +} + +/** + Unit for `Observable`/`ObservableType` that represents property of UI element. + + Sequence of values only represents initial control value and user initiated value changes. + Programatic value changes won't be reported. + + It's properties are: + + - it never fails + - `shareReplay(1)` behavior + - it's stateful, upon subscription (calling subscribe) last element is immediately replayed if it was produced + - it will `Complete` sequence on control being deallocated + - it never errors out + - it delivers events on `MainScheduler.instance` + + **The implementation of `ControlProperty` will ensure that sequence of values is being subscribed on main scheduler + (`subscribeOn(ConcurrentMainScheduler.instance)` behavior).** + + **It is implementor's responsibility to make sure that that all other properties enumerated above are satisfied.** + + **If they aren't, then using this unit communicates wrong properties and could potentially break someone's code.** + + **In case `values` observable sequence that is being passed into initializer doesn't satisfy all enumerated + properties, please don't use this unit.** +*/ +public struct ControlProperty : ControlPropertyType { + public typealias E = PropertyType + + let _values: Observable + let _valueSink: AnyObserver + + /// Initializes control property with a observable sequence that represents property values and observer that enables + /// binding values to property. + /// + /// - parameter values: Observable sequence that represents property values. + /// - parameter valueSink: Observer that enables binding values to control property. + /// - returns: Control property created with a observable sequence of values and an observer that enables binding values + /// to property. + public init(values: V, valueSink: S) where E == V.E, E == S.E { + _values = values.subscribeOn(ConcurrentMainScheduler.instance) + _valueSink = valueSink.asObserver() + } + + /// Subscribes an observer to control property values. + /// + /// - parameter observer: Observer to subscribe to property values. + /// - returns: Disposable object that can be used to unsubscribe the observer from receiving control property values. + public func subscribe(_ observer: O) -> Disposable where O.E == E { + return _values.subscribe(observer) + } + + /// `ControlEvent` of user initiated value changes. Every time user updates control value change event + /// will be emitted from `changed` event. + /// + /// Programatic changes to control value won't be reported. + /// + /// It contains all control property values except for first one. + /// + /// The name only implies that sequence element will be generated once user changes a value and not that + /// adjacent sequence values need to be different (e.g. because of interaction between programatic and user updates, + /// or for any other reason). + public var changed: ControlEvent { + get { + return ControlEvent(events: _values.skip(1)) + } + } + + /// - returns: `Observable` interface. + public func asObservable() -> Observable { + return _values + } + + /// - returns: `ControlProperty` interface. + public func asControlProperty() -> ControlProperty { + return self + } + + /// Binds event to user interface. + /// + /// - In case next element is received, it is being set to control value. + /// - In case error is received, DEBUG buids raise fatal error, RELEASE builds log event to standard output. + /// - In case sequence completes, nothing happens. + public func on(_ event: Event) { + switch event { + case .error(let error): + bindingErrorToInterface(error) + case .next: + _valueSink.on(event) + case .completed: + _valueSink.on(event) + } + } +} + +extension ControlPropertyType where E == String? { + /// Transforms control property of type `String?` into control property of type `String`. + public var orEmpty: ControlProperty { + let original: ControlProperty = self.asControlProperty() + + let values: Observable = original._values.map { $0 ?? "" } + let valueSink: AnyObserver = original._valueSink.mapObserver { $0 } + return ControlProperty(values: values, valueSink: valueSink) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlEvent+Driver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlEvent+Driver.swift new file mode 100644 index 0000000..ca73235 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlEvent+Driver.swift @@ -0,0 +1,27 @@ +// +// ControlEvent+Driver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension ControlEvent { + /// Converts `ControlEvent` to `Driver` unit. + /// + /// `ControlEvent` already can't fail, so no special case needs to be handled. + public func asDriver() -> Driver { + return self.asDriver { (error) -> Driver in + #if DEBUG + rxFatalError("Somehow driver received error from a source that shouldn't fail.") + #else + return Driver.empty() + #endif + } + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlProperty+Driver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlProperty+Driver.swift new file mode 100644 index 0000000..a8a59e2 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ControlProperty+Driver.swift @@ -0,0 +1,27 @@ +// +// ControlProperty+Driver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension ControlProperty { + /// Converts `ControlProperty` to `Driver` unit. + /// + /// `ControlProperty` already can't fail, so no special case needs to be handled. + public func asDriver() -> Driver { + return self.asDriver { (error) -> Driver in + #if DEBUG + rxFatalError("Somehow driver received error from a source that shouldn't fail.") + #else + return Driver.empty() + #endif + } + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver+Subscription.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver+Subscription.swift new file mode 100644 index 0000000..d04007d --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver+Subscription.swift @@ -0,0 +1,125 @@ +// +// Driver+Subscription.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +private let driverErrorMessage = "`drive*` family of methods can be only called from `MainThread`.\n" + +"This is required to ensure that the last replayed `Driver` element is delivered on `MainThread`.\n" + +// This would ideally be Driver, but unfortunatelly Driver can't be extended in Swift 3.0 +extension SharedSequenceConvertibleType where SharingStrategy == DriverSharingStrategy { + /** + Creates new subscription and sends elements to observer. + This method can be only called from `MainThread`. + + In this form it's equivalent to `subscribe` method, but it communicates intent better. + + - parameter observer: Observer that receives events. + - returns: Disposable object that can be used to unsubscribe the observer from the subject. + */ + public func drive(_ observer: O) -> Disposable where O.E == E { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return self.asSharedSequence().asObservable().subscribe(observer) + } + + /** + Creates new subscription and sends elements to observer. + This method can be only called from `MainThread`. + + In this form it's equivalent to `subscribe` method, but it communicates intent better. + + - parameter observer: Observer that receives events. + - returns: Disposable object that can be used to unsubscribe the observer from the subject. + */ + public func drive(_ observer: O) -> Disposable where O.E == E? { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return self.asSharedSequence().asObservable().map { $0 as E? }.subscribe(observer) + } + + /** + Creates new subscription and sends elements to variable. + This method can be only called from `MainThread`. + + - parameter variable: Target variable for sequence elements. + - returns: Disposable object that can be used to unsubscribe the observer from the variable. + */ + public func drive(_ variable: Variable) -> Disposable { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return drive(onNext: { e in + variable.value = e + }) + } + + /** + Creates new subscription and sends elements to variable. + This method can be only called from `MainThread`. + + - parameter variable: Target variable for sequence elements. + - returns: Disposable object that can be used to unsubscribe the observer from the variable. + */ + public func drive(_ variable: Variable) -> Disposable { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return drive(onNext: { e in + variable.value = e + }) + } + + /** + Subscribes to observable sequence using custom binder function. + This method can be only called from `MainThread`. + + - parameter with: Function used to bind elements from `self`. + - returns: Object representing subscription. + */ + public func drive(_ transformation: (Observable) -> R) -> R { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return transformation(self.asObservable()) + } + + /** + Subscribes to observable sequence using custom binder function and final parameter passed to binder function + after `self` is passed. + + public func drive(with: Self -> R1 -> R2, curriedArgument: R1) -> R2 { + return with(self)(curriedArgument) + } + + This method can be only called from `MainThread`. + + - parameter with: Function used to bind elements from `self`. + - parameter curriedArgument: Final argument passed to `binder` to finish binding process. + - returns: Object representing subscription. + */ + public func drive(_ with: (Observable) -> (R1) -> R2, curriedArgument: R1) -> R2 { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return with(self.asObservable())(curriedArgument) + } + + /** + Subscribes an element handler, a completion handler and disposed handler to an observable sequence. + This method can be only called from `MainThread`. + + Error callback is not exposed because `Driver` can't error out. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + gracefully completed, errored, or if the generation is cancelled by disposing subscription) + - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has + gracefully completed, errored, or if the generation is cancelled by disposing subscription) + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func drive(onNext: ((E) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) -> Disposable { + MainScheduler.ensureExecutingOnScheduler(errorMessage: driverErrorMessage) + return self.asObservable().subscribe(onNext: onNext, onCompleted: onCompleted, onDisposed: onDisposed) + } +} + + diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver.swift new file mode 100644 index 0000000..b31c2b5 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Driver.swift @@ -0,0 +1,89 @@ +// +// Driver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/26/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + + +/** + Unit that represents observable sequence with following properties: + + - it never fails + - it delivers events on `MainScheduler.instance` + - `shareReplayLatestWhileConnected()` behavior + - all observers share sequence computation resources + - it's stateful, upon subscription (calling subscribe) last element is immediatelly replayed if it was produced + - computation of elements is reference counted with respect to the number of observers + - if there are no subscribers, it will release sequence computation resources + + `Driver` can be considered a builder pattern for observable sequences that drive the application. + + If observable sequence has produced at least one element, after new subscription is made last produced element will be + immediately replayed on the same thread on which the subscription was made. + + When using `drive*`, `subscribe*` and `bind*` family of methods, they should always be called from main thread. + + If `drive*`, `subscribe*` and `bind*` are called from background thread, it is possible that initial replay + will happen on background thread, and subsequent events will arrive on main thread. + + To find out more about units and how to use them, please visit `Documentation/Units.md`. + */ +public typealias Driver = SharedSequence + +public struct DriverSharingStrategy: SharingStrategyProtocol { + public static var scheduler: SchedulerType { return driverObserveOnScheduler } + public static func share(_ source: Observable) -> Observable { + return source.shareReplayLatestWhileConnected() + } +} + +extension SharedSequenceConvertibleType where SharingStrategy == DriverSharingStrategy { + /// Adds `asDriver` to `SharingSequence` with `DriverSharingStrategy`. + public func asDriver() -> Driver { + return self.asSharedSequence() + } +} + +/** + This method can be used in unit tests to ensure that driver is using mock schedulers instead of + main schedulers. + + **This shouldn't be used in normal release builds.** +*/ +public func driveOnScheduler(_ scheduler: SchedulerType, action: () -> ()) { + let originalObserveOnScheduler = driverObserveOnScheduler + driverObserveOnScheduler = scheduler + + action() + + // If you remove this line , compiler buggy optimizations will change behavior of this code + _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(driverObserveOnScheduler) + // Scary, I know + + driverObserveOnScheduler = originalObserveOnScheduler +} + +#if os(Linux) + import Glibc +#endif + +func _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(_ scheduler: SchedulerType) { + let a: Int32 = 1 +#if os(Linux) + let b = 314 + Int32(Glibc.random() & 1) +#else + let b = 314 + Int32(arc4random() & 1) +#endif + if a == b { + print(scheduler) + } +} + +fileprivate var driverObserveOnScheduler: SchedulerType = MainScheduler.instance diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ObservableConvertibleType+Driver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ObservableConvertibleType+Driver.swift new file mode 100644 index 0000000..ef97b0e --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/ObservableConvertibleType+Driver.swift @@ -0,0 +1,60 @@ +// +// ObservableConvertibleType+Driver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension ObservableConvertibleType { + /** + Converts anything convertible to `Observable` to `Driver` unit. + + - parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence. + - returns: Driving observable sequence. + */ + public func asDriver(onErrorJustReturn: E) -> Driver { + let source = self + .asObservable() + .observeOn(DriverSharingStrategy.scheduler) + .catchErrorJustReturn(onErrorJustReturn) + return Driver(source) + } + + /** + Converts anything convertible to `Observable` to `Driver` unit. + + - parameter onErrorDriveWith: Driver that continues to drive the sequence in case of error. + - returns: Driving observable sequence. + */ + public func asDriver(onErrorDriveWith: Driver) -> Driver { + let source = self + .asObservable() + .observeOn(DriverSharingStrategy.scheduler) + .catchError { _ in + onErrorDriveWith.asObservable() + } + return Driver(source) + } + + /** + Converts anything convertible to `Observable` to `Driver` unit. + + - parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error. + - returns: Driving observable sequence. + */ + public func asDriver(onErrorRecover: @escaping (_ error: Swift.Error) -> Driver) -> Driver { + let source = self + .asObservable() + .observeOn(DriverSharingStrategy.scheduler) + .catchError { error in + onErrorRecover(error).asObservable() + } + return Driver(source) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Variable+Driver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Variable+Driver.swift new file mode 100644 index 0000000..9f9b21d --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/Driver/Variable+Driver.swift @@ -0,0 +1,23 @@ +// +// Variable+Driver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 12/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + +extension Variable { + /// Converts `Variable` to `Driver` unit. + /// + /// - returns: Driving observable sequence. + public func asDriver() -> Driver { + let source = self.asObservable() + .observeOn(DriverSharingStrategy.scheduler) + return Driver(source) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/ObservableConvertibleType+SharedSequence.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/ObservableConvertibleType+SharedSequence.swift new file mode 100644 index 0000000..4cb6de5 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/ObservableConvertibleType+SharedSequence.swift @@ -0,0 +1,60 @@ +// +// ObservableConvertibleType+SharedSequence.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension ObservableConvertibleType { + /** + Converts anything convertible to `Observable` to `SharedSequence` unit. + + - parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence. + - returns: Driving observable sequence. + */ + public func asSharedSequence(sharingStrategy: S.Type = S.self, onErrorJustReturn: E) -> SharedSequence { + let source = self + .asObservable() + .observeOn(S.scheduler) + .catchErrorJustReturn(onErrorJustReturn) + return SharedSequence(source) + } + + /** + Converts anything convertible to `Observable` to `SharedSequence` unit. + + - parameter onErrorDriveWith: SharedSequence that provides elements of the sequence in case of error. + - returns: Driving observable sequence. + */ + public func asSharedSequence(sharingStrategy: S.Type = S.self, onErrorDriveWith: SharedSequence) -> SharedSequence { + let source = self + .asObservable() + .observeOn(S.scheduler) + .catchError { _ in + onErrorDriveWith.asObservable() + } + return SharedSequence(source) + } + + /** + Converts anything convertible to `Observable` to `SharedSequence` unit. + + - parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error. + - returns: Driving observable sequence. + */ + public func asSharedSequence(sharingStrategy: S.Type = S.self, onErrorRecover: @escaping (_ error: Swift.Error) -> SharedSequence) -> SharedSequence { + let source = self + .asObservable() + .observeOn(S.scheduler) + .catchError { error in + onErrorRecover(error).asObservable() + } + return SharedSequence(source) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators+arity.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators+arity.swift new file mode 100644 index 0000000..e66fc47 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators+arity.swift @@ -0,0 +1,351 @@ +// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project +// +// SharedSequence+Operators+arity.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 10/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + + + +// 2 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 3 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 4 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 5 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 6 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 7 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy, + O1.SharingStrategy == O7.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), source7.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy, + O1.SharingStrategy == O7.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), source7.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + + +// 8 + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy, + O1.SharingStrategy == O7.SharingStrategy, + O1.SharingStrategy == O8.SharingStrategy { + let source = Observable.zip( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), source7.asSharedSequence().asObservable(), source8.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> SharedSequence where O1.SharingStrategy == O2.SharingStrategy, + O1.SharingStrategy == O3.SharingStrategy, + O1.SharingStrategy == O4.SharingStrategy, + O1.SharingStrategy == O5.SharingStrategy, + O1.SharingStrategy == O6.SharingStrategy, + O1.SharingStrategy == O7.SharingStrategy, + O1.SharingStrategy == O8.SharingStrategy { + let source = Observable.combineLatest( + source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable(), source6.asSharedSequence().asObservable(), source7.asSharedSequence().asObservable(), source8.asSharedSequence().asObservable(), + resultSelector: resultSelector + ) + + return SharedSequence(source) + } +} + + diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators.swift new file mode 100644 index 0000000..d76fbd3 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence+Operators.swift @@ -0,0 +1,431 @@ +// +// SharedSequence+Operators.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 9/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +// MARK: map +extension SharedSequenceConvertibleType { + + /** + Projects each element of an observable sequence into a new form. + + - parameter selector: A transform function to apply to each source element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. + */ + public func map(_ selector: @escaping (E) -> R) -> SharedSequence { + let source = self + .asObservable() + .map(selector) + return SharedSequence(source) + } +} + +// MARK: filter +extension SharedSequenceConvertibleType { + /** + Filters the elements of an observable sequence based on a predicate. + + - parameter predicate: A function to test each source element for a condition. + - returns: An observable sequence that contains elements from the input sequence that satisfy the condition. + */ + public func filter(_ predicate: @escaping (E) -> Bool) -> SharedSequence { + let source = self + .asObservable() + .filter(predicate) + return SharedSequence(source) + } +} + +// MARK: switchLatest +extension SharedSequenceConvertibleType where E : SharedSequenceConvertibleType, E.SharingStrategy == SharingStrategy { + + /** + Transforms an observable sequence of observable sequences into an observable sequence + producing values only from the most recent observable sequence. + + Each time a new inner observable sequence is received, unsubscribe from the + previous inner observable sequence. + + - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func switchLatest() -> SharedSequence { + let source: Observable = self + .asObservable() + .map { $0.asSharedSequence() } + .switchLatest() + return SharedSequence(source) + } +} + +// MARK: flatMapLatest +extension SharedSequenceConvertibleType { + /** + Projects each element of an observable sequence into a new sequence of observable sequences and then + transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + + It is a combination of `map` + `switchLatest` operator + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an + Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func flatMapLatest(_ selector: @escaping (E) -> SharedSequence) + -> SharedSequence { + let source: Observable = self + .asObservable() + .flatMapLatest(selector) + return SharedSequence(source) + } +} + +// MARK: flatMapFirst +extension SharedSequenceConvertibleType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + If element is received while there is some projected observable sequence being merged it will simply be ignored. + + - parameter selector: A transform function to apply to element that was observed while no observable is executing in parallel. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated. + */ + public func flatMapFirst(_ selector: @escaping (E) -> SharedSequence) + -> SharedSequence { + let source: Observable = self + .asObservable() + .flatMapFirst(selector) + return SharedSequence(source) + } +} + +// MARK: do +extension SharedSequenceConvertibleType { + /** + Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. + - parameter onDispose: Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed. + - returns: The source sequence with the side-effecting behavior applied. + */ + public func `do`(onNext: ((E) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onSubscribe: (() -> ())? = nil, onDispose: (() -> ())? = nil) + -> SharedSequence { + let source = self.asObservable() + .do(onNext: onNext, onCompleted: onCompleted, onSubscribe: onSubscribe, onDispose: onDispose) + + return SharedSequence(source) + } +} + +// MARK: debug +extension SharedSequenceConvertibleType { + + /** + Prints received events for all observers on standard output. + + - parameter identifier: Identifier that is printed together with event description to standard output. + - returns: An observable sequence whose events are printed to standard output. + */ + public func debug(_ identifier: String? = nil, file: String = #file, line: UInt = #line, function: String = #function) -> SharedSequence { + let source = self.asObservable() + .debug(identifier, file: file, line: line, function: function) + return SharedSequence(source) + } +} + +// MARK: distinctUntilChanged +extension SharedSequenceConvertibleType where E: Equatable { + + /** + Returns an observable sequence that contains only distinct contiguous elements according to equality operator. + + - returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence. + */ + public func distinctUntilChanged() + -> SharedSequence { + let source = self.asObservable() + .distinctUntilChanged({ $0 }, comparer: { ($0 == $1) }) + + return SharedSequence(source) + } +} + +extension SharedSequenceConvertibleType { + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `keySelector`. + + - parameter keySelector: A function to compute the comparison key for each element. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) -> K) -> SharedSequence { + let source = self.asObservable() + .distinctUntilChanged(keySelector, comparer: { $0 == $1 }) + return SharedSequence(source) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `comparer`. + + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on `comparer`, from the source sequence. + */ + public func distinctUntilChanged(_ comparer: @escaping (E, E) -> Bool) -> SharedSequence { + let source = self.asObservable() + .distinctUntilChanged({ $0 }, comparer: comparer) + return SharedSequence(source) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. + + - parameter keySelector: A function to compute the comparison key for each element. + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) -> K, comparer: @escaping (K, K) -> Bool) -> SharedSequence { + let source = self.asObservable() + .distinctUntilChanged(keySelector, comparer: comparer) + return SharedSequence(source) + } +} + + +// MARK: flatMap +extension SharedSequenceConvertibleType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. + */ + public func flatMap(_ selector: @escaping (E) -> SharedSequence) -> SharedSequence { + let source = self.asObservable() + .flatMap(selector) + + return SharedSequence(source) + } +} + +// MARK: merge +extension SharedSequenceConvertibleType where E : SharedSequenceConvertibleType, E.SharingStrategy == SharingStrategy { + + /** + Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. + + - parameter maxConcurrent: Maximum number of inner observable sequences being subscribed to concurrently. + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public func merge() -> SharedSequence { + let source = self.asObservable() + .map { $0.asSharedSequence() } + .merge() + return SharedSequence(source) + } + + /** + Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. + + - returns: The observable sequence that merges the elements of the inner sequences. + */ + public func merge(maxConcurrent: Int) + -> SharedSequence { + let source = self.asObservable() + .map { $0.asSharedSequence() } + .merge(maxConcurrent: maxConcurrent) + return SharedSequence(source) + } +} + +// MARK: throttle +extension SharedSequenceConvertibleType { + + /** + Returns an Observable that emits the first and the latest item emitted by the source Observable during sequential time windows of a specified duration. + + This operator makes sure that no two elements are emitted in less then dueTime. + + - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) + + - parameter dueTime: Throttling duration for each element. + - parameter latest: Should latest element received in a dueTime wide time window since last element emission be emitted. + - returns: The throttled sequence. + */ + public func throttle(_ dueTime: RxTimeInterval) + -> SharedSequence { + let source = self.asObservable() + .throttle(dueTime, scheduler: SharingStrategy.scheduler) + + return SharedSequence(source) + } + + /** + Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers. + + - parameter dueTime: Throttling duration for each element. + - returns: The throttled sequence. + */ + public func debounce(_ dueTime: RxTimeInterval) + -> SharedSequence { + let source = self.asObservable() + .debounce(dueTime, scheduler: SharingStrategy.scheduler) + + return SharedSequence(source) + } +} + +// MARK: scan +extension SharedSequenceConvertibleType { + /** + Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. + + For aggregation behavior with no intermediate results, see `reduce`. + + - parameter seed: The initial accumulator value. + - parameter accumulator: An accumulator function to be invoked on each element. + - returns: An observable sequence containing the accumulated values. + */ + public func scan(_ seed: A, accumulator: @escaping (A, E) -> A) + -> SharedSequence { + let source = self.asObservable() + .scan(seed, accumulator: accumulator) + return SharedSequence(source) + } +} + +// MARK: concat + +extension SharedSequence { + /** + Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully. + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ sequence: S) -> SharedSequence + where S.Iterator.Element == SharedSequence { + let source = Observable.concat(sequence.lazy.map { $0.asObservable() }) + return SharedSequence(source) + } + + /** + Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully. + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ collection: C) -> SharedSequence + where C.Iterator.Element == SharedSequence { + let source = Observable.concat(collection.map { $0.asObservable() }) + return SharedSequence(source) + } +} + +// MARK: zip + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip(_ collection: C, _ resultSelector: @escaping ([Element]) throws -> R) -> SharedSequence + where C.Iterator.Element == SharedSequence { + let source = Observable.zip(collection.map { $0.asSharedSequence().asObservable() }, resultSelector) + return SharedSequence(source) + } +} + +// MARK: combineLatest + +extension SharedSequence { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest(_ collection: C, _ resultSelector: @escaping ([Element]) throws -> R) -> SharedSequence + where C.Iterator.Element == SharedSequence { + let source = Observable.combineLatest(collection.map { $0.asObservable() }, resultSelector) + return SharedSequence(source) + } +} + +// MARK: withLatestFrom +extension SharedSequenceConvertibleType { + + /** + Merges two observable sequences into one observable sequence by combining each element from self with the latest element from the second source, if any. + + - parameter second: Second observable source. + - parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) -> ResultType) -> SharedSequence where SecondO.SharingStrategy == SecondO.SharingStrategy { + let source = self.asObservable() + .withLatestFrom(second.asSharedSequence(), resultSelector: resultSelector) + + return SharedSequence(source) + } + + /** + Merges two observable sequences into one observable sequence by using latest element from the second sequence every time when `self` emitts an element. + + - parameter second: Second observable source. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO) -> SharedSequence { + let source = self.asObservable() + .withLatestFrom(second.asSharedSequence()) + + return SharedSequence(source) + } +} + +// MARK: skip +extension SharedSequenceConvertibleType { + + /** + Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. + + - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) + + - parameter count: The number of elements to skip before returning the remaining elements. + - returns: An observable sequence that contains the elements that occur after the specified index in the input sequence. + */ + public func skip(_ count: Int) + -> SharedSequence { + let source = self.asObservable() + .skip(count) + return SharedSequence(source) + } +} + +// MARK: startWith +extension SharedSequenceConvertibleType { + + /** + Prepends a value to an observable sequence. + + - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html) + + - parameter element: Element to prepend to the specified sequence. + - returns: The source sequence prepended with the specified values. + */ + public func startWith(_ element: E) + -> SharedSequence { + let source = self.asObservable() + .startWith(element) + + return SharedSequence(source) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence.swift new file mode 100644 index 0000000..a0a4162 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/SharedSequence.swift @@ -0,0 +1,191 @@ +// +// SharedSequence.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 8/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + +/** + Unit that represents observable sequence that shares computation resources with following properties: + + - it never fails + - it delivers events on `SharingStrategy.scheduler` + - sharing strategy is customizable using `SharingStrategy.share` behavior + + `SharedSequence` can be considered a builder pattern for observable sequences that share computation resources. + + To find out more about units and how to use them, please visit `Documentation/Units.md`. +*/ +public struct SharedSequence : SharedSequenceConvertibleType { + public typealias E = Element + public typealias SharingStrategy = S + + let _source: Observable + + init(_ source: Observable) { + self._source = S.share(source) + } + + init(raw: Observable) { + self._source = raw + } + + #if EXPANDABLE_SHARED_SEQUENCE + /** + This method is extension hook in case this unit needs to extended from outside the library. + + By defining `EXPANDABLE_SHARED_SEQUENCE` one agrees that it's up to him to ensure shared sequence + properties are preserved after extension. + */ + public static func createUnsafe(source: O) -> SharedSequence { + return SharedSequence(raw: source.asObservable()) + } + #endif + + /** + - returns: Built observable sequence. + */ + public func asObservable() -> Observable { + return _source + } + + /** + - returns: `self` + */ + public func asSharedSequence() -> SharedSequence { + return self + } +} + +/** + Different `SharedSequence` sharing strategies must conform to this protocol. + */ +public protocol SharingStrategyProtocol { + /** + Scheduled on which all sequence events will be delivered. + */ + static var scheduler: SchedulerType { get } + + /** + Computation resources sharing strategy for multiple sequence observers. + + E.g. One can choose `shareReplayWhenConnected`, `shareReplay` or `share` + as sequence event sharing strategies, but also do something more exotic, like + implementing promises or lazy loading chains. + */ + static func share(_ source: Observable) -> Observable +} + +/** +A type that can be converted to `SharedSequence`. +*/ +public protocol SharedSequenceConvertibleType : ObservableConvertibleType { + associatedtype SharingStrategy: SharingStrategyProtocol + + /** + Converts self to `SharedSequence`. + */ + func asSharedSequence() -> SharedSequence +} + +extension SharedSequenceConvertibleType { + public func asObservable() -> Observable { + return asSharedSequence().asObservable() + } +} + + +extension SharedSequence { + + /** + Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message. + + - returns: An observable sequence with no elements. + */ + public static func empty() -> SharedSequence { + return SharedSequence(Observable.empty().subscribeOn(S.scheduler)) + } + + /** + Returns a non-terminating observable sequence, which can be used to denote an infinite duration. + + - returns: An observable sequence whose observers will never get called. + */ + public static func never() -> SharedSequence { + return SharedSequence(Observable.never()) + } + + /** + Returns an observable sequence that contains a single element. + + - parameter element: Single element in the resulting observable sequence. + - returns: An observable sequence containing the single specified element. + */ + public static func just(_ element: E) -> SharedSequence { + return SharedSequence(Observable.just(element).subscribeOn(S.scheduler)) + } + + /** + Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. + + - parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence. + - returns: An observable sequence whose observers trigger an invocation of the given observable factory function. + */ + public static func deferred(_ observableFactory: @escaping () -> SharedSequence) + -> SharedSequence { + return SharedSequence(Observable.deferred { observableFactory().asObservable() }) + } + + /** + This method creates a new Observable instance with a variable number of elements. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter elements: Elements to generate. + - returns: The observable sequence whose elements are pulled from the given arguments. + */ + public static func of(_ elements: E ...) -> SharedSequence { + let source = Observable.from(elements, scheduler: S.scheduler) + return SharedSequence(raw: source) + } +} + +extension SharedSequence where Element : SignedInteger { + /** + Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages. + + - seealso: [interval operator on reactivex.io](http://reactivex.io/documentation/operators/interval.html) + + - parameter period: Period for producing the values in the resulting sequence. + - returns: An observable sequence that produces a value after each period. + */ + public static func interval(_ period: RxTimeInterval) + -> SharedSequence { + return SharedSequence(Observable.interval(period, scheduler: S.scheduler)) + } +} + +// MARK: timer + +extension SharedSequence where Element: SignedInteger { + /** + Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers. + + - seealso: [timer operator on reactivex.io](http://reactivex.io/documentation/operators/timer.html) + + - parameter dueTime: Relative time at which to produce the first value. + - parameter period: Period to produce subsequent values. + - returns: An observable sequence that produces a value after due time has elapsed and then each period. + */ + public static func timer(_ dueTime: RxTimeInterval, period: RxTimeInterval) + -> SharedSequence { + return SharedSequence(Observable.timer(dueTime, period: period, scheduler: S.scheduler)) + } +} + diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/Variable+SharedSequence.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/Variable+SharedSequence.swift new file mode 100644 index 0000000..904f5f7 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/SharedSequence/Variable+SharedSequence.swift @@ -0,0 +1,23 @@ +// +// Variable+SharedSequence.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 12/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + +extension Variable { + /// Converts `Variable` to `SharedSequence` unit. + /// + /// - returns: Observable sequence. + public func asSharedSequence(strategy: SharingStrategy.Type = SharingStrategy.self) -> SharedSequence { + let source = self.asObservable() + .observeOn(SharingStrategy.scheduler) + return SharedSequence(source) + } +} diff --git a/Pods/RxCocoa/RxCocoa/CocoaUnits/UIBindingObserver.swift b/Pods/RxCocoa/RxCocoa/CocoaUnits/UIBindingObserver.swift new file mode 100644 index 0000000..087c74c --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/CocoaUnits/UIBindingObserver.swift @@ -0,0 +1,65 @@ +// +// UIBindingObserver.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 2/7/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch +#if !RX_NO_MODULE + import RxSwift +#endif + +/** +Observer that enforces interface binding rules: + * can't bind errors (in debug builds binding of errors causes `fatalError` in release builds errors are being logged) + * ensures binding is performed on main thread + +`UIBindingObserver` doesn't retain target interface and in case owned interface element is released, element isn't bound. + + In case event binding is attempted from non main dispatch queue, event binding will be dispatched async to main dispatch + queue. +*/ +public class UIBindingObserver : ObserverType where UIElementType: AnyObject { + public typealias E = Value + + weak var UIElement: UIElementType? + + let binding: (UIElementType, Value) -> Void + + /// Initializes `ViewBindingObserver` using + public init(UIElement: UIElementType, binding: @escaping (UIElementType, Value) -> Void) { + self.UIElement = UIElement + self.binding = binding + } + + /// Binds next element to owner view as described in `binding`. + public func on(_ event: Event) { + if !DispatchQueue.isMain { + DispatchQueue.main.async { + self.on(event) + } + return + } + + switch event { + case .next(let element): + if let view = self.UIElement { + binding(view, element) + } + case .error(let error): + bindingErrorToInterface(error) + case .completed: + break + } + } + + /// Erases type of observer. + /// + /// - returns: type erased observer. + public func asObserver() -> AnyObserver { + return AnyObserver(eventHandler: on) + } +} diff --git a/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift b/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift new file mode 100644 index 0000000..42b7db9 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift @@ -0,0 +1,92 @@ +// +// ControlTarget.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(iOS) || os(tvOS) || os(macOS) + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +#if os(iOS) || os(tvOS) + import UIKit + + typealias Control = UIKit.UIControl + typealias ControlEvents = UIKit.UIControlEvents +#elseif os(macOS) + import Cocoa + + typealias Control = Cocoa.NSControl +#endif + +// This should be only used from `MainScheduler` +class ControlTarget: RxTarget { + typealias Callback = (Control) -> Void + + let selector: Selector = #selector(ControlTarget.eventHandler(_:)) + + weak var control: Control? +#if os(iOS) || os(tvOS) + let controlEvents: UIControlEvents +#endif + var callback: Callback? + #if os(iOS) || os(tvOS) + init(control: Control, controlEvents: UIControlEvents, callback: @escaping Callback) { + MainScheduler.ensureExecutingOnScheduler() + + self.control = control + self.controlEvents = controlEvents + self.callback = callback + + super.init() + + control.addTarget(self, action: selector, for: controlEvents) + + let method = self.method(for: selector) + if method == nil { + rxFatalError("Can't find method") + } + } +#elseif os(macOS) + init(control: Control, callback: @escaping Callback) { + MainScheduler.ensureExecutingOnScheduler() + + self.control = control + self.callback = callback + + super.init() + + control.target = self + control.action = selector + + let method = self.method(for: selector) + if method == nil { + rxFatalError("Can't find method") + } + } +#endif + + func eventHandler(_ sender: Control!) { + if let callback = self.callback, let control = self.control { + callback(control) + } + } + + override func dispose() { + super.dispose() +#if os(iOS) || os(tvOS) + self.control?.removeTarget(self, action: self.selector, for: self.controlEvents) +#elseif os(macOS) + self.control?.target = nil + self.control?.action = nil +#endif + self.callback = nil + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Common/DelegateProxy.swift b/Pods/RxCocoa/RxCocoa/Common/DelegateProxy.swift new file mode 100644 index 0000000..3634ffc --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/DelegateProxy.swift @@ -0,0 +1,258 @@ +// +// DelegateProxy.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE + import RxSwift + #if SWIFT_PACKAGE && !os(Linux) + import RxCocoaRuntime + #endif +#endif + +var delegateAssociatedTag: UInt8 = 0 +var dataSourceAssociatedTag: UInt8 = 0 + +/// Base class for `DelegateProxyType` protocol. +/// +/// This implementation is not thread safe and can be used only from one thread (Main thread). +open class DelegateProxy : _RXDelegateProxy { + + private var sentMessageForSelector = [Selector: PublishSubject<[Any]>]() + private var methodInvokedForSelector = [Selector: PublishSubject<[Any]>]() + + /// Parent object associated with delegate proxy. + weak private(set) var parentObject: AnyObject? + + /// Initializes new instance. + /// + /// - parameter parentObject: Optional parent object that owns `DelegateProxy` as associated object. + public required init(parentObject: AnyObject) { + self.parentObject = parentObject + + MainScheduler.ensureExecutingOnScheduler() +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + super.init() + } + + /** + Returns observable sequence of invocations of delegate methods. Elements are sent *before method is invoked*. + + Only methods that have `void` return value can be observed using this method because + those methods are used as a notification mechanism. It doesn't matter if they are optional + or not. Observing is performed by installing a hidden associated `PublishSubject` that is + used to dispatch messages to observers. + + Delegate methods that have non `void` return value can't be observed directly using this method + because: + * those methods are not intended to be used as a notification mechanism, but as a behavior customization mechanism + * there is no sensible automatic way to determine a default return value + + In case observing of delegate methods that have return type is required, it can be done by + manually installing a `PublishSubject` or `BehaviorSubject` and implementing delegate method. + + e.g. + + // delegate proxy part (RxScrollViewDelegateProxy) + + let internalSubject = PublishSubject + + public func requiredDelegateMethod(scrollView: UIScrollView, arg1: CGPoint) -> Bool { + internalSubject.on(.next(arg1)) + return self._forwardToDelegate?.requiredDelegateMethod?(scrollView, arg1: arg1) ?? defaultReturnValue + } + + .... + + // reactive property implementation in a real class (`UIScrollView`) + public var property: Observable { + let proxy = RxScrollViewDelegateProxy.proxyForObject(base) + return proxy.internalSubject.asObservable() + } + + **In case calling this method prints "Delegate proxy is already implementing `\(selector)`, + a more performant way of registering might exist.", that means that manual observing method + is required analog to the example above because delegate method has already been implemented.** + + - parameter selector: Selector used to filter observed invocations of delegate methods. + - returns: Observable sequence of arguments passed to `selector` method. + */ + open func sentMessage(_ selector: Selector) -> Observable<[Any]> { + checkSelectorIsObservable(selector) + + let subject = sentMessageForSelector[selector] + + if let subject = subject { + return subject + } + else { + let subject = PublishSubject<[Any]>() + sentMessageForSelector[selector] = subject + return subject + } + } + + /** + Returns observable sequence of invoked delegate methods. Elements are sent *after method is invoked*. + + Only methods that have `void` return value can be observed using this method because + those methods are used as a notification mechanism. It doesn't matter if they are optional + or not. Observing is performed by installing a hidden associated `PublishSubject` that is + used to dispatch messages to observers. + + Delegate methods that have non `void` return value can't be observed directly using this method + because: + * those methods are not intended to be used as a notification mechanism, but as a behavior customization mechanism + * there is no sensible automatic way to determine a default return value + + In case observing of delegate methods that have return type is required, it can be done by + manually installing a `PublishSubject` or `BehaviorSubject` and implementing delegate method. + + e.g. + + // delegate proxy part (RxScrollViewDelegateProxy) + + let internalSubject = PublishSubject + + public func requiredDelegateMethod(scrollView: UIScrollView, arg1: CGPoint) -> Bool { + internalSubject.on(.next(arg1)) + return self._forwardToDelegate?.requiredDelegateMethod?(scrollView, arg1: arg1) ?? defaultReturnValue + } + + .... + + // reactive property implementation in a real class (`UIScrollView`) + public var property: Observable { + let proxy = RxScrollViewDelegateProxy.proxyForObject(base) + return proxy.internalSubject.asObservable() + } + + **In case calling this method prints "Delegate proxy is already implementing `\(selector)`, + a more performant way of registering might exist.", that means that manual observing method + is required analog to the example above because delegate method has already been implemented.** + + - parameter selector: Selector used to filter observed invocations of delegate methods. + - returns: Observable sequence of arguments passed to `selector` method. + */ + open func methodInvoked(_ selector: Selector) -> Observable<[Any]> { + checkSelectorIsObservable(selector) + + let subject = methodInvokedForSelector[selector] + + if let subject = subject { + return subject + } + else { + let subject = PublishSubject<[Any]>() + methodInvokedForSelector[selector] = subject + return subject + } + } + + private func checkSelectorIsObservable(_ selector: Selector) { + MainScheduler.ensureExecutingOnScheduler() + + if hasWiredImplementation(for: selector) { + print("Delegate proxy is already implementing `\(selector)`, a more performant way of registering might exist.") + } + + // It's important to see if super class reponds to selector and not self, + // because super class (_RxDelegateProxy) returns all methods delegate proxy + // can respond to. + // Because of https://github.com/ReactiveX/RxSwift/issues/907 , and possibly + // some other reasons, subclasses could overrride `responds(to:)`, but it shouldn't matter + // for this case. + if !super.responds(to: selector) { + rxFatalError("This class doesn't respond to selector \(selector)") + } + } + + // proxy + + open override func _sentMessage(_ selector: Selector, withArguments arguments: [Any]) { + sentMessageForSelector[selector]?.on(.next(arguments)) + } + + open override func _methodInvoked(_ selector: Selector, withArguments arguments: [Any]) { + methodInvokedForSelector[selector]?.on(.next(arguments)) + } + + /// Returns tag used to identify associated object. + /// + /// - returns: Associated object tag. + open class func delegateAssociatedObjectTag() -> UnsafeRawPointer { + return _pointer(&delegateAssociatedTag) + } + + /// Initializes new instance of delegate proxy. + /// + /// - returns: Initialized instance of `self`. + open class func createProxyForObject(_ object: AnyObject) -> AnyObject { + return self.init(parentObject: object) + } + + /// Returns assigned proxy for object. + /// + /// - parameter object: Object that can have assigned delegate proxy. + /// - returns: Assigned delegate proxy or `nil` if no delegate proxy is assigned. + open class func assignedProxyFor(_ object: AnyObject) -> AnyObject? { + let maybeDelegate = objc_getAssociatedObject(object, self.delegateAssociatedObjectTag()) + return castOptionalOrFatalError(maybeDelegate.map { $0 as AnyObject }) + } + + /// Assigns proxy to object. + /// + /// - parameter object: Object that can have assigned delegate proxy. + /// - parameter proxy: Delegate proxy object to assign to `object`. + open class func assignProxy(_ proxy: AnyObject, toObject object: AnyObject) { + precondition(proxy.isKind(of: self.classForCoder())) + + objc_setAssociatedObject(object, self.delegateAssociatedObjectTag(), proxy, .OBJC_ASSOCIATION_RETAIN) + } + + /// Sets reference of normal delegate that receives all forwarded messages + /// through `self`. + /// + /// - parameter forwardToDelegate: Reference of delegate that receives all messages through `self`. + /// - parameter retainDelegate: Should `self` retain `forwardToDelegate`. + open func setForwardToDelegate(_ delegate: AnyObject?, retainDelegate: Bool) { + self._setForward(toDelegate: delegate, retainDelegate: retainDelegate) + } + + /// Returns reference of normal delegate that receives all forwarded messages + /// through `self`. + /// + /// - returns: Value of reference if set or nil. + open func forwardToDelegate() -> AnyObject? { + return self._forwardToDelegate + } + + deinit { + for v in sentMessageForSelector.values { + v.on(.completed) + } + for v in methodInvokedForSelector.values { + v.on(.completed) + } +#if TRACE_RESOURCES + _ = Resources.decrementTotal() +#endif + } + + // MARK: Pointer + + class func _pointer(_ p: UnsafeRawPointer) -> UnsafeRawPointer { + return p + } +} + +#endif + diff --git a/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift b/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift new file mode 100644 index 0000000..91cf807 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift @@ -0,0 +1,272 @@ +// +// DelegateProxyType.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 6/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +/** +`DelegateProxyType` protocol enables using both normal delegates and Rx observable sequences with +views that can have only one delegate/datasource registered. + +`Proxies` store information about observers, subscriptions and delegates +for specific views. + +Type implementing `DelegateProxyType` should never be initialized directly. + +To fetch initialized instance of type implementing `DelegateProxyType`, `proxyForObject` method +should be used. + +This is more or less how it works. + + + + +-------------------------------------------+ + | | + | UIView subclass (UIScrollView) | + | | + +-----------+-------------------------------+ + | + | Delegate + | + | + +-----------v-------------------------------+ + | | + | Delegate proxy : DelegateProxyType +-----+----> Observable + | , UIScrollViewDelegate | | + +-----------+-------------------------------+ +----> Observable + | | + | +----> Observable + | | + | forwards events | + | to custom delegate | + | v + +-----------v-------------------------------+ + | | + | Custom delegate (UIScrollViewDelegate) | + | | + +-------------------------------------------+ + + +Since RxCocoa needs to automagically create those Proxys +..and because views that have delegates can be hierarchical + +UITableView : UIScrollView : UIView + +.. and corresponding delegates are also hierarchical + +UITableViewDelegate : UIScrollViewDelegate : NSObject + +.. and sometimes there can be only one proxy/delegate registered, +every view has a corresponding delegate virtual factory method. + +In case of UITableView / UIScrollView, there is + + extension UIScrollView { + public func createRxDelegateProxy() -> RxScrollViewDelegateProxy { + return RxScrollViewDelegateProxy(parentObject: base) + } + .... + + +and override in UITableView + + extension UITableView { + public override func createRxDelegateProxy() -> RxScrollViewDelegateProxy { + .... + + +*/ +public protocol DelegateProxyType : AnyObject { + /// Creates new proxy for target object. + static func createProxyForObject(_ object: AnyObject) -> AnyObject + + /// Returns assigned proxy for object. + /// + /// - parameter object: Object that can have assigned delegate proxy. + /// - returns: Assigned delegate proxy or `nil` if no delegate proxy is assigned. + static func assignedProxyFor(_ object: AnyObject) -> AnyObject? + + /// Assigns proxy to object. + /// + /// - parameter object: Object that can have assigned delegate proxy. + /// - parameter proxy: Delegate proxy object to assign to `object`. + static func assignProxy(_ proxy: AnyObject, toObject object: AnyObject) + + /// Returns designated delegate property for object. + /// + /// Objects can have multiple delegate properties. + /// + /// Each delegate property needs to have it's own type implementing `DelegateProxyType`. + /// + /// - parameter object: Object that has delegate property. + /// - returns: Value of delegate property. + static func currentDelegateFor(_ object: AnyObject) -> AnyObject? + + /// Sets designated delegate property for object. + /// + /// Objects can have multiple delegate properties. + /// + /// Each delegate property needs to have it's own type implementing `DelegateProxyType`. + /// + /// - parameter toObject: Object that has delegate property. + /// - parameter delegate: Delegate value. + static func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) + + /// Returns reference of normal delegate that receives all forwarded messages + /// through `self`. + /// + /// - returns: Value of reference if set or nil. + func forwardToDelegate() -> AnyObject? + + /// Sets reference of normal delegate that receives all forwarded messages + /// through `self`. + /// + /// - parameter forwardToDelegate: Reference of delegate that receives all messages through `self`. + /// - parameter retainDelegate: Should `self` retain `forwardToDelegate`. + func setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) +} + +extension DelegateProxyType { + /// Returns existing proxy for object or installs new instance of delegate proxy. + /// + /// - parameter object: Target object on which to install delegate proxy. + /// - returns: Installed instance of delegate proxy. + /// + /// + /// extension Reactive where Base: UISearchBar { + /// + /// public var delegate: DelegateProxy { + /// return RxSearchBarDelegateProxy.proxyForObject(base) + /// } + /// + /// public var text: ControlProperty { + /// let source: Observable = self.delegate.observe(#selector(UISearchBarDelegate.searchBar(_:textDidChange:))) + /// ... + /// } + /// } + public static func proxyForObject(_ object: AnyObject) -> Self { + MainScheduler.ensureExecutingOnScheduler() + + let maybeProxy = Self.assignedProxyFor(object) as? Self + + let proxy: Self + if let existingProxy = maybeProxy { + proxy = existingProxy + } + else { + proxy = Self.createProxyForObject(object) as! Self + Self.assignProxy(proxy, toObject: object) + assert(Self.assignedProxyFor(object) === proxy) + } + + let currentDelegate: AnyObject? = Self.currentDelegateFor(object) + + if currentDelegate !== proxy { + proxy.setForwardToDelegate(currentDelegate, retainDelegate: false) + assert(proxy.forwardToDelegate() === currentDelegate) + Self.setCurrentDelegate(proxy, toObject: object) + assert(Self.currentDelegateFor(object) === proxy) + assert(proxy.forwardToDelegate() === currentDelegate) + } + + return proxy + } + + /// Sets forward delegate for `DelegateProxyType` associated with a specific object and return disposable that can be used to unset the forward to delegate. + /// Using this method will also make sure that potential original object cached selectors are cleared and will report any accidental forward delegate mutations. + /// + /// - parameter forwardDelegate: Delegate object to set. + /// - parameter retainDelegate: Retain `forwardDelegate` while it's being set. + /// - parameter onProxyForObject: Object that has `delegate` property. + /// - returns: Disposable object that can be used to clear forward delegate. + public static func installForwardDelegate(_ forwardDelegate: AnyObject, retainDelegate: Bool, onProxyForObject object: AnyObject) -> Disposable { + weak var weakForwardDelegate: AnyObject? = forwardDelegate + + let proxy = Self.proxyForObject(object) + + assert(proxy.forwardToDelegate() === nil, "This is a feature to warn you that there is already a delegate (or data source) set somewhere previously. The action you are trying to perform will clear that delegate (data source) and that means that some of your features that depend on that delegate (data source) being set will likely stop working.\n" + + "If you are ok with this, try to set delegate (data source) to `nil` in front of this operation.\n" + + " This is the source object value: \(object)\n" + + " This this the original delegate (data source) value: \(proxy.forwardToDelegate()!)\n" + + "Hint: Maybe delegate was already set in xib or storyboard and now it's being overwritten in code.\n") + + proxy.setForwardToDelegate(forwardDelegate, retainDelegate: retainDelegate) + + // refresh properties after delegate is set + // some views like UITableView cache `respondsToSelector` + Self.setCurrentDelegate(nil, toObject: object) + Self.setCurrentDelegate(proxy, toObject: object) + + assert(proxy.forwardToDelegate() === forwardDelegate, "Setting of delegate failed:\ncurrent:\n\(proxy.forwardToDelegate())\nexpected:\n\(forwardDelegate)") + + return Disposables.create { + MainScheduler.ensureExecutingOnScheduler() + + let delegate: AnyObject? = weakForwardDelegate + + assert(delegate == nil || proxy.forwardToDelegate() === delegate, "Delegate was changed from time it was first set. Current \(proxy.forwardToDelegate()), and it should have been \(proxy)") + + proxy.setForwardToDelegate(nil, retainDelegate: retainDelegate) + } + } +} + + #if os(iOS) || os(tvOS) + import UIKit + + extension ObservableType { + func subscribeProxyDataSource(ofObject object: UIView, dataSource: AnyObject, retainDataSource: Bool, binding: @escaping (P, Event) -> Void) + -> Disposable { + let proxy = P.proxyForObject(object) + let unregisterDelegate = P.installForwardDelegate(dataSource, retainDelegate: retainDataSource, onProxyForObject: object) + // this is needed to flush any delayed old state (https://github.com/RxSwiftCommunity/RxDataSources/pull/75) + object.layoutIfNeeded() + + let subscription = self.asObservable() + .observeOn(MainScheduler()) + .catchError { error in + bindingErrorToInterface(error) + return Observable.empty() + } + // source can never end, otherwise it would release the subscriber, and deallocate the data source + .concat(Observable.never()) + .takeUntil(object.rx.deallocated) + .subscribe { [weak object] (event: Event) in + + if let object = object { + assert(proxy === P.currentDelegateFor(object), "Proxy changed from the time it was first set.\nOriginal: \(proxy)\nExisting: \(P.currentDelegateFor(object))") + } + + binding(proxy, event) + + switch event { + case .error(let error): + bindingErrorToInterface(error) + unregisterDelegate.dispose() + case .completed: + unregisterDelegate.dispose() + default: + break + } + } + + return Disposables.create { [weak object] in + subscription.dispose() + unregisterDelegate.dispose() + object?.layoutIfNeeded() + } + } + } + + #endif + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift b/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift new file mode 100644 index 0000000..96db728 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift @@ -0,0 +1,43 @@ +// +// NSLayoutConstraint+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 12/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation + +#if os(macOS) +import Cocoa +#else +import UIKit +#endif + +#if !RX_NO_MODULE +import RxSwift +#endif + +#if os(iOS) || os(macOS) || os(tvOS) +extension Reactive where Base: NSLayoutConstraint { + /// Bindable sink for `constant` property. + public var constant: UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { constraint, constant in + constraint.constant = constant + } + } + + /// Bindable sink for `active` property. + @available(iOS 8, OSX 10.10, *) + public var active: UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { constraint, value in + constraint.isActive = value + } + } +} + +#endif + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Common/Observable+Bind.swift b/Pods/RxCocoa/RxCocoa/Common/Observable+Bind.swift new file mode 100644 index 0000000..e41a40a --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/Observable+Bind.swift @@ -0,0 +1,128 @@ +// +// Observable+Bind.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 8/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension ObservableType { + + /** + Creates new subscription and sends elements to observer. + + In this form it's equivalent to `subscribe` method, but it communicates intent better, and enables + writing more consistent binding code. + + - parameter observer: Observer that receives events. + - returns: Disposable object that can be used to unsubscribe the observer. + */ + public func bindTo(_ observer: O) -> Disposable where O.E == E { + return self.subscribe(observer) + } + + /** + Creates new subscription and sends elements to observer. + + In this form it's equivalent to `subscribe` method, but it communicates intent better, and enables + writing more consistent binding code. + + - parameter observer: Observer that receives events. + - returns: Disposable object that can be used to unsubscribe the observer. + */ + public func bindTo(_ observer: O) -> Disposable where O.E == E? { + return self.map { $0 }.subscribe(observer) + } + + /** + Creates new subscription and sends elements to variable. + + In case error occurs in debug mode, `fatalError` will be raised. + In case error occurs in release mode, `error` will be logged. + + - parameter variable: Target variable for sequence elements. + - returns: Disposable object that can be used to unsubscribe the observer. + */ + public func bindTo(_ variable: Variable) -> Disposable { + return subscribe { e in + switch e { + case let .next(element): + variable.value = element + case let .error(error): + let error = "Binding error to variable: \(error)" + #if DEBUG + rxFatalError(error) + #else + print(error) + #endif + case .completed: + break + } + } + } + + /** + Creates new subscription and sends elements to variable. + + In case error occurs in debug mode, `fatalError` will be raised. + In case error occurs in release mode, `error` will be logged. + + - parameter variable: Target variable for sequence elements. + - returns: Disposable object that can be used to unsubscribe the observer. + */ + public func bindTo(_ variable: Variable) -> Disposable { + return self.map { $0 as E? }.bindTo(variable) + } + + /** + Subscribes to observable sequence using custom binder function. + + - parameter binder: Function used to bind elements from `self`. + - returns: Object representing subscription. + */ + public func bindTo(_ binder: (Self) -> R) -> R { + return binder(self) + } + + /** + Subscribes to observable sequence using custom binder function and final parameter passed to binder function + after `self` is passed. + + public func bindTo(binder: Self -> R1 -> R2, curriedArgument: R1) -> R2 { + return binder(self)(curriedArgument) + } + + - parameter binder: Function used to bind elements from `self`. + - parameter curriedArgument: Final argument passed to `binder` to finish binding process. + - returns: Object representing subscription. + */ + public func bindTo(_ binder: (Self) -> (R1) -> R2, curriedArgument: R1) -> R2 { + return binder(self)(curriedArgument) + } + + + /** + Subscribes an element handler to an observable sequence. + + In case error occurs in debug mode, `fatalError` will be raised. + In case error occurs in release mode, `error` will be logged. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func bindNext(_ onNext: @escaping (E) -> Void) -> Disposable { + return subscribe(onNext: onNext, onError: { error in + let error = "Binding error: \(error)" + #if DEBUG + rxFatalError(error) + #else + print(error) + #endif + }) + } +} diff --git a/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift b/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift new file mode 100644 index 0000000..e368b03 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift @@ -0,0 +1,162 @@ +// +// RxCocoaObjCRuntimeError+Extensions.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 10/9/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE + #if SWIFT_PACKAGE && !DISABLE_SWIZZLING && !os(Linux) + import RxCocoaRuntime + #endif +#endif + +#if !DISABLE_SWIZZLING && !os(Linux) + /// RxCocoa ObjC runtime interception mechanism. + public enum RxCocoaInterceptionMechanism { + /// Unknown message interception mechanism. + case unknown + /// Key value observing interception mechanism. + case kvo + } + + /// RxCocoa ObjC runtime modification errors. + public enum RxCocoaObjCRuntimeError + : Swift.Error + , CustomDebugStringConvertible { + /// Unknown error has occurred. + case unknown(target: AnyObject) + + /** + If the object is reporting a different class then it's real class, that means that there is probably + already some interception mechanism in place or something weird is happening. + + The most common case when this would happen is when using a combination of KVO (`observe`) and `sentMessage`. + + This error is easily resolved by just using `sentMessage` observing before `observe`. + + The reason why the other way around could create issues is because KVO will unregister it's interceptor + class and restore original class. Unfortunately that will happen no matter was there another interceptor + subclass registered in hierarchy or not. + + Failure scenario: + * KVO sets class to be `__KVO__OriginalClass` (subclass of `OriginalClass`) + * `sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`) + * then unobserving with KVO will restore class to be `OriginalClass` -> failure point (possibly a bug in KVO) + + The reason why changing order of observing works is because any interception method on unregistration + should return object's original real class (if that doesn't happen then it's really easy to argue that's a bug + in that interception mechanism). + + This library won't remove registered interceptor even if there aren't any observers left because + it's highly unlikely it would have any benefit in real world use cases, and it's even more + dangerous. + */ + case objectMessagesAlreadyBeingIntercepted(target: AnyObject, interceptionMechanism: RxCocoaInterceptionMechanism) + + /// Trying to observe messages for selector that isn't implemented. + case selectorNotImplemented(target: AnyObject) + + /// Core Foundation classes are usually toll free bridged. Those classes crash the program in case + /// `object_setClass` is performed on them. + /// + /// There is a possibility to just swizzle methods on original object, but since those won't be usual use + /// cases for this library, then an error will just be reported for now. + case cantInterceptCoreFoundationTollFreeBridgedObjects(target: AnyObject) + + /// Two libraries have simultaneously tried to modify ObjC runtime and that was detected. This can only + /// happen in scenarios where multiple interception libraries are used. + /// + /// To synchronize other libraries intercepting messages for an object, use `synchronized` on target object and + /// it's meta-class. + case threadingCollisionWithOtherInterceptionMechanism(target: AnyObject) + + /// For some reason saving original method implementation under RX namespace failed. + case savingOriginalForwardingMethodFailed(target: AnyObject) + + /// Intercepting a sent message by replacing a method implementation with `_objc_msgForward` failed for some reason. + case replacingMethodWithForwardingImplementation(target: AnyObject) + + /// Attempt to intercept one of the performance sensitive methods: + /// * class + /// * respondsToSelector: + /// * methodSignatureForSelector: + /// * forwardingTargetForSelector: + case observingPerformanceSensitiveMessages(target: AnyObject) + + /// Message implementation has unsupported return type (for example large struct). The reason why this is a error + /// is because in some cases intercepting sent messages requires replacing implementation with `_objc_msgForward_stret` + /// instead of `_objc_msgForward`. + /// + /// The unsupported cases should be fairly uncommon. + case observingMessagesWithUnsupportedReturnType(target: AnyObject) + } + + extension RxCocoaObjCRuntimeError { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + switch self { + case let .unknown(target): + return "Unknown error occurred.\nTarget: `\(target)`" + case let .objectMessagesAlreadyBeingIntercepted(target, interceptionMechanism): + let interceptionMechanismDescription = interceptionMechanism == .kvo ? "KVO" : "other interception mechanism" + return "Collision between RxCocoa interception mechanism and \(interceptionMechanismDescription)." + + " To resolve this conflict please use this interception mechanism first.\nTarget: \(target)" + case let .selectorNotImplemented(target): + return "Trying to observe messages for selector that isn't implemented.\nTarget: \(target)" + case let .cantInterceptCoreFoundationTollFreeBridgedObjects(target): + return "Interception of messages sent to Core Foundation isn't supported.\nTarget: \(target)" + case let .threadingCollisionWithOtherInterceptionMechanism(target): + return "Detected a conflict while modifying ObjC runtime.\nTarget: \(target)" + case let .savingOriginalForwardingMethodFailed(target): + return "Saving original method implementation failed.\nTarget: \(target)" + case let .replacingMethodWithForwardingImplementation(target): + return "Intercepting a sent message by replacing a method implementation with `_objc_msgForward` failed for some reason.\nTarget: \(target)" + case let .observingPerformanceSensitiveMessages(target): + return "Attempt to intercept one of the performance sensitive methods. \nTarget: \(target)" + case let .observingMessagesWithUnsupportedReturnType(target): + return "Attempt to intercept a method with unsupported return type. \nTarget: \(target)" + } + } + } + + // MARK: Conversions `NSError` > `RxCocoaObjCRuntimeError` + + extension Error { + func rxCocoaErrorForTarget(_ target: AnyObject) -> RxCocoaObjCRuntimeError { + let error = self as NSError + + if error.domain == RXObjCRuntimeErrorDomain { + let errorCode = RXObjCRuntimeError(rawValue: error.code) ?? .unknown + + switch errorCode { + case .unknown: + return .unknown(target: target) + case .objectMessagesAlreadyBeingIntercepted: + let isKVO = (error.userInfo[RXObjCRuntimeErrorIsKVOKey] as? NSNumber)?.boolValue ?? false + return .objectMessagesAlreadyBeingIntercepted(target: target, interceptionMechanism: isKVO ? .kvo : .unknown) + case .selectorNotImplemented: + return .selectorNotImplemented(target: target) + case .cantInterceptCoreFoundationTollFreeBridgedObjects: + return .cantInterceptCoreFoundationTollFreeBridgedObjects(target: target) + case .threadingCollisionWithOtherInterceptionMechanism: + return .threadingCollisionWithOtherInterceptionMechanism(target: target) + case .savingOriginalForwardingMethodFailed: + return .savingOriginalForwardingMethodFailed(target: target) + case .replacingMethodWithForwardingImplementation: + return .replacingMethodWithForwardingImplementation(target: target) + case .observingPerformanceSensitiveMessages: + return .observingPerformanceSensitiveMessages(target: target) + case .observingMessagesWithUnsupportedReturnType: + return .observingMessagesWithUnsupportedReturnType(target: target) + } + } + + return RxCocoaObjCRuntimeError.unknown(target: target) + } + } + +#endif + diff --git a/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift b/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift new file mode 100644 index 0000000..804bd91 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift @@ -0,0 +1,44 @@ +// +// RxTarget.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 7/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +class RxTarget : NSObject + , Disposable { + + private var retainSelf: RxTarget? + + override init() { + super.init() + self.retainSelf = self + +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + +#if DEBUG + MainScheduler.ensureExecutingOnScheduler() +#endif + } + + func dispose() { +#if DEBUG + MainScheduler.ensureExecutingOnScheduler() +#endif + self.retainSelf = nil + } + +#if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } +#endif +} diff --git a/Pods/RxCocoa/RxCocoa/Common/SectionedViewDataSourceType.swift b/Pods/RxCocoa/RxCocoa/Common/SectionedViewDataSourceType.swift new file mode 100644 index 0000000..5c3cf3c --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/SectionedViewDataSourceType.swift @@ -0,0 +1,20 @@ +// +// SectionedViewDataSourceType.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 1/10/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Data source with access to underlying sectioned model. +public protocol SectionedViewDataSourceType { + /// Returns model at index path. + /// + /// In case data source doesn't contain any sections when this method is being called, `RxCocoaError.ItemsNotYetBound(object: self)` is thrown. + + /// - parameter indexPath: Model index path + /// - returns: Model at index path. + func model(at indexPath: IndexPath) throws -> Any +} diff --git a/Pods/RxCocoa/RxCocoa/Common/TextInput.swift b/Pods/RxCocoa/RxCocoa/Common/TextInput.swift new file mode 100644 index 0000000..5f139ea --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Common/TextInput.swift @@ -0,0 +1,82 @@ +// +// TextInput.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/12/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +#if !RX_NO_MODULE + import RxSwift +#endif + +#if os(iOS) || os(tvOS) + import UIKit + + /// Represents text input with reactive extensions. + public struct TextInput { + /// Base text input to extend. + public let base: Base + + /// Reactive wrapper for `text` property. + public let text: ControlProperty + + /// Initializes new text input. + /// + /// - parameter base: Base object. + /// - parameter text: Textual control property. + public init(base: Base, text: ControlProperty) { + self.base = base + self.text = text + } + } + + extension Reactive where Base: UITextField { + /// Reactive text input. + public var textInput: TextInput { + return TextInput(base: base, text: self.text) + } + } + + extension Reactive where Base: UITextView { + /// Reactive text input. + public var textInput: TextInput { + return TextInput(base: base, text: self.text) + } + } + +#endif + +#if os(macOS) + import Cocoa + + /// Represents text input with reactive extensions. + public struct TextInput { + /// Base text input to extend. + public let base: Base + + /// Reactive wrapper for `text` property. + public let text: ControlProperty + + /// Initializes new text input. + /// + /// - parameter base: Base object. + /// - parameter text: Textual control property. + public init(base: Base, text: ControlProperty) { + self.base = base + self.text = text + } + } + + extension Reactive where Base: NSTextField, Base: NSTextInputClient { + /// Reactive text input. + public var textInput: TextInput { + return TextInput(base: base, text: self.text) + } + } + +#endif + + diff --git a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift new file mode 100644 index 0000000..61ef1db --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift @@ -0,0 +1,69 @@ +// +// KVORepresentable+CoreGraphics.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif +import CoreGraphics + +#if arch(x86_64) || arch(arm64) +let CGRectType = "{CGRect={CGPoint=dd}{CGSize=dd}}" +let CGSizeType = "{CGSize=dd}" +let CGPointType = "{CGPoint=dd}" +#elseif arch(i386) || arch(arm) +let CGRectType = "{CGRect={CGPoint=ff}{CGSize=ff}}" +let CGSizeType = "{CGSize=ff}" +let CGPointType = "{CGPoint=ff}" +#endif + +extension CGRect : KVORepresentable { + public typealias KVOType = NSValue + + /// Constructs self from `NSValue`. + public init?(KVOValue: KVOType) { + if strcmp(KVOValue.objCType, CGRectType) != 0 { + return nil + } + var typedValue = CGRect(x: 0, y: 0, width: 0, height: 0) + KVOValue.getValue(&typedValue) + self = typedValue + } +} + +extension CGPoint : KVORepresentable { + public typealias KVOType = NSValue + + /// Constructs self from `NSValue`. + public init?(KVOValue: KVOType) { + if strcmp(KVOValue.objCType, CGPointType) != 0 { + return nil + } + var typedValue = CGPoint(x: 0, y: 0) + KVOValue.getValue(&typedValue) + self = typedValue + } +} + +extension CGSize : KVORepresentable { + public typealias KVOType = NSValue + + /// Constructs self from `NSValue`. + public init?(KVOValue: KVOType) { + if strcmp(KVOValue.objCType, CGSizeType) != 0 { + return nil + } + var typedValue = CGSize(width: 0, height: 0) + KVOValue.getValue(&typedValue) + self = typedValue + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+Swift.swift b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+Swift.swift new file mode 100644 index 0000000..00d53dd --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+Swift.swift @@ -0,0 +1,88 @@ +// +// KVORepresentable+Swift.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +extension Int : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.int32Value) + } +} + +extension Int32 : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.int32Value) + } +} + +extension Int64 : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.int64Value) + } +} + +extension UInt : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.uintValue) + } +} + +extension UInt32 : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.uint32Value) + } +} + +extension UInt64 : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.uint64Value) + } +} + +extension Bool : KVORepresentable { + public typealias KVOType = NSNumber + + /// Constructs `Self` using KVO value. + public init?(KVOValue: KVOType) { + self.init(KVOValue.boolValue) + } +} + + +extension RawRepresentable where RawValue: KVORepresentable { + /// Constructs `Self` using optional KVO value. + init?(KVOValue: RawValue.KVOType?) { + guard let KVOValue = KVOValue else { + return nil + } + + guard let rawValue = RawValue(KVOValue: KVOValue) else { + return nil + } + + self.init(rawValue: rawValue) + } +} diff --git a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable.swift b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable.swift new file mode 100644 index 0000000..ad59682 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable.swift @@ -0,0 +1,30 @@ +// +// KVORepresentable.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Type that is KVO representable (KVO mechanism can be used to observe it). +public protocol KVORepresentable { + /// Associated KVO type. + associatedtype KVOType + + /// Constructs `Self` using KVO value. + init?(KVOValue: KVOType) +} + +extension KVORepresentable { + /// Initializes `KVORepresentable` with optional value. + init?(KVOValue: KVOType?) { + guard let KVOValue = KVOValue else { + return nil + } + + self.init(KVOValue: KVOValue) + } +} + diff --git a/Pods/RxCocoa/RxCocoa/Foundation/Logging.swift b/Pods/RxCocoa/RxCocoa/Foundation/Logging.swift new file mode 100644 index 0000000..8b821ca --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/Logging.swift @@ -0,0 +1,23 @@ +// +// Logging.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 4/3/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Simple logging settings for RxCocoa library. +public struct Logging { + public typealias LogURLRequest = (URLRequest) -> Bool + + /// Log URL requests to standard output in curl format. + public static var URLRequests: LogURLRequest = { _ in + #if DEBUG + return true + #else + return false + #endif + } +} diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSNotificationCenter+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSNotificationCenter+Rx.swift new file mode 100644 index 0000000..66703d6 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/NSNotificationCenter+Rx.swift @@ -0,0 +1,33 @@ +// +// NSNotificationCenter+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +extension Reactive where Base: NotificationCenter { + /** + Transforms notifications posted to notification center to observable sequence of notifications. + + - parameter name: Optional name used to filter notifications. + - parameter object: Optional object used to filter notifications. + - returns: Observable sequence of posted notifications. + */ + public func notification(_ name: Notification.Name?, object: AnyObject? = nil) -> Observable { + return Observable.create { [weak object] observer in + let nsObserver = self.base.addObserver(forName: name, object: object, queue: nil) { notification in + observer.on(.next(notification)) + } + + return Disposables.create { + self.base.removeObserver(nsObserver) + } + } + } +} diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift new file mode 100644 index 0000000..cb2573c --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift @@ -0,0 +1,47 @@ +// +// NSObject+Rx+KVORepresentable.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + +extension Reactive where Base: NSObject { + + /** + Specialization of generic `observe` method. + + This is a special overload because to observe values of some type (for example `Int`), first values of KVO type + need to be observed (`NSNumber`), and then converted to result type. + + For more information take a look at `observe` method. + */ + public func observe(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable { + return observe(E.KVOType.self, keyPath, options: options, retainSelf: retainSelf) + .map(E.init) + } +} + +#if !DISABLE_SWIZZLING && !os(Linux) + // KVO + extension Reactive where Base: NSObject { + /** + Specialization of generic `observeWeakly` method. + + For more information take a look at `observeWeakly` method. + */ + public func observeWeakly(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable { + return observeWeakly(E.KVOType.self, keyPath, options: options) + .map(E.init) + } + } +#endif + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift new file mode 100644 index 0000000..897cdb3 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift @@ -0,0 +1,53 @@ +// +// NSObject+Rx+RawRepresentable.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 11/9/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE + import RxSwift +#endif + +extension Reactive where Base: NSObject { + /** + Specialization of generic `observe` method. + + This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value. + + It is useful for observing bridged ObjC enum values. + + For more information take a look at `observe` method. + */ + public func observe(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable where E.RawValue: KVORepresentable { + return observe(E.RawValue.KVOType.self, keyPath, options: options, retainSelf: retainSelf) + .map(E.init) + } +} + +#if !DISABLE_SWIZZLING + + // observeWeakly + RawRepresentable + extension Reactive where Base: NSObject { + + /** + Specialization of generic `observeWeakly` method. + + This specialization first observes `KVORepresentable` value and then converts it to `RawRepresentable` value. + + It is useful for observing bridged ObjC enum values. + + For more information take a look at `observeWeakly` method. + */ + public func observeWeakly(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable where E.RawValue: KVORepresentable { + return observeWeakly(E.RawValue.KVOType.self, keyPath, options: options) + .map(E.init) + } + } +#endif + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift new file mode 100644 index 0000000..270d16c --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift @@ -0,0 +1,532 @@ +// +// NSObject+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if !os(Linux) + +import Foundation +#if !RX_NO_MODULE + import RxSwift + #if SWIFT_PACKAGE && !DISABLE_SWIZZLING && !os(Linux) + import RxCocoaRuntime + #endif +#endif + +#if !DISABLE_SWIZZLING && !os(Linux) +fileprivate var deallocatingSubjectTriggerContext: UInt8 = 0 +fileprivate var deallocatingSubjectContext: UInt8 = 0 +#endif +fileprivate var deallocatedSubjectTriggerContext: UInt8 = 0 +fileprivate var deallocatedSubjectContext: UInt8 = 0 + +#if !os(Linux) + +/** +KVO is a tricky mechanism. + +When observing child in a ownership hierarchy, usually retaining observing target is wanted behavior. +When observing parent in a ownership hierarchy, usually retaining target isn't wanter behavior. + +KVO with weak references is especially tricky. For it to work, some kind of swizzling is required. +That can be done by + * replacing object class dynamically (like KVO does) + * by swizzling `dealloc` method on all instances for a class. + * some third method ... + +Both approaches can fail in certain scenarios: + * problems arise when swizzlers return original object class (like KVO does when nobody is observing) + * Problems can arise because replacing dealloc method isn't atomic operation (get implementation, + set implementation). + +Second approach is chosen. It can fail in case there are multiple libraries dynamically trying +to replace dealloc method. In case that isn't the case, it should be ok. +*/ +extension Reactive where Base: NSObject { + + + /** + Observes values on `keyPath` starting from `self` with `options` and retains `self` if `retainSelf` is set. + + `observe` is just a simple and performant wrapper around KVO mechanism. + + * it can be used to observe paths starting from `self` or from ancestors in ownership graph (`retainSelf = false`) + * it can be used to observe paths starting from descendants in ownership graph (`retainSelf = true`) + * the paths have to consist only of `strong` properties, otherwise you are risking crashing the system by not unregistering KVO observer before dealloc. + + If support for weak properties is needed or observing arbitrary or unknown relationships in the + ownership tree, `observeWeakly` is the preferred option. + + - parameter keyPath: Key path of property names to observe. + - parameter options: KVO mechanism notification options. + - parameter retainSelf: Retains self during observation if set `true`. + - returns: Observable sequence of objects on `keyPath`. + */ + public func observe(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable { + return KVOObservable(object: base, keyPath: keyPath, options: options, retainTarget: retainSelf).asObservable() + } +} + +#endif + +#if !DISABLE_SWIZZLING && !os(Linux) +// KVO +extension Reactive where Base: NSObject { + /** + Observes values on `keyPath` starting from `self` with `options` and doesn't retain `self`. + + It can be used in all cases where `observe` can be used and additionally + + * because it won't retain observed target, it can be used to observe arbitrary object graph whose ownership relation is unknown + * it can be used to observe `weak` properties + + **Since it needs to intercept object deallocation process it needs to perform swizzling of `dealloc` method on observed object.** + + - parameter keyPath: Key path of property names to observe. + - parameter options: KVO mechanism notification options. + - returns: Observable sequence of objects on `keyPath`. + */ + public func observeWeakly(_ type: E.Type, _ keyPath: String, options: NSKeyValueObservingOptions = [.new, .initial]) -> Observable { + return observeWeaklyKeyPathFor(base, keyPath: keyPath, options: options) + .map { n in + return n as? E + } + } +} +#endif + +// Dealloc +extension Reactive where Base: AnyObject { + + /** + Observable sequence of object deallocated events. + + After object is deallocated one `()` element will be produced and sequence will immediately complete. + + - returns: Observable sequence of object deallocated events. + */ + public var deallocated: Observable { + return synchronized { + if let deallocObservable = objc_getAssociatedObject(base, &deallocatedSubjectContext) as? DeallocObservable { + return deallocObservable._subject + } + + let deallocObservable = DeallocObservable() + + objc_setAssociatedObject(base, &deallocatedSubjectContext, deallocObservable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + return deallocObservable._subject + } + } + +#if !DISABLE_SWIZZLING && !os(Linux) + + /** + Observable sequence of message arguments that completes when object is deallocated. + + Each element is produced before message is invoked on target object. `methodInvoked` + exists in case observing of invoked messages is needed. + + In case an error occurs sequence will fail with `RxCocoaObjCRuntimeError`. + + In case some argument is `nil`, instance of `NSNull()` will be sent. + + - returns: Observable sequence of object deallocating events. + */ + public func sentMessage(_ selector: Selector) -> Observable<[Any]> { + return synchronized { + // in case of dealloc selector replay subject behavior needs to be used + if selector == deallocSelector { + return deallocating.map { _ in [] } + } + + do { + let proxy: MessageSentProxy = try registerMessageInterceptor(selector) + return proxy.messageSent.asObservable() + } + catch let e { + return Observable.error(e) + } + } + } + + /** + Observable sequence of message arguments that completes when object is deallocated. + + Each element is produced after message is invoked on target object. `sentMessage` + exists in case interception of sent messages before they were invoked is needed. + + In case an error occurs sequence will fail with `RxCocoaObjCRuntimeError`. + + In case some argument is `nil`, instance of `NSNull()` will be sent. + + - returns: Observable sequence of object deallocating events. + */ + public func methodInvoked(_ selector: Selector) -> Observable<[Any]> { + return synchronized { + // in case of dealloc selector replay subject behavior needs to be used + if selector == deallocSelector { + return deallocated.map { _ in [] } + } + + + do { + let proxy: MessageSentProxy = try registerMessageInterceptor(selector) + return proxy.methodInvoked.asObservable() + } + catch let e { + return Observable.error(e) + } + } + } + + /** + Observable sequence of object deallocating events. + + When `dealloc` message is sent to `self` one `()` element will be produced and after object is deallocated sequence + will immediately complete. + + In case an error occurs sequence will fail with `RxCocoaObjCRuntimeError`. + + - returns: Observable sequence of object deallocating events. + */ + public var deallocating: Observable<()> { + return synchronized { + do { + let proxy: DeallocatingProxy = try registerMessageInterceptor(deallocSelector) + return proxy.messageSent.asObservable() + } + catch let e { + return Observable.error(e) + } + } + } + + fileprivate func registerMessageInterceptor(_ selector: Selector) throws -> T { + let rxSelector = RX_selector(selector) + let selectorReference = RX_reference_from_selector(rxSelector) + + let subject: T + if let existingSubject = objc_getAssociatedObject(base, selectorReference) as? T { + subject = existingSubject + } + else { + subject = T() + objc_setAssociatedObject( + base, + selectorReference, + subject, + .OBJC_ASSOCIATION_RETAIN_NONATOMIC + ) + } + + if subject.isActive { + return subject + } + + var error: NSError? + let targetImplementation = RX_ensure_observing(base, selector, &error) + if targetImplementation == nil { + throw error?.rxCocoaErrorForTarget(base) ?? RxCocoaError.unknown + } + + subject.targetImplementation = targetImplementation! + + return subject + } +#endif +} + +// MARK: Message interceptors + +#if !DISABLE_SWIZZLING && !os(Linux) + + fileprivate protocol MessageInterceptorSubject: class { + init() + + var isActive: Bool { + get + } + + var targetImplementation: IMP { get set } + } + + fileprivate final class DeallocatingProxy + : MessageInterceptorSubject + , RXDeallocatingObserver { + typealias E = () + + let messageSent = ReplaySubject<()>.create(bufferSize: 1) + + @objc var targetImplementation: IMP = RX_default_target_implementation() + + var isActive: Bool { + return targetImplementation != RX_default_target_implementation() + } + + init() { + } + + @objc func deallocating() -> Void { + messageSent.on(.next()) + } + + deinit { + messageSent.on(.completed) + } + } + + fileprivate final class MessageSentProxy + : MessageInterceptorSubject + , RXMessageSentObserver { + typealias E = [AnyObject] + + let messageSent = PublishSubject<[Any]>() + let methodInvoked = PublishSubject<[Any]>() + + @objc var targetImplementation: IMP = RX_default_target_implementation() + + var isActive: Bool { + return targetImplementation != RX_default_target_implementation() + } + + init() { + } + + @objc func messageSent(withArguments arguments: [Any]) -> Void { + messageSent.on(.next(arguments)) + } + + @objc func methodInvoked(withArguments arguments: [Any]) -> Void { + methodInvoked.on(.next(arguments)) + } + + deinit { + messageSent.on(.completed) + methodInvoked.on(.completed) + } + } + +#endif + + +fileprivate class DeallocObservable { + let _subject = ReplaySubject.create(bufferSize:1) + + init() { + } + + deinit { + _subject.on(.next(())) + _subject.on(.completed) + } +} + +// MARK: KVO + +#if !os(Linux) + +fileprivate protocol KVOObservableProtocol { + var target: AnyObject { get } + var keyPath: String { get } + var retainTarget: Bool { get } + var options: NSKeyValueObservingOptions { get } +} + +fileprivate class KVOObserver + : _RXKVOObserver + , Disposable { + typealias Callback = (Any?) -> Void + + var retainSelf: KVOObserver? = nil + + init(parent: KVOObservableProtocol, callback: @escaping Callback) { + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + #endif + + super.init(target: parent.target, retainTarget: parent.retainTarget, keyPath: parent.keyPath, options: parent.options, callback: callback) + self.retainSelf = self + } + + override func dispose() { + super.dispose() + self.retainSelf = nil + } + + deinit { + #if TRACE_RESOURCES + _ = Resources.decrementTotal() + #endif + } +} + +fileprivate class KVOObservable + : ObservableType + , KVOObservableProtocol { + typealias E = Element? + + unowned var target: AnyObject + var strongTarget: AnyObject? + + var keyPath: String + var options: NSKeyValueObservingOptions + var retainTarget: Bool + + init(object: AnyObject, keyPath: String, options: NSKeyValueObservingOptions, retainTarget: Bool) { + self.target = object + self.keyPath = keyPath + self.options = options + self.retainTarget = retainTarget + if retainTarget { + self.strongTarget = object + } + } + + func subscribe(_ observer: O) -> Disposable where O.E == Element? { + let observer = KVOObserver(parent: self) { (value) in + if value as? NSNull != nil { + observer.on(.next(nil)) + return + } + observer.on(.next(value as? Element)) + } + + return Disposables.create(with: observer.dispose) + } + +} + +#endif + +#if !DISABLE_SWIZZLING && !os(Linux) + + fileprivate func observeWeaklyKeyPathFor(_ target: NSObject, keyPath: String, options: NSKeyValueObservingOptions) -> Observable { + let components = keyPath.components(separatedBy: ".").filter { $0 != "self" } + + let observable = observeWeaklyKeyPathFor(target, keyPathSections: components, options: options) + .finishWithNilWhenDealloc(target) + + if !options.intersection(.initial).isEmpty { + return observable + } + else { + return observable + .skip(1) + } + } + + // This should work correctly + // Identifiers can't contain `,`, so the only place where `,` can appear + // is as a delimiter. + // This means there is `W` as element in an array of property attributes. + fileprivate func isWeakProperty(_ properyRuntimeInfo: String) -> Bool { + return properyRuntimeInfo.range(of: ",W,") != nil + } + + fileprivate extension ObservableType where E == AnyObject? { + func finishWithNilWhenDealloc(_ target: NSObject) + -> Observable { + let deallocating = target.rx.deallocating + + return deallocating + .map { _ in + return Observable.just(nil) + } + .startWith(self.asObservable()) + .switchLatest() + } + } + + fileprivate func observeWeaklyKeyPathFor( + _ target: NSObject, + keyPathSections: [String], + options: NSKeyValueObservingOptions + ) -> Observable { + + weak var weakTarget: AnyObject? = target + + let propertyName = keyPathSections[0] + let remainingPaths = Array(keyPathSections[1.. + + // KVO recursion for value changes + return propertyObservable + .flatMapLatest { (nextTarget: AnyObject?) -> Observable in + if nextTarget == nil { + return Observable.just(nil) + } + let nextObject = nextTarget! as? NSObject + + let strongTarget: AnyObject? = weakTarget + + if nextObject == nil { + return Observable.error(RxCocoaError.invalidObjectOnKeyPath(object: nextTarget!, sourceObject: strongTarget ?? NSNull(), propertyName: propertyName)) + } + + // if target is alive, then send change + // if it's deallocated, don't send anything + if strongTarget == nil { + return Observable.empty() + } + + let nextElementsObservable = keyPathSections.count == 1 + ? Observable.just(nextTarget) + : observeWeaklyKeyPathFor(nextObject!, keyPathSections: remainingPaths, options: options) + + if isWeak { + return nextElementsObservable + .finishWithNilWhenDealloc(nextObject!) + } + else { + return nextElementsObservable + } + } + } +#endif + +// MARK Constants + +fileprivate let deallocSelector = NSSelectorFromString("dealloc") + +// MARK: AnyObject + Reactive + +extension Reactive where Base: AnyObject { + func synchronized( _ action: () -> T) -> T { + objc_sync_enter(self.base) + let result = action() + objc_sync_exit(self.base) + return result + } +} + +extension Reactive where Base: AnyObject { + /** + Helper to make sure that `Observable` returned from `createCachedObservable` is only created once. + This is important because there is only one `target` and `action` properties on `NSControl` or `UIBarButtonItem`. + */ + func lazyInstanceObservable(_ key: UnsafeRawPointer, createCachedObservable: () -> T) -> T { + if let value = objc_getAssociatedObject(base, key) { + return value as! T + } + + let observable = createCachedObservable() + + objc_setAssociatedObject(base, key, observable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + + return observable + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/URLSession+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/URLSession+Rx.swift new file mode 100644 index 0000000..57d5737 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Foundation/URLSession+Rx.swift @@ -0,0 +1,226 @@ +// +// URLSession+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 3/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif + +/// RxCocoa URL errors. +public enum RxCocoaURLError + : Swift.Error { + /// Unknown error occurred. + case unknown + /// Response is not NSHTTPURLResponse + case nonHTTPResponse(response: URLResponse) + /// Response is not successful. (not in `200 ..< 300` range) + case httpRequestFailed(response: HTTPURLResponse, data: Data?) + /// Deserialization error. + case deserializationError(error: Swift.Error) +} + +extension RxCocoaURLError + : CustomDebugStringConvertible { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + switch self { + case .unknown: + return "Unknown error has occurred." + case let .nonHTTPResponse(response): + return "Response is not NSHTTPURLResponse `\(response)`." + case let .httpRequestFailed(response, _): + return "HTTP request failed with `\(response.statusCode)`." + case let .deserializationError(error): + return "Error during deserialization of the response: \(error)" + } + } +} + +fileprivate func escapeTerminalString(_ value: String) -> String { + return value.replacingOccurrences(of: "\"", with: "\\\"", options:[], range: nil) +} + +fileprivate func convertURLRequestToCurlCommand(_ request: URLRequest) -> String { + let method = request.httpMethod ?? "GET" + var returnValue = "curl -X \(method) " + + if let httpBody = request.httpBody, request.httpMethod == "POST" { + let maybeBody = String(data: httpBody, encoding: String.Encoding.utf8) + if let body = maybeBody { + returnValue += "-d \"\(escapeTerminalString(body))\" " + } + } + + for (key, value) in request.allHTTPHeaderFields ?? [:] { + let escapedKey = escapeTerminalString(key as String) + let escapedValue = escapeTerminalString(value as String) + returnValue += "\n -H \"\(escapedKey): \(escapedValue)\" " + } + + let URLString = request.url?.absoluteString ?? "" + + returnValue += "\n\"\(escapeTerminalString(URLString))\"" + + returnValue += " -i -v" + + return returnValue +} + +fileprivate func convertResponseToString(_ data: Data!, _ response: URLResponse!, _ error: NSError!, _ interval: TimeInterval) -> String { + let ms = Int(interval * 1000) + + if let response = response as? HTTPURLResponse { + if 200 ..< 300 ~= response.statusCode { + return "Success (\(ms)ms): Status \(response.statusCode)" + } + else { + return "Failure (\(ms)ms): Status \(response.statusCode)" + } + } + + if let error = error { + if error.domain == NSURLErrorDomain && error.code == NSURLErrorCancelled { + return "Cancelled (\(ms)ms)" + } + return "Failure (\(ms)ms): NSError > \(error)" + } + + return "" +} + +extension Reactive where Base: URLSession { + /** + Observable sequence of responses for URL request. + + Performing of request starts after observer is subscribed and not after invoking this method. + + **URL requests will be performed per subscribed observer.** + + Any error during fetching of the response will cause observed sequence to terminate with error. + + - parameter request: URL request. + - returns: Observable sequence of URL responses. + */ + public func response(request: URLRequest) -> Observable<(HTTPURLResponse, Data)> { + return Observable.create { observer in + + // smart compiler should be able to optimize this out + let d: Date? + + if Logging.URLRequests(request) { + d = Date() + } + else { + d = nil + } + + let task = self.base.dataTask(with: request) { (data, response, error) in + + if Logging.URLRequests(request) { + let interval = Date().timeIntervalSince(d ?? Date()) + print(convertURLRequestToCurlCommand(request)) + print(convertResponseToString(data, response, error as NSError!, interval)) + } + + guard let response = response, let data = data else { + observer.on(.error(error ?? RxCocoaURLError.unknown)) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + observer.on(.error(RxCocoaURLError.nonHTTPResponse(response: response))) + return + } + + observer.on(.next(httpResponse, data)) + observer.on(.completed) + } + + + let t = task + t.resume() + + return Disposables.create(with: task.cancel) + } + } + + /** + Observable sequence of response data for URL request. + + Performing of request starts after observer is subscribed and not after invoking this method. + + **URL requests will be performed per subscribed observer.** + + Any error during fetching of the response will cause observed sequence to terminate with error. + + If response is not HTTP response with status code in the range of `200 ..< 300`, sequence + will terminate with `(RxCocoaErrorDomain, RxCocoaError.NetworkError)`. + + - parameter request: URL request. + - returns: Observable sequence of response data. + */ + public func data(request: URLRequest) -> Observable { + return response(request: request).map { (response, data) -> Data in + if 200 ..< 300 ~= response.statusCode { + return data + } + else { + throw RxCocoaURLError.httpRequestFailed(response: response, data: data) + } + } + } + + /** + Observable sequence of response JSON for URL request. + + Performing of request starts after observer is subscribed and not after invoking this method. + + **URL requests will be performed per subscribed observer.** + + Any error during fetching of the response will cause observed sequence to terminate with error. + + If response is not HTTP response with status code in the range of `200 ..< 300`, sequence + will terminate with `(RxCocoaErrorDomain, RxCocoaError.NetworkError)`. + + If there is an error during JSON deserialization observable sequence will fail with that error. + + - parameter request: URL request. + - returns: Observable sequence of response JSON. + */ + public func json(request: URLRequest, options: JSONSerialization.ReadingOptions = []) -> Observable { + return data(request: request).map { (data) -> Any in + do { + return try JSONSerialization.jsonObject(with: data, options: options) + } catch let error { + throw RxCocoaURLError.deserializationError(error: error) + } + } + } + + /** + Observable sequence of response JSON for GET request with `URL`. + + Performing of request starts after observer is subscribed and not after invoking this method. + + **URL requests will be performed per subscribed observer.** + + Any error during fetching of the response will cause observed sequence to terminate with error. + + If response is not HTTP response with status code in the range of `200 ..< 300`, sequence + will terminate with `(RxCocoaErrorDomain, RxCocoaError.NetworkError)`. + + If there is an error during JSON deserialization observable sequence will fail with that error. + + - parameter url: URL of `NSURLRequest` request. + - returns: Observable sequence of response JSON. + */ + public func json(url: Foundation.URL) -> Observable { + return json(request: URLRequest(url: url)) + } +} + diff --git a/Pods/RxCocoa/RxCocoa/Runtime/_RX.m b/Pods/RxCocoa/RxCocoa/Runtime/_RX.m new file mode 100644 index 0000000..cffbfbc --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/_RX.m @@ -0,0 +1,10 @@ +// +// _RX.m +// RxCocoa +// +// Created by Krunoslav Zaher on 7/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import "include/_RX.h" + diff --git a/Pods/RxCocoa/RxCocoa/Runtime/_RXDelegateProxy.m b/Pods/RxCocoa/RxCocoa/Runtime/_RXDelegateProxy.m new file mode 100644 index 0000000..d0333a0 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/_RXDelegateProxy.m @@ -0,0 +1,153 @@ +// +// _RXDelegateProxy.m +// RxCocoa +// +// Created by Krunoslav Zaher on 7/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import "include/_RXDelegateProxy.h" +#import "include/_RX.h" +#import "include/_RXObjCRuntime.h" + +@interface _RXDelegateProxy () { + id __weak __forwardToDelegate; +} + +@property (nonatomic, strong) id strongForwardDelegate; + +@end + +static NSMutableDictionary *forwardableSelectorsPerClass = nil; + +@implementation _RXDelegateProxy + ++(NSSet*)collectSelectorsForProtocol:(Protocol *)protocol { + NSMutableSet *selectors = [NSMutableSet set]; + + unsigned int protocolMethodCount = 0; + struct objc_method_description *pMethods = protocol_copyMethodDescriptionList(protocol, NO, YES, &protocolMethodCount); + + for (unsigned int i = 0; i < protocolMethodCount; ++i) { + struct objc_method_description method = pMethods[i]; + if (RX_is_method_with_description_void(method)) { + [selectors addObject:SEL_VALUE(method.name)]; + } + } + + free(pMethods); + + unsigned int numberOfBaseProtocols = 0; + Protocol * __unsafe_unretained * pSubprotocols = protocol_copyProtocolList(protocol, &numberOfBaseProtocols); + + for (unsigned int i = 0; i < numberOfBaseProtocols; ++i) { + [selectors unionSet:[self collectSelectorsForProtocol:pSubprotocols[i]]]; + } + + free(pSubprotocols); + + return selectors; +} + ++(void)initialize { + @synchronized (_RXDelegateProxy.class) { + if (forwardableSelectorsPerClass == nil) { + forwardableSelectorsPerClass = [[NSMutableDictionary alloc] init]; + } + + NSMutableSet *allowedSelectors = [NSMutableSet set]; + +#define CLASS_HIERARCHY_MAX_DEPTH 100 + + NSInteger classHierarchyDepth = 0; + Class targetClass = NULL; + + for (classHierarchyDepth = 0, targetClass = self; + classHierarchyDepth < CLASS_HIERARCHY_MAX_DEPTH && targetClass != nil; + ++classHierarchyDepth, targetClass = class_getSuperclass(targetClass) + ) { + unsigned int count; + Protocol *__unsafe_unretained *pProtocols = class_copyProtocolList(targetClass, &count); + + for (unsigned int i = 0; i < count; i++) { + NSSet *selectorsForProtocol = [self collectSelectorsForProtocol:pProtocols[i]]; + [allowedSelectors unionSet:selectorsForProtocol]; + } + + free(pProtocols); + } + + if (classHierarchyDepth == CLASS_HIERARCHY_MAX_DEPTH) { + NSLog(@"Detected weird class hierarchy with depth over %d. Starting with this class -> %@", CLASS_HIERARCHY_MAX_DEPTH, self); +#if DEBUG + abort(); +#endif + } + + forwardableSelectorsPerClass[CLASS_VALUE(self)] = allowedSelectors; + } +} + +-(id)_forwardToDelegate { + return __forwardToDelegate; +} + +-(void)_setForwardToDelegate:(id __nullable)forwardToDelegate retainDelegate:(BOOL)retainDelegate { + __forwardToDelegate = forwardToDelegate; + if (retainDelegate) { + self.strongForwardDelegate = forwardToDelegate; + } + else { + self.strongForwardDelegate = nil; + } +} + +-(BOOL)hasWiredImplementationForSelector:(SEL)selector { + return [super respondsToSelector:selector]; +} + +-(BOOL)canRespondToSelector:(SEL)selector { + @synchronized(_RXDelegateProxy.class) { + NSSet *allowedMethods = forwardableSelectorsPerClass[CLASS_VALUE(self.class)]; + NSAssert(allowedMethods != nil, @"Set of allowed methods not initialized"); + return [allowedMethods containsObject:SEL_VALUE(selector)]; + } +} + +-(BOOL)respondsToSelector:(SEL)aSelector { + return [super respondsToSelector:aSelector] + || [self._forwardToDelegate respondsToSelector:aSelector] + || [self canRespondToSelector:aSelector]; +} + +-(void)forwardInvocation:(NSInvocation *)anInvocation { + BOOL isVoid = RX_is_method_signature_void(anInvocation.methodSignature); + NSArray *arguments = nil; + if (isVoid) { + arguments = RX_extract_arguments(anInvocation); + [self _sentMessage:anInvocation.selector withArguments:arguments]; + } + + if (self._forwardToDelegate && [self._forwardToDelegate respondsToSelector:anInvocation.selector]) { + [anInvocation invokeWithTarget:self._forwardToDelegate]; + } + + if (isVoid) { + [self _methodInvoked:anInvocation.selector withArguments:arguments]; + } +} + +// abstract method +-(void)_sentMessage:(SEL)selector withArguments:(NSArray *)arguments { + +} + +// abstract method +-(void)_methodInvoked:(SEL)selector withArguments:(NSArray *)arguments { + +} + +-(void)dealloc { +} + +@end diff --git a/Pods/RxCocoa/RxCocoa/Runtime/_RXKVOObserver.m b/Pods/RxCocoa/RxCocoa/Runtime/_RXKVOObserver.m new file mode 100644 index 0000000..fc8fb75 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/_RXKVOObserver.m @@ -0,0 +1,54 @@ +// +// _RXKVOObserver.m +// RxCocoa +// +// Created by Krunoslav Zaher on 7/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import "include/_RXKVOObserver.h" + +@interface _RXKVOObserver () + +@property (nonatomic, unsafe_unretained) id target; +@property (nonatomic, strong ) id retainedTarget; +@property (nonatomic, copy ) NSString *keyPath; +@property (nonatomic, copy ) void (^callback)(id); + +@end + +@implementation _RXKVOObserver + +-(instancetype)initWithTarget:(id)target + retainTarget:(BOOL)retainTarget + keyPath:(NSString*)keyPath + options:(NSKeyValueObservingOptions)options + callback:(void (^)(id))callback { + self = [super init]; + if (!self) return nil; + + self.target = target; + if (retainTarget) { + self.retainedTarget = target; + } + self.keyPath = keyPath; + self.callback = callback; + + [self.target addObserver:self forKeyPath:self.keyPath options:options context:nil]; + + return self; +} + +-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + @synchronized(self) { + self.callback(change[NSKeyValueChangeNewKey]); + } +} + +-(void)dispose { + [self.target removeObserver:self forKeyPath:self.keyPath context:nil]; + self.target = nil; + self.retainedTarget = nil; +} + +@end diff --git a/Pods/RxCocoa/RxCocoa/Runtime/_RXObjCRuntime.m b/Pods/RxCocoa/RxCocoa/Runtime/_RXObjCRuntime.m new file mode 100644 index 0000000..669fab4 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/_RXObjCRuntime.m @@ -0,0 +1,1026 @@ +// +// _RXObjCRuntime.m +// RxCocoa +// +// Created by Krunoslav Zaher on 7/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import +#import +#import +#import +#import + +#import "include/_RX.h" +#import "include/_RXObjCRuntime.h" + +#if !DISABLE_SWIZZLING + +// self + cmd +#define HIDDEN_ARGUMENT_COUNT 2 + +@class RXObjCRuntime; + +BOOL RXAbortOnThreadingHazard = NO; + +typedef NSInvocation *NSInvocationRef; +typedef NSMethodSignature *NSMethodSignatureRef; +typedef unsigned char rx_uchar; +typedef unsigned short rx_ushort; +typedef unsigned int rx_uint; +typedef unsigned long rx_ulong; +typedef id (^rx_block)(id); +typedef BOOL (^RXInterceptWithOptimizedObserver)(RXObjCRuntime * __nonnull self, Class __nonnull class, SEL __nonnull selector, NSError ** __nonnull error); + +static CFTypeID defaultTypeID; +static SEL deallocSelector; + +static int RxSwizzlingTargetClassKey = 0; + +#if TRACE_RESOURCES +static int32_t numberOInterceptedMethods = 0; +static int32_t numberOfForwardedMethods = 0; +#endif + +#define THREADING_HAZARD(class) \ + NSLog(@"There was a problem swizzling on `%@`.\nYou have probably two libraries performing swizzling in runtime.\nWe didn't want to crash your program, but this is not good ...\nYou an solve this problem by either not using swizzling in this library, removing one of those other libraries, or making sure that swizzling parts are synchronized (only perform them on main thread).\nAnd yes, this message will self destruct when you clear the console, and since it's non deterministic, the problem could still exist and it will be hard for you to reproduce it.", NSStringFromClass(class)); ABORT_IN_DEBUG if (RXAbortOnThreadingHazard) { abort(); } + +#define ALWAYS(condition, message) if (!(condition)) { [NSException raise:@"RX Invalid Operator" format:@"%@", message]; } +#define ALWAYS_WITH_INFO(condition, message) NSAssert((condition), @"%@ [%@] > %@", NSStringFromClass(class), NSStringFromSelector(selector), (message)) +#define C_ALWAYS(condition, message) NSCAssert((condition), @"%@ [%@] > %@", NSStringFromClass(class), NSStringFromSelector(selector), (message)) + +#define RX_PREFIX @"_RX_namespace_" + +#define RX_ARG_id(value) ((value) ?: [NSNull null]) +#define RX_ARG_char(value) [NSNumber numberWithChar:value] +#define RX_ARG_short(value) [NSNumber numberWithShort:value] +#define RX_ARG_int(value) [NSNumber numberWithInt:value] +#define RX_ARG_long(value) [NSNumber numberWithLong:value] +#define RX_ARG_BOOL(value) [NSNumber numberWithBool:value] +#define RX_ARG_SEL(value) [NSNumber valueWithPointer:value] +#define RX_ARG_rx_uchar(value) [NSNumber numberWithUnsignedInt:value] +#define RX_ARG_rx_ushort(value) [NSNumber numberWithUnsignedInt:value] +#define RX_ARG_rx_uint(value) [NSNumber numberWithUnsignedInt:value] +#define RX_ARG_rx_ulong(value) [NSNumber numberWithUnsignedLong:value] +#define RX_ARG_rx_block(value) ((id)(value) ?: [NSNull null]) +#define RX_ARG_float(value) [NSNumber numberWithFloat:value] +#define RX_ARG_double(value) [NSNumber numberWithDouble:value] + +typedef struct supported_type { + const char *encoding; +} supported_type_t; + +static supported_type_t supported_types[] = { + { .encoding = @encode(void)}, + { .encoding = @encode(id)}, + { .encoding = @encode(Class)}, + { .encoding = @encode(void (^)())}, + { .encoding = @encode(char)}, + { .encoding = @encode(short)}, + { .encoding = @encode(int)}, + { .encoding = @encode(long)}, + { .encoding = @encode(long long)}, + { .encoding = @encode(unsigned char)}, + { .encoding = @encode(unsigned short)}, + { .encoding = @encode(unsigned int)}, + { .encoding = @encode(unsigned long)}, + { .encoding = @encode(unsigned long long)}, + { .encoding = @encode(float)}, + { .encoding = @encode(double)}, + { .encoding = @encode(BOOL)}, + { .encoding = @encode(const char*)}, +}; + +NSString * __nonnull const RXObjCRuntimeErrorDomain = @"RXObjCRuntimeErrorDomain"; +NSString * __nonnull const RXObjCRuntimeErrorIsKVOKey = @"RXObjCRuntimeErrorIsKVOKey"; + +BOOL RX_return_type_is_supported(const char *type) { + if (type == nil) { + return NO; + } + + for (int i = 0; i < sizeof(supported_types) / sizeof(supported_type_t); ++i) { + if (supported_types[i].encoding[0] != type[0]) { + continue; + } + if (strcmp(supported_types[i].encoding, type) == 0) { + return YES; + } + } + + return NO; +} + +static BOOL RX_method_has_supported_return_type(Method method) { + const char *rawEncoding = method_getTypeEncoding(method); + ALWAYS(rawEncoding != nil, @"Example encoding method is nil."); + + NSMethodSignature *methodSignature = [NSMethodSignature signatureWithObjCTypes:rawEncoding]; + ALWAYS(methodSignature != nil, @"Method signature method is nil."); + + return RX_return_type_is_supported(methodSignature.methodReturnType); +} + +SEL __nonnull RX_selector(SEL __nonnull selector) { + NSString *selectorString = NSStringFromSelector(selector); + return NSSelectorFromString([RX_PREFIX stringByAppendingString:selectorString]); +} + +BOOL RX_is_method_signature_void(NSMethodSignature * __nonnull methodSignature) { + const char *methodReturnType = methodSignature.methodReturnType; + return strcmp(methodReturnType, @encode(void)) == 0; +} + +BOOL RX_is_method_with_description_void(struct objc_method_description method) { + return strncmp(method.types, @encode(void), 1) == 0; +} + +// inspired by https://github.com/ReactiveCocoa/ReactiveCocoa/blob/swift-development/ReactiveCocoa/Objective-C/NSInvocation%2BRACTypeParsing.m +// awesome work +id __nonnull RX_extract_argument_at_index(NSInvocation * __nonnull invocation, NSUInteger index) { + const char *argumentType = [invocation.methodSignature getArgumentTypeAtIndex:index]; + +#define RETURN_VALUE(type) \ + else if (strcmp(argumentType, @encode(type)) == 0) {\ + type val = 0; \ + [invocation getArgument:&val atIndex:index]; \ + return @(val); \ + } + + // Skip const type qualifier. + if (argumentType[0] == 'r') { + argumentType++; + } + + if (strcmp(argumentType, @encode(id)) == 0 + || strcmp(argumentType, @encode(Class)) == 0 + || strcmp(argumentType, @encode(void (^)())) == 0 + ) { + __unsafe_unretained id argument = nil; + [invocation getArgument:&argument atIndex:index]; + return argument; + } + RETURN_VALUE(char) + RETURN_VALUE(short) + RETURN_VALUE(int) + RETURN_VALUE(long) + RETURN_VALUE(long long) + RETURN_VALUE(unsigned char) + RETURN_VALUE(unsigned short) + RETURN_VALUE(unsigned int) + RETURN_VALUE(unsigned long) + RETURN_VALUE(unsigned long long) + RETURN_VALUE(float) + RETURN_VALUE(double) + RETURN_VALUE(BOOL) + RETURN_VALUE(const char *) + else { + NSUInteger size = 0; + NSGetSizeAndAlignment(argumentType, &size, NULL); + NSCParameterAssert(size > 0); + uint8_t data[size]; + [invocation getArgument:&data atIndex:index]; + + return [NSValue valueWithBytes:&data objCType:argumentType]; + } +} + +NSArray *RX_extract_arguments(NSInvocation *invocation) { + NSUInteger numberOfArguments = invocation.methodSignature.numberOfArguments; + NSUInteger numberOfVisibleArguments = numberOfArguments - HIDDEN_ARGUMENT_COUNT; + + NSCParameterAssert(numberOfVisibleArguments >= 0); + + NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:numberOfVisibleArguments]; + + for (NSUInteger index = HIDDEN_ARGUMENT_COUNT; index < numberOfArguments; ++index) { + [arguments addObject:RX_extract_argument_at_index(invocation, index) ?: [NSNull null]]; + } + + return arguments; +} + +void * __nonnull RX_reference_from_selector(SEL __nonnull selector) { + return selector; +} + +static BOOL RX_forward_invocation(id __nonnull __unsafe_unretained self, NSInvocation *invocation) { + SEL originalSelector = RX_selector(invocation.selector); + + id messageSentObserver = objc_getAssociatedObject(self, originalSelector); + + if (messageSentObserver != nil) { + NSArray *arguments = RX_extract_arguments(invocation); + [messageSentObserver messageSentWithArguments:arguments]; + } + + if ([self respondsToSelector:originalSelector]) { + invocation.selector = originalSelector; + [invocation invokeWithTarget:self]; + + if (messageSentObserver != nil) { + NSArray *arguments = RX_extract_arguments(invocation); + [messageSentObserver methodInvokedWithArguments:arguments]; + } + + return YES; + } + + return NO; +} + +static BOOL RX_responds_to_selector(id __nonnull __unsafe_unretained self, SEL selector) { + Class class = object_getClass(self); + if (class == nil) { return NO; } + + Method m = class_getInstanceMethod(class, selector); + return m != nil; + +} + +static NSMethodSignatureRef RX_method_signature(id __nonnull __unsafe_unretained self, SEL selector) { + Class class = object_getClass(self); + if (class == nil) { return nil; } + + Method method = class_getInstanceMethod(class, selector); + if (method == nil) { return nil; } + + const char *encoding = method_getTypeEncoding(method); + if (encoding == nil) { return nil; } + + return [NSMethodSignature signatureWithObjCTypes:encoding]; +} + +static NSString * __nonnull RX_method_encoding(Method __nonnull method) { + const char *typeEncoding = method_getTypeEncoding(method); + ALWAYS(typeEncoding != nil, @"Method encoding is nil."); + + NSString *encoding = [NSString stringWithCString:typeEncoding encoding:NSASCIIStringEncoding]; + ALWAYS(encoding != nil, @"Can't convert encoding to NSString."); + return encoding; +} + +// inspired by +// https://github.com/mikeash/MAZeroingWeakRef/blob/master/Source/MAZeroingWeakRef.m +// https://github.com/ReactiveCocoa/ReactiveCocoa/blob/swift-development/ReactiveCocoa/Objective-C/NSObject%2BRACDeallocating.m +// https://github.com/steipete/Aspects +@interface RXObjCRuntime: NSObject + +@property (nonatomic, assign) pthread_mutex_t lock; + +@property (nonatomic, strong) NSMutableSet *classesThatSupportObservingByForwarding; +@property (nonatomic, strong) NSMutableDictionary *> *forwardedSelectorsByClass; + +@property (nonatomic, strong) NSMutableDictionary *dynamicSubclassByRealClass; +@property (nonatomic, strong) NSMutableDictionary*> *interceptorIMPbySelectorsByClass; + ++(RXObjCRuntime*)instance; + +-(void)performLocked:(void (^)(RXObjCRuntime* __nonnull))action; +-(IMP __nullable)ensurePrepared:(id __nonnull)target forObserving:(SEL __nonnull)selector error:(NSError** __nonnull)error; +-(BOOL)ensureSwizzledSelector:(SEL __nonnull)selector + ofClass:(Class __nonnull)class + newImplementationGenerator:(IMP(^)())newImplementationGenerator +replacementImplementationGenerator:(IMP (^)(IMP originalImplementation))replacementImplementationGenerator + error:(NSError ** __nonnull)error; + + ++(void)registerOptimizedObserver:(RXInterceptWithOptimizedObserver)registration encodedAs:(SEL)selector; + +@end + +/** + All API methods perform work on locked instance of `RXObjCRuntime`. In that way it's easy to prove + that every action is properly locked. + */ +IMP __nullable RX_ensure_observing(id __nonnull target, SEL __nonnull selector, NSError ** __nonnull error) { + __block IMP targetImplementation = nil; + // Target is the second object that needs to be synchronized to TRY to make sure other swizzling framework + // won't do something in parallel. + // Even though this is too fine grained locking and more coarse grained locks should exist, this is just in case + // someone calls this method directly without any external lock. + @synchronized(target) { + // The only other resource that all other swizzling libraries have in common without introducing external + // dependencies is class object. + // + // It is polite to try to synchronize it in hope other unknown entities will also attempt to do so. + // It's like trying to figure out how to communicate with aliens without actually communicating, + // save for the fact that aliens are people, programmers, authors of swizzling libraries. + @synchronized([target class]) { + [[RXObjCRuntime instance] performLocked:^(RXObjCRuntime * __nonnull self) { + targetImplementation = [self ensurePrepared:target + forObserving:selector + error:error]; + }]; + } + } + + return targetImplementation; +} + +IMP __nonnull RX_default_target_implementation() { + return _objc_msgForward; +} + +// bodies + +#define FORWARD_BODY(invocation) if (RX_forward_invocation(self, NAME_CAT(_, 0, invocation))) { return; } + +#define RESPONDS_TO_SELECTOR_BODY(selector) if (RX_responds_to_selector(self, NAME_CAT(_, 0, selector))) return YES; + +#define CLASS_BODY(...) return actAsClass; + +#define METHOD_SIGNATURE_FOR_SELECTOR_BODY(selector) \ + NSMethodSignatureRef methodSignature = RX_method_signature(self, NAME_CAT(_, 0, selector)); \ + if (methodSignature != nil) { \ + return methodSignature; \ + } + +#define DEALLOCATING_BODY(...) \ + id observer = objc_getAssociatedObject(self, rxSelector); \ + if (observer != nil && observer.targetImplementation == thisIMP) { \ + [observer deallocating]; \ + } + +#define OBSERVE_BODY(...) \ + id observer = objc_getAssociatedObject(self, rxSelector); \ + \ + if (observer != nil && observer.targetImplementation == thisIMP) { \ + [observer messageSentWithArguments:@[COMMA_DELIMITED_ARGUMENTS(__VA_ARGS__)]]; \ + } \ + + +#define OBSERVE_INVOKED_BODY(...) \ + if (observer != nil && observer.targetImplementation == thisIMP) { \ + [observer methodInvokedWithArguments:@[COMMA_DELIMITED_ARGUMENTS(__VA_ARGS__)]]; \ + } \ + + +#define BUILD_ARG_WRAPPER(type) RX_ARG_ ## type //RX_ARG_ ## type + +#define CAT(_1, _2, head, tail) RX_CAT2(head, tail) +#define SEPARATE_BY_COMMA(_1, _2, head, tail) head, tail +#define SEPARATE_BY_SPACE(_1, _2, head, tail) head tail +#define SEPARATE_BY_UNDERSCORE(head, tail) RX_CAT2(RX_CAT2(head, _), tail) + +#define UNDERSCORE_TYPE_CAT(_1, index, type) RX_CAT2(_, type) // generates -> _type +#define NAME_CAT(_1, index, type) SEPARATE_BY_UNDERSCORE(type, index) // generates -> type_0 +#define TYPE_AND_NAME_CAT(_1, index, type) type SEPARATE_BY_UNDERSCORE(type, index) // generates -> type type_0 +#define NOT_NULL_ARGUMENT_CAT(_1, index, type) BUILD_ARG_WRAPPER(type)(NAME_CAT(_1, index, type)) // generates -> ((id)(type_0) ?: [NSNull null]) +#define EXAMPLE_PARAMETER(_1, index, type) RX_CAT2(_, type):(type)SEPARATE_BY_UNDERSCORE(type, index) // generates -> _type:(type)type_0 +#define SELECTOR_PART(_1, index, type) RX_CAT2(_, type:) // generates -> _type: + +#define COMMA_DELIMITED_ARGUMENTS(...) RX_FOR(_, SEPARATE_BY_COMMA, NOT_NULL_ARGUMENT_CAT, ## __VA_ARGS__) +#define ARGUMENTS(...) RX_FOR_COMMA(_, NAME_CAT, ## __VA_ARGS__) +#define DECLARE_ARGUMENTS(...) RX_FOR_COMMA(_, TYPE_AND_NAME_CAT, ## __VA_ARGS__) + +// optimized observe methods + +#define GENERATE_METHOD_IDENTIFIER(...) RX_CAT2(swizzle, RX_FOR(_, CAT, UNDERSCORE_TYPE_CAT, ## __VA_ARGS__)) + +#define GENERATE_OBSERVE_METHOD_DECLARATION(...) \ + -(BOOL)GENERATE_METHOD_IDENTIFIER(__VA_ARGS__):(Class __nonnull)class \ + selector:(SEL)selector \ + error:(NSError ** __nonnull)error { \ + + +#define BUILD_EXAMPLE_METHOD(return_value, ...) \ + +(return_value)RX_CAT2(RX_CAT2(example_, return_value), RX_FOR(_, SEPARATE_BY_SPACE, EXAMPLE_PARAMETER, ## __VA_ARGS__)) {} + +#define BUILD_EXAMPLE_METHOD_SELECTOR(return_value, ...) \ + RX_CAT2(RX_CAT2(example_, return_value), RX_FOR(_, SEPARATE_BY_SPACE, SELECTOR_PART, ## __VA_ARGS__)) + +#define SWIZZLE_OBSERVE_METHOD(return_value, ...) \ + @interface RXObjCRuntime (GENERATE_METHOD_IDENTIFIER(return_value, ## __VA_ARGS__)) \ + @end \ + \ + @implementation RXObjCRuntime(GENERATE_METHOD_IDENTIFIER(return_value, ## __VA_ARGS__)) \ + BUILD_EXAMPLE_METHOD(return_value, ## __VA_ARGS__) \ + SWIZZLE_METHOD(return_value, GENERATE_OBSERVE_METHOD_DECLARATION(return_value, ## __VA_ARGS__), OBSERVE_BODY, OBSERVE_INVOKED_BODY, ## __VA_ARGS__) \ + \ + +(void)load { \ + __unused SEL exampleSelector = @selector(BUILD_EXAMPLE_METHOD_SELECTOR(return_value, ## __VA_ARGS__)); \ + [self registerOptimizedObserver:^BOOL(RXObjCRuntime * __nonnull self, Class __nonnull class, \ + SEL __nonnull selector, NSError **__nonnull error) { \ + return [self GENERATE_METHOD_IDENTIFIER(return_value, ## __VA_ARGS__):class selector:selector error:error]; \ + } encodedAs:exampleSelector]; \ + } \ + \ + @end \ + +// infrastructure method + +#define NO_BODY(...) + +#define SWIZZLE_INFRASTRUCTURE_METHOD(return_value, method_name, parameters, method_selector, body, ...) \ + SWIZZLE_METHOD(return_value, -(BOOL)method_name:(Class __nonnull)class parameters error:(NSError **__nonnull)error \ + { \ + SEL selector = method_selector; , body, NO_BODY, __VA_ARGS__) \ + + +// common base + +#define SWIZZLE_METHOD(return_value, method_prototype, body, invoked_body, ...) \ +method_prototype \ + __unused SEL rxSelector = RX_selector(selector); \ + IMP (^newImplementationGenerator)() = ^() { \ + __block IMP thisIMP = nil; \ + id newImplementation = ^return_value(__unsafe_unretained id self DECLARE_ARGUMENTS(__VA_ARGS__)) { \ + body(__VA_ARGS__) \ + \ + struct objc_super superInfo = { \ + .receiver = self, \ + .super_class = class_getSuperclass(class) \ + }; \ + \ + return_value (*msgSend)(struct objc_super *, SEL DECLARE_ARGUMENTS(__VA_ARGS__)) \ + = (__typeof__(msgSend))objc_msgSendSuper; \ + @try { \ + return msgSend(&superInfo, selector ARGUMENTS(__VA_ARGS__)); \ + } \ + @finally { invoked_body(__VA_ARGS__) } \ + }; \ + \ + thisIMP = imp_implementationWithBlock(newImplementation); \ + return thisIMP; \ + }; \ + \ + IMP (^replacementImplementationGenerator)(IMP) = ^(IMP originalImplementation) { \ + __block return_value (*originalImplementationTyped)(__unsafe_unretained id, SEL DECLARE_ARGUMENTS(__VA_ARGS__) ) \ + = (__typeof__(originalImplementationTyped))(originalImplementation); \ + \ + __block IMP thisIMP = nil; \ + id implementationReplacement = ^return_value(__unsafe_unretained id self DECLARE_ARGUMENTS(__VA_ARGS__) ) { \ + body(__VA_ARGS__) \ + @try { \ + return originalImplementationTyped(self, selector ARGUMENTS(__VA_ARGS__)); \ + } \ + @finally { invoked_body(__VA_ARGS__) } \ + }; \ + \ + thisIMP = imp_implementationWithBlock(implementationReplacement); \ + return thisIMP; \ + }; \ + \ + return [self ensureSwizzledSelector:selector \ + ofClass:class \ + newImplementationGenerator:newImplementationGenerator \ + replacementImplementationGenerator:replacementImplementationGenerator \ + error:error]; \ + } \ + + +@interface RXObjCRuntime (InfrastructureMethods) +@end + +// MARK: Infrastructure Methods + +@implementation RXObjCRuntime (InfrastructureMethods) + +SWIZZLE_INFRASTRUCTURE_METHOD( + void, + swizzleForwardInvocation, + , + @selector(forwardInvocation:), + FORWARD_BODY, + NSInvocationRef +) +SWIZZLE_INFRASTRUCTURE_METHOD( + BOOL, + swizzleRespondsToSelector, + , + @selector(respondsToSelector:), + RESPONDS_TO_SELECTOR_BODY, + SEL +) +SWIZZLE_INFRASTRUCTURE_METHOD( + Class __nonnull, + swizzleClass, + toActAs:(Class)actAsClass, + @selector(class), + CLASS_BODY +) +SWIZZLE_INFRASTRUCTURE_METHOD( + NSMethodSignatureRef, + swizzleMethodSignatureForSelector, + , + @selector(methodSignatureForSelector:), + METHOD_SIGNATURE_FOR_SELECTOR_BODY, + SEL +) +SWIZZLE_INFRASTRUCTURE_METHOD( + void, + swizzleDeallocating, + , + deallocSelector, + DEALLOCATING_BODY +) + +@end + +// MARK: Optimized intercepting methods for specific combination of parameter types + +SWIZZLE_OBSERVE_METHOD(void) + +SWIZZLE_OBSERVE_METHOD(void, id) +SWIZZLE_OBSERVE_METHOD(void, char) +SWIZZLE_OBSERVE_METHOD(void, short) +SWIZZLE_OBSERVE_METHOD(void, int) +SWIZZLE_OBSERVE_METHOD(void, long) +SWIZZLE_OBSERVE_METHOD(void, rx_uchar) +SWIZZLE_OBSERVE_METHOD(void, rx_ushort) +SWIZZLE_OBSERVE_METHOD(void, rx_uint) +SWIZZLE_OBSERVE_METHOD(void, rx_ulong) +SWIZZLE_OBSERVE_METHOD(void, rx_block) +SWIZZLE_OBSERVE_METHOD(void, float) +SWIZZLE_OBSERVE_METHOD(void, double) +SWIZZLE_OBSERVE_METHOD(void, SEL) + +SWIZZLE_OBSERVE_METHOD(void, id, id) +SWIZZLE_OBSERVE_METHOD(void, id, char) +SWIZZLE_OBSERVE_METHOD(void, id, short) +SWIZZLE_OBSERVE_METHOD(void, id, int) +SWIZZLE_OBSERVE_METHOD(void, id, long) +SWIZZLE_OBSERVE_METHOD(void, id, rx_uchar) +SWIZZLE_OBSERVE_METHOD(void, id, rx_ushort) +SWIZZLE_OBSERVE_METHOD(void, id, rx_uint) +SWIZZLE_OBSERVE_METHOD(void, id, rx_ulong) +SWIZZLE_OBSERVE_METHOD(void, id, rx_block) +SWIZZLE_OBSERVE_METHOD(void, id, float) +SWIZZLE_OBSERVE_METHOD(void, id, double) +SWIZZLE_OBSERVE_METHOD(void, id, SEL) + +// MARK: RXObjCRuntime + +@implementation RXObjCRuntime + +static RXObjCRuntime *_instance = nil; +static NSMutableDictionary *optimizedObserversByMethodEncoding = nil; + ++(RXObjCRuntime*)instance { + return _instance; +} + ++(void)initialize { + _instance = [[RXObjCRuntime alloc] init]; + defaultTypeID = CFGetTypeID((CFTypeRef)RXObjCRuntime.class); // just need a reference of some object not from CF + deallocSelector = NSSelectorFromString(@"dealloc"); + NSAssert(_instance != nil, @"Failed to initialize swizzling"); +} + +-(instancetype)init { + self = [super init]; + if (!self) return nil; + + self.classesThatSupportObservingByForwarding = [NSMutableSet set]; + self.forwardedSelectorsByClass = [NSMutableDictionary dictionary]; + + self.dynamicSubclassByRealClass = [NSMutableDictionary dictionary]; + self.interceptorIMPbySelectorsByClass = [NSMutableDictionary dictionary]; + + pthread_mutexattr_t lock_attr; + pthread_mutexattr_init(&lock_attr); + pthread_mutexattr_settype(&lock_attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&_lock, &lock_attr); + pthread_mutexattr_destroy(&lock_attr); + + return self; +} + +-(void)performLocked:(void (^)(RXObjCRuntime* __nonnull))action { + pthread_mutex_lock(&_lock); + action(self); + pthread_mutex_unlock(&_lock); +} + ++(void)registerOptimizedObserver:(RXInterceptWithOptimizedObserver)registration encodedAs:(SEL)selector { + Method exampleEncodingMethod = class_getClassMethod(self, selector); + ALWAYS(exampleEncodingMethod != nil, @"Example encoding method is nil."); + + NSString *methodEncoding = RX_method_encoding(exampleEncodingMethod); + + if (optimizedObserversByMethodEncoding == nil) { + optimizedObserversByMethodEncoding = [NSMutableDictionary dictionary]; + } + + DLOG(@"Added optimized method: %@ (%@)", methodEncoding, NSStringFromSelector(selector)); + ALWAYS(optimizedObserversByMethodEncoding[methodEncoding] == nil, @"Optimized observer already registered") + optimizedObserversByMethodEncoding[methodEncoding] = registration; +} + +/** + This is the main entry point for observing messages sent to arbitrary objects. + */ +-(IMP __nullable)ensurePrepared:(id __nonnull)target forObserving:(SEL __nonnull)selector error:(NSError** __nonnull)error { + Method instanceMethod = class_getInstanceMethod([target class], selector); + if (instanceMethod == nil) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorSelectorNotImplemented + userInfo:nil], nil); + } + + if (selector == @selector(class) + || selector == @selector(forwardingTargetForSelector:) + || selector == @selector(methodSignatureForSelector:) + || selector == @selector(respondsToSelector:)) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorObservingPerformanceSensitiveMessages + userInfo:nil], nil); + } + + // For `dealloc` message, original implementation will be swizzled. + // This is a special case because observing `dealloc` message is performed when `observeWeakly` is used. + // + // Some toll free bridged classes don't handle `object_setClass` well and cause crashes. + // + // To make `deallocating` as robust as possible, original implementation will be replaced. + if (selector == deallocSelector) { + Class __nonnull deallocSwizzingTarget = [target class]; + IMP interceptorIMPForSelector = [self interceptorImplementationForSelector:selector forClass:deallocSwizzingTarget]; + if (interceptorIMPForSelector != nil) { + return interceptorIMPForSelector; + } + + if (![self swizzleDeallocating:deallocSwizzingTarget error:error]) { + return nil; + } + + interceptorIMPForSelector = [self interceptorImplementationForSelector:selector forClass:deallocSwizzingTarget]; + if (interceptorIMPForSelector != nil) { + return interceptorIMPForSelector; + } + } + else { + Class __nullable swizzlingImplementorClass = [self prepareTargetClassForObserving:target error:error]; + if (swizzlingImplementorClass == nil) { + return nil; + } + + NSString *methodEncoding = RX_method_encoding(instanceMethod); + RXInterceptWithOptimizedObserver optimizedIntercept = optimizedObserversByMethodEncoding[methodEncoding]; + + if (!RX_method_has_supported_return_type(instanceMethod)) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorObservingMessagesWithUnsupportedReturnType + userInfo:nil], nil); + } + + // optimized interception method + if (optimizedIntercept != nil) { + IMP interceptorIMPForSelector = [self interceptorImplementationForSelector:selector forClass:swizzlingImplementorClass]; + if (interceptorIMPForSelector != nil) { + return interceptorIMPForSelector; + } + + if (!optimizedIntercept(self, swizzlingImplementorClass, selector, error)) { + return nil; + } + + interceptorIMPForSelector = [self interceptorImplementationForSelector:selector forClass:swizzlingImplementorClass]; + if (interceptorIMPForSelector != nil) { + return interceptorIMPForSelector; + } + } + // default fallback to observing by forwarding messages + else { + if ([self forwardingSelector:selector forClass:swizzlingImplementorClass]) { + return RX_default_target_implementation(); + } + + if (![self observeByForwardingMessages:swizzlingImplementorClass + selector:selector + target:target + error:error]) { + return nil; + } + + if ([self forwardingSelector:selector forClass:swizzlingImplementorClass]) { + return RX_default_target_implementation(); + } + } + } + + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorUnknown + userInfo:nil], nil); +} + +-(Class __nullable)prepareTargetClassForObserving:(id __nonnull)target error:(NSError **__nonnull)error { + Class swizzlingClass = objc_getAssociatedObject(target, &RxSwizzlingTargetClassKey); + if (swizzlingClass != nil) { + return swizzlingClass; + } + + Class __nonnull wannaBeClass = [target class]; + /** + Core Foundation classes are usually toll free bridged. Those classes crash the program in case + `object_setClass` is performed on them. + + There is a possibility to just swizzle methods on original object, but since those won't be usual use + cases for this library, then an error will just be reported for now. + */ + BOOL isThisTollFreeFoundationClass = CFGetTypeID((CFTypeRef)target) != defaultTypeID; + + if (isThisTollFreeFoundationClass) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorCantInterceptCoreFoundationTollFreeBridgedObjects + userInfo:nil], nil); + } + + /** + If the object is reporting a different class then what it's real class, that means that there is probably + already some interception mechanism in place or something weird is happening. + + Most common case when this would happen is when using KVO (`observe`) and `sentMessage`. + + This error is easily resolved by just using `sentMessage` observing before `observe`. + + The reason why other way around could create issues is because KVO will unregister it's interceptor + class and restore original class. Unfortunately that will happen no matter was there another interceptor + subclass registered in hierarchy or not. + + Failure scenario: + * KVO sets class to be `__KVO__OriginalClass` (subclass of `OriginalClass`) + * `sentMessage` sets object class to be `_RX_namespace___KVO__OriginalClass` (subclass of `__KVO__OriginalClass`) + * then unobserving with KVO will restore class to be `OriginalClass` -> failure point + + The reason why changing order of observing works is because any interception method should return + object's original real class (if that doesn't happen then it's really easy to argue that's a bug + in that other library). + + This library won't remove registered interceptor even if there aren't any observers left because + it's highly unlikely it would have any benefit in real world use cases, and it's even more + dangerous. + */ + if ([target class] != object_getClass(target)) { + BOOL isKVO = [target respondsToSelector:NSSelectorFromString(@"_isKVOA")]; + + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorObjectMessagesAlreadyBeingIntercepted + userInfo:@{ + RXObjCRuntimeErrorIsKVOKey : @(isKVO) + }], nil); + } + + Class __nullable dynamicFakeSubclass = [self ensureHasDynamicFakeSubclass:wannaBeClass error:error]; + + if (dynamicFakeSubclass == nil) { + return nil; + } + + Class previousClass = object_setClass(target, dynamicFakeSubclass); + if (previousClass != wannaBeClass) { + THREADING_HAZARD(wannaBeClass); + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorThreadingCollisionWithOtherInterceptionMechanism + userInfo:nil], nil); + } + + objc_setAssociatedObject(target, &RxSwizzlingTargetClassKey, dynamicFakeSubclass, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + return dynamicFakeSubclass; +} + + +-(BOOL)forwardingSelector:(SEL)selector forClass:(Class __nonnull)class { + return [self.forwardedSelectorsByClass[CLASS_VALUE(class)] containsObject:SEL_VALUE(selector)]; +} + +-(void)registerForwardedSelector:(SEL)selector forClass:(Class __nonnull)class { + NSValue *classValue = CLASS_VALUE(class); + + NSMutableSet *forwardedSelectors = self.forwardedSelectorsByClass[classValue]; + + if (forwardedSelectors == nil) { + forwardedSelectors = [NSMutableSet set]; + self.forwardedSelectorsByClass[classValue] = forwardedSelectors; + } + + [forwardedSelectors addObject:SEL_VALUE(selector)]; +} + +-(BOOL)observeByForwardingMessages:(Class __nonnull)swizzlingImplementorClass + selector:(SEL)selector + target:(id __nonnull)target + error:(NSError **__nonnull)error { + if (![self ensureForwardingMethodsAreSwizzled:swizzlingImplementorClass error:error]) { + return NO; + } + + ALWAYS(![self forwardingSelector:selector forClass:swizzlingImplementorClass], @"Already observing selector for class"); + +#if TRACE_RESOURCES + OSAtomicIncrement32Barrier(&numberOfForwardedMethods); +#endif + SEL rxSelector = RX_selector(selector); + + Method instanceMethod = class_getInstanceMethod(swizzlingImplementorClass, selector); + ALWAYS(instanceMethod != nil, @"Instance method is nil"); + + const char* methodEncoding = method_getTypeEncoding(instanceMethod); + ALWAYS(methodEncoding != nil, @"Method encoding is nil."); + NSMethodSignature *methodSignature = [NSMethodSignature signatureWithObjCTypes:methodEncoding]; + ALWAYS(methodSignature != nil, @"Method signature is invalid."); + + IMP implementation = method_getImplementation(instanceMethod); + + if (implementation == nil) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorSelectorNotImplemented + userInfo:nil], NO); + } + + if (!class_addMethod(swizzlingImplementorClass, rxSelector, implementation, methodEncoding)) { + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorSavingOriginalForwardingMethodFailed + userInfo:nil], NO); + } + + if (!class_addMethod(swizzlingImplementorClass, selector, _objc_msgForward, methodEncoding)) { + if (implementation != method_setImplementation(instanceMethod, _objc_msgForward)) { + THREADING_HAZARD(swizzlingImplementorClass); + RX_THROW_ERROR([NSError errorWithDomain:RXObjCRuntimeErrorDomain + code:RXObjCRuntimeErrorReplacingMethodWithForwardingImplementation + userInfo:nil], NO); + } + } + + DLOG(@"Rx uses forwarding to observe `%@` for `%@`.", NSStringFromSelector(selector), swizzlingImplementorClass); + [self registerForwardedSelector:selector forClass:swizzlingImplementorClass]; + + return YES; +} + +/** + If object don't have some weird behavior, claims it's the same class that runtime shows, + then dynamic subclass is created (only this instance will have performance hit). + + In case something weird is detected, then original base class is being swizzled and all instances + will have somewhat reduced performance. + + This is especially handy optimization for weak KVO. Nobody will swizzle for example `NSString`, + but to know when instance of a `NSString` was deallocated, performance hit will be only felt on a + single instance of `NSString`, not all instances of `NSString`s. + */ +-(Class __nullable)ensureHasDynamicFakeSubclass:(Class __nonnull)class error:(NSError **)error { + Class dynamicFakeSubclass = self.dynamicSubclassByRealClass[CLASS_VALUE(class)]; + if (dynamicFakeSubclass != nil) { + return dynamicFakeSubclass; + } + + NSString *dynamicFakeSubclassName = [RX_PREFIX stringByAppendingString:NSStringFromClass(class)]; + const char *dynamicFakeSubclassNameRaw = dynamicFakeSubclassName.UTF8String; + dynamicFakeSubclass = objc_allocateClassPair(class, dynamicFakeSubclassNameRaw, 0); + ALWAYS(dynamicFakeSubclass != nil, @"Class not generated"); + + if (![self swizzleClass:dynamicFakeSubclass toActAs:class error:error]) { + return nil; + } + + objc_registerClassPair(dynamicFakeSubclass); + + [self.dynamicSubclassByRealClass setObject:dynamicFakeSubclass forKey:CLASS_VALUE(class)]; + ALWAYS(self.dynamicSubclassByRealClass[CLASS_VALUE(class)] != nil, @"Class not registered"); + + return dynamicFakeSubclass; +} + +-(BOOL)ensureForwardingMethodsAreSwizzled:(Class __nonnull)class error:(NSError ** __nonnull)error { + NSValue *classValue = CLASS_VALUE(class); + if ([self.classesThatSupportObservingByForwarding containsObject:classValue]) { + return YES; + } + + if (![self swizzleForwardInvocation:class error:error]) { return NO; } + if (![self swizzleMethodSignatureForSelector:class error:error]) { return NO; } + if (![self swizzleRespondsToSelector:class error:error]) { return NO; } + + [self.classesThatSupportObservingByForwarding addObject:classValue]; + + return YES; +} + +-(void)registerInterceptedSelector:(SEL)selector implementation:(IMP)implementation forClass:(Class)class { + NSValue * __nonnull classValue = CLASS_VALUE(class); + NSValue * __nonnull selectorValue = SEL_VALUE(selector); + + NSMutableDictionary *swizzledIMPBySelectorsForClass = self.interceptorIMPbySelectorsByClass[classValue]; + + if (swizzledIMPBySelectorsForClass == nil) { + swizzledIMPBySelectorsForClass = [NSMutableDictionary dictionary]; + self.interceptorIMPbySelectorsByClass[classValue] = swizzledIMPBySelectorsForClass; + } + + swizzledIMPBySelectorsForClass[selectorValue] = IMP_VALUE(implementation); + + ALWAYS([self interceptorImplementationForSelector:selector forClass:class] != nil, @"Class should have been swizzled"); +} + +-(IMP)interceptorImplementationForSelector:(SEL)selector forClass:(Class)class { + NSValue * __nonnull classValue = CLASS_VALUE(class); + NSValue * __nonnull selectorValue = SEL_VALUE(selector); + + NSMutableDictionary *swizzledIMPBySelectorForClass = self.interceptorIMPbySelectorsByClass[classValue]; + + NSValue *impValue = swizzledIMPBySelectorForClass[selectorValue]; + return impValue.pointerValue; +} + +-(BOOL)ensureSwizzledSelector:(SEL __nonnull)selector + ofClass:(Class __nonnull)class + newImplementationGenerator:(IMP(^)())newImplementationGenerator +replacementImplementationGenerator:(IMP (^)(IMP originalImplementation))replacementImplementationGenerator + error:(NSError ** __nonnull)error { + if ([self interceptorImplementationForSelector:selector forClass:class] != nil) { + DLOG(@"Trying to register same intercept at least once, this sounds like a possible bug"); + return YES; + } + +#if TRACE_RESOURCES + OSAtomicIncrement32Barrier(&numberOInterceptedMethods); +#endif + + DLOG(@"Rx is swizzling `%@` for `%@`", NSStringFromSelector(selector), class); + + Method existingMethod = class_getInstanceMethod(class, selector); + ALWAYS(existingMethod != nil, @"Method doesn't exist"); + + const char *encoding = method_getTypeEncoding(existingMethod); + ALWAYS(encoding != nil, @"Encoding is nil"); + + IMP newImplementation = newImplementationGenerator(); + + if (class_addMethod(class, selector, newImplementation, encoding)) { + // new method added, job done + [self registerInterceptedSelector:selector implementation:newImplementation forClass:class]; + + return YES; + } + + imp_removeBlock(newImplementation); + + // if add fails, that means that method already exists on targetClass + Method existingMethodOnTargetClass = existingMethod; + + IMP originalImplementation = method_getImplementation(existingMethodOnTargetClass); + ALWAYS(originalImplementation != nil, @"Method must exist."); + IMP implementationReplacementIMP = replacementImplementationGenerator(originalImplementation); + ALWAYS(implementationReplacementIMP != nil, @"Method must exist."); + IMP originalImplementationAfterChange = method_setImplementation(existingMethodOnTargetClass, implementationReplacementIMP); + ALWAYS(originalImplementation != nil, @"Method must exist."); + + // If method replacing failed, who knows what happened, better not trying again, otherwise program can get + // corrupted. + [self registerInterceptedSelector:selector implementation:implementationReplacementIMP forClass:class]; + + // ¯\_(ツ)_/¯ + if (originalImplementationAfterChange != originalImplementation) { + THREADING_HAZARD(class); + return NO; + } + + return YES; +} + +@end + +#if TRACE_RESOURCES + +NSInteger RX_number_of_dynamic_subclasses() { + __block NSInteger count = 0; + [[RXObjCRuntime instance] performLocked:^(RXObjCRuntime * __nonnull self) { + count = self.dynamicSubclassByRealClass.count; + }]; + + return count; +} + +NSInteger RX_number_of_forwarding_enabled_classes() { + __block NSInteger count = 0; + [[RXObjCRuntime instance] performLocked:^(RXObjCRuntime * __nonnull self) { + count = self.classesThatSupportObservingByForwarding.count; + }]; + + return count; +} + +NSInteger RX_number_of_intercepting_classes() { + __block NSInteger count = 0; + [[RXObjCRuntime instance] performLocked:^(RXObjCRuntime * __nonnull self) { + count = self.interceptorIMPbySelectorsByClass.count; + }]; + + return count; +} + +NSInteger RX_number_of_forwarded_methods() { + return numberOfForwardedMethods; +} + +NSInteger RX_number_of_swizzled_methods() { + return numberOInterceptedMethods; +} + +#endif + +#endif diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/RxCocoaRuntime.h b/Pods/RxCocoa/RxCocoa/Runtime/include/RxCocoaRuntime.h new file mode 100644 index 0000000..8cf762e --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/include/RxCocoaRuntime.h @@ -0,0 +1,19 @@ +// +// RxCocoaRuntime.h +// RxCocoa +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import +#import "_RX.h" +#import "_RXDelegateProxy.h" +#import "_RXKVOObserver.h" +#import "_RXObjCRuntime.h" + +//! Project version number for RxCocoa. +FOUNDATION_EXPORT double RxCocoaVersionNumber; + +//! Project version string for RxCocoa. +FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[]; diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/_RX.h b/Pods/RxCocoa/RxCocoa/Runtime/include/_RX.h new file mode 100644 index 0000000..aae1777 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/include/_RX.h @@ -0,0 +1,139 @@ +// +// _RX.h +// RxCocoa +// +// Created by Krunoslav Zaher on 7/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import +#import + +/** + ################################################################################ + This file is part of RX private API + ################################################################################ + */ + +#if TRACE_RESOURCES >= 2 +# define DLOG(...) NSLog(__VA_ARGS__) +#else +# define DLOG(...) +#endif + +#if DEBUG +# define ABORT_IN_DEBUG abort(); +#else +# define ABORT_IN_DEBUG +#endif + + +#define SEL_VALUE(x) [NSValue valueWithPointer:(x)] +#define CLASS_VALUE(x) [NSValue valueWithNonretainedObject:(x)] +#define IMP_VALUE(x) [NSValue valueWithPointer:(x)] + +/** + Checks that the local `error` instance exists before assigning it's value by reference. + This macro exists to work around static analysis warnings — `NSError` is always assumed to be `nullable`, even though we explictly define the method parameter as `nonnull`. See http://www.openradar.me/21766176 for more details. + */ +#define RX_THROW_ERROR(errorValue, returnValue) if (error != nil) { *error = (errorValue); } return (returnValue); + +// Inspired by http://p99.gforge.inria.fr + +// https://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC26 +#define RX_CAT2(_1, _2) _RX_CAT2(_1, _2) + +#define RX_ELEMENT_AT(n, ...) RX_CAT2(_RX_ELEMENT_AT_, n)(__VA_ARGS__) + +#define RX_COUNT(...) RX_ELEMENT_AT(6, ## __VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) + +/** + #define JOIN(context, index, head, tail) head; tail + #define APPLY(context, index, item) item = (context)[index] + + RX_FOR(A, JOIN, APPLY, toto, tutu); + + toto = (A)[0]; tutu = (A)[1]; + */ +#define RX_FOR(context, join, generate, ...) RX_CAT2( _RX_FOR_, RX_COUNT(__VA_ARGS__))(context, 0, join, generate, ## __VA_ARGS__) + +/** + #define JOIN(context, index, head, tail) head tail + #define APPLY(context, index, item) item = (context)[index] + + RX_FOR(A, JOIN, APPLY, toto, tutu); + + , toto = (A)[0], tutu = (A)[1] + */ +#define RX_FOR_COMMA(context, generate, ...) RX_CAT2( _RX_FOR_COMMA_, RX_COUNT(__VA_ARGS__))(context, 0, generate, ## __VA_ARGS__) + +#define RX_INC(x) RX_CAT2(_RX_INC_, x) + +// element at + +#define _RX_ELEMENT_AT_0(x, ...) x +#define _RX_ELEMENT_AT_1(_0, x, ...) x +#define _RX_ELEMENT_AT_2(_0, _1, x, ...) x +#define _RX_ELEMENT_AT_3(_0, _1, _2, x, ...) x +#define _RX_ELEMENT_AT_4(_0, _1, _2, _3, x, ...) x +#define _RX_ELEMENT_AT_5(_0, _1, _2, _3, _4, x, ...) x +#define _RX_ELEMENT_AT_6(_0, _1, _2, _3, _4, _5, x, ...) x + +// rx for + +#define _RX_FOR_0(context, index, join, generate) + +#define _RX_FOR_1(context, index, join, generate, head) \ + generate(context, index, head) + +#define _RX_FOR_2(context, index, join, generate, head, ...) \ + join(context, index, generate(context, index, head), _RX_FOR_1(context, RX_INC(index), join, generate, __VA_ARGS__)) + +#define _RX_FOR_3(context, index, join, generate, head, ...) \ + join(context, index, generate(context, index, head), _RX_FOR_2(context, RX_INC(index), join, generate, __VA_ARGS__)) + +#define _RX_FOR_4(context, index, join, generate, head, ...) \ + join(context, index, generate(context, index, head), _RX_FOR_3(context, RX_INC(index), join, generate, __VA_ARGS__)) + +#define _RX_FOR_5(context, index, join, generate, head, ...) \ + join(context, index, generate(context, index, head), _RX_FOR_4(context, RX_INC(index), join, generate, __VA_ARGS__)) + +#define _RX_FOR_6(context, index, join, generate, head, ...) \ + join(context, index, generate(context, index, head), _RX_FOR_5(context, RX_INC(index), join, generate, __VA_ARGS__)) + +// rx for + +#define _RX_FOR_COMMA_0(context, index, generate) + +#define _RX_FOR_COMMA_1(context, index, generate, head) \ + , generate(context, index, head) + +#define _RX_FOR_COMMA_2(context, index, generate, head, ...) \ + , generate(context, index, head) _RX_FOR_COMMA_1(context, RX_INC(index), generate, __VA_ARGS__) + +#define _RX_FOR_COMMA_3(context, index, generate, head, ...) \ + , generate(context, index, head) _RX_FOR_COMMA_2(context, RX_INC(index), generate, __VA_ARGS__) + +#define _RX_FOR_COMMA_4(context, index, generate, head, ...) \ + , generate(context, index, head) _RX_FOR_COMMA_3(context, RX_INC(index), generate, __VA_ARGS__) + +#define _RX_FOR_COMMA_5(context, index, generate, head, ...) \ + , generate(context, index, head) _RX_FOR_COMMA_4(context, RX_INC(index), generate, __VA_ARGS__) + +#define _RX_FOR_COMMA_6(context, index, generate, head, ...) \ + , generate(context, index, head) _RX_FOR_COMMA_5(context, RX_INC(index), generate, __VA_ARGS__) + + +// rx inc + +#define _RX_INC_0 1 +#define _RX_INC_1 2 +#define _RX_INC_2 3 +#define _RX_INC_3 4 +#define _RX_INC_4 5 +#define _RX_INC_5 6 +#define _RX_INC_6 7 + +// rx cat + +#define _RX_CAT2(_1, _2) _1 ## _2 diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h new file mode 100644 index 0000000..523e7ae --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h @@ -0,0 +1,26 @@ +// +// _RXDelegateProxy.h +// RxCocoa +// +// Created by Krunoslav Zaher on 7/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface _RXDelegateProxy : NSObject + +@property (nonatomic, weak, readonly) id _forwardToDelegate; + +-(void)_setForwardToDelegate:(id __nullable)forwardToDelegate retainDelegate:(BOOL)retainDelegate; + +-(BOOL)hasWiredImplementationForSelector:(SEL)selector; + +-(void)_sentMessage:(SEL)selector withArguments:(NSArray*)arguments; +-(void)_methodInvoked:(SEL)selector withArguments:(NSArray*)arguments; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXKVOObserver.h b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXKVOObserver.h new file mode 100644 index 0000000..adcfd0a --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXKVOObserver.h @@ -0,0 +1,28 @@ +// +// _RXKVOObserver.h +// RxCocoa +// +// Created by Krunoslav Zaher on 7/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import + +/** + ################################################################################ + This file is part of RX private API + ################################################################################ + */ + +// Exists because if written in Swift, reading unowned is disabled during dealloc process +@interface _RXKVOObserver : NSObject + +-(instancetype)initWithTarget:(id)target + retainTarget:(BOOL)retainTarget + keyPath:(NSString*)keyPath + options:(NSKeyValueObservingOptions)options + callback:(void (^)(id))callback; + +-(void)dispose; + +@end diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXObjCRuntime.h b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXObjCRuntime.h new file mode 100644 index 0000000..ca0d025 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXObjCRuntime.h @@ -0,0 +1,102 @@ +// +// _RXObjCRuntime.h +// RxCocoa +// +// Created by Krunoslav Zaher on 7/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import + +#if !DISABLE_SWIZZLING + +/** + ################################################################################ + This file is part of RX private API + ################################################################################ + */ + +/** + This flag controls `RELEASE` configuration behavior in case race was detecting while modifying + ObjC runtime. + + In case this value is set to `YES`, after runtime race is detected, `abort()` will be called. + Otherwise, only error will be reported using normal error reporting mechanism. + + In `DEBUG` mode `abort` will be always called in case race is detected. + + Races can't happen in case this is the only library modifying ObjC runtime, but in case there are multiple libraries + changing ObjC runtime, race conditions can occur because there is no way to synchronize multiple libraries unaware of + each other. + + To help remedy this situation this library will use `synchronized` on target object and it's meta-class, but + there aren't any guarantees of how other libraries will behave. + + Default value is `NO`. + + */ +extern BOOL RXAbortOnThreadingHazard; + +/// Error domain for RXObjCRuntime. +extern NSString * __nonnull const RXObjCRuntimeErrorDomain; + +/// `userInfo` key with additional information is interceptor probably KVO. +extern NSString * __nonnull const RXObjCRuntimeErrorIsKVOKey; + +typedef NS_ENUM(NSInteger, RXObjCRuntimeError) { + RXObjCRuntimeErrorUnknown = 1, + RXObjCRuntimeErrorObjectMessagesAlreadyBeingIntercepted = 2, + RXObjCRuntimeErrorSelectorNotImplemented = 3, + RXObjCRuntimeErrorCantInterceptCoreFoundationTollFreeBridgedObjects = 4, + RXObjCRuntimeErrorThreadingCollisionWithOtherInterceptionMechanism = 5, + RXObjCRuntimeErrorSavingOriginalForwardingMethodFailed = 6, + RXObjCRuntimeErrorReplacingMethodWithForwardingImplementation = 7, + RXObjCRuntimeErrorObservingPerformanceSensitiveMessages = 8, + RXObjCRuntimeErrorObservingMessagesWithUnsupportedReturnType = 9, +}; + +/// Transforms normal selector into a selector with RX prefix. +SEL _Nonnull RX_selector(SEL _Nonnull selector); + +/// Transforms selector into a unique pointer (because of Swift conversion rules) +void * __nonnull RX_reference_from_selector(SEL __nonnull selector); + +/// Protocol that interception observers must implement. +@protocol RXMessageSentObserver + +/// In case the same selector is being intercepted for a pair of base/sub classes, +/// this property will differentiate between interceptors that need to fire. +@property (nonatomic, assign, readonly) IMP __nonnull targetImplementation; + +-(void)messageSentWithArguments:(NSArray* __nonnull)arguments; +-(void)methodInvokedWithArguments:(NSArray* __nonnull)arguments; + +@end + +/// Protocol that deallocating observer must implement. +@protocol RXDeallocatingObserver + +/// In case the same selector is being intercepted for a pair of base/sub classes, +/// this property will differentiate between interceptors that need to fire. +@property (nonatomic, assign, readonly) IMP __nonnull targetImplementation; + +-(void)deallocating; + +@end + +/// Ensures interceptor is installed on target object. +IMP __nullable RX_ensure_observing(id __nonnull target, SEL __nonnull selector, NSError *__nullable * __nonnull error); + +/// Extracts arguments for `invocation`. +NSArray * __nonnull RX_extract_arguments(NSInvocation * __nonnull invocation); + +/// Returns `YES` in case method has `void` return type. +BOOL RX_is_method_with_description_void(struct objc_method_description method); + +/// Returns `YES` in case methodSignature has `void` return type. +BOOL RX_is_method_signature_void(NSMethodSignature * __nonnull methodSignature); + +/// Default value for `RXInterceptionObserver.targetImplementation`. +IMP __nonnull RX_default_target_implementation(); + +#endif diff --git a/Pods/RxCocoa/RxCocoa/RxCocoa.h b/Pods/RxCocoa/RxCocoa/RxCocoa.h new file mode 100644 index 0000000..7436904 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/RxCocoa.h @@ -0,0 +1,19 @@ +// +// RxCocoa.h +// RxCocoa +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#import +#import "_RX.h" +#import "_RXDelegateProxy.h" +#import "_RXKVOObserver.h" +#import "_RXObjCRuntime.h" + +//! Project version number for RxCocoa. +FOUNDATION_EXPORT double RxCocoaVersionNumber; + +//! Project version string for RxCocoa. +FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[]; \ No newline at end of file diff --git a/Pods/RxCocoa/RxCocoa/RxCocoa.swift b/Pods/RxCocoa/RxCocoa/RxCocoa.swift new file mode 100644 index 0000000..e4a646c --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/RxCocoa.swift @@ -0,0 +1,148 @@ +// +// RxCocoa.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif +#if os(iOS) + import UIKit +#endif + +/// RxCocoa errors. +public enum RxCocoaError + : Swift.Error + , CustomDebugStringConvertible { + /// Unknown error has occurred. + case unknown + /// Invalid operation was attempted. + case invalidOperation(object: Any) + /// Items are not yet bound to user interface but have been requested. + case itemsNotYetBound(object: Any) + /// Invalid KVO Path. + case invalidPropertyName(object: Any, propertyName: String) + /// Invalid object on key path. + case invalidObjectOnKeyPath(object: Any, sourceObject: AnyObject, propertyName: String) + /// Error during swizzling. + case errorDuringSwizzling + /// Casting error. + case castingError(object: Any, targetType: Any.Type) +} + + +// MARK: Debug descriptions + +extension RxCocoaError { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + switch self { + case .unknown: + return "Unknown error occurred." + case let .invalidOperation(object): + return "Invalid operation was attempted on `\(object)`." + case let .itemsNotYetBound(object): + return "Data source is set, but items are not yet bound to user interface for `\(object)`." + case let .invalidPropertyName(object, propertyName): + return "Object `\(object)` dosn't have a property named `\(propertyName)`." + case let .invalidObjectOnKeyPath(object, sourceObject, propertyName): + return "Unobservable object `\(object)` was observed as `\(propertyName)` of `\(sourceObject)`." + case .errorDuringSwizzling: + return "Error during swizzling." + case .castingError(let object, let targetType): + return "Error casting `\(object)` to `\(targetType)`" + } + } +} + + + +// MARK: Error binding policies + +func bindingErrorToInterface(_ error: Swift.Error) { + let error = "Binding error to UI: \(error)" +#if DEBUG + rxFatalError(error) +#else + print(error) +#endif +} + +// MARK: Abstract methods + +func rxAbstractMethodWithMessage(_ message: String) -> Swift.Never { + rxFatalError(message) +} + +func rxAbstractMethod() -> Swift.Never { + rxFatalError("Abstract method") +} + +// MARK: casts or fatal error + +// workaround for Swift compiler bug, cheers compiler team :) +func castOptionalOrFatalError(_ value: Any?) -> T? { + if value == nil { + return nil + } + let v: T = castOrFatalError(value) + return v +} + +func castOrThrow(_ resultType: T.Type, _ object: Any) throws -> T { + guard let returnValue = object as? T else { + throw RxCocoaError.castingError(object: object, targetType: resultType) + } + + return returnValue +} + +func castOptionalOrThrow(_ resultType: T.Type, _ object: AnyObject) throws -> T? { + if NSNull().isEqual(object) { + return nil + } + + guard let returnValue = object as? T else { + throw RxCocoaError.castingError(object: object, targetType: resultType) + } + + return returnValue +} + +func castOrFatalError(_ value: AnyObject!, message: String) -> T { + let maybeResult: T? = value as? T + guard let result = maybeResult else { + rxFatalError(message) + } + + return result +} + +func castOrFatalError(_ value: Any!) -> T { + let maybeResult: T? = value as? T + guard let result = maybeResult else { + rxFatalError("Failure converting from \(value) to \(T.self)") + } + + return result +} + +// MARK: Error messages + +let dataSourceNotSet = "DataSource not set" +let delegateNotSet = "Delegate not set" + +// MARK: Shared with RxSwift + +#if !RX_NO_MODULE + +func rxFatalError(_ lastMessage: String) -> Never { + // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. + fatalError(lastMessage) +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift new file mode 100644 index 0000000..87a1db9 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift @@ -0,0 +1,37 @@ +// +// NSButton+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif +import Cocoa + +extension Reactive where Base: NSButton { + + /// Reactive wrapper for control event. + public var tap: ControlEvent { + return controlEvent + } + + /// Reactive wrapper for `state` property`. + public var state: ControlProperty { + return NSButton.rx.value( + base, + getter: { control in + return control.state + }, setter: { control, state in + control.state = state + } + ) + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift new file mode 100644 index 0000000..e63b911 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift @@ -0,0 +1,85 @@ +// +// NSControl+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + +import Foundation +import Cocoa +#if !RX_NO_MODULE +import RxSwift +#endif + +fileprivate var rx_value_key: UInt8 = 0 +fileprivate var rx_control_events_key: UInt8 = 0 + +extension Reactive where Base: NSControl { + + /// Reactive wrapper for control event. + public var controlEvent: ControlEvent { + MainScheduler.ensureExecutingOnScheduler() + + let source = lazyInstanceObservable(&rx_control_events_key) { () -> Observable in + Observable.create { [weak control = self.base] observer in + MainScheduler.ensureExecutingOnScheduler() + + guard let control = control else { + observer.on(.completed) + return Disposables.create() + } + + let observer = ControlTarget(control: control) { control in + observer.on(.next()) + } + + return observer + }.takeUntil(self.deallocated) + } + + return ControlEvent(events: source) + } + + /// You might be wondering why the ugly `as!` casts etc, well, for some reason if + /// Swift compiler knows C is UIControl type and optimizations are turned on, it will crash. + static func value(_ control: C, getter: @escaping (C) -> T, setter: @escaping (C, T) -> Void) -> ControlProperty { + MainScheduler.ensureExecutingOnScheduler() + + let source = (control as! NSObject).rx.lazyInstanceObservable(&rx_value_key) { () -> Observable in + return Observable.create { [weak weakControl = control] (observer: AnyObserver) in + guard let control = weakControl else { + observer.on(.completed) + return Disposables.create() + } + + observer.on(.next(getter(control))) + + let observer = ControlTarget(control: control as! NSControl) { _ in + if let control = weakControl { + observer.on(.next(getter(control))) + } + } + + return observer + } + .distinctUntilChanged() + .takeUntil((control as! NSObject).rx.deallocated) + } + + let bindingObserver = UIBindingObserver(UIElement: control, binding: setter) + + return ControlProperty(values: source, valueSink: bindingObserver) + } + + /// Bindable sink for `enabled` property. + public var isEnabled: UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { (owner, value) in + owner.isEnabled = value + } + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSImageView+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSImageView+Rx.swift new file mode 100644 index 0000000..676f043 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSImageView+Rx.swift @@ -0,0 +1,46 @@ +// +// NSImageView+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif +import Cocoa + +extension Reactive where Base: NSImageView { + + /// Bindable sink for `image` property. + public var image: UIBindingObserver { + return image(transitionType: nil) + } + + /// Bindable sink for `image` property. + /// + /// - parameter transitionType: Optional transition type while setting the image (kCATransitionFade, kCATransitionMoveIn, ...) + public func image(transitionType: String? = nil) -> UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { control, value in + if let transitionType = transitionType { + if value != nil { + let transition = CATransition() + transition.duration = 0.25 + transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) + transition.type = transitionType + control.layer?.add(transition, forKey: kCATransition) + } + } + else { + control.layer?.removeAllAnimations() + } + control.image = value + } + } +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift new file mode 100644 index 0000000..e987e62 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift @@ -0,0 +1,34 @@ +// +// NSSlider+Rx.swift +// RxCocoa +// +// Created by Junior B. on 24/05/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + +import Foundation +#if !RX_NO_MODULE +import RxSwift +#endif +import Cocoa + +extension Reactive where Base: NSSlider { + + /// Reactive wrapper for `value` property. + public var value: ControlProperty { + return NSControl.rx.value( + base, + getter: { control in + return control.doubleValue + }, + setter: { control, value in + control.doubleValue = value + } + ) + } + +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSTextField+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSTextField+Rx.swift new file mode 100644 index 0000000..a20c4b4 --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSTextField+Rx.swift @@ -0,0 +1,104 @@ +// +// NSTextField+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 5/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + +import Foundation +import Cocoa +#if !RX_NO_MODULE +import RxSwift +#endif + +/// Delegate proxy for `NSTextField`. +/// +/// For more information take a look at `DelegateProxyType`. +public class RxTextFieldDelegateProxy + : DelegateProxy + , NSTextFieldDelegate + , DelegateProxyType { + + fileprivate let textSubject = PublishSubject() + + /// Typed parent object. + public weak private(set) var textField: NSTextField? + + /// Initializes `RxTextFieldDelegateProxy` + /// + /// - parameter parentObject: Parent object for delegate proxy. + public required init(parentObject: AnyObject) { + self.textField = castOrFatalError(parentObject) + super.init(parentObject: parentObject) + } + + // MARK: Delegate methods + + public override func controlTextDidChange(_ notification: Notification) { + let textField: NSTextField = castOrFatalError(notification.object) + let nextValue = textField.stringValue + self.textSubject.on(.next(nextValue)) + } + + // MARK: Delegate proxy methods + + /// For more information take a look at `DelegateProxyType`. + public override class func createProxyForObject(_ object: AnyObject) -> AnyObject { + let control: NSTextField = castOrFatalError(object) + return control.createRxDelegateProxy() + } + + /// For more information take a look at `DelegateProxyType`. + public class func currentDelegateFor(_ object: AnyObject) -> AnyObject? { + let textField: NSTextField = castOrFatalError(object) + return textField.delegate + } + + /// For more information take a look at `DelegateProxyType`. + public class func setCurrentDelegate(_ delegate: AnyObject?, toObject object: AnyObject) { + let textField: NSTextField = castOrFatalError(object) + textField.delegate = castOptionalOrFatalError(delegate) + } + +} + +extension NSTextField { + + /// Factory method that enables subclasses to implement their own `delegate`. + /// + /// - returns: Instance of delegate proxy that wraps `delegate`. + public func createRxDelegateProxy() -> RxTextFieldDelegateProxy { + return RxTextFieldDelegateProxy(parentObject: self) + } +} + +extension Reactive where Base: NSTextField { + + /// Reactive wrapper for `delegate`. + /// + /// For more information take a look at `DelegateProxyType` protocol documentation. + public var delegate: DelegateProxy { + return RxTextFieldDelegateProxy.proxyForObject(base) + } + + /// Reactive wrapper for `text` property. + public var text: ControlProperty { + let delegate = RxTextFieldDelegateProxy.proxyForObject(base) + + let source = Observable.deferred { [weak textField = self.base] in + delegate.textSubject.startWith(textField?.stringValue) + }.takeUntil(deallocated) + + let observer = UIBindingObserver(UIElement: base) { (control, value: String?) in + control.stringValue = value ?? "" + } + + return ControlProperty(values: source, valueSink: observer.asObserver()) + } + +} + +#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSView+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSView+Rx.swift new file mode 100644 index 0000000..74bb16a --- /dev/null +++ b/Pods/RxCocoa/RxCocoa/macOS/NSView+Rx.swift @@ -0,0 +1,33 @@ +// +// NSView+Rx.swift +// RxCocoa +// +// Created by Krunoslav Zaher on 12/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) + + import Foundation + import Cocoa + #if !RX_NO_MODULE + import RxSwift + #endif + + extension Reactive where Base: NSView { + /// Bindable sink for `hidden` property. + public var isHidden: UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { view, value in + view.isHidden = value + } + } + + /// Bindable sink for `alphaValue` property. + public var alpha: UIBindingObserver { + return UIBindingObserver(UIElement: self.base) { view, value in + view.alphaValue = value + } + } + } + +#endif diff --git a/Pods/RxSwift/LICENSE.md b/Pods/RxSwift/LICENSE.md new file mode 100644 index 0000000..d6765d9 --- /dev/null +++ b/Pods/RxSwift/LICENSE.md @@ -0,0 +1,9 @@ +**The MIT License** +**Copyright © 2015 Krunoslav Zaher** +**All rights reserved.** + +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: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +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. \ No newline at end of file diff --git a/Pods/RxSwift/Platform/DataStructures/Bag.swift b/Pods/RxSwift/Platform/DataStructures/Bag.swift new file mode 100644 index 0000000..4ab6f94 --- /dev/null +++ b/Pods/RxSwift/Platform/DataStructures/Bag.swift @@ -0,0 +1,167 @@ +// +// Bag.swift +// Platform +// +// Created by Krunoslav Zaher on 2/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Swift + +let arrayDictionaryMaxSize = 30 + +struct BagKey { + /** + Unique identifier for object added to `Bag`. + + It's underlying type is UInt64. If we assume there in an idealized CPU that works at 4GHz, + it would take ~150 years of continuous running time for it to overflow. + */ + fileprivate let rawValue: UInt64 +} + +/** +Data structure that represents a bag of elements typed `T`. + +Single element can be stored multiple times. + +Time and space complexity of insertion an deletion is O(n). + +It is suitable for storing small number of elements. +*/ +struct Bag : CustomDebugStringConvertible { + /// Type of identifier for inserted elements. + typealias KeyType = BagKey + + typealias Entry = (key: BagKey, value: T) + + fileprivate var _nextKey: BagKey = BagKey(rawValue: 0) + + // data + + // first fill inline variables + var _key0: BagKey? = nil + var _value0: T? = nil + + // last is sparse dictionary + var _dictionary: [BagKey : T]? = nil + + var _onlyFastPath = true + + /// Creates new empty `Bag`. + init() { + } + + /** + Inserts `value` into bag. + + - parameter element: Element to insert. + - returns: Key that can be used to remove element from bag. + */ + mutating func insert(_ element: T) -> BagKey { + let key = _nextKey + + _nextKey = BagKey(rawValue: _nextKey.rawValue &+ 1) + + if _key0 == nil { + _key0 = key + _value0 = element + return key + } + + _onlyFastPath = false + + if _dictionary != nil { + _dictionary![key] = element + return key + } + + if _dictionary == nil { + _dictionary = [:] + } + + _dictionary![key] = element + + return key + } + + /// - returns: Number of elements in bag. + var count: Int { + let dictionaryCount: Int = _dictionary?.count ?? 0 + return (_value0 != nil ? 1 : 0) + dictionaryCount + } + + /// Removes all elements from bag and clears capacity. + mutating func removeAll() { + _key0 = nil + _value0 = nil + + _dictionary?.removeAll(keepingCapacity: false) + } + + /** + Removes element with a specific `key` from bag. + + - parameter key: Key that identifies element to remove from bag. + - returns: Element that bag contained, or nil in case element was already removed. + */ + mutating func removeKey(_ key: BagKey) -> T? { + if _key0 == key { + _key0 = nil + let value = _value0! + _value0 = nil + return value + } + + if let existingObject = _dictionary?.removeValue(forKey: key) { + return existingObject + } + + return nil + } +} + +extension Bag { + /// A textual representation of `self`, suitable for debugging. + var debugDescription : String { + return "\(self.count) elements in Bag" + } +} + +extension Bag { + /// Enumerates elements inside the bag. + /// + /// - parameter action: Enumeration closure. + func forEach(_ action: (T) -> Void) { + if _onlyFastPath { + if let value0 = _value0 { + action(value0) + } + return + } + + let value0 = _value0 + let dictionary = _dictionary + + if let value0 = value0 { + action(value0) + } + + if dictionary?.count ?? 0 > 0 { + for element in dictionary!.values { + action(element) + } + } + } +} + +extension BagKey: Hashable { + var hashValue: Int { + return rawValue.hashValue + } +} + +func ==(lhs: BagKey, rhs: BagKey) -> Bool { + return lhs.rawValue == rhs.rawValue +} diff --git a/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift b/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift new file mode 100644 index 0000000..5fad383 --- /dev/null +++ b/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift @@ -0,0 +1,28 @@ +// +// InfiniteSequence.swift +// Platform +// +// Created by Krunoslav Zaher on 6/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Sequence that repeats `repeatedValue` infinite number of times. +struct InfiniteSequence : Sequence { + typealias Element = E + typealias Iterator = AnyIterator + + private let _repeatedValue: E + + init(repeatedValue: E) { + _repeatedValue = repeatedValue + } + + func makeIterator() -> Iterator { + let repeatedValue = _repeatedValue + return AnyIterator { + return repeatedValue + } + } +} diff --git a/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift b/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift new file mode 100644 index 0000000..725feef --- /dev/null +++ b/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift @@ -0,0 +1,114 @@ +// +// PriorityQueue.swift +// Platform +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct PriorityQueue { + private let _hasHigherPriority: (Element, Element) -> Bool + private let _isEqual: (Element, Element) -> Bool + + fileprivate var _elements = [Element]() + + init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) { + _hasHigherPriority = hasHigherPriority + _isEqual = isEqual + } + + mutating func enqueue(_ element: Element) { + _elements.append(element) + bubbleToHigherPriority(_elements.count - 1) + } + + func peek() -> Element? { + return _elements.first + } + + var isEmpty: Bool { + return _elements.count == 0 + } + + mutating func dequeue() -> Element? { + guard let front = peek() else { + return nil + } + + removeAt(0) + + return front + } + + mutating func remove(_ element: Element) { + for i in 0 ..< _elements.count { + if _isEqual(_elements[i], element) { + removeAt(i) + return + } + } + } + + private mutating func removeAt(_ index: Int) { + let removingLast = index == _elements.count - 1 + if !removingLast { + swap(&_elements[index], &_elements[_elements.count - 1]) + } + + _ = _elements.popLast() + + if !removingLast { + bubbleToHigherPriority(index) + bubbleToLowerPriority(index) + } + } + + private mutating func bubbleToHigherPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + + while unbalancedIndex > 0 { + let parentIndex = (unbalancedIndex - 1) / 2 + guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break } + + swap(&_elements[unbalancedIndex], &_elements[parentIndex]) + unbalancedIndex = parentIndex + } + } + + private mutating func bubbleToLowerPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + while true { + let leftChildIndex = unbalancedIndex * 2 + 1 + let rightChildIndex = unbalancedIndex * 2 + 2 + + var highestPriorityIndex = unbalancedIndex + + if leftChildIndex < _elements.count && _hasHigherPriority(_elements[leftChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = leftChildIndex + } + + if rightChildIndex < _elements.count && _hasHigherPriority(_elements[rightChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = rightChildIndex + } + + guard highestPriorityIndex != unbalancedIndex else { break } + + swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex]) + unbalancedIndex = highestPriorityIndex + } + } +} + +extension PriorityQueue : CustomDebugStringConvertible { + var debugDescription: String { + return _elements.debugDescription + } +} diff --git a/Pods/RxSwift/Platform/DataStructures/Queue.swift b/Pods/RxSwift/Platform/DataStructures/Queue.swift new file mode 100644 index 0000000..cfe3df4 --- /dev/null +++ b/Pods/RxSwift/Platform/DataStructures/Queue.swift @@ -0,0 +1,154 @@ +// +// Queue.swift +// Platform +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** +Data structure that represents queue. + +Complexity of `enqueue`, `dequeue` is O(1) when number of operations is +averaged over N operations. + +Complexity of `peek` is O(1). +*/ +struct Queue: Sequence { + /// Type of generator. + typealias Generator = AnyIterator + + private let _resizeFactor = 2 + + private var _storage: ContiguousArray + private var _count = 0 + private var _pushNextIndex = 0 + private let _initialCapacity: Int + + /** + Creates new queue. + + - parameter capacity: Capacity of newly created queue. + */ + init(capacity: Int) { + _initialCapacity = capacity + + _storage = ContiguousArray(repeating: nil, count: capacity) + } + + private var dequeueIndex: Int { + let index = _pushNextIndex - count + return index < 0 ? index + _storage.count : index + } + + /// - returns: Is queue empty. + var isEmpty: Bool { + return count == 0 + } + + /// - returns: Number of elements inside queue. + var count: Int { + return _count + } + + /// - returns: Element in front of a list of elements to `dequeue`. + func peek() -> T { + precondition(count > 0) + + return _storage[dequeueIndex]! + } + + mutating private func resizeTo(_ size: Int) { + var newStorage = ContiguousArray(repeating: nil, count: size) + + let count = _count + + let dequeueIndex = self.dequeueIndex + let spaceToEndOfQueue = _storage.count - dequeueIndex + + // first batch is from dequeue index to end of array + let countElementsInFirstBatch = Swift.min(count, spaceToEndOfQueue) + // second batch is wrapped from start of array to end of queue + let numberOfElementsInSecondBatch = count - countElementsInFirstBatch + + newStorage[0 ..< countElementsInFirstBatch] = _storage[dequeueIndex ..< (dequeueIndex + countElementsInFirstBatch)] + newStorage[countElementsInFirstBatch ..< (countElementsInFirstBatch + numberOfElementsInSecondBatch)] = _storage[0 ..< numberOfElementsInSecondBatch] + + _count = count + _pushNextIndex = count + _storage = newStorage + } + + /// Enqueues `element`. + /// + /// - parameter element: Element to enqueue. + mutating func enqueue(_ element: T) { + if count == _storage.count { + resizeTo(Swift.max(_storage.count, 1) * _resizeFactor) + } + + _storage[_pushNextIndex] = element + _pushNextIndex += 1 + _count += 1 + + if _pushNextIndex >= _storage.count { + _pushNextIndex -= _storage.count + } + } + + private mutating func dequeueElementOnly() -> T { + precondition(count > 0) + + let index = dequeueIndex + + defer { + _storage[index] = nil + _count -= 1 + } + + return _storage[index]! + } + + /// Dequeues element or throws an exception in case queue is empty. + /// + /// - returns: Dequeued element. + mutating func dequeue() -> T? { + if self.count == 0 { + return nil + } + + defer { + let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor) + if _count < downsizeLimit && downsizeLimit >= _initialCapacity { + resizeTo(_storage.count / _resizeFactor) + } + } + + return dequeueElementOnly() + } + + /// - returns: Generator of contained elements. + func makeIterator() -> AnyIterator { + var i = dequeueIndex + var count = _count + + return AnyIterator { + if count == 0 { + return nil + } + + defer { + count -= 1 + i += 1 + } + + if i >= self._storage.count { + i -= self._storage.count + } + + return self._storage[i] + } + } +} diff --git a/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift b/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift new file mode 100644 index 0000000..0df1ce7 --- /dev/null +++ b/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift @@ -0,0 +1,22 @@ +// +// DispatchQueue+Extensions.swift +// Platform +// +// Created by Krunoslav Zaher on 10/22/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +extension DispatchQueue { + private static var token: DispatchSpecificKey<()> = { + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + return key + }() + + static var isMain: Bool { + return DispatchQueue.getSpecific(key: token) != nil + } +} diff --git a/Pods/RxSwift/Platform/Platform.Darwin.swift b/Pods/RxSwift/Platform/Platform.Darwin.swift new file mode 100644 index 0000000..e0d7f0d --- /dev/null +++ b/Pods/RxSwift/Platform/Platform.Darwin.swift @@ -0,0 +1,49 @@ +// +// Platform.Darwin.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) + + import Darwin + import Foundation + + typealias AtomicInt = Int32 + + let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier + let AtomicIncrement = OSAtomicIncrement32Barrier + let AtomicDecrement = OSAtomicDecrement32Barrier + + extension Thread { + + static func setThreadLocalStorageValue(_ value: T?, forKey key: String + ) { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + + } + static func getThreadLocalStorageValueForKey(_ key: String) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + + extension AtomicInt { + func valueSnapshot() -> Int32 { + return self + } + } + +#endif diff --git a/Pods/RxSwift/Platform/Platform.Linux.swift b/Pods/RxSwift/Platform/Platform.Linux.swift new file mode 100644 index 0000000..ae5a49d --- /dev/null +++ b/Pods/RxSwift/Platform/Platform.Linux.swift @@ -0,0 +1,97 @@ +// +// Platform.Linux.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(Linux) + //////////////////////////////////////////////////////////////////////////////// + // This is not the greatest API in the world, this is just a tribute. + // !!! Proof of concept until libdispatch becomes operational. !!! + //////////////////////////////////////////////////////////////////////////////// + + import Foundation + import XCTest + import Glibc + import SwiftShims + + final class AtomicInt { + typealias IntegerLiteralType = Int + fileprivate var value: Int32 = 0 + fileprivate var _lock = NSRecursiveLock() + + func lock() { + _lock.lock() + } + func unlock() { + _lock.unlock() + } + + func valueSnapshot() -> Int32 { + return value + } + } + + extension AtomicInt: ExpressibleByIntegerLiteral { + convenience init(integerLiteral value: Int) { + self.init() + self.value = Int32(value) + } + } + + func >(lhs: AtomicInt, rhs: Int32) -> Bool { + return lhs.value > rhs + } + func ==(lhs: AtomicInt, rhs: Int32) -> Bool { + return lhs.value == rhs + } + + func AtomicIncrement(_ atomic: inout AtomicInt) -> Int32 { + atomic.lock(); defer { atomic.unlock() } + atomic.value += 1 + return atomic.value + } + + func AtomicDecrement(_ atomic: inout AtomicInt) -> Int32 { + atomic.lock(); defer { atomic.unlock() } + atomic.value -= 1 + return atomic.value + } + + func AtomicCompareAndSwap(_ l: Int32, _ r: Int32, _ atomic: inout AtomicInt) -> Bool { + atomic.lock(); defer { atomic.unlock() } + if atomic.value == l { + atomic.value = r + return true + } + + return false + } + + extension Thread { + + static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { + let currentThread = Thread.current + var threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + + currentThread.threadDictionary = threadDictionary + } + + static func getThreadLocalStorageValueForKey(_ key: String) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + +#endif diff --git a/Pods/RxSwift/README.md b/Pods/RxSwift/README.md new file mode 100644 index 0000000..c80e351 --- /dev/null +++ b/Pods/RxSwift/README.md @@ -0,0 +1,208 @@ +Miss Electric Eel 2016 RxSwift: ReactiveX for Swift +====================================== + +[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-333333.svg) ![pod](https://img.shields.io/cocoapods/v/RxSwift.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) + +## About Rx + +**:warning: This readme describes RxSwift 3.0 version that requires Swift 3.0.** + +**:warning: If you are looking for Swift 2.3 compatible version, please take a look at RxSwift ~> 2.0 versions and [swift-2.3](https://github.com/ReactiveX/RxSwift/tree/rxswift-2.0) branch.** + +Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable` interface. + +This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET). + +It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment. + +Cross platform documentation can be found on [ReactiveX.io](http://reactivex.io/). + +Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams. + +KVO observing, async operations and streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful. + +## I came here because I want to ... + +###### ... understand + +* [why use rx?](Documentation/Why.md) +* [the basics, getting started with RxSwift](Documentation/GettingStarted.md) +* [units](Documentation/Units.md) - what is `Driver`, `ControlProperty`, and `Variable` ... and why do they exist? +* [testing](Documentation/UnitTests.md) +* [tips and common errors](Documentation/Tips.md) +* [debugging](Documentation/GettingStarted.md#debugging) +* [the math behind Rx](Documentation/MathBehindRx.md) +* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md) + +###### ... install + +* Integrate RxSwift/RxCocoa with my app. [Installation Guide](#installation) + +###### ... hack around + +* with the example app. [Running Example App](Documentation/ExampleApp.md) +* with operators in playgrounds. [Playgrounds](Documentation/Playgrounds.md) + +###### ... interact + +* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences.
[![Slack channel](http://rxswift-slack.herokuapp.com/badge.svg)](http://slack.rxswift.org) [Join Slack Channel](http://rxswift-slack.herokuapp.com) +* Report a problem using the library. [Open an Issue With Bug Template](.github/ISSUE_TEMPLATE.md) +* Request a new feature. [Open an Issue With Feature Request Template](Documentation/NewFeatureRequestTemplate.md) + + +###### ... compare + +* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). + + +###### ... find compatible + +* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity). +* [Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift). + +###### ... see the broader vision + +* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava) +* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx. + +## Usage + + + + + + + + + + + + + + + + + + + +
Here's an exampleIn Action
Define search for GitHub repositories ...
+let searchResults = searchBar.rx.text.orEmpty
+    .throttle(0.3, scheduler: MainScheduler.instance)
+    .distinctUntilChanged()
+    .flatMapLatest { query -> Observable<[Repository]> in
+        if query.isEmpty {
+            return .just([])
+        }
+
+        return searchGitHub(query)
+            .catchErrorJustReturn([])
+    }
+    .observeOn(MainScheduler.instance)
... then bind the results to your tableview
+searchResults
+    .bindTo(tableView.rx.items(cellIdentifier: "Cell")) {
+        (index, repository: Repository, cell) in
+        cell.textLabel?.text = repository.name
+        cell.detailTextLabel?.text = repository.url
+    }
+    .addDisposableTo(disposeBag)
+ + +## Requirements + +* Xcode 8.0 +* Swift 3.0 + +## Installation + +Rx doesn't contain any external dependencies. + +These are currently the supported options: + +### Manual + +Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run the sample app + +### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) + +**Tested with `pod --version`: `1.1.1`** + +``` +# Podfile +use_frameworks! + +target 'YOUR_TARGET_NAME' do + pod 'RxSwift', '~> 3.0' + pod 'RxCocoa', '~> 3.0' +end + +# RxTests and RxBlocking make the most sense in the context of unit/integration tests +target 'YOUR_TESTING_TARGET' do + pod 'RxBlocking', '~> 3.0' + pod 'RxTest', '~> 3.0' +end +``` + +Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: + +``` +$ pod install +``` + +### [Carthage](https://github.com/Carthage/Carthage) + +**Tested with `carthage version`: `0.18.1`** + +Add this to `Cartfile` + +``` +github "ReactiveX/RxSwift" ~> 3.0 +``` + +``` +$ carthage update +``` + +### [Swift Package Manager](https://github.com/apple/swift-package-manager) + +**Tested with `swift build --version`: `3.0.0 (swiftpm-19)`** + +Create a `Package.swift` file. + +``` +import PackageDescription + +let package = Package( + name: "RxTestProject", + targets: [], + dependencies: [ + .Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3) + ] +) +``` + +``` +$ swift build +``` + +### Manually using git submodules + +* Add RxSwift as a submodule + +``` +$ git submodule add git@github.com:ReactiveX/RxSwift.git +``` + +* Drag `Rx.xcodeproj` into Project Navigator +* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets + + +## References + +* [http://reactivex.io/](http://reactivex.io/) +* [Reactive Extensions GitHub (GitHub)](https://github.com/Reactive-Extensions) +* [Erik Meijer (Wikipedia)](http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29) +* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://youtu.be/looJcaeboBY) +* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc) +* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf) +* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/) +* [Haskell](https://www.haskell.org/) diff --git a/Pods/RxSwift/RxSwift/AnyObserver.swift b/Pods/RxSwift/RxSwift/AnyObserver.swift new file mode 100644 index 0000000..cab759a --- /dev/null +++ b/Pods/RxSwift/RxSwift/AnyObserver.swift @@ -0,0 +1,69 @@ +// +// AnyObserver.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// A type-erased `ObserverType`. +/// +/// Forwards operations to an arbitrary underlying observer with the same `Element` type, hiding the specifics of the underlying observer type. +public struct AnyObserver : ObserverType { + /// The type of elements in sequence that observer can observe. + public typealias E = Element + + /// Anonymous event handler type. + public typealias EventHandler = (Event) -> Void + + private let observer: EventHandler + + /// Construct an instance whose `on(event)` calls `eventHandler(event)` + /// + /// - parameter eventHandler: Event handler that observes sequences events. + public init(eventHandler: @escaping EventHandler) { + self.observer = eventHandler + } + + /// Construct an instance whose `on(event)` calls `observer.on(event)` + /// + /// - parameter observer: Observer that receives sequence events. + public init(_ observer: O) where O.E == Element { + self.observer = observer.on + } + + /// Send `event` to this observer. + /// + /// - parameter event: Event instance. + public func on(_ event: Event) { + return self.observer(event) + } + + /// Erases type of observer and returns canonical observer. + /// + /// - returns: type erased observer. + public func asObserver() -> AnyObserver { + return self + } +} + +extension ObserverType { + /// Erases type of observer and returns canonical observer. + /// + /// - returns: type erased observer. + public func asObserver() -> AnyObserver { + return AnyObserver(self) + } + + /// Transforms observer of type R to type E using custom transform method. + /// Each event sent to result observer is transformed and sent to `self`. + /// + /// - returns: observer that transforms events. + public func mapObserver(_ transform: @escaping (R) throws -> E) -> AnyObserver { + return AnyObserver { e in + self.on(e.map(transform)) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Cancelable.swift b/Pods/RxSwift/RxSwift/Cancelable.swift new file mode 100644 index 0000000..2398be6 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Cancelable.swift @@ -0,0 +1,15 @@ +// +// Cancelable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents disposable resource with state tracking. +public protocol Cancelable : Disposable { + /// Was resource disposed. + var isDisposed: Bool { get } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift b/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift new file mode 100644 index 0000000..3ba6ed2 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift @@ -0,0 +1,104 @@ +// +// AsyncLock.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** +In case nobody holds this lock, the work will be queued and executed immediately +on thread that is requesting lock. + +In case there is somebody currently holding that lock, action will be enqueued. +When owned of the lock finishes with it's processing, it will also execute +and pending work. + +That means that enqueued work could possibly be executed later on a different thread. +*/ +class AsyncLock + : Disposable + , Lock + , SynchronizedDisposeType { + typealias Action = () -> Void + + var _lock = SpinLock() + + private var _queue: Queue = Queue(capacity: 0) + + private var _isExecuting: Bool = false + private var _hasFaulted: Bool = false + + // lock { + func lock() { + _lock.lock() + } + + func unlock() { + _lock.unlock() + } + // } + + private func enqueue(_ action: I) -> I? { + _lock.lock(); defer { _lock.unlock() } // { + if _hasFaulted { + return nil + } + + if _isExecuting { + _queue.enqueue(action) + return nil + } + + _isExecuting = true + + return action + // } + } + + private func dequeue() -> I? { + _lock.lock(); defer { _lock.unlock() } // { + if _queue.count > 0 { + return _queue.dequeue() + } + else { + _isExecuting = false + return nil + } + // } + } + + func invoke(_ action: I) { + let firstEnqueuedAction = enqueue(action) + + if let firstEnqueuedAction = firstEnqueuedAction { + firstEnqueuedAction.invoke() + } + else { + // action is enqueued, it's somebody else's concern now + return + } + + while true { + let nextAction = dequeue() + + if let nextAction = nextAction { + nextAction.invoke() + } + else { + return + } + } + } + + func dispose() { + synchronizedDispose() + } + + func _synchronized_dispose() { + _queue = Queue(capacity: 0) + _hasFaulted = true + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/Lock.swift b/Pods/RxSwift/RxSwift/Concurrency/Lock.swift new file mode 100644 index 0000000..78ec442 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/Lock.swift @@ -0,0 +1,38 @@ +// +// Lock.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol Lock { + func lock() + func unlock() +} + +// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html +typealias SpinLock = NSRecursiveLock + +extension NSRecursiveLock : Lock { + @inline(__always) + func performLocked(_ action: () -> Void) { + lock(); defer { unlock() } + action() + } + + @inline(__always) + func calculateLocked(_ action: () -> T) -> T { + lock(); defer { unlock() } + return action() + } + + @inline(__always) + func calculateLockedOrFail(_ action: () throws -> T) throws -> T { + lock(); defer { unlock() } + let result = try action() + return result + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift b/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift new file mode 100644 index 0000000..41595a9 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift @@ -0,0 +1,23 @@ +// +// LockOwnerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol LockOwnerType : class, Lock { + var _lock: NSRecursiveLock { get } +} + +extension LockOwnerType { + func lock() { + _lock.lock() + } + + func unlock() { + _lock.unlock() + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift new file mode 100644 index 0000000..9bd95b9 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift @@ -0,0 +1,20 @@ +// +// SynchronizedDisposeType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol SynchronizedDisposeType : class, Disposable, Lock { + func _synchronized_dispose() +} + +extension SynchronizedDisposeType { + func synchronizedDispose() { + lock(); defer { unlock() } + _synchronized_dispose() + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift new file mode 100644 index 0000000..3c383d1 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift @@ -0,0 +1,20 @@ +// +// SynchronizedOnType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol SynchronizedOnType : class, ObserverType, Lock { + func _synchronized_on(_ event: Event) +} + +extension SynchronizedOnType { + func synchronizedOn(_ event: Event) { + lock(); defer { unlock() } + _synchronized_on(event) + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift new file mode 100644 index 0000000..ca79012 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift @@ -0,0 +1,20 @@ +// +// SynchronizedSubscribeType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol SynchronizedSubscribeType : class, ObservableType, Lock { + func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E +} + +extension SynchronizedSubscribeType { + func synchronizedSubscribe(_ observer: O) -> Disposable where O.E == E { + lock(); defer { unlock() } + return _synchronized_subscribe(observer) + } +} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift new file mode 100644 index 0000000..fc82ddd --- /dev/null +++ b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift @@ -0,0 +1,15 @@ +// +// SynchronizedUnsubscribeType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol SynchronizedUnsubscribeType : class { + associatedtype DisposeKey + + func synchronizedUnsubscribe(_ disposeKey: DisposeKey) +} diff --git a/Pods/RxSwift/RxSwift/ConnectableObservableType.swift b/Pods/RxSwift/RxSwift/ConnectableObservableType.swift new file mode 100644 index 0000000..bf8f5f0 --- /dev/null +++ b/Pods/RxSwift/RxSwift/ConnectableObservableType.swift @@ -0,0 +1,21 @@ +// +// ConnectableObservableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** +Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. +*/ +public protocol ConnectableObservableType : ObservableType { + /** + 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. + + - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. + */ + func connect() -> Disposable +} diff --git a/Pods/RxSwift/RxSwift/Disposable.swift b/Pods/RxSwift/RxSwift/Disposable.swift new file mode 100644 index 0000000..11e5d16 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposable.swift @@ -0,0 +1,15 @@ +// +// Disposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Respresents a disposable resource. +public protocol Disposable { + /// Dispose resource. + func dispose() +} diff --git a/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift new file mode 100644 index 0000000..74461a6 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift @@ -0,0 +1,63 @@ +// +// AnonymousDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents an Action-based disposable. +/// +/// When dispose method is called, disposal action will be dereferenced. +fileprivate final class AnonymousDisposable : DisposeBase, Cancelable { + public typealias DisposeAction = () -> Void + + private var _isDisposed: AtomicInt = 0 + private var _disposeAction: DisposeAction? + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return _isDisposed == 1 + } + + /// Constructs a new disposable with the given action used for disposal. + /// + /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. + fileprivate init(_ disposeAction: @escaping DisposeAction) { + _disposeAction = disposeAction + super.init() + } + + // Non-deprecated version of the constructor, used by `Disposables.create(with:)` + fileprivate init(disposeAction: @escaping DisposeAction) { + _disposeAction = disposeAction + super.init() + } + + /// Calls the disposal action if and only if the current instance hasn't been disposed yet. + /// + /// After invoking disposal action, disposal action will be dereferenced. + fileprivate func dispose() { + if AtomicCompareAndSwap(0, 1, &_isDisposed) { + assert(_isDisposed == 1) + + if let action = _disposeAction { + _disposeAction = nil + action() + } + } + } +} + +extension Disposables { + + /// Constructs a new disposable with the given action used for disposal. + /// + /// - parameter dispose: Disposal action which will be run upon calling `dispose`. + public static func create(with dispose: @escaping () -> ()) -> Cancelable { + return AnonymousDisposable(disposeAction: dispose) + } + +} diff --git a/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift new file mode 100644 index 0000000..aef8200 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift @@ -0,0 +1,55 @@ +// +// BinaryDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents two disposable resources that are disposed together. +private final class BinaryDisposable : DisposeBase, Cancelable { + + private var _isDisposed: AtomicInt = 0 + + // state + private var _disposable1: Disposable? + private var _disposable2: Disposable? + + /// - returns: Was resource disposed. + var isDisposed: Bool { + return _isDisposed > 0 + } + + /// Constructs new binary disposable from two disposables. + /// + /// - parameter disposable1: First disposable + /// - parameter disposable2: Second disposable + init(_ disposable1: Disposable, _ disposable2: Disposable) { + _disposable1 = disposable1 + _disposable2 = disposable2 + super.init() + } + + /// Calls the disposal action if and only if the current instance hasn't been disposed yet. + /// + /// After invoking disposal action, disposal action will be dereferenced. + func dispose() { + if AtomicCompareAndSwap(0, 1, &_isDisposed) { + _disposable1?.dispose() + _disposable2?.dispose() + _disposable1 = nil + _disposable2 = nil + } + } +} + +extension Disposables { + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable) -> Cancelable { + return BinaryDisposable(disposable1, disposable2) + } + +} diff --git a/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift new file mode 100644 index 0000000..bdd285e --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift @@ -0,0 +1,35 @@ +// +// BooleanDisposable.swift +// RxSwift +// +// Created by Junior B. on 10/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a disposable resource that can be checked for disposal status. +public final class BooleanDisposable : Disposable, Cancelable { + + internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true) + private var _isDisposed = false + + /// Initializes a new instance of the `BooleanDisposable` class + public init() { + } + + /// Initializes a new instance of the `BooleanDisposable` class with given value + public init(isDisposed: Bool) { + self._isDisposed = isDisposed + } + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return _isDisposed + } + + /// Sets the status to disposed, which can be observer through the `isDisposed` property. + public func dispose() { + _isDisposed = true + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift new file mode 100644 index 0000000..e8c31df --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift @@ -0,0 +1,153 @@ +// +// CompositeDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/20/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a group of disposable resources that are disposed together. +public final class CompositeDisposable : DisposeBase, Disposable, Cancelable { + /// Key used to remove disposable from composite disposable + public struct DisposeKey { + fileprivate let key: BagKey + fileprivate init(key: BagKey) { + self.key = key + } + } + + private var _lock = SpinLock() + + // state + private var _disposables: Bag? = Bag() + + public var isDisposed: Bool { + _lock.lock(); defer { _lock.unlock() } + return _disposables == nil + } + + public override init() { + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + let _ = _disposables!.insert(disposable1) + let _ = _disposables!.insert(disposable2) + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + let _ = _disposables!.insert(disposable1) + let _ = _disposables!.insert(disposable2) + let _ = _disposables!.insert(disposable3) + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposable4: Disposable, _ disposables: Disposable...) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + let _ = _disposables!.insert(disposable1) + let _ = _disposables!.insert(disposable2) + let _ = _disposables!.insert(disposable3) + let _ = _disposables!.insert(disposable4) + + for disposable in disposables { + let _ = _disposables!.insert(disposable) + } + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(disposables: [Disposable]) { + for disposable in disposables { + let _ = _disposables!.insert(disposable) + } + } + + /** + Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. + + - parameter disposable: Disposable to add. + - returns: Key that can be used to remove disposable from composite disposable. In case dispose bag was already + disposed `nil` will be returned. + */ + public func insert(_ disposable: Disposable) -> DisposeKey? { + let key = _insert(disposable) + + if key == nil { + disposable.dispose() + } + + return key + } + + private func _insert(_ disposable: Disposable) -> DisposeKey? { + _lock.lock(); defer { _lock.unlock() } + + let bagKey = _disposables?.insert(disposable) + return bagKey.map(DisposeKey.init) + } + + /// - returns: Gets the number of disposables contained in the `CompositeDisposable`. + public var count: Int { + _lock.lock(); defer { _lock.unlock() } + return _disposables?.count ?? 0 + } + + /// Removes and disposes the disposable identified by `disposeKey` from the CompositeDisposable. + /// + /// - parameter disposeKey: Key used to identify disposable to be removed. + public func remove(for disposeKey: DisposeKey) { + _remove(for: disposeKey)?.dispose() + } + + private func _remove(for disposeKey: DisposeKey) -> Disposable? { + _lock.lock(); defer { _lock.unlock() } + return _disposables?.removeKey(disposeKey.key) + } + + /// Disposes all disposables in the group and removes them from the group. + public func dispose() { + if let disposables = _dispose() { + disposeAll(in: disposables) + } + } + + private func _dispose() -> Bag? { + _lock.lock(); defer { _lock.unlock() } + + let disposeBag = _disposables + _disposables = nil + + return disposeBag + } +} + +extension Disposables { + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) -> Cancelable { + return CompositeDisposable(disposable1, disposable2, disposable3) + } + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposables: Disposable ...) -> Cancelable { + var disposables = disposables + disposables.append(disposable1) + disposables.append(disposable2) + disposables.append(disposable3) + return CompositeDisposable(disposables: disposables) + } + + /// Creates a disposable with the given disposables. + public static func create(_ disposables: [Disposable]) -> Cancelable { + switch disposables.count { + case 2: + return Disposables.create(disposables[0], disposables[1]) + default: + return CompositeDisposable(disposables: disposables) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/Disposables.swift b/Pods/RxSwift/RxSwift/Disposables/Disposables.swift new file mode 100644 index 0000000..b409d52 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/Disposables.swift @@ -0,0 +1,15 @@ +// +// Disposables.swift +// RxSwift +// +// Created by Mohsen Ramezanpoor on 01/08/2016. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// A collection of utility methods for common disposable operations. +public struct Disposables { + private init() {} +} + diff --git a/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift b/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift new file mode 100644 index 0000000..d9cb86f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift @@ -0,0 +1,86 @@ +// +// DisposeBag.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +extension Disposable { + /// Adds `self` to `bag`. + /// + /// - parameter bag: `DisposeBag` to add `self` to. + public func addDisposableTo(_ bag: DisposeBag) { + bag.insert(self) + } +} + +/** +Thread safe bag that disposes added disposables on `deinit`. + +This returns ARC (RAII) like resource management to `RxSwift`. + +In case contained disposables need to be disposed, just put a different dispose bag +or create a new one in its place. + + self.existingDisposeBag = DisposeBag() + +In case explicit disposal is necessary, there is also `CompositeDisposable`. +*/ +public final class DisposeBag: DisposeBase { + + private var _lock = SpinLock() + + // state + private var _disposables = [Disposable]() + private var _isDisposed = false + + /// Constructs new empty dispose bag. + public override init() { + super.init() + } + + /// Adds `disposable` to be disposed when dispose bag is being deinited. + /// + /// - parameter disposable: Disposable to add. + public func insert(_ disposable: Disposable) { + _insert(disposable)?.dispose() + } + + private func _insert(_ disposable: Disposable) -> Disposable? { + _lock.lock(); defer { _lock.unlock() } + if _isDisposed { + return disposable + } + + _disposables.append(disposable) + + return nil + } + + /// This is internal on purpose, take a look at `CompositeDisposable` instead. + private func dispose() { + let oldDisposables = _dispose() + + for disposable in oldDisposables { + disposable.dispose() + } + } + + private func _dispose() -> [Disposable] { + _lock.lock(); defer { _lock.unlock() } + + let disposables = _disposables + + _disposables.removeAll(keepingCapacity: false) + _isDisposed = true + + return disposables + } + + deinit { + dispose() + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift b/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift new file mode 100644 index 0000000..0a363bb --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift @@ -0,0 +1,24 @@ +// +// DisposeBase.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Base class for all disposables. +public class DisposeBase { + init() { +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + } + + deinit { +#if TRACE_RESOURCES + let _ = Resources.decrementTotal() +#endif + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift new file mode 100644 index 0000000..9f1df16 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift @@ -0,0 +1,34 @@ +// +// NopDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a disposable that does nothing on disposal. +/// +/// Nop = No Operation +fileprivate struct NopDisposable : Disposable { + + fileprivate static let noOp: Disposable = NopDisposable() + + fileprivate init() { + + } + + /// Does nothing. + public func dispose() { + } +} + +extension Disposables { + /** + Creates a disposable that does nothing on disposal. + */ + static public func create() -> Disposable { + return NopDisposable.noOp + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift new file mode 100644 index 0000000..df0ab3e --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift @@ -0,0 +1,119 @@ +// +// RefCountDisposable.swift +// RxSwift +// +// Created by Junior B. on 10/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. +public final class RefCountDisposable : DisposeBase, Cancelable { + private var _lock = SpinLock() + private var _disposable = nil as Disposable? + private var _primaryDisposed = false + private var _count = 0 + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + _lock.lock(); defer { _lock.unlock() } + return _disposable == nil + } + + /// Initializes a new instance of the `RefCountDisposable`. + public init(disposable: Disposable) { + _disposable = disposable + super.init() + } + + /** + Holds a dependent disposable that when disposed decreases the refcount on the underlying disposable. + + When getter is called, a dependent disposable contributing to the reference count that manages the underlying disposable's lifetime is returned. + */ + public func retain() -> Disposable { + return _lock.calculateLocked { + if let _ = _disposable { + + do { + let _ = try incrementChecked(&_count) + } catch (_) { + rxFatalError("RefCountDisposable increment failed") + } + + return RefCountInnerDisposable(self) + } else { + return Disposables.create() + } + } + } + + /// Disposes the underlying disposable only when all dependent disposables have been disposed. + public func dispose() { + let oldDisposable: Disposable? = _lock.calculateLocked { + if let oldDisposable = _disposable, !_primaryDisposed + { + _primaryDisposed = true + + if (_count == 0) + { + _disposable = nil + return oldDisposable + } + } + + return nil + } + + if let disposable = oldDisposable { + disposable.dispose() + } + } + + fileprivate func release() { + let oldDisposable: Disposable? = _lock.calculateLocked { + if let oldDisposable = _disposable { + do { + let _ = try decrementChecked(&_count) + } catch (_) { + rxFatalError("RefCountDisposable decrement on release failed") + } + + guard _count >= 0 else { + rxFatalError("RefCountDisposable counter is lower than 0") + } + + if _primaryDisposed && _count == 0 { + _disposable = nil + return oldDisposable + } + } + + return nil + } + + if let disposable = oldDisposable { + disposable.dispose() + } + } +} + +internal final class RefCountInnerDisposable: DisposeBase, Disposable +{ + private let _parent: RefCountDisposable + private var _isDisposed: AtomicInt = 0 + + init(_ parent: RefCountDisposable) + { + _parent = parent + super.init() + } + + internal func dispose() + { + if AtomicCompareAndSwap(0, 1, &_isDisposed) { + _parent.release() + } + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift new file mode 100644 index 0000000..a922600 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift @@ -0,0 +1,52 @@ +// +// ScheduledDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +private let disposeScheduledDisposable: (ScheduledDisposable) -> Disposable = { sd in + sd.disposeInner() + return Disposables.create() +} + +/// Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. +public final class ScheduledDisposable : Cancelable { + public let scheduler: ImmediateSchedulerType + + private var _isDisposed: AtomicInt = 0 + + // state + private var _disposable: Disposable? + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return _isDisposed == 1 + } + + /** + Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. + + - parameter scheduler: Scheduler where the disposable resource will be disposed on. + - parameter disposable: Disposable resource to dispose on the given scheduler. + */ + public init(scheduler: ImmediateSchedulerType, disposable: Disposable) { + self.scheduler = scheduler + _disposable = disposable + } + + /// Disposes the wrapped disposable on the provided scheduler. + public func dispose() { + let _ = scheduler.schedule(self, action: disposeScheduledDisposable) + } + + func disposeInner() { + if AtomicCompareAndSwap(0, 1, &_isDisposed) { + _disposable!.dispose() + _disposable = nil + } + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift new file mode 100644 index 0000000..a87814f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift @@ -0,0 +1,77 @@ +// +// SerialDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. +public final class SerialDisposable : DisposeBase, Cancelable { + private var _lock = SpinLock() + + // state + private var _current = nil as Disposable? + private var _isDisposed = false + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return _isDisposed + } + + /// Initializes a new instance of the `SerialDisposable`. + override public init() { + super.init() + } + + /** + Gets or sets the underlying disposable. + + Assigning this property disposes the previous disposable object. + + If the `SerialDisposable` has already been disposed, assignment to this property causes immediate disposal of the given disposable object. + */ + public var disposable: Disposable { + get { + return _lock.calculateLocked { + return self.disposable + } + } + set (newDisposable) { + let disposable: Disposable? = _lock.calculateLocked { + if _isDisposed { + return newDisposable + } + else { + let toDispose = _current + _current = newDisposable + return toDispose + } + } + + if let disposable = disposable { + disposable.dispose() + } + } + } + + /// Disposes the underlying disposable as well as all future replacements. + public func dispose() { + _dispose()?.dispose() + } + + private func _dispose() -> Disposable? { + _lock.lock(); defer { _lock.unlock() } + if _isDisposed { + return nil + } + else { + _isDisposed = true + let current = _current + _current = nil + return current + } + } +} diff --git a/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift new file mode 100644 index 0000000..18d27ec --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift @@ -0,0 +1,97 @@ +// +// SingleAssignmentDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** +Represents a disposable resource which only allows a single assignment of its underlying disposable resource. + +If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception. +*/ +public class SingleAssignmentDisposable : DisposeBase, Disposable, Cancelable { +#if os(Linux) + fileprivate let _lock = SpinLock() +#endif + + fileprivate enum DisposeState: UInt32 { + case disposed = 1 + case disposableSet = 2 + } + + // Jeej, swift API consistency rules + fileprivate enum DisposeStateInt32: Int32 { + case disposed = 1 + case disposableSet = 2 + } + + // state + private var _state: UInt32 = 0 + private var _disposable = nil as Disposable? + + /// - returns: A value that indicates whether the object is disposed. + public var isDisposed: Bool { + return (_state & DisposeState.disposed.rawValue) != 0 + } + + /// Initializes a new instance of the `SingleAssignmentDisposable`. + public override init() { + super.init() + } + + /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined. + /// + /// **Throws exception if the `SingleAssignmentDisposable` has already been assigned to.** + public func setDisposable(_ disposable: Disposable) { + _disposable = disposable + + #if os(Linux) + _lock.lock() + let previousState = Int32(_state) + _state = _state | DisposeState.disposableSet.rawValue + // We know about `defer { _lock.unlock() }`, but this resolves Swift compiler bug. Using `defer` here causes anomaly. + _lock.unlock() + #else + let previousState = OSAtomicOr32OrigBarrier(DisposeState.disposableSet.rawValue, &_state) + #endif + + if (previousState & DisposeStateInt32.disposableSet.rawValue) != 0 { + rxFatalError("oldState.disposable != nil") + } + + if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { + disposable.dispose() + _disposable = nil + } + } + + /// Disposes the underlying disposable. + public func dispose() { + #if os(Linux) + _lock.lock() + let previousState = Int32(_state) + _state = _state | DisposeState.disposed.rawValue + // We know about `defer { _lock.unlock() }`, but this resolves Swift compiler bug. Using `defer` here causes anomaly. + _lock.unlock() + #else + let previousState = OSAtomicOr32OrigBarrier(DisposeState.disposed.rawValue, &_state) + #endif + + if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { + return + } + + if (previousState & DisposeStateInt32.disposableSet.rawValue) != 0 { + guard let disposable = _disposable else { + rxFatalError("Disposable not set") + } + disposable.dispose() + _disposable = nil + } + } + +} diff --git a/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift new file mode 100644 index 0000000..9a3d639 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift @@ -0,0 +1,23 @@ +// +// SubscriptionDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct SubscriptionDisposable : Disposable { + private let _key: T.DisposeKey + private weak var _owner: T? + + init(owner: T, key: T.DisposeKey) { + _owner = owner + _key = key + } + + func dispose() { + _owner?.synchronizedUnsubscribe(_key) + } +} diff --git a/Pods/RxSwift/RxSwift/Errors.swift b/Pods/RxSwift/RxSwift/Errors.swift new file mode 100644 index 0000000..92cb2f1 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Errors.swift @@ -0,0 +1,54 @@ +// +// Errors.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +let RxErrorDomain = "RxErrorDomain" +let RxCompositeFailures = "RxCompositeFailures" + +/// Generic Rx error codes. +public enum RxError + : Swift.Error + , CustomDebugStringConvertible { + /// Unknown error occured. + case unknown + /// Performing an action on disposed object. + case disposed(object: AnyObject) + /// Aritmetic overflow error. + case overflow + /// Argument out of range error. + case argumentOutOfRange + /// Sequence doesn't contain any elements. + case noElements + /// Sequence contains more than one element. + case moreThanOneElement + /// Timeout error. + case timeout +} + +extension RxError { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + switch self { + case .unknown: + return "Unknown error occured." + case .disposed(let object): + return "Object `\(object)` was already disposed." + case .overflow: + return "Arithmetic overflow occured." + case .argumentOutOfRange: + return "Argument out of range." + case .noElements: + return "Sequence doesn't contain any elements." + case .moreThanOneElement: + return "Sequence contains more than one element." + case .timeout: + return "Sequence timeout." + } + } +} diff --git a/Pods/RxSwift/RxSwift/Event.swift b/Pods/RxSwift/RxSwift/Event.swift new file mode 100644 index 0000000..d0f995c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Event.swift @@ -0,0 +1,84 @@ +// +// Event.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a sequence event. +/// +/// Sequence grammar: +/// **next\* (error | completed)** +public enum Event { + /// Next element is produced. + case next(Element) + + /// Sequence terminated with an error. + case error(Swift.Error) + + /// Sequence completed successfully. + case completed +} + +extension Event : CustomDebugStringConvertible { + /// - returns: Description of event. + public var debugDescription: String { + switch self { + case .next(let value): + return "next(\(value))" + case .error(let error): + return "error(\(error))" + case .completed: + return "completed" + } + } +} + +extension Event { + /// Is `Completed` or `Error` event. + public var isStopEvent: Bool { + switch self { + case .next: return false + case .error, .completed: return true + } + } + + /// If `Next` event, returns element value. + public var element: Element? { + if case .next(let value) = self { + return value + } + return nil + } + + /// If `Error` event, returns error. + public var error: Swift.Error? { + if case .error(let error) = self { + return error + } + return nil + } +} + +extension Event { + /// Maps sequence elements using transform. If error happens during the transform .error + /// will be returned as value + public func map(_ transform: (Element) throws -> Result) -> Event { + do { + switch self { + case let .next(element): + return .next(try transform(element)) + case let .error(error): + return .error(error) + case .completed: + return .completed + } + } + catch let e { + return .error(e) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift b/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift new file mode 100644 index 0000000..7a917e3 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift @@ -0,0 +1,58 @@ +// +// Bag+Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/19/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + +// MARK: forEach + +extension Bag where T: ObserverType { + /// Dispatches `event` to app observers contained inside bag. + /// + /// - parameter action: Enumeration closure. + func on(_ event: Event) { + if _onlyFastPath { + _value0?.on(event) + return + } + + let value0 = _value0 + let dictionary = _dictionary + + if let value0 = value0 { + value0.on(event) + } + + if let dictionary = dictionary { + for element in dictionary.values { + element.on(event) + } + } + } +} + +/// Dispatches `dispose` to all disposables contained inside bag. +func disposeAll(in bag: Bag) { + if bag._onlyFastPath { + bag._value0?.dispose() + return + } + + let value0 = bag._value0 + let dictionary = bag._dictionary + + if let value0 = value0 { + value0.dispose() + } + + if let dictionary = dictionary { + for element in dictionary.values { + element.dispose() + } + } +} diff --git a/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift b/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift new file mode 100644 index 0000000..40fd9a8 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift @@ -0,0 +1,24 @@ +// +// String+Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +extension String { + /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` + func lastIndexOf(_ character: Character) -> Index? { + var index = endIndex + while index > startIndex { + index = self.index(before: index) + if self[index] == character { + return index + } + } + + return nil + } +} diff --git a/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift b/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift new file mode 100644 index 0000000..fa0c2d3 --- /dev/null +++ b/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift @@ -0,0 +1,38 @@ +// +// ImmediateSchedulerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents an object that immediately schedules units of work. +public protocol ImmediateSchedulerType { + /** + Schedules an action to be executed immediatelly. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable +} + +extension ImmediateSchedulerType { + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - 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. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRecursive(_ state: State, action: @escaping (_ state: State, _ recurse: (State) -> ()) -> ()) -> Disposable { + let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) + + recursiveScheduler.schedule(state) + + return Disposables.create(with: recursiveScheduler.dispose) + } +} diff --git a/Pods/RxSwift/RxSwift/Observable.swift b/Pods/RxSwift/RxSwift/Observable.swift new file mode 100644 index 0000000..f394063 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observable.swift @@ -0,0 +1,46 @@ +// +// Observable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// A type-erased `ObservableType`. +/// +/// It represents a push style sequence. +public class Observable : ObservableType { + /// Type of elements in sequence. + public typealias E = Element + + init() { +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + } + + public func subscribe(_ observer: O) -> Disposable where O.E == E { + abstractMethod() + } + + public func asObservable() -> Observable { + return self + } + + deinit { +#if TRACE_RESOURCES + let _ = Resources.decrementTotal() +#endif + } + + // this is kind of ugly I know :( + // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ + + /// Optimizations for map operator + internal func composeMap(_ selector: @escaping (Element) throws -> R) -> Observable { + return Map(source: self, transform: selector) + } +} + diff --git a/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift b/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift new file mode 100644 index 0000000..2a94d63 --- /dev/null +++ b/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift @@ -0,0 +1,20 @@ +// +// ObservableConvertibleType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Type that can be converted to observable sequence (`Observer`). +public protocol ObservableConvertibleType { + /// Type of elements in sequence. + associatedtype E + + /// Converts `self` to `Observable` sequence. + /// + /// - returns: Observable sequence that represents `self`. + func asObservable() -> Observable +} diff --git a/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift b/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift new file mode 100644 index 0000000..ea225ab --- /dev/null +++ b/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift @@ -0,0 +1,119 @@ +// +// ObservableType+Extensions.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +extension ObservableType { + /** + Subscribes an event handler to an observable sequence. + + - parameter on: Action to invoke for each event in the observable sequence. + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func subscribe(_ on: @escaping (Event) -> Void) + -> Disposable { + let observer = AnonymousObserver { e in + on(e) + } + return self.subscribeSafe(observer) + } + + #if DEBUG + /** + Subscribes an element handler, an error handler, a completion handler and disposed handler to an observable sequence. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has + gracefully completed, errored, or if the generation is cancelled by disposing subscription). + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func subscribe(file: String = #file, line: UInt = #line, function: String = #function, onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) + -> Disposable { + + let disposable: Disposable + + if let disposed = onDisposed { + disposable = Disposables.create(with: disposed) + } + else { + disposable = Disposables.create() + } + + let observer = AnonymousObserver { e in + switch e { + case .next(let value): + onNext?(value) + case .error(let e): + if let onError = onError { + onError(e) + } + else { + print("Received unhandled error: \(file):\(line):\(function) -> \(e)") + } + disposable.dispose() + case .completed: + onCompleted?() + disposable.dispose() + } + } + return Disposables.create( + self.subscribeSafe(observer), + disposable + ) + } + #else + /** + Subscribes an element handler, an error handler, a completion handler and disposed handler to an observable sequence. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has + gracefully completed, errored, or if the generation is cancelled by disposing subscription). + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func subscribe(onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) + -> Disposable { + + let disposable: Disposable + + if let disposed = onDisposed { + disposable = Disposables.create(with: disposed) + } + else { + disposable = Disposables.create() + } + + let observer = AnonymousObserver { e in + switch e { + case .next(let value): + onNext?(value) + case .error(let e): + onError?(e) + disposable.dispose() + case .completed: + onCompleted?() + disposable.dispose() + } + } + return Disposables.create( + self.subscribeSafe(observer), + disposable + ) + } + #endif +} + +extension ObservableType { + /// All internal subscribe calls go through this method. + func subscribeSafe(_ observer: O) -> Disposable where O.E == E { + return self.asObservable().subscribe(observer) + } +} diff --git a/Pods/RxSwift/RxSwift/ObservableType.swift b/Pods/RxSwift/RxSwift/ObservableType.swift new file mode 100644 index 0000000..7fd799c --- /dev/null +++ b/Pods/RxSwift/RxSwift/ObservableType.swift @@ -0,0 +1,52 @@ +// +// ObservableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents a push style sequence. +public protocol ObservableType : ObservableConvertibleType { + /// Type of elements in sequence. + associatedtype E + + /** + Subscribes `observer` to receive events for this sequence. + + ### Grammar + + **Next\* (Error | Completed)?** + + * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` + * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements + + It is possible that events are sent from different threads, but no two events can be sent concurrently to + `observer`. + + ### Resource Management + + When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements + will be freed. + + To cancel production of sequence elements and free resources immediatelly, call `dispose` on returned + subscription. + + - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. + */ + func subscribe(_ observer: O) -> Disposable where O.E == E +} + +extension ObservableType { + + /// Default implementation of converting `ObservableType` to `Observable`. + public func asObservable() -> Observable { + // temporary workaround + //return Observable.create(subscribe: self.subscribe) + return Observable.create { o in + return self.subscribe(o) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/AddRef.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/AddRef.swift new file mode 100644 index 0000000..36f9d79 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/AddRef.swift @@ -0,0 +1,47 @@ +// +// AddRef.swift +// RxSwift +// +// Created by Junior B. on 30/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class AddRefSink : Sink, ObserverType { + typealias Element = O.E + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(_): + forwardOn(event) + case .completed, .error(_): + forwardOn(event) + dispose() + } + } +} + +class AddRef : Producer { + typealias EventHandler = (Event) throws -> Void + + private let _source: Observable + private let _refCount: RefCountDisposable + + init(source: Observable, refCount: RefCountDisposable) { + _source = source + _refCount = refCount + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let releaseDisposable = _refCount.retain() + let sink = AddRefSink(observer: observer, cancel: cancel) + let subscription = Disposables.create(releaseDisposable, _source.subscribeSafe(sink)) + + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Amb.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Amb.swift new file mode 100644 index 0000000..698747d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Amb.swift @@ -0,0 +1,123 @@ +// +// Amb.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +enum AmbState { + case neither + case left + case right +} + +class AmbObserver : ObserverType { + typealias Element = O.E + typealias Parent = AmbSink + typealias This = AmbObserver + typealias Sink = (This, Event) -> Void + + fileprivate let _parent: Parent + fileprivate var _sink: Sink + fileprivate var _cancel: Disposable + + init(parent: Parent, cancel: Disposable, sink: @escaping Sink) { +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + + _parent = parent + _sink = sink + _cancel = cancel + } + + func on(_ event: Event) { + _sink(self, event) + if event.isStopEvent { + _cancel.dispose() + } + } + + deinit { +#if TRACE_RESOURCES + let _ = Resources.decrementTotal() +#endif + } +} + +class AmbSink : Sink { + typealias ElementType = O.E + typealias Parent = Amb + typealias AmbObserverType = AmbObserver + + private let _parent: Parent + + private let _lock = NSRecursiveLock() + // state + private var _choice = AmbState.neither + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let disposeAll = Disposables.create(subscription1, subscription2) + + let forwardEvent = { (o: AmbObserverType, event: Event) -> Void in + self.forwardOn(event) + } + + let decide = { (o: AmbObserverType, event: Event, me: AmbState, otherSubscription: Disposable) in + self._lock.performLocked { + if self._choice == .neither { + self._choice = me + o._sink = forwardEvent + o._cancel = disposeAll + otherSubscription.dispose() + } + + if self._choice == me { + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + } + } + + let sink1 = AmbObserver(parent: self, cancel: subscription1) { o, e in + decide(o, e, .left, subscription2) + } + + let sink2 = AmbObserver(parent: self, cancel: subscription1) { o, e in + decide(o, e, .right, subscription1) + } + + subscription1.setDisposable(_parent._left.subscribe(sink1)) + subscription2.setDisposable(_parent._right.subscribe(sink2)) + + return disposeAll + } +} + +class Amb: Producer { + fileprivate let _left: Observable + fileprivate let _right: Observable + + init(left: Observable, right: Observable) { + _left = left + _right = right + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AmbSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/AnonymousObservable.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/AnonymousObservable.swift new file mode 100644 index 0000000..bf3627a --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/AnonymousObservable.swift @@ -0,0 +1,56 @@ +// +// AnonymousObservable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class AnonymousObservableSink : Sink, ObserverType { + typealias E = O.E + typealias Parent = AnonymousObservable + + // state + private var _isStopped: AtomicInt = 0 + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + if _isStopped == 1 { + return + } + forwardOn(event) + case .error, .completed: + if AtomicCompareAndSwap(0, 1, &_isStopped) { + forwardOn(event) + dispose() + } + } + } + + func run(_ parent: Parent) -> Disposable { + return parent._subscribeHandler(AnyObserver(self)) + } +} + +class AnonymousObservable : Producer { + typealias SubscribeHandler = (AnyObserver) -> Disposable + + let _subscribeHandler: SubscribeHandler + + init(_ subscribeHandler: @escaping SubscribeHandler) { + _subscribeHandler = subscribeHandler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AnonymousObservableSink(observer: observer, cancel: cancel) + let subscription = sink.run(self) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Buffer.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Buffer.swift new file mode 100644 index 0000000..c773f47 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Buffer.swift @@ -0,0 +1,121 @@ +// +// Buffer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class BufferTimeCount : Producer<[Element]> { + + fileprivate let _timeSpan: RxTimeInterval + fileprivate let _count: Int + fileprivate let _scheduler: SchedulerType + fileprivate let _source: Observable + + init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { + _source = source + _timeSpan = timeSpan + _count = count + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [Element] { + let sink = BufferTimeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +class BufferTimeCountSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType where O.E == [Element] { + typealias Parent = BufferTimeCount + typealias E = Element + + private let _parent: Parent + + let _lock = NSRecursiveLock() + + // state + private let _timerD = SerialDisposable() + private var _buffer = [Element]() + private var _windowID = 0 + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + createTimer(_windowID) + return Disposables.create(_timerD, _parent._source.subscribe(self)) + } + + func startNewWindowAndSendCurrentOne() { + _windowID = _windowID &+ 1 + let windowID = _windowID + + let buffer = _buffer + _buffer = [] + forwardOn(.next(buffer)) + + createTimer(windowID) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + _buffer.append(element) + + if _buffer.count == _parent._count { + startNewWindowAndSendCurrentOne() + } + + case .error(let error): + _buffer = [] + forwardOn(.error(error)) + dispose() + case .completed: + forwardOn(.next(_buffer)) + forwardOn(.completed) + dispose() + } + } + + func createTimer(_ windowID: Int) { + if _timerD.isDisposed { + return + } + + if _windowID != windowID { + return + } + + let nextTimer = SingleAssignmentDisposable() + + _timerD.disposable = nextTimer + + let disposable = _parent._scheduler.scheduleRelative(windowID, dueTime: _parent._timeSpan) { previousWindowID in + self._lock.performLocked { + if previousWindowID != self._windowID { + return + } + + self.startNewWindowAndSendCurrentOne() + } + + return Disposables.create() + } + + nextTimer.setDisposable(disposable) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Catch.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Catch.swift new file mode 100644 index 0000000..0f43069 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Catch.swift @@ -0,0 +1,162 @@ +// +// Catch.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// catch with callback + +class CatchSinkProxy : ObserverType { + typealias E = O.E + typealias Parent = CatchSink + + private let _parent: Parent + + init(parent: Parent) { + _parent = parent + } + + func on(_ event: Event) { + _parent.forwardOn(event) + + switch event { + case .next: + break + case .error, .completed: + _parent.dispose() + } + } +} + +class CatchSink : Sink, ObserverType { + typealias E = O.E + typealias Parent = Catch + + private let _parent: Parent + private let _subscription = SerialDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let d1 = SingleAssignmentDisposable() + _subscription.disposable = d1 + d1.setDisposable(_parent._source.subscribe(self)) + + return _subscription + } + + func on(_ event: Event) { + switch event { + case .next: + forwardOn(event) + case .completed: + forwardOn(event) + dispose() + case .error(let error): + do { + let catchSequence = try _parent._handler(error) + + let observer = CatchSinkProxy(parent: self) + + _subscription.disposable = catchSequence.subscribe(observer) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + } + } +} + +class Catch : Producer { + typealias Handler = (Swift.Error) throws -> Observable + + fileprivate let _source: Observable + fileprivate let _handler: Handler + + init(source: Observable, handler: @escaping Handler) { + _source = source + _handler = handler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = CatchSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +// catch enumerable + +class CatchSequenceSink + : TailRecursiveSink + , ObserverType where S.Iterator.Element : ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Element = O.E + typealias Parent = CatchSequence + + private var _lastError: Swift.Error? + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + forwardOn(event) + case .error(let error): + _lastError = error + schedule(.moveNext) + case .completed: + forwardOn(event) + dispose() + } + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + return source.subscribe(self) + } + + override func done() { + if let lastError = _lastError { + forwardOn(.error(lastError)) + } + else { + forwardOn(.completed) + } + + self.dispose() + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + if let onError = observable as? CatchSequence { + return (onError.sources.makeIterator(), nil) + } + else { + return nil + } + } +} + +class CatchSequence : Producer where S.Iterator.Element : ObservableConvertibleType { + typealias Element = S.Iterator.Element.E + + let sources: S + + init(sources: S) { + self.sources = sources + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = CatchSequenceSink(observer: observer, cancel: cancel) + let subscription = sink.run((self.sources.makeIterator(), nil)) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+Collection.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+Collection.swift new file mode 100644 index 0000000..fea66e2 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+Collection.swift @@ -0,0 +1,128 @@ +// +// CombineLatest+Collection.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class CombineLatestCollectionTypeSink + : Sink where C.Iterator.Element : ObservableConvertibleType { + typealias R = O.E + typealias Parent = CombineLatestCollectionType + typealias SourceElement = C.Iterator.Element.E + + let _parent: Parent + + let _lock = NSRecursiveLock() + + // state + var _numberOfValues = 0 + var _values: [SourceElement?] + var _isDone: [Bool] + var _numberOfDone = 0 + var _subscriptions: [SingleAssignmentDisposable] + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _values = [SourceElement?](repeating: nil, count: parent._count) + _isDone = [Bool](repeating: false, count: parent._count) + _subscriptions = Array() + _subscriptions.reserveCapacity(parent._count) + + for _ in 0 ..< parent._count { + _subscriptions.append(SingleAssignmentDisposable()) + } + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event, atIndex: Int) { + _lock.lock(); defer { _lock.unlock() } // { + switch event { + case .next(let element): + if _values[atIndex] == nil { + _numberOfValues += 1 + } + + _values[atIndex] = element + + if _numberOfValues < _parent._count { + let numberOfOthersThatAreDone = self._numberOfDone - (_isDone[atIndex] ? 1 : 0) + if numberOfOthersThatAreDone == self._parent._count - 1 { + forwardOn(.completed) + dispose() + } + return + } + + do { + let result = try _parent._resultSelector(_values.map { $0! }) + forwardOn(.next(result)) + } + catch let error { + forwardOn(.error(error)) + dispose() + } + + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + if _isDone[atIndex] { + return + } + + _isDone[atIndex] = true + _numberOfDone += 1 + + if _numberOfDone == self._parent._count { + forwardOn(.completed) + dispose() + } + else { + _subscriptions[atIndex].dispose() + } + } + // } + } + + func run() -> Disposable { + var j = 0 + for i in _parent._sources { + let index = j + let source = i.asObservable() + let disposable = source.subscribe(AnyObserver { event in + self.on(event, atIndex: index) + }) + + _subscriptions[j].setDisposable(disposable) + + j += 1 + } + + return Disposables.create(_subscriptions) + } +} + +class CombineLatestCollectionType : Producer where C.Iterator.Element : ObservableConvertibleType { + typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R + + let _sources: C + let _resultSelector: ResultSelector + let _count: Int + + init(sources: C, resultSelector: @escaping ResultSelector) { + _sources = sources + _resultSelector = resultSelector + _count = Int(self._sources.count.toIntMax()) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestCollectionTypeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+arity.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+arity.swift new file mode 100644 index 0000000..2969b45 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest+arity.swift @@ -0,0 +1,719 @@ +// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project +// +// CombineLatest+arity.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + + +// 2 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> Observable { + return CombineLatest2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink2_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest2 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 2, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + + return Disposables.create([ + subscription1, + subscription2 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2) + } +} + +class CombineLatest2 : Producer { + typealias ResultSelector = (E1, E2) throws -> R + + let _source1: Observable + let _source2: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink2_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 3 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> Observable { + return CombineLatest3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink3_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest3 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 3, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3) + } +} + +class CombineLatest3 : Producer { + typealias ResultSelector = (E1, E2, E3) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink3_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 4 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> Observable { + return CombineLatest4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink4_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest4 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 4, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + subscription4.setDisposable(_parent._source4.subscribe(observer4)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4) + } +} + +class CombineLatest4 : Producer { + typealias ResultSelector = (E1, E2, E3, E4) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + _source4 = source4 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink4_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 5 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> Observable { + return CombineLatest5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink5_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest5 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 5, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + subscription4.setDisposable(_parent._source4.subscribe(observer4)) + subscription5.setDisposable(_parent._source5.subscribe(observer5)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5) + } +} + +class CombineLatest5 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + _source4 = source4 + _source5 = source5 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink5_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 6 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> Observable { + return CombineLatest6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink6_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest6 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 6, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + subscription4.setDisposable(_parent._source4.subscribe(observer4)) + subscription5.setDisposable(_parent._source5.subscribe(observer5)) + subscription6.setDisposable(_parent._source6.subscribe(observer6)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6) + } +} + +class CombineLatest6 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + _source4 = source4 + _source5 = source5 + _source6 = source6 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink6_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 7 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> Observable { + return CombineLatest7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink7_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest7 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + var _latestElement7: E7! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 7, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + let observer7 = CombineLatestObserver(lock: _lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + subscription4.setDisposable(_parent._source4.subscribe(observer4)) + subscription5.setDisposable(_parent._source5.subscribe(observer5)) + subscription6.setDisposable(_parent._source6.subscribe(observer6)) + subscription7.setDisposable(_parent._source7.subscribe(observer7)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6, _latestElement7) + } +} + +class CombineLatest7 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + let _source7: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + _source4 = source4 + _source5 = source5 + _source6 = source6 + _source7 = source7 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink7_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 8 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> Observable { + return CombineLatest8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: resultSelector + ) + } +} + +class CombineLatestSink8_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest8 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + var _latestElement7: E7! = nil + var _latestElement8: E8! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 8, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + let subscription8 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + let observer7 = CombineLatestObserver(lock: _lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) + let observer8 = CombineLatestObserver(lock: _lock, parent: self, index: 7, setLatestValue: { (e: E8) -> Void in self._latestElement8 = e }, this: subscription8) + + subscription1.setDisposable(_parent._source1.subscribe(observer1)) + subscription2.setDisposable(_parent._source2.subscribe(observer2)) + subscription3.setDisposable(_parent._source3.subscribe(observer3)) + subscription4.setDisposable(_parent._source4.subscribe(observer4)) + subscription5.setDisposable(_parent._source5.subscribe(observer5)) + subscription6.setDisposable(_parent._source6.subscribe(observer6)) + subscription7.setDisposable(_parent._source7.subscribe(observer7)) + subscription8.setDisposable(_parent._source8.subscribe(observer8)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7, + subscription8 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6, _latestElement7, _latestElement8) + } +} + +class CombineLatest8 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + let _source7: Observable + let _source8: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { + _source1 = source1 + _source2 = source2 + _source3 = source3 + _source4 = source4 + _source5 = source5 + _source6 = source6 + _source7 = source7 + _source8 = source8 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink8_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest.swift new file mode 100644 index 0000000..be5cc2e --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/CombineLatest.swift @@ -0,0 +1,134 @@ +// +// CombineLatest.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol CombineLatestProtocol : class { + func next(_ index: Int) + func fail(_ error: Swift.Error) + func done(_ index: Int) +} + +class CombineLatestSink + : Sink + , CombineLatestProtocol { + typealias Element = O.E + + let _lock = NSRecursiveLock() + + private let _arity: Int + private var _numberOfValues = 0 + private var _numberOfDone = 0 + private var _hasValue: [Bool] + private var _isDone: [Bool] + + init(arity: Int, observer: O, cancel: Cancelable) { + _arity = arity + _hasValue = [Bool](repeating: false, count: arity) + _isDone = [Bool](repeating: false, count: arity) + + super.init(observer: observer, cancel: cancel) + } + + func getResult() throws -> Element { + abstractMethod() + } + + func next(_ index: Int) { + if !_hasValue[index] { + _hasValue[index] = true + _numberOfValues += 1 + } + + if _numberOfValues == _arity { + do { + let result = try getResult() + forwardOn(.next(result)) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + } + else { + var allOthersDone = true + + for i in 0 ..< _arity { + if i != index && !_isDone[i] { + allOthersDone = false + break + } + } + + if allOthersDone { + forwardOn(.completed) + dispose() + } + } + } + + func fail(_ error: Swift.Error) { + forwardOn(.error(error)) + dispose() + } + + func done(_ index: Int) { + if _isDone[index] { + return + } + + _isDone[index] = true + _numberOfDone += 1 + + if _numberOfDone == _arity { + forwardOn(.completed) + dispose() + } + } +} + +class CombineLatestObserver + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = ElementType + typealias ValueSetter = (Element) -> Void + + private let _parent: CombineLatestProtocol + + let _lock: NSRecursiveLock + private let _index: Int + private let _this: Disposable + private let _setLatestValue: ValueSetter + + init(lock: NSRecursiveLock, parent: CombineLatestProtocol, index: Int, setLatestValue: @escaping ValueSetter, this: Disposable) { + _lock = lock + _parent = parent + _index = index + _this = this + _setLatestValue = setLatestValue + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let value): + _setLatestValue(value) + _parent.next(_index) + case .error(let error): + _this.dispose() + _parent.fail(error) + case .completed: + _this.dispose() + _parent.done(_index) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Concat.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Concat.swift new file mode 100644 index 0000000..51ac494 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Concat.swift @@ -0,0 +1,63 @@ +// +// Concat.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + +class ConcatSink + : TailRecursiveSink + , ObserverType where S.Iterator.Element : ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Element = O.E + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event){ + switch event { + case .next: + forwardOn(event) + case .error: + forwardOn(event) + dispose() + case .completed: + schedule(.moveNext) + } + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + return source.subscribe(self) + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + if let source = observable as? Concat { + return (source._sources.makeIterator(), source._count) + } + else { + return nil + } + } +} + +class Concat : Producer where S.Iterator.Element : ObservableConvertibleType { + typealias Element = S.Iterator.Element.E + + fileprivate let _sources: S + fileprivate let _count: IntMax? + + init(sources: S, count: IntMax?) { + _sources = sources + _count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = ConcatSink(observer: observer, cancel: cancel) + let subscription = sink.run((_sources.makeIterator(), _count)) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ConnectableObservable.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ConnectableObservable.swift new file mode 100644 index 0000000..12eb555 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ConnectableObservable.swift @@ -0,0 +1,96 @@ +// +// ConnectableObservable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/** + Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. +*/ +public class ConnectableObservable + : Observable + , ConnectableObservableType { + + /** + 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. + + - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. + */ + public func connect() -> Disposable { + abstractMethod() + } +} + +class Connection : Disposable { + + private var _lock: NSRecursiveLock + // state + private var _parent: ConnectableObservableAdapter? + private var _subscription : Disposable? + + init(parent: ConnectableObservableAdapter, lock: NSRecursiveLock, subscription: Disposable) { + _parent = parent + _subscription = subscription + _lock = lock + } + + func dispose() { + _lock.lock(); defer { _lock.unlock() } // { + guard let parent = _parent else { + return + } + + guard let oldSubscription = _subscription else { + return + } + + _subscription = nil + if parent._connection === self { + parent._connection = nil + } + _parent = nil + + oldSubscription.dispose() + // } + } +} + +class ConnectableObservableAdapter + : ConnectableObservable { + typealias ConnectionType = Connection + + fileprivate let _subject: S + fileprivate let _source: Observable + + fileprivate let _lock = NSRecursiveLock() + + // state + fileprivate var _connection: ConnectionType? + + init(source: Observable, subject: S) { + _source = source + _subject = subject + _connection = nil + } + + override func connect() -> Disposable { + return _lock.calculateLocked { + if let connection = _connection { + return connection + } + + let disposable = _source.subscribe(_subject.asObserver()) + let connection = Connection(parent: self, lock: _lock, subscription: disposable) + _connection = connection + return connection + } + } + + override func subscribe(_ observer: O) -> Disposable where O.E == S.E { + return _subject.subscribe(observer) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Debug.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Debug.swift new file mode 100644 index 0000000..76f8ecd --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Debug.swift @@ -0,0 +1,85 @@ +// +// Debug.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +let dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" + +func logEvent(_ identifier: String, dateFormat: DateFormatter, content: String) { + print("\(dateFormat.string(from: Date())): \(identifier) -> \(content)") +} + +class DebugSink : Sink, ObserverType where O.E == Source.E { + typealias Element = O.E + typealias Parent = Debug + + private let _parent: Parent + private let _timestampFormatter = DateFormatter() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _timestampFormatter.dateFormat = dateFormat + + logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "subscribed") + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + let maxEventTextLength = 40 + let eventText = "\(event)" + + let eventNormalized = (eventText.characters.count > maxEventTextLength) && _parent._trimOutput + ? String(eventText.characters.prefix(maxEventTextLength / 2)) + "..." + String(eventText.characters.suffix(maxEventTextLength / 2)) + : eventText + + logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "Event \(eventNormalized)") + + forwardOn(event) + if event.isStopEvent { + dispose() + } + } + + override func dispose() { + if !self.disposed { + logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "isDisposed") + } + super.dispose() + } +} + +class Debug : Producer { + fileprivate let _identifier: String + fileprivate let _trimOutput: Bool + fileprivate let _source: Source + + init(source: Source, identifier: String?, trimOutput: Bool, file: String, line: UInt, function: String) { + _trimOutput = trimOutput + if let identifier = identifier { + _identifier = identifier + } + else { + let trimmedFile: String + if let lastIndex = file.lastIndexOf("/") { + trimmedFile = file[file.index(after: lastIndex) ..< file.endIndex] + } + else { + trimmedFile = file + } + _identifier = "\(trimmedFile):\(line) (\(function))" + } + _source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Source.E { + let sink = DebugSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Debunce.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Debunce.swift new file mode 100644 index 0000000..99e8013 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Debunce.swift @@ -0,0 +1,104 @@ +// +// Debunce.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/11/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DebounceSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias ParentType = Debounce + + private let _parent: ParentType + + let _lock = NSRecursiveLock() + + // state + private var _id = 0 as UInt64 + private var _value: Element? = nil + + let cancellable = SerialDisposable() + + init(parent: ParentType, observer: O, cancel: Cancelable) { + _parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = _parent._source.subscribe(self) + + return Disposables.create(subscription, cancellable) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + _id = _id &+ 1 + let currentId = _id + _value = element + + + let scheduler = _parent._scheduler + let dueTime = _parent._dueTime + + let d = SingleAssignmentDisposable() + self.cancellable.disposable = d + d.setDisposable(scheduler.scheduleRelative(currentId, dueTime: dueTime, action: self.propagate)) + case .error: + _value = nil + forwardOn(event) + dispose() + case .completed: + if let value = _value { + _value = nil + forwardOn(.next(value)) + } + forwardOn(.completed) + dispose() + } + } + + func propagate(_ currentId: UInt64) -> Disposable { + _lock.lock(); defer { _lock.unlock() } // { + let originalValue = _value + + if let value = originalValue, _id == currentId { + _value = nil + forwardOn(.next(value)) + } + // } + return Disposables.create() + } +} + +class Debounce : Producer { + + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + _source = source + _dueTime = dueTime + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DebounceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Deferred.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Deferred.swift new file mode 100644 index 0000000..43182ce --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Deferred.swift @@ -0,0 +1,61 @@ +// +// Deferred.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DeferredSink : Sink, ObserverType where S.E == O.E { + typealias E = O.E + + private let _observableFactory: () throws -> S + + init(observableFactory: @escaping () throws -> S, observer: O, cancel: Cancelable) { + _observableFactory = observableFactory + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + do { + let result = try _observableFactory() + return result.subscribe(self) + } + catch let e { + forwardOn(.error(e)) + dispose() + return Disposables.create() + } + } + + func on(_ event: Event) { + forwardOn(event) + + switch event { + case .next: + break + case .error: + dispose() + case .completed: + dispose() + } + } +} + +class Deferred : Producer { + typealias Factory = () throws -> S + + private let _observableFactory : Factory + + init(observableFactory: @escaping Factory) { + _observableFactory = observableFactory + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = DeferredSink(observableFactory: _observableFactory, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Delay.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Delay.swift new file mode 100644 index 0000000..37f6a2f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Delay.swift @@ -0,0 +1,164 @@ +// +// Delay.swift +// RxSwift +// +// Created by tarunon on 2016/02/09. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DelaySink + : Sink + , ObserverType { + typealias E = O.E + typealias Source = Observable + typealias DisposeKey = Bag.KeyType + + private let _lock = NSRecursiveLock() + + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + private let _sourceSubscription = SingleAssignmentDisposable() + private let _cancelable = SerialDisposable() + + // is scheduled some action + private var _active = false + // is "run loop" on different scheduler running + private var _running = false + private var _errorEvent: Event? = nil + + // state + private var _queue = Queue<(eventTime: RxTime, event: Event)>(capacity: 0) + private var _disposed = false + + init(observer: O, dueTime: RxTimeInterval, scheduler: SchedulerType, cancel: Cancelable) { + _dueTime = dueTime + _scheduler = scheduler + super.init(observer: observer, cancel: cancel) + } + + // All of these complications in this method are caused by the fact that + // error should be propagated immediatelly. Error can bepotentially received on different + // scheduler so this process needs to be synchronized somehow. + // + // Another complication is that scheduler is potentially concurrent so internal queue is used. + func drainQueue(state: (), scheduler: AnyRecursiveScheduler<()>) { + + _lock.lock() // { + let hasFailed = _errorEvent != nil + if !hasFailed { + _running = true + } + _lock.unlock() // } + + if hasFailed { + return + } + + var ranAtLeastOnce = false + + while true { + _lock.lock() // { + let errorEvent = _errorEvent + + let eventToForwardImmediatelly = ranAtLeastOnce ? nil : _queue.dequeue()?.event + let nextEventToScheduleOriginalTime: Date? = ranAtLeastOnce && !_queue.isEmpty ? _queue.peek().eventTime : nil + + if let _ = errorEvent { + } + else { + if let _ = eventToForwardImmediatelly { + } + else if let _ = nextEventToScheduleOriginalTime { + _running = false + } + else { + _running = false + _active = false + } + } + _lock.unlock() // { + + if let errorEvent = errorEvent { + self.forwardOn(errorEvent) + self.dispose() + return + } + else { + if let eventToForwardImmediatelly = eventToForwardImmediatelly { + ranAtLeastOnce = true + self.forwardOn(eventToForwardImmediatelly) + if case .completed = eventToForwardImmediatelly { + self.dispose() + return + } + } + else if let nextEventToScheduleOriginalTime = nextEventToScheduleOriginalTime { + let elapsedTime = _scheduler.now.timeIntervalSince(nextEventToScheduleOriginalTime) + let interval = _dueTime - elapsedTime + let normalizedInterval = interval < 0.0 ? 0.0 : interval + scheduler.schedule((), dueTime: normalizedInterval) + return + } + else { + return + } + } + } + } + + func on(_ event: Event) { + if event.isStopEvent { + _sourceSubscription.dispose() + } + + switch event { + case .error(_): + _lock.lock() // { + let shouldSendImmediatelly = !_running + _queue = Queue(capacity: 0) + _errorEvent = event + _lock.unlock() // } + + if shouldSendImmediatelly { + forwardOn(event) + dispose() + } + default: + _lock.lock() // { + let shouldSchedule = !_active + _active = true + _queue.enqueue((_scheduler.now, event)) + _lock.unlock() // } + + if shouldSchedule { + _cancelable.disposable = _scheduler.scheduleRecursive((), dueTime: _dueTime, action: self.drainQueue) + } + } + } + + func run(source: Source) -> Disposable { + _sourceSubscription.setDisposable(source.subscribeSafe(self)) + return Disposables.create(_sourceSubscription, _cancelable) + } +} + +class Delay: Producer { + private let _source: Observable + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + _source = source + _dueTime = dueTime + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DelaySink(observer: observer, dueTime: _dueTime, scheduler: _scheduler, cancel: cancel) + let subscription = sink.run(source: _source) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/DelaySubscription.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/DelaySubscription.swift new file mode 100644 index 0000000..20207d2 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/DelaySubscription.swift @@ -0,0 +1,51 @@ +// +// DelaySubscription.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DelaySubscriptionSink + : Sink, ObserverType { + typealias E = O.E + typealias Parent = DelaySubscription + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + forwardOn(event) + if event.isStopEvent { + dispose() + } + } + +} + +class DelaySubscription: Producer { + private let _source: Observable + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + _source = source + _dueTime = dueTime + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DelaySubscriptionSink(parent: self, observer: observer, cancel: cancel) + let subscription = _scheduler.scheduleRelative((), dueTime: _dueTime) { _ in + return self._source.subscribe(sink) + } + + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/DistinctUntilChanged.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/DistinctUntilChanged.swift new file mode 100644 index 0000000..a54f6cf --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/DistinctUntilChanged.swift @@ -0,0 +1,70 @@ +// +// DistinctUntilChanged.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DistinctUntilChangedSink: Sink, ObserverType { + typealias E = O.E + + private let _parent: DistinctUntilChanged + private var _currentKey: Key? = nil + + init(parent: DistinctUntilChanged, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let key = try _parent._selector(value) + var areEqual = false + if let currentKey = _currentKey { + areEqual = try _parent._comparer(currentKey, key) + } + + if areEqual { + return + } + + _currentKey = key + + forwardOn(event) + } + catch let error { + forwardOn(.error(error)) + dispose() + } + case .error, .completed: + forwardOn(event) + dispose() + } + } +} + +class DistinctUntilChanged: Producer { + typealias KeySelector = (Element) throws -> Key + typealias EqualityComparer = (Key, Key) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _selector: KeySelector + fileprivate let _comparer: EqualityComparer + + init(source: Observable, selector: @escaping KeySelector, comparer: @escaping EqualityComparer) { + _source = source + _selector = selector + _comparer = comparer + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DistinctUntilChangedSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Do.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Do.swift new file mode 100644 index 0000000..0e766dd --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Do.swift @@ -0,0 +1,63 @@ +// +// Do.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class DoSink : Sink, ObserverType { + typealias Element = O.E + typealias Parent = Do + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + do { + try _parent._eventHandler(event) + forwardOn(event) + if event.isStopEvent { + dispose() + } + } + catch let error { + forwardOn(.error(error)) + dispose() + } + } +} + +class Do : Producer { + typealias EventHandler = (Event) throws -> Void + + fileprivate let _source: Observable + fileprivate let _eventHandler: EventHandler + fileprivate let _onSubscribe: (() -> ())? + fileprivate let _onDispose: (() -> ())? + + init(source: Observable, eventHandler: @escaping EventHandler, onSubscribe: (() -> ())?, onDispose: (() -> ())?) { + _source = source + _eventHandler = eventHandler + _onSubscribe = onSubscribe + _onDispose = onDispose + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + _onSubscribe?() + let sink = DoSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + let onDispose = _onDispose + let allSubscriptions = Disposables.create { + subscription.dispose() + onDispose?() + } + return (sink: sink, subscription: allSubscriptions) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ElementAt.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ElementAt.swift new file mode 100644 index 0000000..0c103a7 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ElementAt.swift @@ -0,0 +1,80 @@ +// +// ElementAt.swift +// RxSwift +// +// Created by Junior B. on 21/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + +class ElementAtSink : Sink, ObserverType { + typealias SourceType = O.E + typealias Parent = ElementAt + + let _parent: Parent + var _i: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _i = parent._index + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(_): + + if (_i == 0) { + forwardOn(event) + forwardOn(.completed) + self.dispose() + } + + do { + let _ = try decrementChecked(&_i) + } catch(let e) { + forwardOn(.error(e)) + dispose() + return + } + + case .error(let e): + forwardOn(.error(e)) + self.dispose() + case .completed: + if (_parent._throwOnEmpty) { + forwardOn(.error(RxError.argumentOutOfRange)) + } else { + forwardOn(.completed) + } + + self.dispose() + } + } +} + +class ElementAt : Producer { + + let _source: Observable + let _throwOnEmpty: Bool + let _index: Int + + init(source: Observable, index: Int, throwOnEmpty: Bool) { + if index < 0 { + rxFatalError("index can't be negative") + } + + self._source = source + self._index = index + self._throwOnEmpty = throwOnEmpty + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { + let sink = ElementAtSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribeSafe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Empty.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Empty.swift new file mode 100644 index 0000000..39861a7 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Empty.swift @@ -0,0 +1,16 @@ +// +// Empty.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class Empty : Producer { + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.completed) + return Disposables.create() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Error.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Error.swift new file mode 100644 index 0000000..6ddae8b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Error.swift @@ -0,0 +1,22 @@ +// +// Error.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class Error : Producer { + private let _error: Swift.Error + + init(error: Swift.Error) { + _error = error + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.error(_error)) + return Disposables.create() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Filter.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Filter.swift new file mode 100644 index 0000000..2f03135 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Filter.swift @@ -0,0 +1,58 @@ +// +// Filter.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class FilterSink: Sink, ObserverType { + typealias Predicate = (Element) throws -> Bool + typealias Element = O.E + + private let _predicate: Predicate + + init(predicate: @escaping Predicate, observer: O, cancel: Cancelable) { + _predicate = predicate + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let satisfies = try _predicate(value) + if satisfies { + forwardOn(.next(value)) + } + } + catch let e { + forwardOn(.error(e)) + dispose() + } + case .completed, .error: + forwardOn(event) + dispose() + } + } +} + +class Filter : Producer { + typealias Predicate = (Element) throws -> Bool + + private let _source: Observable + private let _predicate: Predicate + + init(source: Observable, predicate: @escaping Predicate) { + _source = source + _predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = FilterSink(predicate: _predicate, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Generate.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Generate.swift new file mode 100644 index 0000000..aebfb95 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Generate.swift @@ -0,0 +1,71 @@ +// +// Generate.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class GenerateSink : Sink { + typealias Parent = Generate + + private let _parent: Parent + + private var _state: S + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _state = parent._initialState + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.scheduleRecursive(true) { (isFirst, recurse) -> Void in + do { + if !isFirst { + self._state = try self._parent._iterate(self._state) + } + + if try self._parent._condition(self._state) { + let result = try self._parent._resultSelector(self._state) + self.forwardOn(.next(result)) + + recurse(false) + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + } + } +} + +class Generate : Producer { + fileprivate let _initialState: S + fileprivate let _condition: (S) throws -> Bool + fileprivate let _iterate: (S) throws -> S + fileprivate let _resultSelector: (S) throws -> E + fileprivate let _scheduler: ImmediateSchedulerType + + init(initialState: S, condition: @escaping (S) throws -> Bool, iterate: @escaping (S) throws -> S, resultSelector: @escaping (S) throws -> E, scheduler: ImmediateSchedulerType) { + _initialState = initialState + _condition = condition + _iterate = iterate + _resultSelector = resultSelector + _scheduler = scheduler + super.init() + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = GenerateSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Just.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Just.swift new file mode 100644 index 0000000..08ef34c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Just.swift @@ -0,0 +1,61 @@ +// +// Just.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class JustScheduledSink : Sink { + typealias Parent = JustScheduled + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let scheduler = _parent._scheduler + return scheduler.schedule(_parent._element) { element in + self.forwardOn(.next(element)) + return scheduler.schedule(()) { _ in + self.forwardOn(.completed) + return Disposables.create() + } + } + } +} + +class JustScheduled : Producer { + fileprivate let _scheduler: ImmediateSchedulerType + fileprivate let _element: Element + + init(element: Element, scheduler: ImmediateSchedulerType) { + _scheduler = scheduler + _element = element + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = JustScheduledSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +class Just : Producer { + private let _element: Element + + init(element: Element) { + _element = element + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.next(_element)) + observer.on(.completed) + return Disposables.create() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Map.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Map.swift new file mode 100644 index 0000000..1a28fcb --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Map.swift @@ -0,0 +1,145 @@ +// +// Map.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class MapSink : Sink, ObserverType { + typealias Transform = (SourceType) throws -> ResultType + + typealias ResultType = O.E + typealias Element = SourceType + + private let _transform: Transform + + init(transform: @escaping Transform, observer: O, cancel: Cancelable) { + _transform = transform + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let element): + do { + let mappedElement = try _transform(element) + forwardOn(.next(mappedElement)) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + forwardOn(.completed) + dispose() + } + } +} + +class MapWithIndexSink : Sink, ObserverType { + typealias Selector = (SourceType, Int) throws -> ResultType + + typealias ResultType = O.E + typealias Element = SourceType + typealias Parent = MapWithIndex + + private let _selector: Selector + + private var _index = 0 + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + _selector = selector + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let element): + do { + let mappedElement = try _selector(element, try incrementChecked(&_index)) + forwardOn(.next(mappedElement)) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + forwardOn(.completed) + dispose() + } + } +} + +class MapWithIndex : Producer { + typealias Selector = (SourceType, Int) throws -> ResultType + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + _source = source + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = MapWithIndexSink(selector: _selector, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} + +#if TRACE_RESOURCES + var _numberOfMapOperators: AtomicInt = 0 + extension Resources { + public static var numberOfMapOperators: Int32 { + return _numberOfMapOperators.valueSnapshot() + } + } +#endif + +class Map: Producer { + typealias Transform = (SourceType) throws -> ResultType + + private let _source: Observable + + private let _transform: Transform + + init(source: Observable, transform: @escaping Transform) { + _source = source + _transform = transform + +#if TRACE_RESOURCES + let _ = AtomicIncrement(&_numberOfMapOperators) +#endif + } + + override func composeMap(_ selector: @escaping (ResultType) throws -> R) -> Observable { + let originalSelector = _transform + return Map(source: _source, transform: { (s: SourceType) throws -> R in + let r: ResultType = try originalSelector(s) + return try selector(r) + }) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = MapSink(transform: _transform, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + + #if TRACE_RESOURCES + deinit { + let _ = AtomicDecrement(&_numberOfMapOperators) + } + #endif +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Merge.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Merge.swift new file mode 100644 index 0000000..cd700ab --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Merge.swift @@ -0,0 +1,424 @@ +// +// Merge.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: Limited concurrency version + +class MergeLimitedSinkIter + : ObserverType + , LockOwnerType + , SynchronizedOnType where S.E == O.E { + typealias E = O.E + typealias DisposeKey = CompositeDisposable.DisposeKey + typealias Parent = MergeLimitedSink + + private let _parent: Parent + private let _disposeKey: DisposeKey + + var _lock: NSRecursiveLock { + return _parent._lock + } + + init(parent: Parent, disposeKey: DisposeKey) { + _parent = parent + _disposeKey = disposeKey + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + _parent.forwardOn(event) + case .error: + _parent.forwardOn(event) + _parent.dispose() + case .completed: + _parent._group.remove(for: _disposeKey) + if let next = _parent._queue.dequeue() { + _parent.subscribe(next, group: _parent._group) + } + else { + _parent._activeCount = _parent._activeCount - 1 + + if _parent._stopped && _parent._activeCount == 0 { + _parent.forwardOn(.completed) + _parent.dispose() + } + } + } + } +} + +class MergeLimitedSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType where S.E == O.E { + typealias E = S + typealias QueueType = Queue + + fileprivate let _maxConcurrent: Int + + let _lock = NSRecursiveLock() + + // state + fileprivate var _stopped = false + fileprivate var _activeCount = 0 + fileprivate var _queue = QueueType(capacity: 2) + + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + fileprivate let _group = CompositeDisposable() + + init(maxConcurrent: Int, observer: O, cancel: Cancelable) { + _maxConcurrent = maxConcurrent + + let _ = _group.insert(_sourceSubscription) + super.init(observer: observer, cancel: cancel) + } + + func run(_ source: Observable) -> Disposable { + let _ = _group.insert(_sourceSubscription) + + let disposable = source.subscribe(self) + _sourceSubscription.setDisposable(disposable) + return _group + } + + func subscribe(_ innerSource: E, group: CompositeDisposable) { + let subscription = SingleAssignmentDisposable() + + let key = group.insert(subscription) + + if let key = key { + let observer = MergeLimitedSinkIter(parent: self, disposeKey: key) + + let disposable = innerSource.asObservable().subscribe(observer) + subscription.setDisposable(disposable) + } + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let value): + let subscribe: Bool + if _activeCount < _maxConcurrent { + _activeCount += 1 + subscribe = true + } + else { + _queue.enqueue(value) + subscribe = false + } + + if subscribe { + self.subscribe(value, group: _group) + } + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + if _activeCount == 0 { + forwardOn(.completed) + dispose() + } + else { + _sourceSubscription.dispose() + } + + _stopped = true + } + } +} + +class MergeLimited : Producer { + private let _source: Observable + private let _maxConcurrent: Int + + init(source: Observable, maxConcurrent: Int) { + _source = source + _maxConcurrent = maxConcurrent + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = MergeLimitedSink(maxConcurrent: _maxConcurrent, observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} + +// MARK: Merge + +final class MergeBasicSink : MergeSink where O.E == S.E { + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: S) throws -> S { + return element + } +} + +// MARK: flatMap + +final class FlatMapSink : MergeSink where O.E == S.E { + typealias Selector = (SourceType) throws -> S + + private let _selector: Selector + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + _selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceType) throws -> S { + return try _selector(element) + } +} + +final class FlatMapWithIndexSink : MergeSink where O.E == S.E { + typealias Selector = (SourceType, Int) throws -> S + + private var _index = 0 + private let _selector: Selector + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + _selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceType) throws -> S { + return try _selector(element, try incrementChecked(&_index)) + } +} + +// MARK: FlatMapFirst + +final class FlatMapFirstSink : MergeSink where O.E == S.E { + typealias Selector = (SourceType) throws -> S + + private let _selector: Selector + + override var subscribeNext: Bool { + return _group.count == MergeNoIterators + } + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + _selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceType) throws -> S { + return try _selector(element) + } +} + +// It's value is one because initial source subscription is always in CompositeDisposable +private let MergeNoIterators = 1 + +class MergeSinkIter : ObserverType where O.E == S.E { + typealias Parent = MergeSink + typealias DisposeKey = CompositeDisposable.DisposeKey + typealias E = O.E + + private let _parent: Parent + private let _disposeKey: DisposeKey + + init(parent: Parent, disposeKey: DisposeKey) { + _parent = parent + _disposeKey = disposeKey + } + + func on(_ event: Event) { + switch event { + case .next(let value): + _parent._lock.lock(); defer { _parent._lock.unlock() } // lock { + _parent.forwardOn(.next(value)) + // } + case .error(let error): + _parent._lock.lock(); defer { _parent._lock.unlock() } // lock { + _parent.forwardOn(.error(error)) + _parent.dispose() + // } + case .completed: + _parent._group.remove(for: _disposeKey) + // If this has returned true that means that `Completed` should be sent. + // In case there is a race who will sent first completed, + // lock will sort it out. When first Completed message is sent + // it will set observer to nil, and thus prevent further complete messages + // to be sent, and thus preserving the sequence grammar. + if _parent._stopped && _parent._group.count == MergeNoIterators { + _parent._lock.lock(); defer { _parent._lock.unlock() } // lock { + _parent.forwardOn(.completed) + _parent.dispose() + // } + } + } + } +} + + +class MergeSink + : Sink + , ObserverType where O.E == S.E { + typealias ResultType = O.E + typealias Element = SourceType + + fileprivate let _lock = NSRecursiveLock() + + fileprivate var subscribeNext: Bool { + return true + } + + // state + fileprivate let _group = CompositeDisposable() + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + + fileprivate var _stopped = false + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func performMap(_ element: SourceType) throws -> S { + abstractMethod() + } + + func on(_ event: Event) { + switch event { + case .next(let element): + if !subscribeNext { + return + } + do { + let value = try performMap(element) + subscribeInner(value.asObservable()) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + case .error(let error): + _lock.lock(); defer { _lock.unlock() } // lock { + forwardOn(.error(error)) + dispose() + // } + case .completed: + _lock.lock(); defer { _lock.unlock() } // lock { + _stopped = true + if _group.count == MergeNoIterators { + forwardOn(.completed) + dispose() + } + else { + _sourceSubscription.dispose() + } + //} + } + } + + func subscribeInner(_ source: Observable) { + let iterDisposable = SingleAssignmentDisposable() + if let disposeKey = _group.insert(iterDisposable) { + let iter = MergeSinkIter(parent: self, disposeKey: disposeKey) + let subscription = source.subscribe(iter) + iterDisposable.setDisposable(subscription) + } + } + + func run(_ source: Observable) -> Disposable { + let _ = _group.insert(_sourceSubscription) + + let subscription = source.subscribe(self) + _sourceSubscription.setDisposable(subscription) + + return _group + } +} + +// MARK: Producers + +final class FlatMap: Producer { + typealias Selector = (SourceType) throws -> S + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + _source = source + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = FlatMapSink(selector: _selector, observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} + +final class FlatMapWithIndex: Producer { + typealias Selector = (SourceType, Int) throws -> S + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + _source = source + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = FlatMapWithIndexSink(selector: _selector, observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } + +} + +final class FlatMapFirst: Producer { + typealias Selector = (SourceType) throws -> S + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + _source = source + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = FlatMapFirstSink(selector: _selector, observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} + +final class Merge : Producer { + private let _source: Observable + + init(source: Observable) { + _source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = MergeBasicSink(observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} + diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Multicast.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Multicast.swift new file mode 100644 index 0000000..fe4ec2d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Multicast.swift @@ -0,0 +1,71 @@ +// +// Multicast.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class MulticastSink: Sink, ObserverType { + typealias Element = O.E + typealias ResultType = Element + typealias MutlicastType = Multicast + + private let _parent: MutlicastType + + init(parent: MutlicastType, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + do { + let subject = try _parent._subjectSelector() + let connectable = ConnectableObservableAdapter(source: _parent._source, subject: subject) + + let observable = try _parent._selector(connectable) + + let subscription = observable.subscribe(self) + let connection = connectable.connect() + + return Disposables.create(subscription, connection) + } + catch let e { + forwardOn(.error(e)) + dispose() + return Disposables.create() + } + } + + func on(_ event: Event) { + forwardOn(event) + switch event { + case .next: break + case .error, .completed: + dispose() + } + } +} + +class Multicast: Producer { + typealias SubjectSelectorType = () throws -> S + typealias SelectorType = (Observable) throws -> Observable + + fileprivate let _source: Observable + fileprivate let _subjectSelector: SubjectSelectorType + fileprivate let _selector: SelectorType + + init(source: Observable, subjectSelector: @escaping SubjectSelectorType, selector: @escaping SelectorType) { + _source = source + _subjectSelector = subjectSelector + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = MulticastSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Never.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Never.swift new file mode 100644 index 0000000..2e1df69 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Never.swift @@ -0,0 +1,15 @@ +// +// Never.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class Never : Producer { + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + return Disposables.create() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOn.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOn.swift new file mode 100644 index 0000000..9c561b1 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOn.swift @@ -0,0 +1,129 @@ +// +// ObserveOn.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ObserveOn : Producer { + let scheduler: ImmediateSchedulerType + let source: Observable + + init(source: Observable, scheduler: ImmediateSchedulerType) { + self.scheduler = scheduler + self.source = source + +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObserveOnSink(scheduler: scheduler, observer: observer, cancel: cancel) + let subscription = source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + +#if TRACE_RESOURCES + deinit { + let _ = Resources.decrementTotal() + } +#endif +} + +enum ObserveOnState : Int32 { + // pump is not running + case stopped = 0 + // pump is running + case running = 1 +} + +class ObserveOnSink : ObserverBase { + typealias E = O.E + + let _scheduler: ImmediateSchedulerType + + var _lock = SpinLock() + let _observer: O + + // state + var _state = ObserveOnState.stopped + var _queue = Queue>(capacity: 10) + + let _scheduleDisposable = SerialDisposable() + let _cancel: Cancelable + + init(scheduler: ImmediateSchedulerType, observer: O, cancel: Cancelable) { + _scheduler = scheduler + _observer = observer + _cancel = cancel + } + + override func onCore(_ event: Event) { + let shouldStart = _lock.calculateLocked { () -> Bool in + self._queue.enqueue(event) + + switch self._state { + case .stopped: + self._state = .running + return true + case .running: + return false + } + } + + if shouldStart { + _scheduleDisposable.disposable = self._scheduler.scheduleRecursive((), action: self.run) + } + } + + func run(_ state: Void, recurse: (Void) -> Void) { + let (nextEvent, observer) = self._lock.calculateLocked { () -> (Event?, O) in + if self._queue.count > 0 { + return (self._queue.dequeue(), self._observer) + } + else { + self._state = .stopped + return (nil, self._observer) + } + } + + if let nextEvent = nextEvent, !_cancel.isDisposed { + observer.on(nextEvent) + if nextEvent.isStopEvent { + dispose() + } + } + else { + return + } + + let shouldContinue = _shouldContinue_synchronized() + + if shouldContinue { + recurse() + } + } + + func _shouldContinue_synchronized() -> Bool { + _lock.lock(); defer { _lock.unlock() } // { + if self._queue.count > 0 { + return true + } + else { + self._state = .stopped + return false + } + // } + } + + override func dispose() { + super.dispose() + + _cancel.dispose() + _scheduleDisposable.dispose() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOnSerialDispatchQueue.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOnSerialDispatchQueue.swift new file mode 100644 index 0000000..7f4ab9c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ObserveOnSerialDispatchQueue.swift @@ -0,0 +1,87 @@ +// +// ObserveOnSerialDispatchQueue.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +#if TRACE_RESOURCES + fileprivate var _numberOfSerialDispatchQueueObservables: AtomicInt = 0 + extension Resources { + /** + Counts number of `SerialDispatchQueueObservables`. + + Purposed for unit tests. + */ + public static var numberOfSerialDispatchQueueObservables: Int32 { + return _numberOfSerialDispatchQueueObservables.valueSnapshot() + } + } +#endif + +class ObserveOnSerialDispatchQueueSink : ObserverBase { + let scheduler: SerialDispatchQueueScheduler + let observer: O + + let cancel: Cancelable + + var cachedScheduleLambda: ((ObserveOnSerialDispatchQueueSink, Event) -> Disposable)! + + init(scheduler: SerialDispatchQueueScheduler, observer: O, cancel: Cancelable) { + self.scheduler = scheduler + self.observer = observer + self.cancel = cancel + super.init() + + cachedScheduleLambda = { sink, event in + sink.observer.on(event) + + if event.isStopEvent { + sink.dispose() + } + + return Disposables.create() + } + } + + override func onCore(_ event: Event) { + let _ = self.scheduler.schedule((self, event), action: cachedScheduleLambda) + } + + override func dispose() { + super.dispose() + + cancel.dispose() + } +} + +class ObserveOnSerialDispatchQueue : Producer { + let scheduler: SerialDispatchQueueScheduler + let source: Observable + + init(source: Observable, scheduler: SerialDispatchQueueScheduler) { + self.scheduler = scheduler + self.source = source + +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() + let _ = AtomicIncrement(&_numberOfSerialDispatchQueueObservables) +#endif + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObserveOnSerialDispatchQueueSink(scheduler: scheduler, observer: observer, cancel: cancel) + let subscription = source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + +#if TRACE_RESOURCES + deinit { + let _ = Resources.decrementTotal() + let _ = AtomicDecrement(&_numberOfSerialDispatchQueueObservables) + } +#endif +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Optional.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Optional.swift new file mode 100644 index 0000000..b05f7ea --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Optional.swift @@ -0,0 +1,68 @@ +// +// Optional.swift +// RxSwift +// +// Created by tarunon on 2016/12/13. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ObservableOptionalScheduledSink : Sink { + typealias E = O.E + typealias Parent = ObservableOptionalScheduled + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.schedule(_parent._optional) { (optional: E?) -> Disposable in + if let next = optional { + self.forwardOn(.next(next)) + return self._parent._scheduler.schedule(()) { _ in + self.forwardOn(.completed) + return Disposables.create() + } + } else { + self.forwardOn(.completed) + return Disposables.create() + } + } + } +} + +class ObservableOptionalScheduled : Producer { + fileprivate let _optional: E? + fileprivate let _scheduler: ImmediateSchedulerType + + init(optional: E?, scheduler: ImmediateSchedulerType) { + _optional = optional + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObservableOptionalScheduledSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +class ObservableOptional: Producer { + private let _optional: E? + + init(optional: E?) { + _optional = optional + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + if let element = _optional { + observer.on(.next(element)) + } + observer.on(.completed) + return Disposables.create() + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Producer.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Producer.swift new file mode 100644 index 0000000..ca20f8a --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Producer.swift @@ -0,0 +1,119 @@ +// +// Producer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/20/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class Producer : Observable { + override init() { + super.init() + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + if !CurrentThreadScheduler.isScheduleRequired { + // The returned disposable needs to release all references once it was disposed. + let disposer = SinkDisposer() + let sinkAndSubscription = run(observer, cancel: disposer) + disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) + + return disposer + } + else { + return CurrentThreadScheduler.instance.schedule(()) { _ in + let disposer = SinkDisposer() + let sinkAndSubscription = self.run(observer, cancel: disposer) + disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) + + return disposer + } + } + } + + func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + abstractMethod() + } +} + +fileprivate class SinkDisposer: Cancelable { + #if os(Linux) + fileprivate let _lock = SpinLock() + #endif + + fileprivate enum DisposeState: UInt32 { + case disposed = 1 + case sinkAndSubscriptionSet = 2 + } + + // Jeej, swift API consistency rules + fileprivate enum DisposeStateInt32: Int32 { + case disposed = 1 + case sinkAndSubscriptionSet = 2 + } + + private var _state: UInt32 = 0 + private var _sink: Disposable? = nil + private var _subscription: Disposable? = nil + + var isDisposed: Bool { + return (_state & DisposeState.disposed.rawValue) != 0 + } + + func setSinkAndSubscription(sink: Disposable, subscription: Disposable) { + _sink = sink + _subscription = subscription + + #if os(Linux) + _lock.lock() + let previousState = Int32(_state) + _state = _state | DisposeState.sinkAndSubscriptionSet.rawValue + // We know about `defer { _lock.unlock() }`, but this resolves Swift compiler bugs. Using `defer` here causes anomaly. + _lock.unlock() + #else + let previousState = OSAtomicOr32OrigBarrier(DisposeState.sinkAndSubscriptionSet.rawValue, &_state) + #endif + if (previousState & DisposeStateInt32.sinkAndSubscriptionSet.rawValue) != 0 { + rxFatalError("Sink and subscription were already set") + } + + if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { + sink.dispose() + subscription.dispose() + _sink = nil + _subscription = nil + } + } + + func dispose() { + #if os(Linux) + _lock.lock() + let previousState = Int32(_state) + _state = _state | DisposeState.disposed.rawValue + // We know about `defer { _lock.unlock() }`, but this resolves Swift compiler bugs. Using `defer` here causes anomaly. + _lock.unlock() + #else + let previousState = OSAtomicOr32OrigBarrier(DisposeState.disposed.rawValue, &_state) + #endif + if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { + return + } + + if (previousState & DisposeStateInt32.sinkAndSubscriptionSet.rawValue) != 0 { + guard let sink = _sink else { + rxFatalError("Sink not set") + } + guard let subscription = _subscription else { + rxFatalError("Subscription not set") + } + + sink.dispose() + subscription.dispose() + + _sink = nil + _subscription = nil + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Range.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Range.swift new file mode 100644 index 0000000..74ece4d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Range.swift @@ -0,0 +1,59 @@ +// +// Range.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class RangeProducer : Producer { + fileprivate let _start: E + fileprivate let _count: E + fileprivate let _scheduler: ImmediateSchedulerType + + init(start: E, count: E, scheduler: ImmediateSchedulerType) { + if count < 0 { + rxFatalError("count can't be negative") + } + + if start &+ (count - 1) < start { + rxFatalError("overflow of count") + } + + _start = start + _count = count + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = RangeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +class RangeSink : Sink where O.E: SignedInteger { + typealias Parent = RangeProducer + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in + if i < self._parent._count { + self.forwardOn(.next(self._parent._start + i)) + recurse(i + 1) + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Reduce.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Reduce.swift new file mode 100644 index 0000000..f203709 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Reduce.swift @@ -0,0 +1,74 @@ +// +// Reduce.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ReduceSink : Sink, ObserverType { + typealias ResultType = O.E + typealias Parent = Reduce + + private let _parent: Parent + private var _accumulation: AccumulateType + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _accumulation = parent._seed + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + _accumulation = try _parent._accumulator(_accumulation, value) + } + catch let e { + forwardOn(.error(e)) + dispose() + } + case .error(let e): + forwardOn(.error(e)) + dispose() + case .completed: + do { + let result = try _parent._mapResult(_accumulation) + forwardOn(.next(result)) + forwardOn(.completed) + dispose() + } + catch let e { + forwardOn(.error(e)) + dispose() + } + } + } +} + +class Reduce : Producer { + typealias AccumulatorType = (AccumulateType, SourceType) throws -> AccumulateType + typealias ResultSelectorType = (AccumulateType) throws -> ResultType + + fileprivate let _source: Observable + fileprivate let _seed: AccumulateType + fileprivate let _accumulator: AccumulatorType + fileprivate let _mapResult: ResultSelectorType + + init(source: Observable, seed: AccumulateType, accumulator: @escaping AccumulatorType, mapResult: @escaping ResultSelectorType) { + _source = source + _seed = seed + _accumulator = accumulator + _mapResult = mapResult + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = ReduceSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/RefCount.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/RefCount.swift new file mode 100644 index 0000000..1c5e88c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/RefCount.swift @@ -0,0 +1,84 @@ +// +// RefCount.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/5/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class RefCountSink + : Sink + , ObserverType where CO.E == O.E { + typealias Element = O.E + typealias Parent = RefCount + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = _parent._source.subscribeSafe(self) + + _parent._lock.lock(); defer { _parent._lock.unlock() } // { + if _parent._count == 0 { + _parent._count = 1 + _parent._connectableSubscription = _parent._source.connect() + } + else { + _parent._count = _parent._count + 1 + } + // } + + return Disposables.create { + subscription.dispose() + self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { + if self._parent._count == 1 { + self._parent._connectableSubscription!.dispose() + self._parent._count = 0 + self._parent._connectableSubscription = nil + } + else if self._parent._count > 1 { + self._parent._count = self._parent._count - 1 + } + else { + rxFatalError("Something went wrong with RefCount disposing mechanism") + } + // } + } + } + + func on(_ event: Event) { + switch event { + case .next: + forwardOn(event) + case .error, .completed: + forwardOn(event) + dispose() + } + } +} + +class RefCount: Producer { + fileprivate let _lock = NSRecursiveLock() + + // state + fileprivate var _count = 0 + fileprivate var _connectableSubscription = nil as Disposable? + + fileprivate let _source: CO + + init(source: CO) { + _source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == CO.E { + let sink = RefCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Repeat.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Repeat.swift new file mode 100644 index 0000000..90b850b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Repeat.swift @@ -0,0 +1,44 @@ +// +// Repeat.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class RepeatElement : Producer { + fileprivate let _element: Element + fileprivate let _scheduler: ImmediateSchedulerType + + init(element: Element, scheduler: ImmediateSchedulerType) { + _element = element + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + + return (sink: sink, subscription: subscription) + } +} + +class RepeatElementSink : Sink { + typealias Parent = RepeatElement + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.scheduleRecursive(_parent._element) { e, recurse in + self.forwardOn(.next(e)) + recurse(e) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/RetryWhen.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/RetryWhen.swift new file mode 100644 index 0000000..00cba3d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/RetryWhen.swift @@ -0,0 +1,150 @@ +// +// RetryWhen.swift +// RxSwift +// +// Created by Junior B. on 06/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class RetryTriggerSink + : ObserverType where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { + typealias E = TriggerObservable.E + + typealias Parent = RetryWhenSequenceSinkIter + + fileprivate let _parent: Parent + + init(parent: Parent) { + _parent = parent + } + + func on(_ event: Event) { + switch event { + case .next: + _parent._parent._lastError = nil + _parent._parent.schedule(.moveNext) + case .error(let e): + _parent._parent.forwardOn(.error(e)) + _parent._parent.dispose() + case .completed: + _parent._parent.forwardOn(.completed) + _parent._parent.dispose() + } + } +} + +class RetryWhenSequenceSinkIter + : SingleAssignmentDisposable + , ObserverType where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { + typealias E = O.E + typealias Parent = RetryWhenSequenceSink + + fileprivate let _parent: Parent + fileprivate let _errorHandlerSubscription = SingleAssignmentDisposable() + + init(parent: Parent) { + _parent = parent + } + + func on(_ event: Event) { + switch event { + case .next: + _parent.forwardOn(event) + case .error(let error): + _parent._lastError = error + + if let failedWith = error as? Error { + // dispose current subscription + super.dispose() + + let errorHandlerSubscription = _parent._notifier.subscribe(RetryTriggerSink(parent: self)) + _errorHandlerSubscription.setDisposable(errorHandlerSubscription) + _parent._errorSubject.on(.next(failedWith)) + } + else { + _parent.forwardOn(.error(error)) + _parent.dispose() + } + case .completed: + _parent.forwardOn(event) + _parent.dispose() + } + } + + override func dispose() { + super.dispose() + _errorHandlerSubscription.dispose() + } +} + +class RetryWhenSequenceSink + : TailRecursiveSink where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { + typealias Element = O.E + typealias Parent = RetryWhenSequence + + let _lock = NSRecursiveLock() + + fileprivate let _parent: Parent + + fileprivate var _lastError: Swift.Error? + fileprivate let _errorSubject = PublishSubject() + fileprivate let _handler: Observable + fileprivate let _notifier = PublishSubject() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _handler = parent._notificationHandler(_errorSubject).asObservable() + super.init(observer: observer, cancel: cancel) + } + + override func done() { + if let lastError = _lastError { + forwardOn(.error(lastError)) + _lastError = nil + } + else { + forwardOn(.completed) + } + + dispose() + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + // It is important to always return `nil` here because there are sideffects in the `run` method + // that are dependant on particular `retryWhen` operator so single operator stack can't be reused in this + // case. + return nil + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + let iter = RetryWhenSequenceSinkIter(parent: self) + iter.setDisposable(source.subscribe(iter)) + return iter + } + + override func run(_ sources: SequenceGenerator) -> Disposable { + let triggerSubscription = _handler.subscribe(_notifier.asObserver()) + let superSubscription = super.run(sources) + return Disposables.create(superSubscription, triggerSubscription) + } +} + +class RetryWhenSequence : Producer where S.Iterator.Element : ObservableType { + typealias Element = S.Iterator.Element.E + + fileprivate let _sources: S + fileprivate let _notificationHandler: (Observable) -> TriggerObservable + + init(sources: S, notificationHandler: @escaping (Observable) -> TriggerObservable) { + _sources = sources + _notificationHandler = notificationHandler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = RetryWhenSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run((self._sources.makeIterator(), nil)) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Sample.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Sample.swift new file mode 100644 index 0000000..107dfec --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Sample.swift @@ -0,0 +1,124 @@ +// +// Sample.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class SamplerSink + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = SampleType + + typealias Parent = SampleSequenceSink + + fileprivate let _parent: Parent + + var _lock: NSRecursiveLock { + return _parent._lock + } + + init(parent: Parent) { + _parent = parent + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + if let element = _parent._element { + _parent._element = nil + _parent.forwardOn(.next(element)) + } + + if _parent._atEnd { + _parent.forwardOn(.completed) + _parent.dispose() + } + case .error(let e): + _parent.forwardOn(.error(e)) + _parent.dispose() + case .completed: + if let element = _parent._element { + _parent._element = nil + _parent.forwardOn(.next(element)) + } + if _parent._atEnd { + _parent.forwardOn(.completed) + _parent.dispose() + } + } + } +} + +class SampleSequenceSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias Parent = Sample + + fileprivate let _parent: Parent + + let _lock = NSRecursiveLock() + + // state + fileprivate var _element = nil as Element? + fileprivate var _atEnd = false + + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + _sourceSubscription.setDisposable(_parent._source.subscribe(self)) + let samplerSubscription = _parent._sampler.subscribe(SamplerSink(parent: self)) + + return Disposables.create(_sourceSubscription, samplerSubscription) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + _element = element + case .error: + forwardOn(event) + dispose() + case .completed: + _atEnd = true + _sourceSubscription.dispose() + } + } + +} + +class Sample : Producer { + fileprivate let _source: Observable + fileprivate let _sampler: Observable + + init(source: Observable, sampler: Observable) { + _source = source + _sampler = sampler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SampleSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Scan.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Scan.swift new file mode 100644 index 0000000..e381ae3 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Scan.swift @@ -0,0 +1,65 @@ +// +// Scan.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ScanSink : Sink, ObserverType { + typealias Accumulate = O.E + typealias Parent = Scan + typealias E = ElementType + + fileprivate let _parent: Parent + fileprivate var _accumulate: Accumulate + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _accumulate = parent._seed + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let element): + do { + _accumulate = try _parent._accumulator(_accumulate, element) + forwardOn(.next(_accumulate)) + } + catch let error { + forwardOn(.error(error)) + dispose() + } + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + forwardOn(.completed) + dispose() + } + } + +} + +class Scan: Producer { + typealias Accumulator = (Accumulate, Element) throws -> Accumulate + + fileprivate let _source: Observable + fileprivate let _seed: Accumulate + fileprivate let _accumulator: Accumulator + + init(source: Observable, seed: Accumulate, accumulator: @escaping Accumulator) { + _source = source + _seed = seed + _accumulator = accumulator + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Accumulate { + let sink = ScanSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Sequence.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Sequence.swift new file mode 100644 index 0000000..b5f972d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Sequence.swift @@ -0,0 +1,49 @@ +// +// Sequence.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ObservableSequenceSink : Sink where S.Iterator.Element == O.E { + typealias Parent = ObservableSequence + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.scheduleRecursive((_parent._elements.makeIterator(), _parent._elements)) { (iterator, recurse) in + var mutableIterator = iterator + if let next = mutableIterator.0.next() { + self.forwardOn(.next(next)) + recurse(mutableIterator) + } + else { + self.forwardOn(.completed) + } + } + } +} + +class ObservableSequence : Producer { + fileprivate let _elements: S + fileprivate let _scheduler: ImmediateSchedulerType + + init(elements: S, scheduler: ImmediateSchedulerType) { + _elements = elements + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObservableSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1.swift new file mode 100644 index 0000000..6f7497b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1.swift @@ -0,0 +1,101 @@ +// +// ShareReplay1.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// optimized version of share replay for most common case +final class ShareReplay1 + : Observable + , ObserverType + , SynchronizedUnsubscribeType { + + typealias DisposeKey = Bag>.KeyType + + private let _source: Observable + + private var _lock = NSRecursiveLock() + + private var _connection: SingleAssignmentDisposable? + private var _element: Element? + private var _stopped = false + private var _stopEvent = nil as Event? + private var _observers = Bag>() + + init(source: Observable) { + self._source = source + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + _lock.lock(); defer { _lock.unlock() } + return _synchronized_subscribe(observer) + } + + func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E { + if let element = self._element { + observer.on(.next(element)) + } + + if let stopEvent = self._stopEvent { + observer.on(stopEvent) + return Disposables.create() + } + + let initialCount = self._observers.count + + let disposeKey = self._observers.insert(AnyObserver(observer)) + + if initialCount == 0 { + let connection = SingleAssignmentDisposable() + _connection = connection + + connection.setDisposable(self._source.subscribe(self)) + } + + return SubscriptionDisposable(owner: self, key: disposeKey) + } + + func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { + _lock.lock(); defer { _lock.unlock() } + _synchronized_unsubscribe(disposeKey) + } + + func _synchronized_unsubscribe(_ disposeKey: DisposeKey) { + // if already unsubscribed, just return + if self._observers.removeKey(disposeKey) == nil { + return + } + + if _observers.count == 0 { + _connection?.dispose() + _connection = nil + } + } + + func on(_ event: Event) { + _synchronized_on(event).on(event) + } + + func _synchronized_on(_ event: Event) -> Bag> { + _lock.lock(); defer { _lock.unlock() } + if _stopped { + return Bag() + } + + switch event { + case .next(let element): + _element = element + case .error, .completed: + _stopEvent = event + _stopped = true + _connection?.dispose() + _connection = nil + } + + return _observers + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1WhileConnected.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1WhileConnected.swift new file mode 100644 index 0000000..fa8c252 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ShareReplay1WhileConnected.swift @@ -0,0 +1,92 @@ +// +// ShareReplay1WhileConnected.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// optimized version of share replay for most common case +final class ShareReplay1WhileConnected + : Observable + , ObserverType + , SynchronizedUnsubscribeType { + + typealias DisposeKey = Bag>.KeyType + + private let _source: Observable + + private var _lock = NSRecursiveLock() + + private var _connection: SingleAssignmentDisposable? + private var _element: Element? + private var _observers = Bag>() + + init(source: Observable) { + self._source = source + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + _lock.lock(); defer { _lock.unlock() } + return _synchronized_subscribe(observer) + } + + func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E { + if let element = self._element { + observer.on(.next(element)) + } + + let initialCount = self._observers.count + + let disposeKey = self._observers.insert(AnyObserver(observer)) + + if initialCount == 0 { + let connection = SingleAssignmentDisposable() + _connection = connection + + connection.setDisposable(self._source.subscribe(self)) + } + + return SubscriptionDisposable(owner: self, key: disposeKey) + } + + func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { + _lock.lock(); defer { _lock.unlock() } + _synchronized_unsubscribe(disposeKey) + } + + func _synchronized_unsubscribe(_ disposeKey: DisposeKey) { + // if already unsubscribed, just return + if self._observers.removeKey(disposeKey) == nil { + return + } + + if _observers.count == 0 { + _connection?.dispose() + _connection = nil + _element = nil + } + } + + func on(_ event: Event) { + _synchronized_on(event).on(event) + } + + func _synchronized_on(_ event: Event) -> Bag> { + _lock.lock(); defer { _lock.unlock() } + switch event { + case .next(let element): + _element = element + return _observers + case .error, .completed: + _element = nil + _connection?.dispose() + _connection = nil + let observers = _observers + _observers = Bag() + return observers + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/SingleAsync.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/SingleAsync.swift new file mode 100644 index 0000000..988677d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/SingleAsync.swift @@ -0,0 +1,77 @@ +// +// SingleAsync.swift +// RxSwift +// +// Created by Junior B. on 09/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class SingleAsyncSink : Sink, ObserverType { + typealias ElementType = O.E + typealias Parent = SingleAsync + typealias E = ElementType + + private let _parent: Parent + private var _seenValue: Bool = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let forward = try _parent._predicate?(value) ?? true + if !forward { + return + } + } + catch let error { + forwardOn(.error(error as Swift.Error)) + dispose() + return + } + + if _seenValue == false { + _seenValue = true + forwardOn(.next(value)) + } else { + forwardOn(.error(RxError.moreThanOneElement)) + dispose() + } + + case .error: + forwardOn(event) + dispose() + case .completed: + if (!_seenValue) { + forwardOn(.error(RxError.noElements)) + } else { + forwardOn(.completed) + } + dispose() + } + } +} + +class SingleAsync: Producer { + typealias Predicate = (Element) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate? + + init(source: Observable, predicate: Predicate? = nil) { + _source = source + _predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SingleAsyncSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Sink.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Sink.swift new file mode 100644 index 0000000..21e1d78 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Sink.swift @@ -0,0 +1,70 @@ +// +// Sink.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class Sink : Disposable { + fileprivate let _observer: O + fileprivate let _cancel: Cancelable + fileprivate var _disposed: Bool + + init(observer: O, cancel: Cancelable) { +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + _observer = observer + _cancel = cancel + _disposed = false + } + + final func forwardOn(_ event: Event) { + if _disposed { + return + } + _observer.on(event) + } + + final func forwarder() -> SinkForward { + return SinkForward(forward: self) + } + + var disposed: Bool { + return _disposed + } + + func dispose() { + _disposed = true + _cancel.dispose() + } + + deinit { +#if TRACE_RESOURCES + let _ = Resources.decrementTotal() +#endif + } +} + +class SinkForward: ObserverType { + typealias E = O.E + + private let _forward: Sink + + init(forward: Sink) { + _forward = forward + } + + func on(_ event: Event) { + switch event { + case .next: + _forward._observer.on(event) + case .error, .completed: + _forward._observer.on(event) + _forward._cancel.dispose() + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Skip.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Skip.swift new file mode 100644 index 0000000..66d4165 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Skip.swift @@ -0,0 +1,128 @@ +// +// Skip.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// count version + +class SkipCountSink : Sink, ObserverType { + typealias Element = O.E + typealias Parent = SkipCount + + let parent: Parent + + var remaining: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + self.remaining = parent.count + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + + if remaining <= 0 { + forwardOn(.next(value)) + } + else { + remaining -= 1 + } + case .error: + forwardOn(event) + self.dispose() + case .completed: + forwardOn(event) + self.dispose() + } + } + +} + +class SkipCount: Producer { + let source: Observable + let count: Int + + init(source: Observable, count: Int) { + self.source = source + self.count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = source.subscribe(sink) + + return (sink: sink, subscription: subscription) + } +} + +// time version + +class SkipTimeSink : Sink, ObserverType where O.E == ElementType { + typealias Parent = SkipTime + typealias Element = ElementType + + let parent: Parent + + // state + var open = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if open { + forwardOn(.next(value)) + } + case .error: + forwardOn(event) + self.dispose() + case .completed: + forwardOn(event) + self.dispose() + } + } + + func tick() { + open = true + } + + func run() -> Disposable { + let disposeTimer = parent.scheduler.scheduleRelative((), dueTime: self.parent.duration) { + self.tick() + return Disposables.create() + } + + let disposeSubscription = parent.source.subscribe(self) + + return Disposables.create(disposeTimer, disposeSubscription) + } +} + +class SkipTime: Producer { + let source: Observable + let duration: RxTimeInterval + let scheduler: SchedulerType + + init(source: Observable, duration: RxTimeInterval, scheduler: SchedulerType) { + self.source = source + self.scheduler = scheduler + self.duration = duration + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipTimeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/SkipUntil.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/SkipUntil.swift new file mode 100644 index 0000000..d7c4c73 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/SkipUntil.swift @@ -0,0 +1,125 @@ +// +// SkipUntil.swift +// RxSwift +// +// Created by Yury Korolev on 10/3/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class SkipUntilSinkOther + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Parent = SkipUntilSink + typealias E = Other + + fileprivate let _parent: Parent + + var _lock: NSRecursiveLock { + return _parent._lock + } + + let _subscription = SingleAssignmentDisposable() + + init(parent: Parent) { + _parent = parent + #if TRACE_RESOURCES + let _ = Resources.incrementTotal() + #endif + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + _parent._forwardElements = true + _subscription.dispose() + case .error(let e): + _parent.forwardOn(.error(e)) + _parent.dispose() + case .completed: + _subscription.dispose() + } + } + + #if TRACE_RESOURCES + deinit { + let _ = Resources.decrementTotal() + } + #endif + +} + + +class SkipUntilSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = O.E + typealias Parent = SkipUntil + + let _lock = NSRecursiveLock() + fileprivate let _parent: Parent + fileprivate var _forwardElements = false + + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + if _forwardElements { + forwardOn(event) + } + case .error: + forwardOn(event) + dispose() + case .completed: + if _forwardElements { + forwardOn(event) + } + _sourceSubscription.dispose() + } + } + + func run() -> Disposable { + let sourceSubscription = _parent._source.subscribe(self) + let otherObserver = SkipUntilSinkOther(parent: self) + let otherSubscription = _parent._other.subscribe(otherObserver) + _sourceSubscription.setDisposable(sourceSubscription) + otherObserver._subscription.setDisposable(otherSubscription) + + return Disposables.create(_sourceSubscription, otherObserver._subscription) + } +} + +class SkipUntil: Producer { + + fileprivate let _source: Observable + fileprivate let _other: Observable + + init(source: Observable, other: Observable) { + _source = source + _other = other + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipUntilSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/SkipWhile.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/SkipWhile.swift new file mode 100644 index 0000000..a6c1665 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/SkipWhile.swift @@ -0,0 +1,115 @@ +// +// SkipWhile.swift +// RxSwift +// +// Created by Yury Korolev on 10/9/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +class SkipWhileSink : Sink, ObserverType { + + typealias Element = O.E + typealias Parent = SkipWhile + + fileprivate let _parent: Parent + fileprivate var _running = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !_running { + do { + _running = try !_parent._predicate(value) + } catch let e { + forwardOn(.error(e)) + dispose() + return + } + } + + if _running { + forwardOn(.next(value)) + } + case .error, .completed: + forwardOn(event) + dispose() + } + } +} + +class SkipWhileSinkWithIndex : Sink, ObserverType { + + typealias Element = O.E + typealias Parent = SkipWhile + + fileprivate let _parent: Parent + fileprivate var _index = 0 + fileprivate var _running = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !_running { + do { + _running = try !_parent._predicateWithIndex(value, _index) + let _ = try incrementChecked(&_index) + } catch let e { + forwardOn(.error(e)) + dispose() + return + } + } + + if _running { + forwardOn(.next(value)) + } + case .error, .completed: + forwardOn(event) + dispose() + } + } +} + +class SkipWhile: Producer { + typealias Predicate = (Element) throws -> Bool + typealias PredicateWithIndex = (Element, Int) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate! + fileprivate let _predicateWithIndex: PredicateWithIndex! + + init(source: Observable, predicate: @escaping Predicate) { + _source = source + _predicate = predicate + _predicateWithIndex = nil + } + + init(source: Observable, predicate: @escaping PredicateWithIndex) { + _source = source + _predicate = nil + _predicateWithIndex = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + if let _ = _predicate { + let sink = SkipWhileSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + else { + let sink = SkipWhileSinkWithIndex(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/StartWith.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/StartWith.swift new file mode 100644 index 0000000..a5ac927 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/StartWith.swift @@ -0,0 +1,28 @@ +// +// StartWith.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class StartWith: Producer { + let elements: [Element] + let source: Observable + + init(source: Observable, elements: [Element]) { + self.source = source + self.elements = elements + super.init() + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + for e in elements { + observer.on(.next(e)) + } + + return (sink: Disposables.create(), subscription: source.subscribe(observer)) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/SubscribeOn.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/SubscribeOn.swift new file mode 100644 index 0000000..b2f871c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/SubscribeOn.swift @@ -0,0 +1,62 @@ +// +// SubscribeOn.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class SubscribeOnSink : Sink, ObserverType where Ob.E == O.E { + typealias Element = O.E + typealias Parent = SubscribeOn + + let parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + forwardOn(event) + + if event.isStopEvent { + self.dispose() + } + } + + func run() -> Disposable { + let disposeEverything = SerialDisposable() + let cancelSchedule = SingleAssignmentDisposable() + + disposeEverything.disposable = cancelSchedule + + let disposeSchedule = parent.scheduler.schedule(()) { (_) -> Disposable in + let subscription = self.parent.source.subscribe(self) + disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) + return Disposables.create() + } + + cancelSchedule.setDisposable(disposeSchedule) + + return disposeEverything + } +} + +class SubscribeOn : Producer { + let source: Ob + let scheduler: ImmediateSchedulerType + + init(source: Ob, scheduler: ImmediateSchedulerType) { + self.source = source + self.scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Ob.E { + let sink = SubscribeOnSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Switch.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Switch.swift new file mode 100644 index 0000000..5b8e34f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Switch.swift @@ -0,0 +1,193 @@ +// +// Switch.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class SwitchSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType where S.E == O.E { + typealias E = SourceType + + fileprivate let _subscriptions: SingleAssignmentDisposable = SingleAssignmentDisposable() + fileprivate let _innerSubscription: SerialDisposable = SerialDisposable() + + let _lock = NSRecursiveLock() + + // state + fileprivate var _stopped = false + fileprivate var _latest = 0 + fileprivate var _hasLatest = false + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func run(_ source: Observable) -> Disposable { + let subscription = source.subscribe(self) + _subscriptions.setDisposable(subscription) + return Disposables.create(_subscriptions, _innerSubscription) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func performMap(_ element: SourceType) throws -> S { + abstractMethod() + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + do { + let observable = try performMap(element).asObservable() + _hasLatest = true + _latest = _latest &+ 1 + let latest = _latest + + let d = SingleAssignmentDisposable() + _innerSubscription.disposable = d + + let observer = SwitchSinkIter(parent: self, id: latest, _self: d) + let disposable = observable.subscribe(observer) + d.setDisposable(disposable) + } + catch let error { + forwardOn(.error(error)) + dispose() + } + case .error(let error): + forwardOn(.error(error)) + dispose() + case .completed: + _stopped = true + + _subscriptions.dispose() + + if !_hasLatest { + forwardOn(.completed) + dispose() + } + } + } +} + +class SwitchSinkIter + : ObserverType + , LockOwnerType + , SynchronizedOnType where S.E == O.E { + typealias E = S.E + typealias Parent = SwitchSink + + fileprivate let _parent: Parent + fileprivate let _id: Int + fileprivate let _self: Disposable + + var _lock: NSRecursiveLock { + return _parent._lock + } + + init(parent: Parent, id: Int, _self: Disposable) { + _parent = parent + _id = id + self._self = _self + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: break + case .error, .completed: + _self.dispose() + } + + if _parent._latest != _id { + return + } + + switch event { + case .next: + _parent.forwardOn(event) + case .error: + _parent.forwardOn(event) + _parent.dispose() + case .completed: + _parent._hasLatest = false + if _parent._stopped { + _parent.forwardOn(event) + _parent.dispose() + } + } + } +} + +// MARK: Specializations + +final class SwitchIdentitySink : SwitchSink where O.E == S.E { + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: S) throws -> S { + return element + } +} + +final class MapSwitchSink : SwitchSink where O.E == S.E { + typealias Selector = (SourceType) throws -> S + + fileprivate let _selector: Selector + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + _selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceType) throws -> S { + return try _selector(element) + } +} + +// MARK: Producers + +final class Switch : Producer { + fileprivate let _source: Observable + + init(source: Observable) { + _source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = SwitchIdentitySink(observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} + +final class FlatMapLatest : Producer { + typealias Selector = (SourceType) throws -> S + + fileprivate let _source: Observable + fileprivate let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + _source = source + _selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = MapSwitchSink(selector: _selector, observer: observer, cancel: cancel) + let subscription = sink.run(_source) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Take.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Take.swift new file mode 100644 index 0000000..9ff6c78 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Take.swift @@ -0,0 +1,144 @@ +// +// Take.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// count version + +class TakeCountSink : Sink, ObserverType { + typealias E = O.E + typealias Parent = TakeCount + + private let _parent: Parent + + private var _remaining: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _remaining = parent._count + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + + if _remaining > 0 { + _remaining -= 1 + + forwardOn(.next(value)) + + if _remaining == 0 { + forwardOn(.completed) + dispose() + } + } + case .error: + forwardOn(event) + dispose() + case .completed: + forwardOn(event) + dispose() + } + } + +} + +class TakeCount: Producer { + fileprivate let _source: Observable + fileprivate let _count: Int + + init(source: Observable, count: Int) { + if count < 0 { + rxFatalError("count can't be negative") + } + _source = source + _count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} + +// time version + +class TakeTimeSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType where O.E == ElementType { + typealias Parent = TakeTime + typealias E = ElementType + + fileprivate let _parent: Parent + + let _lock = NSRecursiveLock() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let value): + forwardOn(.next(value)) + case .error: + forwardOn(event) + dispose() + case .completed: + forwardOn(event) + dispose() + } + } + + func tick() { + _lock.lock(); defer { _lock.unlock() } + + forwardOn(.completed) + dispose() + } + + func run() -> Disposable { + let disposeTimer = _parent._scheduler.scheduleRelative((), dueTime: _parent._duration) { + self.tick() + return Disposables.create() + } + + let disposeSubscription = _parent._source.subscribe(self) + + return Disposables.create(disposeTimer, disposeSubscription) + } +} + +class TakeTime : Producer { + typealias TimeInterval = RxTimeInterval + + fileprivate let _source: Observable + fileprivate let _duration: TimeInterval + fileprivate let _scheduler: SchedulerType + + init(source: Observable, duration: TimeInterval, scheduler: SchedulerType) { + _source = source + _scheduler = scheduler + _duration = duration + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeTimeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/TakeLast.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeLast.swift new file mode 100644 index 0000000..4159d09 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeLast.swift @@ -0,0 +1,63 @@ +// +// TakeLast.swift +// RxSwift +// +// Created by Tomi Koskinen on 25/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + +class TakeLastSink : Sink, ObserverType { + typealias E = O.E + typealias Parent = TakeLast + + private let _parent: Parent + + private var _elements: Queue + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _elements = Queue(capacity: parent._count + 1) + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + _elements.enqueue(value) + if _elements.count > self._parent._count { + let _ = _elements.dequeue() + } + case .error: + forwardOn(event) + dispose() + case .completed: + for e in _elements { + forwardOn(.next(e)) + } + forwardOn(.completed) + dispose() + } + } +} + +class TakeLast: Producer { + fileprivate let _source: Observable + fileprivate let _count: Int + + init(source: Observable, count: Int) { + if count < 0 { + rxFatalError("count can't be negative") + } + _source = source + _count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/TakeUntil.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeUntil.swift new file mode 100644 index 0000000..18bbd55 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeUntil.swift @@ -0,0 +1,120 @@ +// +// TakeUntil.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class TakeUntilSinkOther + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Parent = TakeUntilSink + typealias E = Other + + fileprivate let _parent: Parent + + var _lock: NSRecursiveLock { + return _parent._lock + } + + fileprivate let _subscription = SingleAssignmentDisposable() + + init(parent: Parent) { + _parent = parent +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + _parent.forwardOn(.completed) + _parent.dispose() + case .error(let e): + _parent.forwardOn(.error(e)) + _parent.dispose() + case .completed: + _parent._open = true + _subscription.dispose() + } + } + +#if TRACE_RESOURCES + deinit { + let _ = Resources.decrementTotal() + } +#endif +} + +class TakeUntilSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType { + typealias E = O.E + typealias Parent = TakeUntil + + fileprivate let _parent: Parent + + let _lock = NSRecursiveLock() + + // state + fileprivate var _open = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + forwardOn(event) + case .error: + forwardOn(event) + dispose() + case .completed: + forwardOn(event) + dispose() + } + } + + func run() -> Disposable { + let otherObserver = TakeUntilSinkOther(parent: self) + let otherSubscription = _parent._other.subscribe(otherObserver) + otherObserver._subscription.setDisposable(otherSubscription) + let sourceSubscription = _parent._source.subscribe(self) + + return Disposables.create(sourceSubscription, otherObserver._subscription) + } +} + +class TakeUntil: Producer { + + fileprivate let _source: Observable + fileprivate let _other: Observable + + init(source: Observable, other: Observable) { + _source = source + _other = other + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeUntilSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/TakeWhile.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeWhile.swift new file mode 100644 index 0000000..a5a0651 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/TakeWhile.swift @@ -0,0 +1,132 @@ +// +// TakeWhile.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class TakeWhileSink + : Sink + , ObserverType { + typealias Element = O.E + typealias Parent = TakeWhile + + fileprivate let _parent: Parent + + fileprivate var _running = true + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !_running { + return + } + + do { + _running = try _parent._predicate(value) + } catch let e { + forwardOn(.error(e)) + dispose() + return + } + + if _running { + forwardOn(.next(value)) + } else { + forwardOn(.completed) + dispose() + } + case .error, .completed: + forwardOn(event) + dispose() + } + } + +} + +class TakeWhileSinkWithIndex + : Sink + , ObserverType { + typealias Element = O.E + typealias Parent = TakeWhile + + fileprivate let _parent: Parent + + fileprivate var _running = true + fileprivate var _index = 0 + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !_running { + return + } + + do { + _running = try _parent._predicateWithIndex(value, _index) + let _ = try incrementChecked(&_index) + } catch let e { + forwardOn(.error(e)) + dispose() + return + } + + if _running { + forwardOn(.next(value)) + } else { + forwardOn(.completed) + dispose() + } + case .error, .completed: + forwardOn(event) + dispose() + } + } + +} + +class TakeWhile: Producer { + typealias Predicate = (Element) throws -> Bool + typealias PredicateWithIndex = (Element, Int) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate! + fileprivate let _predicateWithIndex: PredicateWithIndex! + + init(source: Observable, predicate: @escaping Predicate) { + _source = source + _predicate = predicate + _predicateWithIndex = nil + } + + init(source: Observable, predicate: @escaping PredicateWithIndex) { + _source = source + _predicate = nil + _predicateWithIndex = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + if let _ = _predicate { + let sink = TakeWhileSink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } else { + let sink = TakeWhileSinkWithIndex(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Throttle.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Throttle.swift new file mode 100644 index 0000000..f9683fe --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Throttle.swift @@ -0,0 +1,143 @@ +// +// Throttle.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ThrottleSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias ParentType = Throttle + + private let _parent: ParentType + + let _lock = NSRecursiveLock() + + // state + private var _lastUnsentElement: Element? = nil + private var _lastSentTime: Date? = nil + private var _completed: Bool = false + + let cancellable = SerialDisposable() + + init(parent: ParentType, observer: O, cancel: Cancelable) { + _parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = _parent._source.subscribe(self) + + return Disposables.create(subscription, cancellable) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + let now = _parent._scheduler.now + + let timeIntervalSinceLast: RxTimeInterval + + if let lastSendingTime = _lastSentTime { + timeIntervalSinceLast = now.timeIntervalSince(lastSendingTime) + } + else { + timeIntervalSinceLast = _parent._dueTime + } + + let couldSendNow = timeIntervalSinceLast >= _parent._dueTime + + if couldSendNow { + self.sendNow(element: element) + return + } + + if !_parent._latest { + return + } + + let isThereAlreadyInFlightRequest = _lastUnsentElement != nil + + _lastUnsentElement = element + + if isThereAlreadyInFlightRequest { + return + } + + let scheduler = _parent._scheduler + let dueTime = _parent._dueTime + + let d = SingleAssignmentDisposable() + self.cancellable.disposable = d + + d.setDisposable(scheduler.scheduleRelative(0, dueTime: dueTime - timeIntervalSinceLast, action: self.propagate)) + case .error: + _lastUnsentElement = nil + forwardOn(event) + dispose() + case .completed: + if let _ = _lastUnsentElement { + _completed = true + } + else { + forwardOn(.completed) + dispose() + } + } + } + + private func sendNow(element: Element) { + _lastUnsentElement = nil + self.forwardOn(.next(element)) + // in case element processing takes a while, this should give some more room + _lastSentTime = _parent._scheduler.now + } + + func propagate(_: Int) -> Disposable { + _lock.lock(); defer { _lock.unlock() } // { + if let lastUnsentElement = _lastUnsentElement { + sendNow(element: lastUnsentElement) + } + + if _completed { + forwardOn(.completed) + dispose() + } + // } + return Disposables.create() + } +} + +class Throttle : Producer { + + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _latest: Bool + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, latest: Bool, scheduler: SchedulerType) { + _source = source + _dueTime = dueTime + _latest = latest + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = ThrottleSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Timeout.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Timeout.swift new file mode 100644 index 0000000..bf5d31f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Timeout.swift @@ -0,0 +1,122 @@ +// +// Timeout.swift +// RxSwift +// +// Created by Tomi Koskinen on 13/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class TimeoutSink: Sink, LockOwnerType, ObserverType { + typealias E = O.E + typealias Parent = Timeout + + private let _parent: Parent + + let _lock = NSRecursiveLock() + + private let _timerD = SerialDisposable() + private let _subscription = SerialDisposable() + + private var _id = 0 + private var _switched = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let original = SingleAssignmentDisposable() + _subscription.disposable = original + + _createTimeoutTimer() + + original.setDisposable(_parent._source.subscribeSafe(self)) + + return Disposables.create(_subscription, _timerD) + } + + func on(_ event: Event) { + switch event { + case .next: + var onNextWins = false + + _lock.performLocked() { + onNextWins = !self._switched + if onNextWins { + self._id = self._id &+ 1 + } + } + + if onNextWins { + forwardOn(event) + self._createTimeoutTimer() + } + case .error, .completed: + var onEventWins = false + + _lock.performLocked() { + onEventWins = !self._switched + if onEventWins { + self._id = self._id &+ 1 + } + } + + if onEventWins { + forwardOn(event) + self.dispose() + } + } + } + + private func _createTimeoutTimer() { + if _timerD.isDisposed { + return + } + + let nextTimer = SingleAssignmentDisposable() + _timerD.disposable = nextTimer + + let disposeSchedule = _parent._scheduler.scheduleRelative(_id, dueTime: _parent._dueTime) { state in + + var timerWins = false + + self._lock.performLocked() { + self._switched = (state == self._id) + timerWins = self._switched + } + + if timerWins { + self._subscription.disposable = self._parent._other.subscribeSafe(self.forwarder()) + } + + return Disposables.create() + } + + nextTimer.setDisposable(disposeSchedule) + } +} + + +class Timeout : Producer { + + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _other: Observable + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, other: Observable, scheduler: SchedulerType) { + _source = source + _dueTime = dueTime + _other = other + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TimeoutSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Timer.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Timer.swift new file mode 100644 index 0000000..1b55719 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Timer.swift @@ -0,0 +1,73 @@ +// +// Timer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class TimerSink : Sink where O.E : SignedInteger { + typealias Parent = Timer + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.schedulePeriodic(0 as O.E, startAfter: _parent._dueTime, period: _parent._period!) { state in + self.forwardOn(.next(state)) + return state &+ 1 + } + } +} + +class TimerOneOffSink : Sink where O.E : SignedInteger { + typealias Parent = Timer + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return _parent._scheduler.scheduleRelative(self, dueTime: _parent._dueTime) { (`self`) -> Disposable in + self.forwardOn(.next(0)) + self.forwardOn(.completed) + self.dispose() + + return Disposables.create() + } + } +} + +class Timer: Producer { + fileprivate let _scheduler: SchedulerType + fileprivate let _dueTime: RxTimeInterval + fileprivate let _period: RxTimeInterval? + + init(dueTime: RxTimeInterval, period: RxTimeInterval?, scheduler: SchedulerType) { + _scheduler = scheduler + _dueTime = dueTime + _period = period + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + if let _ = _period { + let sink = TimerSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + else { + let sink = TimerOneOffSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/ToArray.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/ToArray.swift new file mode 100644 index 0000000..623d6e2 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/ToArray.swift @@ -0,0 +1,50 @@ +// +// ToArray.swift +// RxSwift +// +// Created by Junior B. on 20/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ToArraySink : Sink, ObserverType where O.E == [SourceType] { + typealias Parent = ToArray + + let _parent: Parent + var _list = Array() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + self._list.append(value) + case .error(let e): + forwardOn(.error(e)) + self.dispose() + case .completed: + forwardOn(.next(_list)) + forwardOn(.completed) + self.dispose() + } + } +} + +class ToArray : Producer<[SourceType]> { + let _source: Observable + + init(source: Observable) { + _source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [SourceType] { + let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) + let subscription = _source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Using.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Using.swift new file mode 100644 index 0000000..19b6e00 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Using.swift @@ -0,0 +1,77 @@ +// +// Using.swift +// RxSwift +// +// Created by Yury Korolev on 10/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class UsingSink : Sink, ObserverType { + typealias SourceType = O.E + typealias Parent = Using + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + var disposable = Disposables.create() + + do { + let resource = try _parent._resourceFactory() + disposable = resource + let source = try _parent._observableFactory(resource) + + return Disposables.create( + source.subscribe(self), + disposable + ) + } catch let error { + return Disposables.create( + Observable.error(error).subscribe(self), + disposable + ) + } + } + + func on(_ event: Event) { + switch event { + case let .next(value): + forwardOn(.next(value)) + case let .error(error): + forwardOn(.error(error)) + dispose() + case .completed: + forwardOn(.completed) + dispose() + } + } +} + +class Using: Producer { + + typealias E = SourceType + + typealias ResourceFactory = () throws -> ResourceType + typealias ObservableFactory = (ResourceType) throws -> Observable + + fileprivate let _resourceFactory: ResourceFactory + fileprivate let _observableFactory: ObservableFactory + + + init(resourceFactory: @escaping ResourceFactory, observableFactory: @escaping ObservableFactory) { + _resourceFactory = resourceFactory + _observableFactory = observableFactory + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = UsingSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Window.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Window.swift new file mode 100644 index 0000000..4ca7ac4 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Window.swift @@ -0,0 +1,154 @@ +// +// Window.swift +// RxSwift +// +// Created by Junior B. on 29/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class WindowTimeCountSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType where O.E == Observable { + typealias Parent = WindowTimeCount + typealias E = Element + + private let _parent: Parent + + let _lock = NSRecursiveLock() + + private var _subject = PublishSubject() + private var _count = 0 + private var _windowId = 0 + + private let _timerD = SerialDisposable() + private let _refCountDisposable: RefCountDisposable + private let _groupDisposable = CompositeDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + + let _ = _groupDisposable.insert(_timerD) + + _refCountDisposable = RefCountDisposable(disposable: _groupDisposable) + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + + forwardOn(.next(AddRef(source: _subject, refCount: _refCountDisposable).asObservable())) + createTimer(_windowId) + + let _ = _groupDisposable.insert(_parent._source.subscribeSafe(self)) + return _refCountDisposable + } + + func startNewWindowAndCompleteCurrentOne() { + _subject.on(.completed) + _subject = PublishSubject() + + forwardOn(.next(AddRef(source: _subject, refCount: _refCountDisposable).asObservable())) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + var newWindow = false + var newId = 0 + + switch event { + case .next(let element): + _subject.on(.next(element)) + + do { + let _ = try incrementChecked(&_count) + } catch (let e) { + _subject.on(.error(e as Swift.Error)) + dispose() + } + + if (_count == _parent._count) { + newWindow = true + _count = 0 + _windowId += 1 + newId = _windowId + self.startNewWindowAndCompleteCurrentOne() + } + + case .error(let error): + _subject.on(.error(error)) + forwardOn(.error(error)) + dispose() + case .completed: + _subject.on(.completed) + forwardOn(.completed) + dispose() + } + + if newWindow { + createTimer(newId) + } + } + + func createTimer(_ windowId: Int) { + if _timerD.isDisposed { + return + } + + if _windowId != windowId { + return + } + + let nextTimer = SingleAssignmentDisposable() + + _timerD.disposable = nextTimer + + let scheduledRelative = _parent._scheduler.scheduleRelative(windowId, dueTime: _parent._timeSpan) { previousWindowId in + + var newId = 0 + + self._lock.performLocked { + if previousWindowId != self._windowId { + return + } + + self._count = 0 + self._windowId = self._windowId &+ 1 + newId = self._windowId + self.startNewWindowAndCompleteCurrentOne() + } + + self.createTimer(newId) + + return Disposables.create() + } + + nextTimer.setDisposable(scheduledRelative) + } +} + +class WindowTimeCount : Producer> { + + fileprivate let _timeSpan: RxTimeInterval + fileprivate let _count: Int + fileprivate let _scheduler: SchedulerType + fileprivate let _source: Observable + + init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { + _source = source + _timeSpan = timeSpan + _count = count + _scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Observable { + let sink = WindowTimeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/WithLatestFrom.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/WithLatestFrom.swift new file mode 100644 index 0000000..c10bf69 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/WithLatestFrom.swift @@ -0,0 +1,123 @@ +// +// WithLatestFrom.swift +// RxSwift +// +// Created by Yury Korolev on 10/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class WithLatestFromSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias ResultType = O.E + typealias Parent = WithLatestFrom + typealias E = FirstType + + fileprivate let _parent: Parent + + var _lock = NSRecursiveLock() + fileprivate var _latest: SecondType? + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let sndSubscription = SingleAssignmentDisposable() + let sndO = WithLatestFromSecond(parent: self, disposable: sndSubscription) + + sndSubscription.setDisposable(_parent._second.subscribe(sndO)) + let fstSubscription = _parent._first.subscribe(self) + + return Disposables.create(fstSubscription, sndSubscription) + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case let .next(value): + guard let latest = _latest else { return } + do { + let res = try _parent._resultSelector(value, latest) + + forwardOn(.next(res)) + } catch let e { + forwardOn(.error(e)) + dispose() + } + case .completed: + forwardOn(.completed) + dispose() + case let .error(error): + forwardOn(.error(error)) + dispose() + } + } +} + +class WithLatestFromSecond + : ObserverType + , LockOwnerType + , SynchronizedOnType { + + typealias ResultType = O.E + typealias Parent = WithLatestFromSink + typealias E = SecondType + + private let _parent: Parent + private let _disposable: Disposable + + var _lock: NSRecursiveLock { + return _parent._lock + } + + init(parent: Parent, disposable: Disposable) { + _parent = parent + _disposable = disposable + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case let .next(value): + _parent._latest = value + case .completed: + _disposable.dispose() + case let .error(error): + _parent.forwardOn(.error(error)) + _parent.dispose() + } + } +} + +class WithLatestFrom: Producer { + typealias ResultSelector = (FirstType, SecondType) throws -> ResultType + + fileprivate let _first: Observable + fileprivate let _second: Observable + fileprivate let _resultSelector: ResultSelector + + init(first: Observable, second: Observable, resultSelector: @escaping ResultSelector) { + _first = first + _second = second + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = WithLatestFromSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+Collection.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+Collection.swift new file mode 100644 index 0000000..60474fd --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+Collection.swift @@ -0,0 +1,140 @@ +// +// Zip+Collection.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ZipCollectionTypeSink + : Sink where C.Iterator.Element : ObservableConvertibleType { + typealias R = O.E + typealias Parent = ZipCollectionType + typealias SourceElement = C.Iterator.Element.E + + private let _parent: Parent + + private let _lock = NSRecursiveLock() + + // state + private var _numberOfValues = 0 + private var _values: [Queue] + private var _isDone: [Bool] + private var _numberOfDone = 0 + private var _subscriptions: [SingleAssignmentDisposable] + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + _values = [Queue](repeating: Queue(capacity: 4), count: parent.count) + _isDone = [Bool](repeating: false, count: parent.count) + _subscriptions = Array() + _subscriptions.reserveCapacity(parent.count) + + for _ in 0 ..< parent.count { + _subscriptions.append(SingleAssignmentDisposable()) + } + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event, atIndex: Int) { + _lock.lock(); defer { _lock.unlock() } // { + switch event { + case .next(let element): + _values[atIndex].enqueue(element) + + if _values[atIndex].count == 1 { + _numberOfValues += 1 + } + + if _numberOfValues < _parent.count { + let numberOfOthersThatAreDone = _numberOfDone - (_isDone[atIndex] ? 1 : 0) + if numberOfOthersThatAreDone == _parent.count - 1 { + self.forwardOn(.completed) + self.dispose() + } + return + } + + do { + var arguments = [SourceElement]() + arguments.reserveCapacity(_parent.count) + + // recalculate number of values + _numberOfValues = 0 + + for i in 0 ..< _values.count { + arguments.append(_values[i].dequeue()!) + if _values[i].count > 0 { + _numberOfValues += 1 + } + } + + let result = try _parent.resultSelector(arguments) + self.forwardOn(.next(result)) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + if _isDone[atIndex] { + return + } + + _isDone[atIndex] = true + _numberOfDone += 1 + + if _numberOfDone == _parent.count { + self.forwardOn(.completed) + self.dispose() + } + else { + _subscriptions[atIndex].dispose() + } + } + // } + } + + func run() -> Disposable { + var j = 0 + for i in _parent.sources { + let index = j + let source = i.asObservable() + + let disposable = source.subscribe(AnyObserver { event in + self.on(event, atIndex: index) + }) + _subscriptions[j].setDisposable(disposable) + j += 1 + } + + return Disposables.create(_subscriptions) + } +} + +class ZipCollectionType : Producer where C.Iterator.Element : ObservableConvertibleType { + typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R + + let sources: C + let resultSelector: ResultSelector + let count: Int + + init(sources: C, resultSelector: @escaping ResultSelector) { + self.sources = sources + self.resultSelector = resultSelector + self.count = Int(self.sources.count.toIntMax()) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipCollectionTypeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+arity.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+arity.swift new file mode 100644 index 0000000..b74464f --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip+arity.swift @@ -0,0 +1,824 @@ +// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project +// +// Zip+arity.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + + + +// 2 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> Observable { + return Zip2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink2_ : ZipSink { + typealias R = O.E + typealias Parent = Zip2 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 2, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + + return Disposables.create([ + subscription1, + subscription2 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!) + } +} + +class Zip2 : Producer { + typealias ResultSelector = (E1, E2) throws -> R + + let source1: Observable + let source2: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink2_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 3 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> Observable { + return Zip3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink3_ : ZipSink { + typealias R = O.E + typealias Parent = Zip3 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 3, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!) + } +} + +class Zip3 : Producer { + typealias ResultSelector = (E1, E2, E3) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink3_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 4 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> Observable { + return Zip4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink4_ : ZipSink { + typealias R = O.E + typealias Parent = Zip4 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 4, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + case 3: return _values4.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + subscription4.setDisposable(_parent.source4.subscribe(observer4)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!) + } +} + +class Zip4 : Producer { + typealias ResultSelector = (E1, E2, E3, E4) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink4_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 5 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> Observable { + return Zip5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink5_ : ZipSink { + typealias R = O.E + typealias Parent = Zip5 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 5, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + case 3: return _values4.count > 0 + case 4: return _values5.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + subscription4.setDisposable(_parent.source4.subscribe(observer4)) + subscription5.setDisposable(_parent.source5.subscribe(observer5)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!) + } +} + +class Zip5 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink5_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 6 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> Observable { + return Zip6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink6_ : ZipSink { + typealias R = O.E + typealias Parent = Zip6 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 6, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + case 3: return _values4.count > 0 + case 4: return _values5.count > 0 + case 5: return _values6.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + subscription4.setDisposable(_parent.source4.subscribe(observer4)) + subscription5.setDisposable(_parent.source5.subscribe(observer5)) + subscription6.setDisposable(_parent.source6.subscribe(observer6)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!) + } +} + +class Zip6 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink6_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 7 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> Observable { + return Zip7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink7_ : ZipSink { + typealias R = O.E + typealias Parent = Zip7 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + var _values7: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 7, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + case 3: return _values4.count > 0 + case 4: return _values5.count > 0 + case 5: return _values6.count > 0 + case 6: return _values7.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + let observer7 = ZipObserver(lock: _lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + subscription4.setDisposable(_parent.source4.subscribe(observer4)) + subscription5.setDisposable(_parent.source5.subscribe(observer5)) + subscription6.setDisposable(_parent.source6.subscribe(observer6)) + subscription7.setDisposable(_parent.source7.subscribe(observer7)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!, _values7.dequeue()!) + } +} + +class Zip7 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + let source7: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + self.source7 = source7 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink7_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 8 + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> Observable { + return Zip8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: resultSelector + ) + } +} + +class ZipSink8_ : ZipSink { + typealias R = O.E + typealias Parent = Zip8 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + var _values7: Queue = Queue(capacity: 2) + var _values8: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + _parent = parent + super.init(arity: 8, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch (index) { + case 0: return _values1.count > 0 + case 1: return _values2.count > 0 + case 2: return _values3.count > 0 + case 3: return _values4.count > 0 + case 4: return _values5.count > 0 + case 5: return _values6.count > 0 + case 6: return _values7.count > 0 + case 7: return _values8.count > 0 + + default: + rxFatalError("Unhandled case (Function)") + } + + return false + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + let subscription8 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + let observer7 = ZipObserver(lock: _lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) + let observer8 = ZipObserver(lock: _lock, parent: self, index: 7, setNextValue: { self._values8.enqueue($0) }, this: subscription8) + + subscription1.setDisposable(_parent.source1.subscribe(observer1)) + subscription2.setDisposable(_parent.source2.subscribe(observer2)) + subscription3.setDisposable(_parent.source3.subscribe(observer3)) + subscription4.setDisposable(_parent.source4.subscribe(observer4)) + subscription5.setDisposable(_parent.source5.subscribe(observer5)) + subscription6.setDisposable(_parent.source6.subscribe(observer6)) + subscription7.setDisposable(_parent.source7.subscribe(observer7)) + subscription8.setDisposable(_parent.source8.subscribe(observer8)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7, + subscription8 + ]) + } + + override func getResult() throws -> R { + return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!, _values7.dequeue()!, _values8.dequeue()!) + } +} + +class Zip8 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + let source7: Observable + let source8: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + self.source7 = source7 + self.source8 = source8 + + _resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink8_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + diff --git a/Pods/RxSwift/RxSwift/Observables/Implementations/Zip.swift b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip.swift new file mode 100644 index 0000000..0cd273c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Implementations/Zip.swift @@ -0,0 +1,157 @@ +// +// Zip.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol ZipSinkProtocol : class +{ + func next(_ index: Int) + func fail(_ error: Swift.Error) + func done(_ index: Int) +} + +class ZipSink : Sink, ZipSinkProtocol { + typealias Element = O.E + + let _arity: Int + + let _lock = NSRecursiveLock() + + // state + private var _isDone: [Bool] + + init(arity: Int, observer: O, cancel: Cancelable) { + _isDone = [Bool](repeating: false, count: arity) + _arity = arity + + super.init(observer: observer, cancel: cancel) + } + + func getResult() throws -> Element { + abstractMethod() + } + + func hasElements(_ index: Int) -> Bool { + abstractMethod() + } + + func next(_ index: Int) { + var hasValueAll = true + + for i in 0 ..< _arity { + if !hasElements(i) { + hasValueAll = false + break + } + } + + if hasValueAll { + do { + let result = try getResult() + self.forwardOn(.next(result)) + } + catch let e { + self.forwardOn(.error(e)) + dispose() + } + } + else { + var allOthersDone = true + + let arity = _isDone.count + for i in 0 ..< arity { + if i != index && !_isDone[i] { + allOthersDone = false + break + } + } + + if allOthersDone { + forwardOn(.completed) + self.dispose() + } + } + } + + func fail(_ error: Swift.Error) { + forwardOn(.error(error)) + dispose() + } + + func done(_ index: Int) { + _isDone[index] = true + + var allDone = true + + for done in _isDone { + if !done { + allDone = false + break + } + } + + if allDone { + forwardOn(.completed) + dispose() + } + } +} + +class ZipObserver + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = ElementType + typealias ValueSetter = (ElementType) -> () + + private var _parent: ZipSinkProtocol? + + let _lock: NSRecursiveLock + + // state + private let _index: Int + private let _this: Disposable + private let _setNextValue: ValueSetter + + init(lock: NSRecursiveLock, parent: ZipSinkProtocol, index: Int, setNextValue: @escaping ValueSetter, this: Disposable) { + _lock = lock + _parent = parent + _index = index + _this = this + _setNextValue = setNextValue + } + + func on(_ event: Event) { + synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + if let _ = _parent { + switch event { + case .next(_): + break + case .error(_): + _this.dispose() + case .completed: + _this.dispose() + } + } + + if let parent = _parent { + switch event { + case .next(let value): + _setNextValue(value) + parent.next(_index) + case .error(let error): + parent.fail(error) + case .completed: + parent.done(_index) + } + } + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Aggregate.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Aggregate.swift new file mode 100644 index 0000000..8e7a29d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Aggregate.swift @@ -0,0 +1,61 @@ +// +// Observable+Aggregate.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: reduce + +extension ObservableType { + + /** + Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. + + For aggregation behavior with incremental intermediate results, see `scan`. + + - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: A accumulator function to be invoked on each element. + - parameter mapResult: A function to transform the final accumulator value into the result value. + - returns: An observable sequence containing a single element with the final accumulator value. + */ + public func reduce(_ seed: A, accumulator: @escaping (A, E) throws -> A, mapResult: @escaping (A) throws -> R) + -> Observable { + return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: mapResult) + } + + /** + Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. + + For aggregation behavior with incremental intermediate results, see `scan`. + + - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: A accumulator function to be invoked on each element. + - returns: An observable sequence containing a single element with the final accumulator value. + */ + public func reduce
(_ seed: A, accumulator: @escaping (A, E) throws -> A) + -> Observable { + return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: { $0 }) + } + + /** + Converts an Observable into another Observable that emits the whole sequence as a single array and then terminates. + + For aggregation behavior see `reduce`. + + - seealso: [toArray operator on reactivex.io](http://reactivex.io/documentation/operators/to.html) + + - returns: An observable sequence containing all the emitted elements as array. + */ + public func toArray() + -> Observable<[E]> { + return ToArray(source: self.asObservable()) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Binding.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Binding.swift new file mode 100644 index 0000000..dd4a75e --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Binding.swift @@ -0,0 +1,181 @@ +// +// Observable+Binding.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: multicast + +extension ObservableType { + + /** + Multicasts the source sequence notifications through the specified subject to the resulting connectable observable. + + Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. + + For specializations with fixed subject types, see `publish` and `replay`. + + - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - parameter subject: Subject to push source elements into. + - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. + */ + public func multicast(_ subject: S) + -> ConnectableObservable where S.SubjectObserverType.E == E { + return ConnectableObservableAdapter(source: self.asObservable(), subject: subject) + } + + /** + Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. + + Each subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's invocation. + + For specializations with fixed subject types, see `publish` and `replay`. + + - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - parameter subjectSelector: Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. + - parameter selector: Selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. + */ + public func multicast(_ subjectSelector: @escaping () throws -> S, selector: @escaping (Observable) throws -> Observable) + -> Observable where S.SubjectObserverType.E == E { + return Multicast( + source: self.asObservable(), + subjectSelector: subjectSelector, + selector: selector + ) + } +} + +// MARK: publish + +extension ObservableType { + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence. + + This operator is a specialization of `multicast` using a `PublishSubject`. + + - seealso: [publish operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func publish() -> ConnectableObservable { + return self.multicast(PublishSubject()) + } +} + +// MARK: replay + +extension ObservableType { + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize elements. + + This operator is a specialization of `multicast` using a `ReplaySubject`. + + - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - parameter bufferSize: Maximum element count of the replay buffer. + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func replay(_ bufferSize: Int) + -> ConnectableObservable { + return self.multicast(ReplaySubject.create(bufferSize: bufferSize)) + } + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all elements. + + This operator is a specialization of `multicast` using a `ReplaySubject`. + + - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func replayAll() + -> ConnectableObservable { + return self.multicast(ReplaySubject.createUnbounded()) + } +} + +// MARK: refcount + +extension ConnectableObservableType { + + /** + Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. + + - seealso: [refCount operator on reactivex.io](http://reactivex.io/documentation/operators/refCount.html) + + - returns: An observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. + */ + public func refCount() -> Observable { + return RefCount(source: self) + } +} + +// MARK: share + +extension ObservableType { + + /** + Returns an observable sequence that shares a single subscription to the underlying sequence. + + This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + + - seealso: [share operator on reactivex.io](http://reactivex.io/documentation/operators/refcount.html) + + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + public func share() -> Observable { + return self.publish().refCount() + } +} + +// MARK: shareReplay + +extension ObservableType { + + /** + Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays maximum number of elements in buffer. + + This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + + - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - parameter bufferSize: Maximum element count of the replay buffer. + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + public func shareReplay(_ bufferSize: Int) + -> Observable { + if bufferSize == 1 { + return ShareReplay1(source: self.asObservable()) + } + else { + return self.replay(bufferSize).refCount() + } + } + + /** + Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays latest element in buffer. + + This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + + Unlike `shareReplay(bufferSize: Int)`, this operator will clear latest element from replay buffer in case number of subscribers drops from one to zero. In case sequence + completes or errors out replay buffer is also cleared. + + - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + public func shareReplayLatestWhileConnected() + -> Observable { + return ShareReplay1WhileConnected(source: self.asObservable()) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Concurrency.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Concurrency.swift new file mode 100644 index 0000000..ce66ae9 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Concurrency.swift @@ -0,0 +1,60 @@ +// +// Observable+Concurrency.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: observeOn + +extension ObservableType { + + /** + Wraps the source sequence in order to run its observer callbacks on the specified scheduler. + + This only invokes observer callbacks on a `scheduler`. In case the subscription and/or unsubscription + actions have side-effects that require to be run on a scheduler, use `subscribeOn`. + + - seealso: [observeOn operator on reactivex.io](http://reactivex.io/documentation/operators/observeon.html) + + - parameter scheduler: Scheduler to notify observers on. + - returns: The source sequence whose observations happen on the specified scheduler. + */ + public func observeOn(_ scheduler: ImmediateSchedulerType) + -> Observable { + if let scheduler = scheduler as? SerialDispatchQueueScheduler { + return ObserveOnSerialDispatchQueue(source: self.asObservable(), scheduler: scheduler) + } + else { + return ObserveOn(source: self.asObservable(), scheduler: scheduler) + } + } +} + +// MARK: subscribeOn + +extension ObservableType { + + /** + Wraps the source sequence in order to run its subscription and unsubscription logic on the specified + scheduler. + + This operation is not commonly used. + + This only performs the side-effects of subscription and unsubscription on the specified scheduler. + + In order to invoke observer callbacks on a `scheduler`, use `observeOn`. + + - seealso: [subscribeOn operator on reactivex.io](http://reactivex.io/documentation/operators/subscribeon.html) + + - parameter scheduler: Scheduler to perform subscription and unsubscription actions on. + - returns: The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. + */ + public func subscribeOn(_ scheduler: ImmediateSchedulerType) + -> Observable { + return SubscribeOn(source: self, scheduler: scheduler) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Creation.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Creation.swift new file mode 100644 index 0000000..2f3987b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Creation.swift @@ -0,0 +1,228 @@ +// +// Observable+Creation.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +extension Observable { + // MARK: create + + /** + Creates an observable sequence from a specified subscribe method implementation. + + - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) + + - parameter subscribe: Implementation of the resulting observable sequence's `subscribe` method. + - returns: The observable sequence with the specified implementation for the `subscribe` method. + */ + public static func create(_ subscribe: @escaping (AnyObserver) -> Disposable) -> Observable { + return AnonymousObservable(subscribe) + } + + // MARK: empty + + /** + Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message. + + - seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: An observable sequence with no elements. + */ + public static func empty() -> Observable { + return Empty() + } + + // MARK: never + + /** + Returns a non-terminating observable sequence, which can be used to denote an infinite duration. + + - seealso: [never operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: An observable sequence whose observers will never get called. + */ + public static func never() -> Observable { + return Never() + } + + // MARK: just + + /** + Returns an observable sequence that contains a single element. + + - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) + + - parameter element: Single element in the resulting observable sequence. + - returns: An observable sequence containing the single specified element. + */ + public static func just(_ element: E) -> Observable { + return Just(element: element) + } + + /** + Returns an observable sequence that contains a single element. + + - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) + + - parameter element: Single element in the resulting observable sequence. + - parameter: Scheduler to send the single element on. + - returns: An observable sequence containing the single specified element. + */ + public static func just(_ element: E, scheduler: ImmediateSchedulerType) -> Observable { + return JustScheduled(element: element, scheduler: scheduler) + } + + // MARK: fail + + /** + Returns an observable sequence that terminates with an `error`. + + - seealso: [throw operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: The observable sequence that terminates with specified error. + */ + public static func error(_ error: Swift.Error) -> Observable { + return Error(error: error) + } + + // MARK: of + + /** + This method creates a new Observable instance with a variable number of elements. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter elements: Elements to generate. + - parameter scheduler: Scheduler to send elements on. If `nil`, elements are sent immediatelly on subscription. + - returns: The observable sequence whose elements are pulled from the given arguments. + */ + public static func of(_ elements: E ..., scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return ObservableSequence(elements: elements, scheduler: scheduler) + } + + // MARK: defer + + /** + Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. + + - seealso: [defer operator on reactivex.io](http://reactivex.io/documentation/operators/defer.html) + + - parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence. + - returns: An observable sequence whose observers trigger an invocation of the given observable factory function. + */ + public static func deferred(_ observableFactory: @escaping () throws -> Observable) + -> Observable { + return Deferred(observableFactory: observableFactory) + } + + /** + Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler + to run the loop send out observer messages. + + - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) + + - parameter initialState: Initial state. + - parameter condition: Condition to terminate generation (upon returning `false`). + - parameter iterate: Iteration step function. + - parameter scheduler: Scheduler on which to run the generator loop. + - returns: The generated sequence. + */ + public static func generate(initialState: E, condition: @escaping (E) throws -> Bool, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance, iterate: @escaping (E) throws -> E) -> Observable { + return Generate(initialState: initialState, condition: condition, iterate: iterate, resultSelector: { $0 }, scheduler: scheduler) + } + + /** + Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages. + + - seealso: [repeat operator on reactivex.io](http://reactivex.io/documentation/operators/repeat.html) + + - parameter element: Element to repeat. + - parameter scheduler: Scheduler to run the producer loop on. + - returns: An observable sequence that repeats the given element infinitely. + */ + public static func repeatElement(_ element: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return RepeatElement(element: element, scheduler: scheduler) + } + + /** + Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. + + - seealso: [using operator on reactivex.io](http://reactivex.io/documentation/operators/using.html) + + - parameter resourceFactory: Factory function to obtain a resource object. + - parameter observableFactory: Factory function to obtain an observable sequence that depends on the obtained resource. + - returns: An observable sequence whose lifetime controls the lifetime of the dependent resource object. + */ + public static func using(_ resourceFactory: @escaping () throws -> R, observableFactory: @escaping (R) throws -> Observable) -> Observable { + return Using(resourceFactory: resourceFactory, observableFactory: observableFactory) + } +} + +extension Observable where Element : SignedInteger { + /** + Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to generate and send out observer messages. + + - seealso: [range operator on reactivex.io](http://reactivex.io/documentation/operators/range.html) + + - parameter start: The value of the first integer in the sequence. + - parameter count: The number of sequential integers to generate. + - parameter scheduler: Scheduler to run the generator loop on. + - returns: An observable sequence that contains a range of sequential integral numbers. + */ + public static func range(start: E, count: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return RangeProducer(start: start, count: count, scheduler: scheduler) + } +} + +extension Observable { + /** + Converts an array to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - returns: The observable sequence whose elements are pulled from the given enumerable sequence. + */ + public static func from(_ array: [E], scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return ObservableSequence(elements: array, scheduler: scheduler) + } + + /** + Converts a sequence to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - returns: The observable sequence whose elements are pulled from the given enumerable sequence. + */ + public static func from(_ sequence: S, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable where S.Iterator.Element == E { + return ObservableSequence(elements: sequence, scheduler: scheduler) + } + + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + public static func from(_ optional: E?) -> Observable { + return ObservableOptional(optional: optional) + } + + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - parameter: Scheduler to send the optional element on. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + public static func from(_ optional: E?, scheduler: ImmediateSchedulerType) -> Observable { + return ObservableOptionalScheduled(optional: optional, scheduler: scheduler) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Debug.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Debug.swift new file mode 100644 index 0000000..e0f1c71 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Debug.swift @@ -0,0 +1,28 @@ +// +// Observable+Debug.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: debug + +extension ObservableType { + + /** + Prints received events for all observers on standard output. + + - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) + + - parameter identifier: Identifier that is printed together with event description to standard output. + - parameter trimOutput: Should output be trimmed to max 40 characters. + - returns: An observable sequence whose events are printed to standard output. + */ + public func debug(_ identifier: String? = nil, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function) + -> Observable { + return Debug(source: self, identifier: identifier, trimOutput: trimOutput, file: file, line: line, function: function) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Multiple.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Multiple.swift new file mode 100644 index 0000000..c679683 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Multiple.swift @@ -0,0 +1,308 @@ +// +// Observable+Multiple.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: combineLatest + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> Element) -> Observable + where C.Iterator.Element: ObservableType { + return CombineLatestCollectionType(sources: collection, resultSelector: resultSelector) + } +} + +// MARK: zip + +extension Observable { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> Element) -> Observable + where C.Iterator.Element: ObservableType { + return ZipCollectionType(sources: collection, resultSelector: resultSelector) + } +} + +// MARK: switch + +extension ObservableType where E : ObservableConvertibleType { + + /** + Transforms an observable sequence of observable sequences into an observable sequence + producing values only from the most recent observable sequence. + + Each time a new inner observable sequence is received, unsubscribe from the + previous inner observable sequence. + + - seealso: [switch operator on reactivex.io](http://reactivex.io/documentation/operators/switch.html) + + - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func switchLatest() -> Observable { + return Switch(source: asObservable()) + } +} + +// MARK: concat + +extension ObservableType { + + /** + Concatenates the second observable sequence to `self` upon successful termination of `self`. + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - parameter second: Second observable sequence. + - returns: An observable sequence that contains the elements of `self`, followed by those of the second sequence. + */ + public func concat(_ second: O) -> Observable where O.E == E { + return Observable.concat([self.asObservable(), second.asObservable()]) + } +} + +extension Observable { + /** + Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully. + + This operator has tail recursive optimizations that will prevent stack overflow. + + Optimizations will be performed in cases equivalent to following: + + [1, [2, [3, .....].concat()].concat].concat() + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return Concat(sources: sequence, count: nil) + } + + /** + Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully. + + This operator has tail recursive optimizations that will prevent stack overflow. + + Optimizations will be performed in cases equivalent to following: + + [1, [2, [3, .....].concat()].concat].concat() + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ collection: S) -> Observable + where S.Iterator.Element == Observable { + return Concat(sources: collection, count: collection.count.toIntMax()) + } +} + +extension ObservableType where E : ObservableConvertibleType { + + /** + Concatenates all inner observable sequences, as long as the previous observable sequence terminated successfully. + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each observed inner sequence, in sequential order. + */ + public func concat() -> Observable { + return merge(maxConcurrent: 1) + } +} + +// MARK: merge + +extension ObservableType where E : ObservableConvertibleType { + + /** + Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public func merge() -> Observable { + return Merge(source: asObservable()) + } + + /** + Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - parameter maxConcurrent: Maximum number of inner observable sequences being subscribed to concurrently. + - returns: The observable sequence that merges the elements of the inner sequences. + */ + public func merge(maxConcurrent: Int) + -> Observable { + return MergeLimited(source: asObservable(), maxConcurrent: maxConcurrent) + } +} + +// MARK: catch + +extension ObservableType { + + /** + Continues an observable sequence that is terminated by an error with the observable sequence produced by the handler. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - parameter handler: Error handler function, producing another observable sequence. + - returns: An observable sequence containing the source sequence's elements, followed by the elements produced by the handler's resulting observable sequence in case an error occurred. + */ + public func catchError(_ handler: @escaping (Swift.Error) throws -> Observable) + -> Observable { + return Catch(source: asObservable(), handler: handler) + } + + /** + Continues an observable sequence that is terminated by an error with a single element. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - parameter element: Last element in an observable sequence in case error occurs. + - returns: An observable sequence containing the source sequence's elements, followed by the `element` in case an error occurred. + */ + public func catchErrorJustReturn(_ element: E) + -> Observable { + return Catch(source: asObservable(), handler: { _ in Observable.just(element) }) + } + +} + +extension Observable { + /** + Continues an observable sequence that is terminated by an error with the next observable sequence. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - returns: An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. + */ + public static func catchError(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return CatchSequence(sources: sequence) + } +} + +// MARK: takeUntil + +extension ObservableType { + + /** + Returns the elements from the source observable sequence until the other observable sequence produces an element. + + - seealso: [takeUntil operator on reactivex.io](http://reactivex.io/documentation/operators/takeuntil.html) + + - parameter other: Observable sequence that terminates propagation of elements of the source sequence. + - returns: An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. + */ + public func takeUntil(_ other: O) + -> Observable { + return TakeUntil(source: asObservable(), other: other.asObservable()) + } +} + +// MARK: skipUntil + +extension ObservableType { + + /** + Returns the elements from the source observable sequence that are emitted after the other observable sequence produces an element. + + - seealso: [skipUntil operator on reactivex.io](http://reactivex.io/documentation/operators/skipuntil.html) + + - parameter other: Observable sequence that starts propagation of elements of the source sequence. + - returns: An observable sequence containing the elements of the source sequence that are emitted after the other sequence emits an item. + */ + public func skipUntil(_ other: O) + -> Observable { + return SkipUntil(source: asObservable(), other: other.asObservable()) + } +} + +// MARK: amb + +extension ObservableType { + + /** + Propagates the observable sequence that reacts first. + + - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) + + - parameter right: Second observable sequence. + - returns: An observable sequence that surfaces either of the given sequences, whichever reacted first. + */ + public func amb + (_ right: O2) + -> Observable where O2.E == E { + return Amb(left: asObservable(), right: right.asObservable()) + } +} + +extension Observable { + /** + Propagates the observable sequence that reacts first. + + - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) + + - returns: An observable sequence that surfaces any of the given sequences, whichever reacted first. + */ + public static func amb(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return sequence.reduce(Observable.never()) { a, o in + return a.amb(o.asObservable()) + } + } +} + +// withLatestFrom + +extension ObservableType { + + /** + Merges two observable sequences into one observable sequence by combining each element from self with the latest element from the second source, if any. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter second: Second observable source. + - parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) throws -> ResultType) -> Observable { + return WithLatestFrom(first: asObservable(), second: second.asObservable(), resultSelector: resultSelector) + } + + /** + Merges two observable sequences into one observable sequence by using latest element from the second sequence every time when `self` emitts an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter second: Second observable source. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO) -> Observable { + return WithLatestFrom(first: asObservable(), second: second.asObservable(), resultSelector: { $1 }) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Single.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Single.swift new file mode 100644 index 0000000..d0e38bb --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Single.swift @@ -0,0 +1,198 @@ +// +// Observable+Single.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: distinct until changed + +extension ObservableType where E: Equatable { + + /** + Returns an observable sequence that contains only distinct contiguous elements according to equality operator. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence. + */ + public func distinctUntilChanged() + -> Observable { + return self.distinctUntilChanged({ $0 }, comparer: { ($0 == $1) }) + } +} + +extension ObservableType { + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `keySelector`. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter keySelector: A function to compute the comparison key for each element. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K) + -> Observable { + return self.distinctUntilChanged(keySelector, comparer: { $0 == $1 }) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `comparer`. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on `comparer`, from the source sequence. + */ + public func distinctUntilChanged(_ comparer: @escaping (E, E) throws -> Bool) + -> Observable { + return self.distinctUntilChanged({ $0 }, comparer: comparer) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter keySelector: A function to compute the comparison key for each element. + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K, comparer: @escaping (K, K) throws -> Bool) + -> Observable { + return DistinctUntilChanged(source: self.asObservable(), selector: keySelector, comparer: comparer) + } +} + +// MARK: doOn + +extension ObservableType { + /** + Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence. + + - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. + - parameter onDispose: Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed. + - returns: The source sequence with the side-effecting behavior applied. + */ + public func `do`(onNext: ((E) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> ())? = nil, onDispose: (() -> ())? = nil) + -> Observable { + return Do(source: self.asObservable(), eventHandler: { e in + switch e { + case .next(let element): + try onNext?(element) + case .error(let e): + try onError?(e) + case .completed: + try onCompleted?() + } + }, onSubscribe: onSubscribe, onDispose: onDispose) + } +} + +// MARK: startWith + +extension ObservableType { + + /** + Prepends a sequence of values to an observable sequence. + + - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html) + + - parameter elements: Elements to prepend to the specified sequence. + - returns: The source sequence prepended with the specified values. + */ + public func startWith(_ elements: E ...) + -> Observable { + return StartWith(source: self.asObservable(), elements: elements) + } +} + +// MARK: retry + +extension ObservableType { + + /** + Repeats the source observable sequence until it successfully terminates. + + **This could potentially create an infinite sequence.** + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - returns: Observable sequence to repeat until it successfully terminates. + */ + public func retry() -> Observable { + return CatchSequence(sources: InfiniteSequence(repeatedValue: self.asObservable())) + } + + /** + Repeats the source observable sequence the specified number of times in case of an error or until it successfully terminates. + + If you encounter an error and want it to retry once, then you must use `retry(2)` + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter maxAttemptCount: Maximum number of times to repeat the sequence. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. + */ + public func retry(_ maxAttemptCount: Int) + -> Observable { + return CatchSequence(sources: repeatElement(self.asObservable(), count: maxAttemptCount)) + } + + /** + Repeats the source observable sequence on error when the notifier emits a next value. + If the source observable errors and the notifier completes, it will complete the source sequence. + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. + */ + public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) + -> Observable { + return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) + } + + /** + Repeats the source observable sequence on error when the notifier emits a next value. + If the source observable errors and the notifier completes, it will complete the source sequence. + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. + */ + public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) + -> Observable { + return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) + } +} + +// MARK: scan + +extension ObservableType { + + /** + Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. + + For aggregation behavior with no intermediate results, see `reduce`. + + - seealso: [scan operator on reactivex.io](http://reactivex.io/documentation/operators/scan.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: An accumulator function to be invoked on each element. + - returns: An observable sequence containing the accumulated values. + */ + public func scan(_ seed: A, accumulator: @escaping (A, E) throws -> A) + -> Observable { + return Scan(source: self.asObservable(), seed: seed, accumulator: accumulator) + } +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+StandardSequenceOperators.swift b/Pods/RxSwift/RxSwift/Observables/Observable+StandardSequenceOperators.swift new file mode 100644 index 0000000..4dd53f8 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+StandardSequenceOperators.swift @@ -0,0 +1,306 @@ +// +// Observable+StandardSequenceOperators.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: filter aka where + +extension ObservableType { + + /** + Filters the elements of an observable sequence based on a predicate. + + - seealso: [filter operator on reactivex.io](http://reactivex.io/documentation/operators/filter.html) + + - parameter predicate: A function to test each source element for a condition. + - returns: An observable sequence that contains elements from the input sequence that satisfy the condition. + */ + public func filter(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return Filter(source: asObservable(), predicate: predicate) + } +} + +// MARK: takeWhile + +extension ObservableType { + + /** + Returns elements from an observable sequence as long as a specified condition is true. + + - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) + + - parameter predicate: A function to test each element for a condition. + - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. + */ + public func takeWhile(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return TakeWhile(source: asObservable(), predicate: predicate) + } + + /** + Returns elements from an observable sequence as long as a specified condition is true. + + The element's index is used in the logic of the predicate function. + + - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) + + - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. + - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. + */ + public func takeWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) + -> Observable { + return TakeWhile(source: asObservable(), predicate: predicate) + } +} + +// MARK: take + +extension ObservableType { + + /** + Returns a specified number of contiguous elements from the start of an observable sequence. + + - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) + + - parameter count: The number of elements to return. + - returns: An observable sequence that contains the specified number of elements from the start of the input sequence. + */ + public func take(_ count: Int) + -> Observable { + if count == 0 { + return Observable.empty() + } + else { + return TakeCount(source: asObservable(), count: count) + } + } +} + +// MARK: takeLast + +extension ObservableType { + + /** + Returns a specified number of contiguous elements from the end of an observable sequence. + + This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. + + - seealso: [takeLast operator on reactivex.io](http://reactivex.io/documentation/operators/takelast.html) + + - parameter count: Number of elements to take from the end of the source sequence. + - returns: An observable sequence containing the specified number of elements from the end of the source sequence. + */ + public func takeLast(_ count: Int) + -> Observable { + return TakeLast(source: asObservable(), count: count) + } +} + + +// MARK: skip + +extension ObservableType { + + /** + Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. + + - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) + + - parameter count: The number of elements to skip before returning the remaining elements. + - returns: An observable sequence that contains the elements that occur after the specified index in the input sequence. + */ + public func skip(_ count: Int) + -> Observable { + return SkipCount(source: asObservable(), count: count) + } +} + +// MARK: SkipWhile + +extension ObservableType { + + /** + Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. + + - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) + + - parameter predicate: A function to test each element for a condition. + - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. + */ + public func skipWhile(_ predicate: @escaping (E) throws -> Bool) -> Observable { + return SkipWhile(source: asObservable(), predicate: predicate) + } + + /** + Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. + The element's index is used in the logic of the predicate function. + + - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) + + - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. + - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. + */ + public func skipWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) -> Observable { + return SkipWhile(source: asObservable(), predicate: predicate) + } +} + +// MARK: map aka select + +extension ObservableType { + + /** + Projects each element of an observable sequence into a new form. + + - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) + + - parameter transform: A transform function to apply to each source element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. + + */ + public func map(_ transform: @escaping (E) throws -> R) + -> Observable { + return self.asObservable().composeMap(transform) + } + + /** + Projects each element of an observable sequence into a new form by incorporating the element's index. + + - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) + + - parameter selector: A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. + */ + public func mapWithIndex(_ selector: @escaping (E, Int) throws -> R) + -> Observable { + return MapWithIndex(source: asObservable(), selector: selector) + } +} + +// MARK: flatMap + +extension ObservableType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + + - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. + */ + public func flatMap(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMap(source: asObservable(), selector: selector) + } + + /** + Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence. + + - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element; the second parameter of the function represents the index of the source element. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. + */ + public func flatMapWithIndex(_ selector: @escaping (E, Int) throws -> O) + -> Observable { + return FlatMapWithIndex(source: asObservable(), selector: selector) + } +} + +// MARK: flatMapFirst + +extension ObservableType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + If element is received while there is some projected observable sequence being merged it will simply be ignored. + + - seealso: [flatMapFirst operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to element that was observed while no observable is executing in parallel. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated. + */ + public func flatMapFirst(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMapFirst(source: asObservable(), selector: selector) + } +} + +// MARK: flatMapLatest + +extension ObservableType { + /** + Projects each element of an observable sequence into a new sequence of observable sequences and then + transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + + It is a combination of `map` + `switchLatest` operator + + - seealso: [flatMapLatest operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an + Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func flatMapLatest(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMapLatest(source: asObservable(), selector: selector) + } +} + +// MARK: elementAt + +extension ObservableType { + + /** + Returns a sequence emitting only item _n_ emitted by an Observable + + - seealso: [elementAt operator on reactivex.io](http://reactivex.io/documentation/operators/elementat.html) + + - parameter index: The index of the required item (starting from 0). + - returns: An observable sequence that emits the desired item as its own sole emission. + */ + public func elementAt(_ index: Int) + -> Observable { + return ElementAt(source: asObservable(), index: index, throwOnEmpty: true) + } +} + +// MARK: single + +extension ObservableType { + + /** + The single operator is similar to first, but throws a `RxError.NoElements` or `RxError.MoreThanOneElement` + if the source Observable does not emit exactly one item before successfully completing. + + - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) + + - returns: An observable sequence that emits a single item or throws an exception if more (or none) of them are emitted. + */ + public func single() + -> Observable { + return SingleAsync(source: asObservable()) + } + + /** + The single operator is similar to first, but throws a `RxError.NoElements` or `RxError.MoreThanOneElement` + if the source Observable does not emit exactly one item before successfully completing. + + - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) + + - parameter predicate: A function to test each source element for a condition. + - returns: An observable sequence that emits a single item or throws an exception if more (or none) of them are emitted. + */ + public func single(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return SingleAsync(source: asObservable(), predicate: predicate) + } + +} diff --git a/Pods/RxSwift/RxSwift/Observables/Observable+Time.swift b/Pods/RxSwift/RxSwift/Observables/Observable+Time.swift new file mode 100644 index 0000000..b4b86c7 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observables/Observable+Time.swift @@ -0,0 +1,279 @@ +// +// Observable+Time.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// MARK: throttle +extension ObservableType { + + /** + Returns an Observable that emits the first and the latest item emitted by the source Observable during sequential time windows of a specified duration. + + This operator makes sure that no two elements are emitted in less then dueTime. + + - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) + + - parameter dueTime: Throttling duration for each element. + - parameter latest: Should latest element received in a dueTime wide time window since last element emission be emitted. + - parameter scheduler: Scheduler to run the throttle timers and send events on. + - returns: The throttled sequence. + */ + public func throttle(_ dueTime: RxTimeInterval, latest: Bool = true, scheduler: SchedulerType) + -> Observable { + return Throttle(source: self.asObservable(), dueTime: dueTime, latest: latest, scheduler: scheduler) + } + + /** + Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers. + + - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) + + - parameter dueTime: Throttling duration for each element. + - parameter scheduler: Scheduler to run the throttle timers and send events on. + - returns: The throttled sequence. + */ + public func debounce(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Debounce(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} + +// MARK: sample + +extension ObservableType { + + /** + Samples the source observable sequence using a sampler observable sequence producing sampling ticks. + + Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. + + **In case there were no new elements between sampler ticks, no element is sent to the resulting sequence.** + + - seealso: [sample operator on reactivex.io](http://reactivex.io/documentation/operators/sample.html) + + - parameter sampler: Sampling tick sequence. + - returns: Sampled observable sequence. + */ + public func sample(_ sampler: O) + -> Observable { + return Sample(source: self.asObservable(), sampler: sampler.asObservable()) + } +} + +extension Observable where Element : SignedInteger { + /** + Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages. + + - seealso: [interval operator on reactivex.io](http://reactivex.io/documentation/operators/interval.html) + + - parameter period: Period for producing the values in the resulting sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence that produces a value after each period. + */ + public static func interval(_ period: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Timer(dueTime: period, + period: period, + scheduler: scheduler + ) + } +} + +// MARK: timer + +extension Observable where Element: SignedInteger { + /** + Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers. + + - seealso: [timer operator on reactivex.io](http://reactivex.io/documentation/operators/timer.html) + + - parameter dueTime: Relative time at which to produce the first value. + - parameter period: Period to produce subsequent values. + - parameter scheduler: Scheduler to run timers on. + - returns: An observable sequence that produces a value after due time has elapsed and then each period. + */ + public static func timer(_ dueTime: RxTimeInterval, period: RxTimeInterval? = nil, scheduler: SchedulerType) + -> Observable { + return Timer( + dueTime: dueTime, + period: period, + scheduler: scheduler + ) + } +} + +// MARK: take + +extension ObservableType { + + /** + Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. + + - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) + + - parameter duration: Duration for taking elements from the start of the sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence with the elements taken during the specified duration from the start of the source sequence. + */ + public func take(_ duration: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return TakeTime(source: self.asObservable(), duration: duration, scheduler: scheduler) + } +} + +// MARK: skip + +extension ObservableType { + + /** + Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. + + - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) + + - parameter duration: Duration for skipping elements from the start of the sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence with the elements skipped during the specified duration from the start of the source sequence. + */ + public func skip(_ duration: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return SkipTime(source: self.asObservable(), duration: duration, scheduler: scheduler) + } +} + +// MARK: ignoreElements + +extension ObservableType { + + /** + Skips elements and completes (or errors) when the receiver completes (or errors). Equivalent to filter that always returns false. + + - seealso: [ignoreElements operator on reactivex.io](http://reactivex.io/documentation/operators/ignoreelements.html) + + - returns: An observable sequence that skips all elements of the source sequence. + */ + public func ignoreElements() + -> Observable { + return filter { _ -> Bool in + return false + } + } +} + +// MARK: delaySubscription + +extension ObservableType { + + /** + Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. + + - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) + + - parameter dueTime: Relative time shift of the subscription. + - parameter scheduler: Scheduler to run the subscription delay timer on. + - returns: Time-shifted sequence. + */ + public func delaySubscription(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return DelaySubscription(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} + +// MARK: buffer + +extension ObservableType { + + /** + Projects each element of an observable sequence into a buffer that's sent out when either it's full or a given amount of time has elapsed, using the specified scheduler to run timers. + + A useful real-world analogy of this overload is the behavior of a ferry leaving the dock when all seats are taken, or at the scheduled time of departure, whichever event occurs first. + + - seealso: [buffer operator on reactivex.io](http://reactivex.io/documentation/operators/buffer.html) + + - parameter timeSpan: Maximum time length of a buffer. + - parameter count: Maximum element count of a buffer. + - parameter scheduler: Scheduler to run buffering timers on. + - returns: An observable sequence of buffers. + */ + public func buffer(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) + -> Observable<[E]> { + return BufferTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) + } +} + +// MARK: window + +extension ObservableType { + + /** + Projects each element of an observable sequence into a window that is completed when either it’s full or a given amount of time has elapsed. + + - seealso: [window operator on reactivex.io](http://reactivex.io/documentation/operators/window.html) + + - parameter timeSpan: Maximum time length of a window. + - parameter count: Maximum element count of a window. + - parameter scheduler: Scheduler to run windowing timers on. + - returns: An observable sequence of windows (instances of `Observable`). + */ + public func window(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) + -> Observable> { + return WindowTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) + } +} + +// MARK: timeout + +extension ObservableType { + + /** + Applies a timeout policy for each element in the observable sequence. If the next element isn't received within the specified timeout duration starting from its predecessor, a TimeoutError is propagated to the observer. + + - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) + + - parameter dueTime: Maximum duration between values before a timeout occurs. + - parameter scheduler: Scheduler to run the timeout timer on. + - returns: An observable sequence with a TimeoutError in case of a timeout. + */ + public func timeout(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Timeout(source: self.asObservable(), dueTime: dueTime, other: Observable.error(RxError.timeout), scheduler: scheduler) + } + + /** + Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers. If the next element isn't received within the specified timeout duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. + + - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) + + - parameter dueTime: Maximum duration between values before a timeout occurs. + - parameter other: Sequence to return in case of a timeout. + - parameter scheduler: Scheduler to run the timeout timer on. + - returns: The source sequence switching to the other sequence in case of a timeout. + */ + public func timeout(_ dueTime: RxTimeInterval, other: O, scheduler: SchedulerType) + -> Observable where E == O.E { + return Timeout(source: self.asObservable(), dueTime: dueTime, other: other.asObservable(), scheduler: scheduler) + } +} + +// MARK: delay + +extension ObservableType { + + /** + Returns an observable sequence by the source observable sequence shifted forward in time by a specified delay. Error events from the source observable sequence are not delayed. + + - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) + + - parameter dueTime: Relative time shift of the source by. + - parameter scheduler: Scheduler to run the subscription delay timer on. + - returns: the source Observable shifted in time by the specified delay. + */ + public func delay(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Delay(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} diff --git a/Pods/RxSwift/RxSwift/ObserverType.swift b/Pods/RxSwift/RxSwift/ObserverType.swift new file mode 100644 index 0000000..3447e5e --- /dev/null +++ b/Pods/RxSwift/RxSwift/ObserverType.swift @@ -0,0 +1,42 @@ +// +// ObserverType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Supports push-style iteration over an observable sequence. +public protocol ObserverType { + /// The type of elements in sequence that observer can observe. + associatedtype E + + /// Notify observer about sequence event. + /// + /// - parameter event: Event that occured. + func on(_ event: Event) +} + +/// Convenience API extensions to provide alternate next, error, completed events +extension ObserverType { + + /// Convenience method equivalent to `on(.next(element: E))` + /// + /// - parameter element: Next element to send to observer(s) + public final func onNext(_ element: E) { + on(.next(element)) + } + + /// Convenience method equivalent to `on(.completed)` + public final func onCompleted() { + on(.completed) + } + + /// Convenience method equivalent to `on(.error(Swift.Error))` + /// - parameter error: Swift.Error to send to observer(s) + public final func onError(_ error: Swift.Error) { + on(.error(error)) + } +} diff --git a/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift b/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift new file mode 100644 index 0000000..4abc816 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift @@ -0,0 +1,34 @@ +// +// AnonymousObserver.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class AnonymousObserver : ObserverBase { + typealias Element = ElementType + + typealias EventHandler = (Event) -> Void + + private let _eventHandler : EventHandler + + init(_ eventHandler: @escaping EventHandler) { +#if TRACE_RESOURCES + let _ = Resources.incrementTotal() +#endif + _eventHandler = eventHandler + } + + override func onCore(_ event: Event) { + return _eventHandler(event) + } + +#if TRACE_RESOURCES + deinit { + let _ = Resources.decrementTotal() + } +#endif +} diff --git a/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift b/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift new file mode 100644 index 0000000..7a6ebe6 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift @@ -0,0 +1,39 @@ +// +// ObserverBase.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +class ObserverBase : Disposable, ObserverType { + typealias E = ElementType + + private var _isStopped: AtomicInt = 0 + + func on(_ event: Event) { + switch event { + case .next: + if _isStopped == 0 { + onCore(event) + } + case .error, .completed: + + if !AtomicCompareAndSwap(0, 1, &_isStopped) { + return + } + + onCore(event) + } + } + + func onCore(_ event: Event) { + abstractMethod() + } + + func dispose() { + _ = AtomicCompareAndSwap(0, 1, &_isStopped) + } +} diff --git a/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift b/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift new file mode 100644 index 0000000..2f9464d --- /dev/null +++ b/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift @@ -0,0 +1,152 @@ +// +// TailRecursiveSink.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +enum TailRecursiveSinkCommand { + case moveNext + case dispose +} + +#if DEBUG || TRACE_RESOURCES + public var maxTailRecursiveSinkStackSize = 0 +#endif + +/// This class is usually used with `Generator` version of the operators. +class TailRecursiveSink + : Sink + , InvocableWithValueType where S.Iterator.Element: ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Value = TailRecursiveSinkCommand + typealias E = O.E + typealias SequenceGenerator = (generator: S.Iterator, remaining: IntMax?) + + var _generators: [SequenceGenerator] = [] + var _isDisposed = false + var _subscription = SerialDisposable() + + // this is thread safe object + var _gate = AsyncLock>>() + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func run(_ sources: SequenceGenerator) -> Disposable { + _generators.append(sources) + + schedule(.moveNext) + + return _subscription + } + + func invoke(_ command: TailRecursiveSinkCommand) { + switch command { + case .dispose: + disposeCommand() + case .moveNext: + moveNextCommand() + } + } + + // simple implementation for now + func schedule(_ command: TailRecursiveSinkCommand) { + _gate.invoke(InvocableScheduledItem(invocable: self, state: command)) + } + + func done() { + forwardOn(.completed) + dispose() + } + + func extract(_ observable: Observable) -> SequenceGenerator? { + abstractMethod() + } + + // should be done on gate locked + + private func moveNextCommand() { + var next: Observable? = nil + + repeat { + guard let (g, left) = _generators.last else { + break + } + + if _isDisposed { + return + } + + _generators.removeLast() + + var e = g + + guard let nextCandidate = e.next()?.asObservable() else { + continue + } + + // `left` is a hint of how many elements are left in generator. + // In case this is the last element, then there is no need to push + // that generator on stack. + // + // This is an optimization used to make sure in tail recursive case + // there is no memory leak in case this operator is used to generate non terminating + // sequence. + + if let knownOriginalLeft = left { + // `- 1` because generator.next() has just been called + if knownOriginalLeft - 1 >= 1 { + _generators.append((e, knownOriginalLeft - 1)) + } + } + else { + _generators.append((e, nil)) + } + + let nextGenerator = extract(nextCandidate) + + if let nextGenerator = nextGenerator { + _generators.append(nextGenerator) + #if DEBUG || TRACE_RESOURCES + if maxTailRecursiveSinkStackSize < _generators.count { + maxTailRecursiveSinkStackSize = _generators.count + } + #endif + } + else { + next = nextCandidate + } + } while next == nil + + if next == nil { + done() + return + } + + let disposable = SingleAssignmentDisposable() + _subscription.disposable = disposable + disposable.setDisposable(subscribeToNext(next!)) + } + + func subscribeToNext(_ source: Observable) -> Disposable { + abstractMethod() + } + + func disposeCommand() { + _isDisposed = true + _generators.removeAll(keepingCapacity: false) + } + + override func dispose() { + super.dispose() + + _subscription.dispose() + + schedule(.dispose) + } +} + diff --git a/Pods/RxSwift/RxSwift/Reactive.swift b/Pods/RxSwift/RxSwift/Reactive.swift new file mode 100644 index 0000000..57ecab7 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Reactive.swift @@ -0,0 +1,74 @@ +// +// Reactive.swift +// RxSwift +// +// Created by Yury Korolev on 5/2/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +/** + Use `Reactive` proxy as customization point for constrained protocol extensions. + + General pattern would be: + + // 1. Extend Reactive protocol with constrain on Base + // Read as: Reactive Extension where Base is a SomeType + extension Reactive where Base: SomeType { + // 2. Put any specific reactive extension for SomeType here + } + + With this approach we can have more specialized methods and properties using + `Base` and not just specialized on common base type. + + */ + +public struct Reactive { + /// Base object to extend. + public let base: Base + + /// Creates extensions with base object. + /// + /// - parameter base: Base object. + public init(_ base: Base) { + self.base = base + } +} + +/// A type that has reactive extensions. +public protocol ReactiveCompatible { + /// Extended type + associatedtype CompatibleType + + /// Reactive extensions. + static var rx: Reactive.Type { get set } + + /// Reactive extensions. + var rx: Reactive { get set } +} + +extension ReactiveCompatible { + /// Reactive extensions. + public static var rx: Reactive.Type { + get { + return Reactive.self + } + set { + // this enables using Reactive to "mutate" base type + } + } + + /// Reactive extensions. + public var rx: Reactive { + get { + return Reactive(self) + } + set { + // this enables using Reactive to "mutate" base object + } + } +} + +import Foundation + +/// Extend NSObject with `rx` proxy. +extension NSObject: ReactiveCompatible { } diff --git a/Pods/RxSwift/RxSwift/Rx.swift b/Pods/RxSwift/RxSwift/Rx.swift new file mode 100644 index 0000000..18a99b1 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Rx.swift @@ -0,0 +1,61 @@ +// +// Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +#if TRACE_RESOURCES + fileprivate var resourceCount: AtomicInt = 0 + + /// Resource utilization information + public struct Resources { + /// Counts internal Rx resource allocations (Observables, Observers, Disposables, etc.). This provides a simple way to detect leaks during development. + public static var total: Int32 { + return resourceCount.valueSnapshot() + } + + /// Increments `Resources.total` resource count. + /// + /// - returns: New resource count + public static func incrementTotal() -> Int32 { + return AtomicIncrement(&resourceCount) + } + + /// Decrements `Resources.total` resource count + /// + /// - returns: New resource count + public static func decrementTotal() -> Int32 { + return AtomicDecrement(&resourceCount) + } + } +#endif + +/// Swift does not implement abstract methods. This method is used as a runtime check to ensure that methods which intended to be abstract (i.e., they should be implemented in subclasses) are not called directly on the superclass. +func abstractMethod() -> Swift.Never { + rxFatalError("Abstract method") +} + +func rxFatalError(_ lastMessage: String) -> Swift.Never { + // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. + fatalError(lastMessage) +} + +func incrementChecked(_ i: inout Int) throws -> Int { + if i == Int.max { + throw RxError.overflow + } + defer { i += 1 } + return i +} + +func decrementChecked(_ i: inout Int) throws -> Int { + if i == Int.min { + throw RxError.overflow + } + defer { i -= 1 } + return i +} diff --git a/Pods/RxSwift/RxSwift/RxMutableBox.swift b/Pods/RxSwift/RxSwift/RxMutableBox.swift new file mode 100644 index 0000000..7606b99 --- /dev/null +++ b/Pods/RxSwift/RxSwift/RxMutableBox.swift @@ -0,0 +1,29 @@ +// +// RxMutableBox.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Creates mutable reference wrapper for any type. +class RxMutableBox : CustomDebugStringConvertible { + /// Wrapped value + var value : T + + /// Creates reference wrapper for `value`. + /// + /// - parameter value: Value to wrap. + init (_ value: T) { + self.value = value + } +} + +extension RxMutableBox { + /// - returns: Box description. + var debugDescription: String { + return "MutatingBox(\(self.value))" + } +} diff --git a/Pods/RxSwift/RxSwift/SchedulerType.swift b/Pods/RxSwift/RxSwift/SchedulerType.swift new file mode 100644 index 0000000..3c329ba --- /dev/null +++ b/Pods/RxSwift/RxSwift/SchedulerType.swift @@ -0,0 +1,70 @@ +// +// SchedulerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +// Type that represents time interval in the context of RxSwift. +public typealias RxTimeInterval = TimeInterval + +/// Type that represents absolute time in the context of RxSwift. +public typealias RxTime = Date + +/// Represents an object that schedules units of work. +public protocol SchedulerType: ImmediateSchedulerType { + + /// - returns: Current time. + var now : RxTime { + get + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable +} + +extension SchedulerType { + + /** + Periodic task will be emulated using recursive scheduling. + + - parameter state: Initial state passed to the action upon the first iteration. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - returns: The disposable object used to cancel the scheduled recurring action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + let schedule = SchedulePeriodicRecursive(scheduler: self, startAfter: startAfter, period: period, action: action, state: state) + + return schedule.start() + } + + func scheduleRecursive(_ state: State, dueTime: RxTimeInterval, action: @escaping (State, AnyRecursiveScheduler) -> ()) -> Disposable { + let scheduler = AnyRecursiveScheduler(scheduler: self, action: action) + + scheduler.schedule(state, dueTime: dueTime) + + return Disposables.create(with: scheduler.dispose) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift new file mode 100644 index 0000000..f4c202b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift @@ -0,0 +1,81 @@ +// +// ConcurrentDispatchQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/5/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +/// Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems. +/// +/// This scheduler is suitable when some work needs to be performed in background. +public class ConcurrentDispatchQueueScheduler: SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + public var now : Date { + return Date() + } + + let configuration: DispatchQueueConfiguration + + /// Constructs new `ConcurrentDispatchQueueScheduler` that wraps `queue`. + /// + /// - parameter queue: Target dispatch queue. + public init(queue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + configuration = DispatchQueueConfiguration(queue: queue, leeway: leeway) + } + + /// Convenience init for scheduler that wraps one of the global concurrent dispatch queues. + /// + /// - parameter qos: Target global dispatch queue, by quality of service class. + @available(iOS 8, OSX 10.10, *) + public convenience init(qos: DispatchQoS, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.init(queue: DispatchQueue( + label: "rxswift.queue.\(qos)", + qos: qos, + attributes: [DispatchQueue.Attributes.concurrent], + target: nil), + leeway: leeway + ) + } + + /** + Schedules an action to be executed immediatelly. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.schedule(state, action: action) + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift new file mode 100644 index 0000000..6feaedd --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift @@ -0,0 +1,87 @@ +// +// ConcurrentMainScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +/** +Abstracts work that needs to be performed on `MainThread`. In case `schedule` methods are called from main thread, it will perform action immediately without scheduling. + +This scheduler is optimized for `subscribeOn` operator. If you want to observe observable sequence elements on main thread using `observeOn` operator, +`MainScheduler` is more suitable for that purpose. +*/ +public final class ConcurrentMainScheduler : SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + private let _mainScheduler: MainScheduler + private let _mainQueue: DispatchQueue + + /// - returns: Current time. + public var now : Date { + return _mainScheduler.now as Date + } + + private init(mainScheduler: MainScheduler) { + _mainQueue = DispatchQueue.main + _mainScheduler = mainScheduler + } + + /// Singleton instance of `ConcurrentMainScheduler` + public static let instance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance) + + /** + Schedules an action to be executed immediatelly. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + if DispatchQueue.isMain { + return action(state) + } + + let cancel = SingleAssignmentDisposable() + + _mainQueue.async { + if cancel.isDisposed { + return + } + + cancel.setDisposable(action(state)) + } + + return cancel + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return _mainScheduler.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return _mainScheduler.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift new file mode 100644 index 0000000..8a49ce0 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift @@ -0,0 +1,101 @@ +// +// CurrentThreadScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +let CurrentThreadSchedulerKeyInstance = "RxSwift.CurrentThreadScheduler.SchedulerKey" +let CurrentThreadSchedulerQueueKeyInstance = "RxSwift.CurrentThreadScheduler.Queue" + +typealias CurrentThreadSchedulerValue = NSString +let CurrentThreadSchedulerValueInstance = "RxSwift.CurrentThreadScheduler.SchedulerKey" as NSString + + +/// Represents an object that schedules units of work on the current thread. +/// +/// This is the default scheduler for operators that generate elements. +/// +/// This scheduler is also sometimes called `trampoline scheduler`. +public class CurrentThreadScheduler : ImmediateSchedulerType { + typealias ScheduleQueue = RxMutableBox> + + /// The singleton instance of the current thread scheduler. + public static let instance = CurrentThreadScheduler() + + static var queue : ScheduleQueue? { + get { + return Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerQueueKeyInstance) + } + set { + Thread.setThreadLocalStorageValue(newValue, forKey: CurrentThreadSchedulerQueueKeyInstance) + } + } + + /// Gets a value that indicates whether the caller must call a `schedule` method. + public static fileprivate(set) var isScheduleRequired: Bool { + get { + let value: CurrentThreadSchedulerValue? = Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerKeyInstance) + return value == nil + } + set(isScheduleRequired) { + Thread.setThreadLocalStorageValue(isScheduleRequired ? nil : CurrentThreadSchedulerValueInstance, forKey: CurrentThreadSchedulerKeyInstance) + } + } + + /** + Schedules an action to be executed as soon as possible on current thread. + + If this method is called on some thread that doesn't have `CurrentThreadScheduler` installed, scheduler will be + automatically installed and uninstalled after all work is performed. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + if CurrentThreadScheduler.isScheduleRequired { + CurrentThreadScheduler.isScheduleRequired = false + + let disposable = action(state) + + defer { + CurrentThreadScheduler.isScheduleRequired = true + CurrentThreadScheduler.queue = nil + } + + guard let queue = CurrentThreadScheduler.queue else { + return disposable + } + + while let latest = queue.value.dequeue() { + if latest.isDisposed { + continue + } + latest.invoke() + } + + return disposable + } + + let existingQueue = CurrentThreadScheduler.queue + + let queue: RxMutableBox> + if let existingQueue = existingQueue { + queue = existingQueue + } + else { + queue = RxMutableBox(Queue(capacity: 1)) + CurrentThreadScheduler.queue = queue + } + + let scheduledItem = ScheduledItem(action: action, state: state) + queue.value.enqueue(scheduledItem) + + return scheduledItem + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift new file mode 100644 index 0000000..fede60e --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift @@ -0,0 +1,22 @@ +// +// HistoricalScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Provides a virtual time scheduler that uses `Date` for absolute time and `NSTimeInterval` for relative time. +public class HistoricalScheduler : VirtualTimeScheduler { + + /** + Creates a new historical scheduler with initial clock value. + + - parameter initialClock: Initial value for virtual clock. + */ + public init(initialClock: RxTime = Date(timeIntervalSince1970: 0)) { + super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter()) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift b/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift new file mode 100644 index 0000000..2ef349a --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift @@ -0,0 +1,67 @@ +// +// HistoricalSchedulerTimeConverter.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Converts historial virtual time into real time. +/// +/// Since historical virtual time is also measured in `Date`, this converter is identity function. +public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType { + /// Virtual time unit used that represents ticks of virtual clock. + public typealias VirtualTimeUnit = RxTime + + /// Virtual time unit used to represent differences of virtual times. + public typealias VirtualTimeIntervalUnit = RxTimeInterval + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime { + return virtualTime + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit { + return time + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval { + return virtualTimeInterval + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit { + return timeInterval + } + + /** + Offsets `Date` by time interval. + + - parameter time: Time. + - parameter timeInterval: Time interval offset. + - returns: Time offsetted by time interval. + */ + public func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit { + return time.addingTimeInterval(offset) + } + + /// Compares two `Date`s. + public func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison { + switch lhs.compare(rhs as Date) { + case .orderedAscending: + return .lessThan + case .orderedSame: + return .equal + case .orderedDescending: + return .greaterThan + } + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift new file mode 100644 index 0000000..f3e1635 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift @@ -0,0 +1,37 @@ +// +// ImmediateScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Represents an object that schedules units of work to run immediately on the current thread. +private class ImmediateScheduler : ImmediateSchedulerType { + + private let _asyncLock = AsyncLock() + + /** + Schedules an action to be executed immediatelly. + + In case `schedule` is called recursively from inside of `action` callback, scheduled `action` will be enqueued + and executed after current `action`. (`AsyncLock` behavior) + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let disposable = SingleAssignmentDisposable() + _asyncLock.invoke(AnonymousInvocable { + if disposable.isDisposed { + return + } + disposable.setDisposable(action(state)) + }) + + return disposable + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift new file mode 100644 index 0000000..b3a19af --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift @@ -0,0 +1,21 @@ +// +// AnonymousInvocable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct AnonymousInvocable : InvocableType { + private let _action: () -> () + + init(_ action: @escaping () -> ()) { + _action = action + } + + func invoke() { + _action() + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift new file mode 100644 index 0000000..be7040c --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift @@ -0,0 +1,104 @@ +// +// DispatchQueueConfiguration.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/23/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +struct DispatchQueueConfiguration { + let queue: DispatchQueue + let leeway: DispatchTimeInterval +} + +private func dispatchInterval(_ interval: Foundation.TimeInterval) -> DispatchTimeInterval { + precondition(interval >= 0.0) + // TODO: Replace 1000 with something that actually works + // NSEC_PER_MSEC returns 1000000 + return DispatchTimeInterval.milliseconds(Int(interval * 1000.0)) +} + +extension DispatchQueueConfiguration { + func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let cancel = SingleAssignmentDisposable() + + queue.async { + if cancel.isDisposed { + return + } + + + cancel.setDisposable(action(state)) + } + + return cancel + } + + func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let deadline = DispatchTime.now() + dispatchInterval(dueTime) + + let compositeDisposable = CompositeDisposable() + + let timer = DispatchSource.makeTimerSource(queue: queue) + timer.scheduleOneshot(deadline: deadline) + + // TODO: + // This looks horrible, and yes, it is. + // It looks like Apple has made a conceputal change here, and I'm unsure why. + // Need more info on this. + // It looks like just setting timer to fire and not holding a reference to it + // until deadline causes timer cancellation. + var timerReference: DispatchSourceTimer? = timer + let cancelTimer = Disposables.create { + timerReference?.cancel() + timerReference = nil + } + + timer.setEventHandler(handler: { + if compositeDisposable.isDisposed { + return + } + _ = compositeDisposable.insert(action(state)) + cancelTimer.dispose() + }) + timer.resume() + + _ = compositeDisposable.insert(cancelTimer) + + return compositeDisposable + } + + func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + let initial = DispatchTime.now() + dispatchInterval(startAfter) + + var timerState = state + + let timer = DispatchSource.makeTimerSource(queue: queue) + timer.scheduleRepeating(deadline: initial, interval: dispatchInterval(period), leeway: leeway) + + // TODO: + // This looks horrible, and yes, it is. + // It looks like Apple has made a conceputal change here, and I'm unsure why. + // Need more info on this. + // It looks like just setting timer to fire and not holding a reference to it + // until deadline causes timer cancellation. + var timerReference: DispatchSourceTimer? = timer + let cancelTimer = Disposables.create { + timerReference?.cancel() + timerReference = nil + } + + timer.setEventHandler(handler: { + if cancelTimer.isDisposed { + return + } + timerState = action(timerState) + }) + timer.resume() + + return cancelTimer + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift new file mode 100644 index 0000000..54c7f19 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift @@ -0,0 +1,24 @@ +// +// InvocableScheduledItem.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct InvocableScheduledItem : InvocableType { + + let _invocable: I + let _state: I.Value + + init(invocable: I, state: I.Value) { + _invocable = invocable + _state = state + } + + func invoke() { + _invocable.invoke(_state) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift new file mode 100644 index 0000000..1f95c66 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift @@ -0,0 +1,19 @@ +// +// InvocableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol InvocableType { + func invoke() +} + +protocol InvocableWithValueType { + associatedtype Value + + func invoke(_ value: Value) +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift new file mode 100644 index 0000000..c03b2eb --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift @@ -0,0 +1,37 @@ +// +// ScheduledItem.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +struct ScheduledItem + : ScheduledItemType + , InvocableType { + typealias Action = (T) -> Disposable + + private let _action: Action + private let _state: T + + private let _disposable = SingleAssignmentDisposable() + + var isDisposed: Bool { + return _disposable.isDisposed + } + + init(action: @escaping Action, state: T) { + _action = action + _state = state + } + + func invoke() { + _disposable.setDisposable(_action(_state)) + } + + func dispose() { + _disposable.dispose() + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift new file mode 100644 index 0000000..a5f0b0b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift @@ -0,0 +1,15 @@ +// +// ScheduledItemType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +protocol ScheduledItemType + : Cancelable + , InvocableType { + func invoke() +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift new file mode 100644 index 0000000..5adfa78 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift @@ -0,0 +1,69 @@ +// +// MainScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +/** +Abstracts work that needs to be performed on `DispatchQueue.main`. In case `schedule` methods are called from `DispatchQueue.main`, it will perform action immediately without scheduling. + +This scheduler is usually used to perform UI work. + +Main scheduler is a specialization of `SerialDispatchQueueScheduler`. + +This scheduler is optimized for `observeOn` operator. To ensure observable sequence is subscribed on main thread using `subscribeOn` +operator please use `ConcurrentMainScheduler` because it is more optimized for that purpose. +*/ +public final class MainScheduler : SerialDispatchQueueScheduler { + + private let _mainQueue: DispatchQueue + + var numberEnqueued: AtomicInt = 0 + + /// Initializes new instance of `MainScheduler`. + public init() { + _mainQueue = DispatchQueue.main + super.init(serialQueue: _mainQueue) + } + + /// Singleton instance of `MainScheduler` + public static let instance = MainScheduler() + + /// Singleton instance of `MainScheduler` that always schedules work asynchronously + /// and doesn't perform optimizations for calls scheduled from main queue. + public static let asyncInstance = SerialDispatchQueueScheduler(serialQueue: DispatchQueue.main) + + /// In case this method is called on a background thread it will throw an exception. + public class func ensureExecutingOnScheduler(errorMessage: String? = nil) { + if !DispatchQueue.isMain { + rxFatalError(errorMessage ?? "Executing on backgound thread. Please use `MainScheduler.instance.schedule` to schedule work on main thread.") + } + } + + override func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let currentNumberEnqueued = AtomicIncrement(&numberEnqueued) + + if DispatchQueue.isMain && currentNumberEnqueued == 1 { + let disposable = action(state) + _ = AtomicDecrement(&numberEnqueued) + return disposable + } + + let cancel = SingleAssignmentDisposable() + + _mainQueue.async { + if !cancel.isDisposed { + _ = action(state) + } + + _ = AtomicDecrement(&self.numberEnqueued) + } + + return cancel + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift new file mode 100644 index 0000000..957f053 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift @@ -0,0 +1,48 @@ +// +// OperationQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. +/// +/// This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`. +public class OperationQueueScheduler: ImmediateSchedulerType { + public let operationQueue: OperationQueue + + /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. + /// + /// - parameter operationQueue: Operation queue targeted to perform work on. + public init(operationQueue: OperationQueue) { + self.operationQueue = operationQueue + } + + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - 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. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let cancel = SingleAssignmentDisposable() + + let operation = BlockOperation { + if cancel.isDisposed { + return + } + + + cancel.setDisposable(action(state)) + } + + self.operationQueue.addOperation(operation) + + return cancel + } + +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift new file mode 100644 index 0000000..fd9992b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift @@ -0,0 +1,228 @@ +// +// RecursiveScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +fileprivate enum ScheduleState { + case initial + case added(CompositeDisposable.DisposeKey) + case done +} + +/// Type erased recursive scheduler. +class AnyRecursiveScheduler { + + typealias Action = (State, AnyRecursiveScheduler) -> Void + + private let _lock = NSRecursiveLock() + + // state + private let _group = CompositeDisposable() + + private var _scheduler: SchedulerType + private var _action: Action? + + init(scheduler: SchedulerType, action: @escaping Action) { + _action = action + _scheduler = scheduler + } + + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the recursive action. + */ + func schedule(_ state: State, dueTime: RxTimeInterval) { + var scheduleState: ScheduleState = .initial + + let d = _scheduler.scheduleRelative(state, dueTime: dueTime) { (state) -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self) + } + + return Disposables.create() + } + + _lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + break + case .initial: + if let removeKey = _group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + break + case .done: + break + } + } + } + + /// Schedules an action to be executed recursively. + /// + /// - parameter state: State passed to the action to be executed. + func schedule(_ state: State) { + var scheduleState: ScheduleState = .initial + + let d = _scheduler.schedule(state) { (state) -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self) + } + + return Disposables.create() + } + + _lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + break + case .initial: + if let removeKey = _group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + break + case .done: + break + } + } + } + + func dispose() { + _lock.performLocked { + _action = nil + } + _group.dispose() + } +} + +/// Type erased recursive scheduler. +class RecursiveImmediateScheduler { + typealias Action = (_ state: State, _ recurse: (State) -> Void) -> Void + + private var _lock = SpinLock() + private let _group = CompositeDisposable() + + private var _action: Action? + private let _scheduler: ImmediateSchedulerType + + init(action: @escaping Action, scheduler: ImmediateSchedulerType) { + _action = action + _scheduler = scheduler + } + + // immediate scheduling + + /// Schedules an action to be executed recursively. + /// + /// - parameter state: State passed to the action to be executed. + func schedule(_ state: State) { + var scheduleState: ScheduleState = .initial + + let d = _scheduler.schedule(state) { (state) -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self.schedule) + } + + return Disposables.create() + } + + _lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + break + case .initial: + if let removeKey = _group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + break + case .done: + break + } + } + } + + func dispose() { + _lock.performLocked { + _action = nil + } + _group.dispose() + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift b/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift new file mode 100644 index 0000000..9374fc5 --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift @@ -0,0 +1,63 @@ +// +// SchedulerServices+Emulation.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +enum SchedulePeriodicRecursiveCommand { + case tick + case dispatchStart +} + +class SchedulePeriodicRecursive { + typealias RecursiveAction = (State) -> State + typealias RecursiveScheduler = AnyRecursiveScheduler + + private let _scheduler: SchedulerType + private let _startAfter: RxTimeInterval + private let _period: RxTimeInterval + private let _action: RecursiveAction + + private var _state: State + private var _pendingTickCount: AtomicInt = 0 + + init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { + _scheduler = scheduler + _startAfter = startAfter + _period = period + _action = action + _state = state + } + + func start() -> Disposable { + return _scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: _startAfter, action: self.tick) + } + + func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) -> Void { + // Tries to emulate periodic scheduling as best as possible. + // The problem that could arise is if handling periodic ticks take too long, or + // tick interval is short. + switch command { + case .tick: + scheduler.schedule(.tick, dueTime: _period) + + // The idea is that if on tick there wasn't any item enqueued, schedule to perform work immediatelly. + // Else work will be scheduled after previous enqueued work completes. + if AtomicIncrement(&_pendingTickCount) == 1 { + self.tick(.dispatchStart, scheduler: scheduler) + } + + case .dispatchStart: + _state = _action(_state) + // Start work and schedule check is this last batch of work + if AtomicDecrement(&_pendingTickCount) > 0 { + // This gives priority to scheduler emulation, it's not perfect, but helps + scheduler.schedule(SchedulePeriodicRecursiveCommand.dispatchStart) + } + } + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift new file mode 100644 index 0000000..fab8cbe --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift @@ -0,0 +1,122 @@ +// +// SerialDispatchQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation +import Dispatch + +/** +Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure +that even if concurrent dispatch queue is passed, it's transformed into a serial one. + +It is extremely important that this scheduler is serial, because +certain operator perform optimizations that rely on that property. + +Because there is no way of detecting is passed dispatch queue serial or +concurrent, for every queue that is being passed, worst case (concurrent) +will be assumed, and internal serial proxy dispatch queue will be created. + +This scheduler can also be used with internal serial queue alone. + +In case some customization need to be made on it before usage, +internal serial queue can be customized using `serialQueueConfiguration` +callback. +*/ +public class SerialDispatchQueueScheduler : SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + /// - returns: Current time. + public var now : Date { + return Date() + } + + let configuration: DispatchQueueConfiguration + + init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + configuration = DispatchQueueConfiguration(queue: serialQueue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` with internal serial queue named `internalSerialQueueName`. + + Additional dispatch queue properties can be set after dispatch queue is created using `serialQueueConfiguration`. + + - parameter internalSerialQueueName: Name of internal serial dispatch queue. + - parameter serialQueueConfiguration: Additional configuration of internal serial dispatch queue. + */ + public convenience init(internalSerialQueueName: String, serialQueueConfiguration: ((DispatchQueue) -> Void)? = nil, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + let queue = DispatchQueue(label: internalSerialQueueName, attributes: []) + serialQueueConfiguration?(queue) + self.init(serialQueue: queue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` named `internalSerialQueueName` that wraps `queue`. + + - parameter queue: Possibly concurrent dispatch queue used to perform work. + - parameter internalSerialQueueName: Name of internal serial dispatch queue proxy. + */ + public convenience init(queue: DispatchQueue, internalSerialQueueName: String, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + // Swift 3.0 IUO + let serialQueue = DispatchQueue(label: internalSerialQueueName, + attributes: [], + target: queue) + self.init(serialQueue: serialQueue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` that wraps on of the global concurrent dispatch queues. + + - parameter qos: Identifier for global dispatch queue with specified quality of service class. + - parameter internalSerialQueueName: Custom name for internal serial dispatch queue proxy. + */ + @available(iOS 8, OSX 10.10, *) + public convenience init(qos: DispatchQoS, internalSerialQueueName: String = "rx.global_dispatch_queue.serial", leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.init(queue: DispatchQueue.global(qos: qos.qosClass), internalSerialQueueName: internalSerialQueueName, leeway: leeway) + } + + /** + Schedules an action to be executed immediatelly. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.scheduleInternal(state, action: action) + } + + func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.schedule(state, action: action) + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift b/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift new file mode 100644 index 0000000..f7aa87a --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift @@ -0,0 +1,97 @@ +// +// VirtualTimeConverterType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Parametrization for virtual time used by `VirtualTimeScheduler`s. +public protocol VirtualTimeConverterType { + /// Virtual time unit used that represents ticks of virtual clock. + associatedtype VirtualTimeUnit + + /// Virtual time unit used to represent differences of virtual times. + associatedtype VirtualTimeIntervalUnit + + /** + Converts virtual time to real time. + + - parameter virtualTime: Virtual time to convert to `Date`. + - returns: `Date` corresponding to virtual time. + */ + func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime + + /** + Converts real time to virtual time. + + - parameter time: `Date` to convert to virtual time. + - returns: Virtual time corresponding to `Date`. + */ + func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit + + /** + Converts from virtual time interval to `NSTimeInterval`. + + - parameter virtualTimeInterval: Virtual time interval to convert to `NSTimeInterval`. + - returns: `NSTimeInterval` corresponding to virtual time interval. + */ + func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval + + /** + Converts from virtual time interval to `NSTimeInterval`. + + - parameter timeInterval: `NSTimeInterval` to convert to virtual time interval. + - returns: Virtual time interval corresponding to time interval. + */ + func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit + + /** + Offsets virtual time by virtual time interval. + + - parameter time: Virtual time. + - parameter offset: Virtual time interval. + - returns: Time corresponding to time offsetted by virtual time interval. + */ + func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit + + /** + This is aditional abstraction because `Date` is unfortunately not comparable. + Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. + */ + func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison +} + +/** + Virtual time comparison result. + + This is aditional abstraction because `Date` is unfortunately not comparable. + Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. +*/ +public enum VirtualTimeComparison { + /// lhs < rhs. + case lessThan + /// lhs == rhs. + case equal + /// lhs > rhs. + case greaterThan +} + +extension VirtualTimeComparison { + /// lhs < rhs. + var lessThen: Bool { + return self == .lessThan + } + + /// lhs > rhs + var greaterThan: Bool { + return self == .greaterThan + } + + /// lhs == rhs + var equal: Bool { + return self == .equal + } +} diff --git a/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift new file mode 100644 index 0000000..2956c4b --- /dev/null +++ b/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift @@ -0,0 +1,271 @@ +// +// VirtualTimeScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +/// Base class for virtual time schedulers using a priority queue for scheduled items. +open class VirtualTimeScheduler + : SchedulerType { + + public typealias VirtualTime = Converter.VirtualTimeUnit + public typealias VirtualTimeInterval = Converter.VirtualTimeIntervalUnit + + private var _running : Bool + + private var _clock: VirtualTime + + fileprivate var _schedulerQueue : PriorityQueue> + private var _converter: Converter + + private var _nextId = 0 + + /// - returns: Current time. + public var now: RxTime { + return _converter.convertFromVirtualTime(clock) + } + + /// - returns: Scheduler's absolute time clock value. + public var clock: VirtualTime { + return _clock + } + + /// Creates a new virtual time scheduler. + /// + /// - parameter initialClock: Initial value for the clock. + public init(initialClock: VirtualTime, converter: Converter) { + _clock = initialClock + _running = false + _converter = converter + _schedulerQueue = PriorityQueue(hasHigherPriority: { + switch converter.compareVirtualTime($0.time, $1.time) { + case .lessThan: + return true + case .equal: + return $0.id < $1.id + case .greaterThan: + return false + } + }, isEqual: { $0 === $1 }) + #if TRACE_RESOURCES + let _ = Resources.incrementTotal() + #endif + } + + /** + Schedules an action to be executed immediatelly. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.scheduleRelative(state, dueTime: 0.0) { a in + return action(a) + } + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let time = self.now.addingTimeInterval(dueTime) + let absoluteTime = _converter.convertToVirtualTime(time) + let adjustedTime = self.adjustScheduledTime(absoluteTime) + return scheduleAbsoluteVirtual(state, time: adjustedTime, action: action) + } + + /** + Schedules an action to be executed after relative time has passed. + + - parameter state: State passed to the action to be executed. + - parameter time: Absolute time when to execute the action. If this is less or equal then `now`, `now + 1` will be used. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRelativeVirtual(_ state: StateType, dueTime: VirtualTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let time = _converter.offsetVirtualTime(self.clock, offset: dueTime) + return scheduleAbsoluteVirtual(state, time: time, action: action) + } + + /** + Schedules an action to be executed at absolute virtual time. + + - parameter state: State passed to the action to be executed. + - parameter time: Absolute time when to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleAbsoluteVirtual(_ state: StateType, time: Converter.VirtualTimeUnit, action: @escaping (StateType) -> Disposable) -> Disposable { + MainScheduler.ensureExecutingOnScheduler() + + let compositeDisposable = CompositeDisposable() + + let item = VirtualSchedulerItem(action: { + let dispose = action(state) + return dispose + }, time: time, id: _nextId) + + _nextId += 1 + + _schedulerQueue.enqueue(item) + + _ = compositeDisposable.insert(item) + + return compositeDisposable + } + + /// Adjusts time of scheduling before adding item to schedule queue. + open func adjustScheduledTime(_ time: Converter.VirtualTimeUnit) -> Converter.VirtualTimeUnit { + return time + } + + /// Starts the virtual time scheduler. + public func start() { + MainScheduler.ensureExecutingOnScheduler() + + if _running { + return + } + + _running = true + repeat { + guard let next = findNext() else { + break + } + + if _converter.compareVirtualTime(next.time, self.clock).greaterThan { + _clock = next.time + } + + next.invoke() + _schedulerQueue.remove(next) + } while _running + + _running = false + } + + func findNext() -> VirtualSchedulerItem? { + while let front = _schedulerQueue.peek() { + if front.isDisposed { + _schedulerQueue.remove(front) + continue + } + + return front + } + + return nil + } + + /// Advances the scheduler's clock to the specified time, running all work till that point. + /// + /// - parameter virtualTime: Absolute time to advance the scheduler's clock to. + public func advanceTo(_ virtualTime: VirtualTime) { + MainScheduler.ensureExecutingOnScheduler() + + if _running { + fatalError("Scheduler is already running") + } + + _running = true + repeat { + guard let next = findNext() else { + break + } + + if _converter.compareVirtualTime(next.time, virtualTime).greaterThan { + break + } + + if _converter.compareVirtualTime(next.time, self.clock).greaterThan { + _clock = next.time + } + + next.invoke() + _schedulerQueue.remove(next) + } while _running + + _clock = virtualTime + _running = false + } + + /// Advances the scheduler's clock by the specified relative time. + public func sleep(_ virtualInterval: VirtualTimeInterval) { + MainScheduler.ensureExecutingOnScheduler() + + let sleepTo = _converter.offsetVirtualTime(clock, offset: virtualInterval) + if _converter.compareVirtualTime(sleepTo, clock).lessThen { + fatalError("Can't sleep to past.") + } + + _clock = sleepTo + } + + /// Stops the virtual time scheduler. + public func stop() { + MainScheduler.ensureExecutingOnScheduler() + + _running = false + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } + #endif +} + +// MARK: description + +extension VirtualTimeScheduler: CustomDebugStringConvertible { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + return self._schedulerQueue.debugDescription + } +} + +class VirtualSchedulerItem