diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 0000000..3e9fe85 --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,31 @@ +name: Beta + +on: + workflow_dispatch: + +jobs: + beta: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Write App Store Connect API key + env: + APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }} + run: | + mkdir -p ~/.appstoreconnect/private_keys + echo "$APP_STORE_CONNECT_API_KEY_CONTENT" | base64 -d > ~/.appstoreconnect/private_keys/AuthKey_${APP_STORE_CONNECT_API_KEY_ID}.p8 + + - name: Upload to TestFlight + env: + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} + APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + run: bundle exec fastlane beta diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..14799e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Run tests + run: bundle exec fastlane test + + periphery: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + bundler-cache: true + + - name: Install periphery + run: brew install peripheryapp/periphery/periphery + + - name: Scan for dead code + run: bundle exec fastlane periphery diff --git a/.gitignore b/.gitignore index 3b3602b..8858554 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,11 @@ Carthage/Build fastlane/report.xml fastlane/Preview.html fastlane/screenshots -fastlane/test_output \ No newline at end of file +fastlane/test_output + +.DS_Store +*.xcuserstate + +# Bundler +.bundle/ +vendor/ diff --git a/.periphery.yml b/.periphery.yml new file mode 100644 index 0000000..a563b5b --- /dev/null +++ b/.periphery.yml @@ -0,0 +1,16 @@ +project: PcVolumeControl.xcodeproj +schemes: + - PcVolumeControl +# Wire-protocol DTOs are only encoded to JSON for the server; their properties +# are written but never read back, which is not dead code. +retain_codable_properties: true +# Widget Live Activity / Control / AppIntent are intentional scaffolding kept for +# planned widget work (see WIDGET_IMPLEMENTATION_GUIDE.md). Exclude from reports. +# SnapshotHelper.swift is vendored verbatim from fastlane (regenerated by +# `fastlane snapshot`); its unused legacy overloads are part of fastlane's public +# API and must not be hand-edited. +report_exclude: + - "**/PcVolumeControlWidget/AppIntent.swift" + - "**/PcVolumeControlWidget/PcVolumeControlWidgetControl.swift" + - "**/PcVolumeControlWidget/PcVolumeControlWidgetLiveActivity.swift" + - "**/PcVolumeControlUITests/SnapshotHelper.swift" diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d923945 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,98 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +PCVolumeControl is an iOS application that allows users to remotely control application audio volumes on a Windows PC. The app connects to a server running on the PC through a TCP connection and provides a UI to adjust volume levels for individual applications. + +## Architecture + +- **Platform**: iOS 17+ Swift app using SwiftUI +- **Architecture Pattern**: MVVM (Model-View-ViewModel) +- **Networking**: TCP socket communication using Apple's Network framework +- **Protocol**: JSON-based protocol (version 7) for client-server communication + +## Key Components + +1. **Connection Management**: + - `MainViewModel.swift`: Handles TCP socket connection, error handling, and data processing + - Connection states: ready, preparing, failed, waiting, cancelled + +2. **Data Models**: + - `FullState`: Server response with complete state information + - `Session`: Represents an application with volume and mute state + - Various update models for sending changes to the server + +3. **UI Components**: + - `MainView`: Initial connection screen + - `SliderView`: Volume controls for applications + - `ConnectingView`: Connection status display + +## Development Workflow + +### Building and Running the App + +1. Open the project in Xcode: + ``` + open PcVolumeControl.xcodeproj + ``` + +2. Select a target device or simulator + +3. Build and run the app using Xcode's run button or: + ``` + ⌘+R + ``` +## Running Tests + **unit tests** + +Run this to execute all unit tests: `xcodebuild test -scheme PcVolumeControl -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max,OS=26.0'` + +## Dead Code Analysis + +The project uses [periphery](https://github.com/peripheryapp/periphery) to detect unused code. + +1. Install (one-time): `brew install peripheryapp/periphery/periphery` +2. Run the scan from the repo root: `periphery scan` + +In CI this runs as the `periphery` fastlane lane (`bundle exec fastlane periphery`), +which adds `--strict` so the scan exits non-zero on findings. The +`.github/workflows/ci.yml` workflow runs it on every push and pull request. + +Configuration lives in the committed `.periphery.yml`; `periphery scan` reads it +automatically. A clean run reports `No unused code detected.`. Notes: + +- `retain_codable_properties: true` keeps the encode-only wire DTOs in + `models/VolumeUpdateDTOs.swift` from being flagged (their properties are written + to JSON but never read back, which is not dead code). +- `report_exclude` covers the widget scaffolding (`AppIntent.swift`, + `PcVolumeControlWidgetControl.swift`, `PcVolumeControlWidgetLiveActivity.swift`) + kept for planned widget work, and `SnapshotHelper.swift`, which is vendored + verbatim from fastlane and must not be hand-edited. +- The scan requires a single shared `PcVolumeControl` scheme. A stale per-user + scheme under `xcodeproj/xcuserdata/.../xcschemes/` creates a duplicate that + makes periphery fail with "Scheme ... does not exist"; delete it (it is + git-ignored and regenerated by Xcode). + +### Development Notes + +- The project is undergoing refactoring (branch: bill/refactor) +- Recently migrated to SwiftUI from an older architecture +- Pods dependencies have been removed +- NEVER use emojis in the code, including in comments. + +## Protocol + +The app communicates with the PC server using a JSON protocol: + +- **Server → Client**: Sends `FullState` with all devices and sessions information +- **Client → Server**: Sends updates for: + - Default device changes + - Master volume/mute changes + - Individual application volume/mute changes + +## Related Resources + +- Demo Video: https://youtu.be/OgueVzguP3w +- Wiki: https://github.com/PcVolumeControl/PcVolumeControliOS/wiki diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8988648 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,83 @@ +# Contributing to PCVolumeControl + +Thanks for contributing! This guide covers the local development workflow. + +## Prerequisites + +- Xcode 16+ with the iOS 17+ SDK +- [Homebrew](https://brew.sh) + +## Building and Running + +```sh +open PcVolumeControl.xcodeproj +``` + +Select a simulator or device and build/run with the Xcode run button (`Cmd+R`). + +## Running Tests + +```sh +xcodebuild test -scheme PcVolumeControl \ + -destination 'platform=iOS Simulator,name=iPhone 17 Pro Max,OS=26.0' +``` + +## Dead Code Analysis + +We use [periphery](https://github.com/peripheryapp/periphery) to find unused code. +Run a scan before opening a pull request and resolve anything it reports. + +1. Install (one-time): + + ```sh + brew install peripheryapp/periphery/periphery + ``` + +2. From the repository root, run: + + ```sh + periphery scan + ``` + +`periphery scan` reads the committed `.periphery.yml`; a clean run prints +`No unused code detected.`. + +Alternatively, run the same check CI runs via fastlane: + +```sh +bundle exec fastlane periphery +``` + +The `periphery` lane runs `periphery scan --strict`, so it exits non-zero when +unused code is found. CI (`.github/workflows/ci.yml`) runs this lane on every push +and pull request, so a scan failure will fail the build. + +### Handling findings + +Prefer deleting genuinely unused code. When periphery flags code that is *not* +actually dead, do not silence it blindly: + +- Code reachable only through reflection, SwiftUI SPI, or the wire protocol can be + retained via `.periphery.yml` settings (e.g. `retain_codable_properties`) or a + targeted `// periphery:ignore` comment with an explanatory note. +- Vendored or generated files (e.g. fastlane's `SnapshotHelper.swift`) and + intentional scaffolding are listed under `report_exclude` in `.periphery.yml`. + +Always add a comment explaining why an exclusion or ignore is justified. + +### Troubleshooting + +If periphery fails with `Scheme 'PcVolumeControl' does not exist`, you likely have +a stale per-user scheme shadowing the shared one. Remove it (it is git-ignored and +Xcode regenerates it): + +```sh +rm PcVolumeControl.xcodeproj/xcuserdata/*.xcuserdatad/xcschemes/PcVolumeControl.xcscheme +``` + +## Code Style + +- Target iOS 17+ with SwiftUI and the MVVM pattern. +- NEVER use emojis in code, including comments and log output. + + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..60fb268 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "fastlane" +gem "abbrev" +gem "ostruct" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..12a8057 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,343 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.8) + abbrev (0.1.2) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + artifactory (3.0.17) + atomos (0.1.3) + aws-eventstream (1.4.0) + aws-partitions (1.1258.0) + aws-sdk-core (3.251.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + bigdecimal + jmespath (~> 1, >= 1.6.1) + logger + aws-sdk-kms (1.129.0) + aws-sdk-core (~> 3, >= 3.248.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.225.0) + aws-sdk-core (~> 3, >= 3.248.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.12.1) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.2) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + csv (3.3.5) + declarative (0.0.20) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20240107) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.112.0) + faraday (1.10.5) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.8) + faraday (>= 0.8.0) + http-cookie (>= 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.1) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.4) + faraday_middleware (1.2.1) + faraday (~> 1.0) + fastimage (2.4.1) + fastlane (2.236.0) + CFPropertyList (>= 2.3, < 5.0.0) + abbrev (~> 0.1) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.197) + babosa (>= 1.0.3, < 2.0.0) + base64 (~> 0.2) + benchmark (>= 0.1.0) + bundler (>= 2.4.0, < 5.0.0) + colored (~> 1.2) + commander (~> 4.6) + csv (~> 3.3) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.1.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.3.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.10.3, < 4) + logger (>= 1.6, < 2.0) + mini_magick (>= 4.9.4, < 5.0.0) + multi_json (~> 1.12) + multipart-post (>= 2.0.0, < 3.0.0) + mutex_m (~> 0.3) + naturally (~> 2.2) + nkf (~> 0.2) + optparse (>= 0.1.1, < 1.0.0) + ostruct (>= 0.1.0) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.5) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.4.1) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-sirp (1.1.0) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.102.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-core (0.18.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (~> 1.9) + httpclient (>= 2.8.3, < 3.a) + mini_mime (~> 1.0) + mutex_m + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + google-apis-iamcredentials_v1 (0.27.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-playcustomapp_v1 (0.17.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-storage_v1 (0.63.0) + google-apis-core (>= 0.15.0, < 2.a) + google-cloud-core (1.8.0) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (2.2.2) + base64 (~> 0.2) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.6.0) + google-cloud-storage (1.60.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-core (>= 0.18, < 2) + google-apis-iamcredentials_v1 (~> 0.18) + google-apis-storage_v1 (>= 0.42) + google-cloud-core (~> 1.6) + googleauth (~> 1.9) + mini_mime (~> 1.0) + google-logging-utils (0.2.0) + googleauth (1.17.0) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + jwt (>= 1.4, < 4.0) + os (>= 0.9, < 2.0) + pstore (~> 0.1) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.8) + domain_name (~> 0.5) + httpclient (2.9.0) + mutex_m + jmespath (1.6.2) + json (2.19.8) + jwt (3.2.0) + base64 + logger (1.7.0) + mini_magick (4.13.2) + mini_mime (1.1.5) + multi_json (1.21.1) + multipart-post (2.4.1) + mutex_m (0.3.0) + nanaimo (0.4.0) + naturally (2.3.0) + nkf (0.2.0) + optparse (0.8.1) + os (1.1.4) + ostruct (0.6.3) + plist (3.7.2) + pstore (0.2.1) + public_suffix (7.0.5) + rake (13.4.2) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.8.0) + rexml (3.4.4) + rouge (3.28.0) + ruby2_keywords (0.0.5) + rubyzip (2.4.1) + security (0.1.5) + signet (0.22.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 4.0) + simctl (1.6.10) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (2.6.0) + word_wrap (1.0.0) + xcodeproj (1.27.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.4.0) + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + arm64-darwin-25 + ruby + +DEPENDENCIES + abbrev + fastlane + ostruct + +CHECKSUMS + CFPropertyList (3.0.8) sha256=2c99d0d980536d3d7ab252f7bd59ac8be50fbdd1ff487c98c949bb66bb114261 + abbrev (0.1.2) sha256=ad1b4eaaaed4cb722d5684d63949e4bde1d34f2a95e20db93aecfe7cbac74242 + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + artifactory (3.0.17) sha256=3023d5c964c31674090d655a516f38ca75665c15084140c08b7f2841131af263 + atomos (0.1.3) sha256=7d43b22f2454a36bace5532d30785b06de3711399cb1c6bf932573eda536789f + aws-eventstream (1.4.0) sha256=116bf85c436200d1060811e6f5d2d40c88f65448f2125bc77ffce5121e6e183b + aws-partitions (1.1258.0) sha256=3fee017570594ecf5e7f4c845b115fef8000530e57bdaf2b927357e5bf08967f + aws-sdk-core (3.251.0) sha256=ef8186cb5509147e590310da58fab4c5b0901eba0e85a72955abdf772e425c87 + aws-sdk-kms (1.129.0) sha256=363f548df321f4a4fcfd05523384e591060b400f8e65133ed7ef0793155a3343 + aws-sdk-s3 (1.225.0) sha256=734752cc77e369c645ff5285b70ff5af207b0dcd3388346de2f727cd4e943924 + aws-sigv4 (1.12.1) sha256=6973ff95cb0fd0dc58ba26e90e9510a2219525d07620c8babeb70ef831826c00 + babosa (1.0.4) sha256=18dea450f595462ed7cb80595abd76b2e535db8c91b350f6c4b3d73986c5bc99 + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + claide (1.1.0) sha256=6d3c5c089dde904d96aa30e73306d0d4bd444b1accb9b3125ce14a3c0183f82e + colored (1.2) sha256=9d82b47ac589ce7f6cab64b1f194a2009e9fd00c326a5357321f44afab2c1d2c + colored2 (3.1.2) sha256=b13c2bd7eeae2cf7356a62501d398e72fde78780bd26aec6a979578293c28b4a + commander (4.6.0) sha256=7d1ddc3fccae60cc906b4131b916107e2ef0108858f485fdda30610c0f2913d9 + csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f + declarative (0.0.20) sha256=8021dd6cb17ab2b61233c56903d3f5a259c5cf43c80ff332d447d395b17d9ff9 + digest-crc (0.7.0) sha256=64adc23a26a241044cbe6732477ca1b3c281d79e2240bcff275a37a5a0d78c07 + domain_name (0.6.20240107) sha256=5f693b2215708476517479bf2b3802e49068ad82167bcd2286f899536a17d933 + dotenv (2.8.1) sha256=c5944793349ae03c432e1780a2ca929d60b88c7d14d52d630db0508c3a8a17d8 + emoji_regex (3.2.3) sha256=ecd8be856b7691406c6bf3bb3a5e55d6ed683ffab98b4aa531bb90e1ddcc564b + excon (0.112.0) sha256=daf9ac3a4c2fc9aa48383a33da77ecb44fa395111e973084d5c52f6f214ae0f0 + faraday (1.10.5) sha256=b144f1d2b045652fa820b5f532723e1643cc28b93dae911d784e5c5f88e8f6ed + faraday-cookie_jar (0.0.8) sha256=0140605823f8cc63c7028fccee486aaed8e54835c360cffc1f7c8c07c4299dbb + faraday-em_http (1.0.0) sha256=7a3d4c7079789121054f57e08cd4ef7e40ad1549b63101f38c7093a9d6c59689 + faraday-em_synchrony (1.0.1) sha256=bf3ce45dcf543088d319ab051f80985ea6d294930635b7a0b966563179f81750 + faraday-excon (1.1.0) sha256=b055c842376734d7f74350fe8611542ae2000c5387348d9ba9708109d6e40940 + faraday-httpclient (1.0.1) sha256=4c8ff1f0973ff835be8d043ef16aaf54f47f25b7578f6d916deee8399a04d33b + faraday-multipart (1.2.0) sha256=7d89a949693714176f612323ca13746a2ded204031a6ba528adee788694ef757 + faraday-net_http (1.0.2) sha256=63992efea42c925a20818cf3c0830947948541fdcf345842755510d266e4c682 + faraday-net_http_persistent (1.2.0) sha256=0b0cbc8f03dab943c3e1cc58d8b7beb142d9df068b39c718cd83e39260348335 + faraday-patron (1.0.0) sha256=dc2cd7b340bb3cc8e36bcb9e6e7eff43d134b6d526d5f3429c7a7680ddd38fa7 + faraday-rack (1.0.0) sha256=ef60ec969a2bb95b8dbf24400155aee64a00fc8ba6c6a4d3968562bcc92328c0 + faraday-retry (1.0.4) sha256=dc659233777fabf96c69c2ffe56c0a5d2c102af90321a42cc6c90157bcd716aa + faraday_middleware (1.2.1) sha256=d45b78c8ee864c4783fbc276f845243d4a7918a67301c052647bacabec0529e9 + fastimage (2.4.1) sha256=c64bebd46b6fd8943ab70c1e6e85ff728f970f2e48f92ecd249b6bc3a540ad20 + fastlane (2.236.0) sha256=a496b8235ebce61c6311ca4cc1fd274b599e497f65d3035d7cb409d5591150d8 + fastlane-sirp (1.1.0) sha256=10bc94f9682efd8e1badfb31452a76dd8981f1f3a33717c765fde6d75b54d847 + gh_inspector (1.1.3) sha256=04cca7171b87164e053aa43147971d3b7f500fcb58177698886b48a9fc4a1939 + google-apis-androidpublisher_v3 (0.102.0) sha256=562415c44bd7f81cc808abbea11845ede16cdc3696d95f95efcf50aaffb159cf + google-apis-core (0.18.0) sha256=96b057816feeeab448139ed5b5c78eab7fc2a9d8958f0fbc8217dedffad054ee + google-apis-iamcredentials_v1 (0.27.0) sha256=9289f29968610754ef11d98b9ec627f0153f3e2616fef839aef096de529f6d1e + google-apis-playcustomapp_v1 (0.17.0) sha256=d5bc90b705f3f862bab4998086449b0abe704ee1685a84821daa90ca7fa95a78 + google-apis-storage_v1 (0.63.0) sha256=7063a6c19c40f5ef96d5894df33c4f9ac915e3107e632b1870ba5247e3bb633f + google-cloud-core (1.8.0) sha256=e572edcbf189cfcab16590628a516cec3f4f63454b730e59f0b36575120281cf + google-cloud-env (2.2.2) sha256=94bed40e05a67e9468ce1cb38389fba9a90aa8fc62fc9e173204c1dca59e21e7 + google-cloud-errors (1.6.0) sha256=1da8476dd706ad04b9d32e3c4b90d07d3463b37d6407cb56d41342ea7647d0a1 + google-cloud-storage (1.60.0) sha256=b21b752d37945d678a4533be5ef4303f15d33a964d8bc709c7c41c3600f650db + google-logging-utils (0.2.0) sha256=675462b4ea5affa825a3442694ca2d75d0069455a1d0956127207498fca3df7b + googleauth (1.17.0) sha256=dbddcaa3b78469fa9392c0e784ab6d8f3f760a1e5f6c6dbbbaa44a612c4198b0 + highline (2.0.3) sha256=2ddd5c127d4692721486f91737307236fe005352d12a4202e26c48614f719479 + http-cookie (1.0.8) sha256=b14fe0445cf24bf9ae098633e9b8d42e4c07c3c1f700672b09fbfe32ffd41aa6 + httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8 + jmespath (1.6.2) sha256=238d774a58723d6c090494c8879b5e9918c19485f7e840f2c1c7532cf84ebcb1 + json (2.19.8) sha256=6354310fd76ef69b87d5bd1f38b40d730613baf90b6803d2d0a48f618d32dfaa + jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7 + logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 + mini_magick (4.13.2) sha256=71d6258e0e8a3d04a9a0a09784d5d857b403a198a51dd4f882510435eb95ddd9 + mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef + multi_json (1.21.1) sha256=e6126a31808e3b4d19f483c775ceac34df190dffa62adfb63a165ee14ba68080 + multipart-post (2.4.1) sha256=9872d03a8e552020ca096adadbf5e3cb1cd1cdd6acd3c161136b8a5737cdb4a8 + mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751 + nanaimo (0.4.0) sha256=faf069551bab17f15169c1f74a1c73c220657e71b6e900919897a10d991d0723 + naturally (2.3.0) sha256=459923cf76c2e6613048301742363200c3c7e4904c324097d54a67401e179e01 + nkf (0.2.0) sha256=fbc151bda025451f627fafdfcb3f4f13d0b22ae11f58c6d3a2939c76c5f5f126 + optparse (0.8.1) sha256=42bea10d53907ccff4f080a69991441d611fbf8733b60ed1ce9ee365ce03bd1a + os (1.1.4) sha256=57816d6a334e7bd6aed048f4b0308226c5fb027433b67d90a9ab435f35108d3f + ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912 + plist (3.7.2) sha256=d37a4527cc1116064393df4b40e1dbbc94c65fa9ca2eec52edf9a13616718a42 + pstore (0.2.1) sha256=03904d0f2c66579e96d1e6704cdabc0c88df7ea8ed8782d9f3569f6f6c702c1a + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + representable (3.2.0) sha256=cc29bf7eebc31653586849371a43ffe36c60b54b0a6365b5f7d95ec34d1ebace + retriable (3.8.0) sha256=9f2f1b0207594c7817f17f671587b8ec7587387ac6cebda6c941a802bb98a8e5 + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rouge (3.28.0) sha256=0d6de482c7624000d92697772ab14e48dca35629f8ddf3f4b21c99183fd70e20 + ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef + rubyzip (2.4.1) sha256=8577c88edc1fde8935eb91064c5cb1aef9ad5494b940cf19c775ee833e075615 + security (0.1.5) sha256=3a977a0eca7706e804c96db0dd9619e0a94969fe3aac9680fcfc2bf9b8a833b7 + signet (0.22.0) sha256=b76d495ccb07ad35dbc89f3e920665a9d8ed717141955034005d7843dcfe4780 + simctl (1.6.10) sha256=b99077f4d13ad81eace9f86bf5ba4df1b0b893a4d1b368bd3ed59b5b27f9236b + terminal-notifier (2.0.0) sha256=7a0d2b2212ab9835c07f4b2e22a94cff64149dba1eed203c04835f7991078cea + terminal-table (3.0.2) sha256=f951b6af5f3e00203fb290a669e0a85c5dd5b051b3b023392ccfd67ba5abae91 + trailblazer-option (0.1.2) sha256=20e4f12ea4e1f718c8007e7944ca21a329eee4eed9e0fa5dde6e8ad8ac4344a3 + tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48 + tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50 + tty-spinner (0.9.3) sha256=0e036f047b4ffb61f2aa45f5a770ec00b4d04130531558a94bfc5b192b570542 + uber (0.1.0) sha256=5beeb407ff807b5db994f82fa9ee07cfceaa561dad8af20be880bc67eba935dc + unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a + word_wrap (1.0.0) sha256=f556d4224c812e371000f12a6ee8102e0daa724a314c3f246afaad76d82accc7 + xcodeproj (1.27.0) sha256=8cc7a73b4505c227deab044dce118ede787041c702bc47636856a2e566f854d3 + xcpretty (0.4.1) sha256=b14c50e721f6589ee3d6f5353e2c2cfcd8541fa1ea16d6c602807dd7327f3892 + xcpretty-travis-formatter (1.0.1) sha256=aacc332f17cb7b2cba222994e2adc74223db88724fe76341483ad3098e232f93 + +BUNDLED WITH + 4.0.11 diff --git a/Localizable.xcstrings b/Localizable.xcstrings new file mode 100644 index 0000000..dc5be65 --- /dev/null +++ b/Localizable.xcstrings @@ -0,0 +1,343 @@ +{ + "sourceLanguage" : "en", + "strings" : { + "(%@)" : { + + }, + "%lld" : { + + }, + "%lld percent" : { + "comment" : "The accessibility value of the slider, which shows the current volume as a percentage.", + "isCommentAutoGenerated" : true + }, + "192.168.1.100" : { + + }, + "3000" : { + + }, + "About" : { + + }, + "Adjust the volume of every application on your Windows PC remotely. Turn the game down without leaving voice chat behind." : { + "comment" : "A description of the main feature of the app.", + "isCommentAutoGenerated" : true + }, + "App %@ · Server protocol v%lld" : { + "comment" : "A footer with the app version and server protocol version.", + "isCommentAutoGenerated" : true, + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "App %1$@ · Server protocol v%2$lld" + } + } + } + }, + "AUTO" : { + + }, + "Auto-discovered" : { + + }, + "Cancel" : { + + }, + "CHAT BALANCE ACTIVATED" : { + + }, + "Clear" : { + + }, + "Closes the intro tour" : { + "comment" : "A hint that appears when hovering over the \"Skip\" button in the intro tour.", + "isCommentAutoGenerated" : true + }, + "Connect" : { + "comment" : "A button label that says \"Connect\".", + "isCommentAutoGenerated" : true + }, + "Connect to %@" : { + "comment" : "A button that connects to a discovered or recently connected server. The label includes the server's IP address or hostname and, if available, the computer name.", + "isCommentAutoGenerated" : true + }, + "Connecting is automatic" : { + "comment" : "A description of how to connect to the PcVolumeControl server automatically.", + "isCommentAutoGenerated" : true + }, + "Connection Error" : { + + }, + "Connection lost – reconnecting…" : { + + }, + "Control your PC application volume from your iOS device." : { + + }, + "Control your PC's audio from your phone" : { + "comment" : "A title for the main feature of the app.", + "isCommentAutoGenerated" : true + }, + "Custom name" : { + + }, + "Custom Names" : { + + }, + "Delete" : { + + }, + "Disconnect" : { + + }, + "Don't have the PC server yet? Set it up" : { + + }, + "Done" : { + + }, + "Download PcVolumeControlWindows releases on GitHub" : { + "comment" : "A link that, when tapped, directs the user to the GitHub releases page for the PcVolumeControlWindows app.", + "isCommentAutoGenerated" : true + }, + "Edit Custom Name" : { + + }, + "Edit Name" : { + + }, + "Enter a custom name for \"%@\"" : { + + }, + "Enter new name" : { + + }, + "Find PcVolumeControl on GitHub" : { + "comment" : "A link that takes the user to the GitHub page for PcVolumeControl.", + "isCommentAutoGenerated" : true + }, + "Find us on GitHub" : { + "comment" : "A link that directs them to the GitHub page for PcVolumeControl.", + "isCommentAutoGenerated" : true + }, + "Get Started" : { + "comment" : "A button label that says \"Get Started\".", + "isCommentAutoGenerated" : true + }, + "Help" : { + "comment" : "A section header that links to help information.", + "isCommentAutoGenerated" : true + }, + "Leave" : { + + }, + "Make sure this device and PC are on the same network, the server is allowed through Windows Firewall, and no VPN is active on either device. VPNs often block local discovery." : { + "comment" : "A description of troubleshooting steps for connecting to the server.", + "isCommentAutoGenerated" : true + }, + "Manage Custom Names" : { + + }, + "Master Devices" : { + + }, + "Master mute" : { + + }, + "More options" : { + + }, + "Move the highlighted slider to automatically balance all other application volumes. Use the menu on any session to change which one is the chat balance control." : { + "comment" : "A description of how to use the chat balance feature.", + "isCommentAutoGenerated" : true + }, + "muted" : { + + }, + "No custom device names set" : { + + }, + "No custom session names set" : { + + }, + "off" : { + "comment" : "The accessibility label for when the toggle is off.", + "isCommentAutoGenerated" : true + }, + "OK" : { + + }, + "OK!" : { + "comment" : "The text on a button that dismisses a view.", + "isCommentAutoGenerated" : true + }, + "on" : { + "comment" : "A text string that describes a toggle as being \"on\".", + "isCommentAutoGenerated" : true + }, + "On the same Wi-Fi network, your PC appears in the server list with a green Wi-Fi badge. Tap it to connect, or enter an IP address and port manually." : { + "comment" : "A description of how to connect to the PcVolumeControl server.", + "isCommentAutoGenerated" : true + }, + "On your Windows PC, download the latest installer from GitHub." : { + "comment" : "A step in the guide that instructs the user to download the latest installer from GitHub.", + "isCommentAutoGenerated" : true + }, + "Opens a picker to choose the active output device" : { + + }, + "Opens the Windows server setup guide" : { + "comment" : "A hint that appears when hovering over the button to", + "isCommentAutoGenerated" : true + }, + "PC Server Setup Guide" : { + "comment" : "A link in the \"Help\" section of the settings view that directs the user to a guide on setting up a PC server.", + "isCommentAutoGenerated" : true + }, + "PC Volume Control" : { + + }, + "PcVolumeControl" : { + "comment" : "The accessibility label for the app logo.", + "isCommentAutoGenerated" : true + }, + "PcVolumeControl needs a small, free server running on your Windows PC. Set it up once and this app can find it automatically." : { + "comment" : "A description of the purpose of the Windows server.", + "isCommentAutoGenerated" : true + }, + "PcVolumeControlWindows releases" : { + "comment" : "A link label that, when tapped, takes the user to the GitHub releases page for the PcVolumeControlWindows repository.", + "isCommentAutoGenerated" : true + }, + "Please enter a valid TCP port (1-65535)" : { + + }, + "Port: %@" : { + + }, + "Preserve Session Order" : { + + }, + "Protocol Version: 7" : { + + }, + "Recent connection" : { + + }, + "Reconnect" : { + + }, + "Remove from Chat Balance" : { + + }, + "Rename" : { + + }, + "Replay Intro Tour" : { + "comment" : "A button that, when pressed, replays the introductory tour.", + "isCommentAutoGenerated" : true + }, + "Run the installer, then start the server. If Windows Firewall asks, click Allow so the server can accept connections on private networks." : { + "comment" : "A step in the guide that instructs the user to run the installer and start the server, with a note about Windows Firewall.", + "isCommentAutoGenerated" : true + }, + "Save" : { + + }, + "Select master device" : { + + }, + "Select Master Device" : { + + }, + "Server disconnected" : { + + }, + "Server IP or Hostname" : { + + }, + "Server Port" : { + + }, + "Session Preferences" : { + + }, + "Sessions" : { + + }, + "Set as Chat Balance" : { + + }, + "Set Custom Name" : { + + }, + "Set Master Device Name" : { + + }, + "Set Up Your PC" : { + "comment" : "The title of the view.", + "isCommentAutoGenerated" : true + }, + "Settings" : { + + }, + "Share download link" : { + "comment" : "A button label that allows users to share the download link to open on their PC.", + "isCommentAutoGenerated" : true + }, + "Share the download link to open on your PC" : { + "comment" : "A button that allows the user to share the download link to open the PcVolumeControlWindows installer on their PC.", + "isCommentAutoGenerated" : true + }, + "Show me how to set it up" : { + "comment" : "A button label that directs the user to follow the server setup guide.", + "isCommentAutoGenerated" : true + }, + "Skip" : { + "comment" : "A button that lets a user skip the first-launch welcome tour.", + "isCommentAutoGenerated" : true + }, + "The server window shows your PC's IP address and port. The default port is 3000." : { + "comment" : "A description of how to find the IP address and port of the server.", + "isCommentAutoGenerated" : true + }, + "This app talks to the PcVolumeControl server, a small program that runs on your Windows PC." : { + "comment" : "A description of how the app interacts with the server.", + "isCommentAutoGenerated" : true + }, + "Trouble connecting?" : { + "comment" : "A heading that appears below the main content, explaining that there may be issues connecting.", + "isCommentAutoGenerated" : true + }, + "unmuted" : { + + }, + "Version 2.0.0" : { + + }, + "We're open source. Report bugs, ask questions, or submit pull requests on GitHub!" : { + + }, + "When enabled, your manually arranged session order will be preserved when you restart the app." : { + + }, + "With your device on the same Wi-Fi network as the PC, your computer usually appears in the server list automatically. Otherwise, type the IP address and port manually." : { + "comment" : "A description of how to manually enter a server's IP address and port if it isn't automatically detected.", + "isCommentAutoGenerated" : true + }, + "You can also do this later from the connection screen." : { + "comment" : "A footnote explaining that users can set up the server later from the connection screen.", + "isCommentAutoGenerated" : true + }, + "You can create custom names for both devices and sessions by tapping their names or using the pencil icons." : { + + }, + "Your PC needs the free server" : { + "comment" : "A heading that explains that the user's PC needs a free server to function.", + "isCommentAutoGenerated" : true + } + }, + "version" : "1.1" +} \ No newline at end of file diff --git a/PcVolumeControl.xcodeproj/project.pbxproj b/PcVolumeControl.xcodeproj/project.pbxproj index bdab710..8973218 100644 --- a/PcVolumeControl.xcodeproj/project.pbxproj +++ b/PcVolumeControl.xcodeproj/project.pbxproj @@ -3,71 +3,35 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ - 348891E8769139D2690DB42B /* Pods_PcVolumeControlTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F56215ED55A4131802149D7F /* Pods_PcVolumeControlTests.framework */; }; - 5550754A39B693CAFC993140 /* Pods_PcVolumeControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 99C84E6328E6B3ED66F99F6E /* Pods_PcVolumeControl.framework */; }; - A927E14B1FC53AB10024D526 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A927E14A1FC53AB10024D526 /* AppDelegate.swift */; }; - A927E14D1FC53AB10024D526 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A927E14C1FC53AB10024D526 /* ViewController.swift */; }; - A927E1501FC53AB10024D526 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A927E14E1FC53AB10024D526 /* Main.storyboard */; }; A927E1521FC53AB10024D526 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A927E1511FC53AB10024D526 /* Assets.xcassets */; }; - A92F6C8520105AEA0045180F /* Icon-100.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6720105AEA0045180F /* Icon-100.png */; }; - A92F6C8620105AEA0045180F /* Icon-1024.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6820105AEA0045180F /* Icon-1024.png */; }; - A92F6C8720105AEA0045180F /* Icon-114.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6920105AEA0045180F /* Icon-114.png */; }; - A92F6C8820105AEA0045180F /* Icon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6A20105AEA0045180F /* Icon-120.png */; }; - A92F6C8920105AEA0045180F /* Icon-128.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6B20105AEA0045180F /* Icon-128.png */; }; - A92F6C8A20105AEA0045180F /* Icon-144.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6C20105AEA0045180F /* Icon-144.png */; }; - A92F6C8B20105AEA0045180F /* Icon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6D20105AEA0045180F /* Icon-152.png */; }; - A92F6C8C20105AEA0045180F /* Icon-16.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6E20105AEA0045180F /* Icon-16.png */; }; - A92F6C8D20105AEA0045180F /* Icon-167.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C6F20105AEA0045180F /* Icon-167.png */; }; - A92F6C8E20105AEA0045180F /* Icon-172.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7020105AEA0045180F /* Icon-172.png */; }; - A92F6C8F20105AEA0045180F /* Icon-180.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7120105AEA0045180F /* Icon-180.png */; }; - A92F6C9020105AEA0045180F /* Icon-196.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7220105AEA0045180F /* Icon-196.png */; }; - A92F6C9120105AEA0045180F /* Icon-20.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7320105AEA0045180F /* Icon-20.png */; }; - A92F6C9220105AEA0045180F /* Icon-256.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7420105AEA0045180F /* Icon-256.png */; }; - A92F6C9320105AEA0045180F /* Icon-29.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7520105AEA0045180F /* Icon-29.png */; }; - A92F6C9420105AEA0045180F /* Icon-32.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7620105AEA0045180F /* Icon-32.png */; }; - A92F6C9520105AEA0045180F /* Icon-40.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7720105AEA0045180F /* Icon-40.png */; }; - A92F6C9620105AEA0045180F /* Icon-48.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7820105AEA0045180F /* Icon-48.png */; }; - A92F6C9720105AEA0045180F /* Icon-50.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7920105AEA0045180F /* Icon-50.png */; }; - A92F6C9820105AEA0045180F /* Icon-512.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7A20105AEA0045180F /* Icon-512.png */; }; - A92F6C9920105AEA0045180F /* Icon-55.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7B20105AEA0045180F /* Icon-55.png */; }; - A92F6C9A20105AEA0045180F /* Icon-57.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7C20105AEA0045180F /* Icon-57.png */; }; - A92F6C9B20105AEA0045180F /* Icon-58.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7D20105AEA0045180F /* Icon-58.png */; }; - A92F6C9C20105AEA0045180F /* Icon-60.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7E20105AEA0045180F /* Icon-60.png */; }; - A92F6C9D20105AEA0045180F /* Icon-64.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C7F20105AEA0045180F /* Icon-64.png */; }; - A92F6C9E20105AEA0045180F /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C8020105AEA0045180F /* Icon-72.png */; }; - A92F6C9F20105AEA0045180F /* Icon-76.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C8120105AEA0045180F /* Icon-76.png */; }; - A92F6CA020105AEA0045180F /* Icon-80.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C8220105AEA0045180F /* Icon-80.png */; }; - A92F6CA120105AEA0045180F /* Icon-87.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C8320105AEA0045180F /* Icon-87.png */; }; - A92F6CA220105AEA0045180F /* Icon-88.png in Resources */ = {isa = PBXBuildFile; fileRef = A92F6C8420105AEA0045180F /* Icon-88.png */; }; - A952C1661FE8D3A6002559B3 /* Alert.swift in Sources */ = {isa = PBXBuildFile; fileRef = A952C1651FE8D3A6002559B3 /* Alert.swift */; }; - A971F2471FF1DA5D00AD9167 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A971F2461FF1DA5D00AD9167 /* Launch Screen.storyboard */; }; - A971F2491FF2ABBB00AD9167 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A971F2481FF2ABBB00AD9167 /* AboutViewController.swift */; }; - A971F24B1FF2B52C00AD9167 /* black-on-white.png in Resources */ = {isa = PBXBuildFile; fileRef = A971F24A1FF2B52B00AD9167 /* black-on-white.png */; }; - A971F24D1FF2BD4C00AD9167 /* DesignableSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A971F24C1FF2BD4C00AD9167 /* DesignableSlider.swift */; }; - A971F2511FF2BDE800AD9167 /* volume-thumbslider.png in Resources */ = {isa = PBXBuildFile; fileRef = A971F2501FF2BDE800AD9167 /* volume-thumbslider.png */; }; - A97414AB1FDF98BC00062954 /* SliderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97414AA1FDF98BC00062954 /* SliderCell.swift */; }; - A97414AD1FE629AC00062954 /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = A97414AC1FE629AC00062954 /* Session.swift */; }; - A9A25CCE1FEB61DD009C985B /* StreamController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A25CCD1FEB61DD009C985B /* StreamController.swift */; }; - A9AC32CA1FECEF1400D385A8 /* pcvg logo.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AC32C91FECEF1400D385A8 /* pcvg logo.png */; }; - A9AC32CC1FECF78400D385A8 /* pcvg logo square.png in Resources */ = {isa = PBXBuildFile; fileRef = A9AC32CB1FECF78400D385A8 /* pcvg logo square.png */; }; - A9B66A231FECE1910051C4C5 /* ViewControllerStart.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B66A221FECE1910051C4C5 /* ViewControllerStart.swift */; }; - A9FDBC6F1FECFCE300DAE6D7 /* pcvg logo square in Resources */ = {isa = PBXBuildFile; fileRef = A9FDBC6E1FECFCE300DAE6D7 /* pcvg logo square */; }; - EEDA50CCF6A917C7E1D4A1CD /* Pods_PcVolumeControlUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D95E22BFE1DA0B3954E6D2E7 /* Pods_PcVolumeControlUITests.framework */; }; + A92ED6E32CE92F1A00D40FC4 /* PCVolumeControlApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A92ED6DA2CE92F1A00D40FC4 /* PCVolumeControlApp.swift */; }; + A9B17AC0000000000000B001 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = A9B17AC0000000000000F001 /* PrivacyInfo.xcprivacy */; }; + A9B31EA52DF0F3DB00117327 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = A9B31EA42DF0F3DB00117327 /* Localizable.xcstrings */; }; + A9F9DEBB2EA59F28003FC66E /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F9DEBA2EA59F28003FC66E /* WidgetKit.framework */; }; + A9F9DEBD2EA59F28003FC66E /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9F9DEBC2EA59F28003FC66E /* SwiftUI.framework */; }; + A9F9DECE2EA59F2A003FC66E /* PcVolumeControlWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A9F9DEB82EA59F28003FC66E /* PcVolumeControlWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - A927E15C1FC53AB10024D526 /* PBXContainerItemProxy */ = { + A9B31EBF2DF108B200117327 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A927E13F1FC53AB10024D526 /* Project object */; proxyType = 1; remoteGlobalIDString = A927E1461FC53AB10024D526; remoteInfo = PcVolumeControl; }; - A927E1671FC53AB10024D526 /* PBXContainerItemProxy */ = { + A9F9DECC2EA59F2A003FC66E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A927E13F1FC53AB10024D526 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A9F9DEB72EA59F28003FC66E; + remoteInfo = PcVolumeControlWidgetExtension; + }; + B1000008000000000000AA01 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A927E13F1FC53AB10024D526 /* Project object */; proxyType = 1; @@ -76,127 +40,132 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + A9F9DED32EA59F2A003FC66E /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + A9F9DECE2EA59F2A003FC66E /* PcVolumeControlWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - 086A605B7329CBA602164155 /* Pods-PcVolumeControlUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControlUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests.release.xcconfig"; sourceTree = ""; }; - 0BA2255E57FA4C02678D5451 /* Pods-PcVolumeControl.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControl.release.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl.release.xcconfig"; sourceTree = ""; }; - 495F5F7A5E85DDCE697DD73B /* Pods-PcVolumeControlTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControlTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests.release.xcconfig"; sourceTree = ""; }; - 784048895FDEE72E5BF0656F /* Pods-PcVolumeControl.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControl.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl.debug.xcconfig"; sourceTree = ""; }; - 99C84E6328E6B3ED66F99F6E /* Pods_PcVolumeControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A927E1471FC53AB10024D526 /* PcVolumeControl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PcVolumeControl.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A927E14A1FC53AB10024D526 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - A927E14C1FC53AB10024D526 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - A927E14F1FC53AB10024D526 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; A927E1511FC53AB10024D526 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; A927E1561FC53AB10024D526 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A927E15B1FC53AB10024D526 /* PcVolumeControlTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PcVolumeControlTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A927E1661FC53AB10024D526 /* PcVolumeControlUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PcVolumeControlUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A92F6C6720105AEA0045180F /* Icon-100.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-100.png"; sourceTree = ""; }; - A92F6C6820105AEA0045180F /* Icon-1024.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-1024.png"; sourceTree = ""; }; - A92F6C6920105AEA0045180F /* Icon-114.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-114.png"; sourceTree = ""; }; - A92F6C6A20105AEA0045180F /* Icon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-120.png"; sourceTree = ""; }; - A92F6C6B20105AEA0045180F /* Icon-128.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-128.png"; sourceTree = ""; }; - A92F6C6C20105AEA0045180F /* Icon-144.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-144.png"; sourceTree = ""; }; - A92F6C6D20105AEA0045180F /* Icon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-152.png"; sourceTree = ""; }; - A92F6C6E20105AEA0045180F /* Icon-16.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-16.png"; sourceTree = ""; }; - A92F6C6F20105AEA0045180F /* Icon-167.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-167.png"; sourceTree = ""; }; - A92F6C7020105AEA0045180F /* Icon-172.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-172.png"; sourceTree = ""; }; - A92F6C7120105AEA0045180F /* Icon-180.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-180.png"; sourceTree = ""; }; - A92F6C7220105AEA0045180F /* Icon-196.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-196.png"; sourceTree = ""; }; - A92F6C7320105AEA0045180F /* Icon-20.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-20.png"; sourceTree = ""; }; - A92F6C7420105AEA0045180F /* Icon-256.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-256.png"; sourceTree = ""; }; - A92F6C7520105AEA0045180F /* Icon-29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-29.png"; sourceTree = ""; }; - A92F6C7620105AEA0045180F /* Icon-32.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-32.png"; sourceTree = ""; }; - A92F6C7720105AEA0045180F /* Icon-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-40.png"; sourceTree = ""; }; - A92F6C7820105AEA0045180F /* Icon-48.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-48.png"; sourceTree = ""; }; - A92F6C7920105AEA0045180F /* Icon-50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-50.png"; sourceTree = ""; }; - A92F6C7A20105AEA0045180F /* Icon-512.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-512.png"; sourceTree = ""; }; - A92F6C7B20105AEA0045180F /* Icon-55.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-55.png"; sourceTree = ""; }; - A92F6C7C20105AEA0045180F /* Icon-57.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-57.png"; sourceTree = ""; }; - A92F6C7D20105AEA0045180F /* Icon-58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-58.png"; sourceTree = ""; }; - A92F6C7E20105AEA0045180F /* Icon-60.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-60.png"; sourceTree = ""; }; - A92F6C7F20105AEA0045180F /* Icon-64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-64.png"; sourceTree = ""; }; - A92F6C8020105AEA0045180F /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; }; - A92F6C8120105AEA0045180F /* Icon-76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-76.png"; sourceTree = ""; }; - A92F6C8220105AEA0045180F /* Icon-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-80.png"; sourceTree = ""; }; - A92F6C8320105AEA0045180F /* Icon-87.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-87.png"; sourceTree = ""; }; - A92F6C8420105AEA0045180F /* Icon-88.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-88.png"; sourceTree = ""; }; - A952C1651FE8D3A6002559B3 /* Alert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alert.swift; sourceTree = ""; }; - A971F2461FF1DA5D00AD9167 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; - A971F2481FF2ABBB00AD9167 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; - A971F24A1FF2B52B00AD9167 /* black-on-white.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "black-on-white.png"; path = "../../../../Desktop/pcvc_images/black-on-white.png"; sourceTree = ""; }; - A971F24C1FF2BD4C00AD9167 /* DesignableSlider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DesignableSlider.swift; sourceTree = ""; }; - A971F2501FF2BDE800AD9167 /* volume-thumbslider.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "volume-thumbslider.png"; path = "../../../../Desktop/pcvc_images/volume-thumbslider.png"; sourceTree = ""; }; - A97414AA1FDF98BC00062954 /* SliderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderCell.swift; sourceTree = ""; }; - A97414AC1FE629AC00062954 /* Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Session.swift; sourceTree = ""; }; - A9A25CCD1FEB61DD009C985B /* StreamController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamController.swift; sourceTree = ""; }; - A9AC32C91FECEF1400D385A8 /* pcvg logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "pcvg logo.png"; path = "../../../../Desktop/pcvc_images/pcvg logo.png"; sourceTree = ""; }; - A9AC32CB1FECF78400D385A8 /* pcvg logo square.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "pcvg logo square.png"; path = "../../../../Desktop/pcvc_images/pcvg logo square.png"; sourceTree = ""; }; - A9B66A221FECE1910051C4C5 /* ViewControllerStart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerStart.swift; sourceTree = ""; }; - A9FDBC6E1FECFCE300DAE6D7 /* pcvg logo square */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "pcvg logo square"; path = "../../../../Desktop/pcvg logo square"; sourceTree = ""; }; - BC0C05349FA2A35B69E7936E /* Pods-PcVolumeControlUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControlUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests.debug.xcconfig"; sourceTree = ""; }; - D95E22BFE1DA0B3954E6D2E7 /* Pods_PcVolumeControlUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControlUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E497C089C2FB3C823939B7C5 /* Pods-PcVolumeControlTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PcVolumeControlTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests.debug.xcconfig"; sourceTree = ""; }; - F56215ED55A4131802149D7F /* Pods_PcVolumeControlTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControlTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A92ED6DA2CE92F1A00D40FC4 /* PCVolumeControlApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PCVolumeControlApp.swift; sourceTree = ""; }; + A9B17AC0000000000000F001 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + A9B31EA42DF0F3DB00117327 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; + A9B31EBB2DF108B200117327 /* PcVolumeControlTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PcVolumeControlTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F9DEB32EA59EE5003FC66E /* PcVolumeControl.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PcVolumeControl.entitlements; sourceTree = ""; }; + A9F9DEB82EA59F28003FC66E /* PcVolumeControlWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PcVolumeControlWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + A9F9DEBA2EA59F28003FC66E /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + A9F9DEBC2EA59F28003FC66E /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + A9F9DED42EA5A056003FC66E /* PcVolumeControlWidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PcVolumeControlWidgetExtension.entitlements; sourceTree = ""; }; + B1000001000000000000AA01 /* PcVolumeControlUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PcVolumeControlUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + A9B31E692DF00FCE00117327 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + SavedServerManager.swift, + ); + target = A927E1461FC53AB10024D526 /* PcVolumeControl */; + }; + A9B31EC82DF1193C00117327 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = A9B31EBA2DF108B200117327 /* PcVolumeControlTests */; + }; + A9F9DED22EA59F2A003FC66E /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = A9F9DEB72EA59F28003FC66E /* PcVolumeControlWidgetExtension */; + }; + A9F9DED62EA5A125003FC66E /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Log.swift, + SharedConnectionState.swift, + ); + target = A9F9DEB72EA59F28003FC66E /* PcVolumeControlWidgetExtension */; + }; + B1000003000000000000AA01 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = B1000007000000000000AA01 /* PcVolumeControlUITests */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + A9B31E642DECC25900117327 /* models */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (A9F9DED62EA5A125003FC66E /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = models; sourceTree = ""; }; + A9B31E652DF00C4800117327 /* datasources */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = datasources; sourceTree = ""; }; + A9B31E662DF00C7B00117327 /* views */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = views; sourceTree = ""; }; + A9B31E672DF00C8A00117327 /* repos */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (A9B31E692DF00FCE00117327 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = repos; sourceTree = ""; }; + A9B31E7E2DF01A1500117327 /* usecases */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = usecases; sourceTree = ""; }; + A9B31EBC2DF108B200117327 /* PcVolumeControlTests */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (A9B31EC82DF1193C00117327 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = PcVolumeControlTests; sourceTree = ""; }; + A9C1EAD12DF01A1500117327 /* viewmodels */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = viewmodels; sourceTree = ""; }; + A9F9DEBE2EA59F28003FC66E /* PcVolumeControlWidget */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (A9F9DED22EA59F2A003FC66E /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = PcVolumeControlWidget; sourceTree = ""; }; + B1000002000000000000AA01 /* PcVolumeControlUITests */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (B1000003000000000000AA01 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = PcVolumeControlUITests; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ A927E1441FC53AB10024D526 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5550754A39B693CAFC993140 /* Pods_PcVolumeControl.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1581FC53AB10024D526 /* Frameworks */ = { + A9B31EB82DF108B200117327 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9F9DEB52EA59F28003FC66E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 348891E8769139D2690DB42B /* Pods_PcVolumeControlTests.framework in Frameworks */, + A9F9DEBD2EA59F28003FC66E /* SwiftUI.framework in Frameworks */, + A9F9DEBB2EA59F28003FC66E /* WidgetKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1631FC53AB10024D526 /* Frameworks */ = { + B1000004000000000000AA01 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EEDA50CCF6A917C7E1D4A1CD /* Pods_PcVolumeControlUITests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 05289F2B48ABC96006296323 /* Pods */ = { - isa = PBXGroup; - children = ( - 784048895FDEE72E5BF0656F /* Pods-PcVolumeControl.debug.xcconfig */, - 0BA2255E57FA4C02678D5451 /* Pods-PcVolumeControl.release.xcconfig */, - E497C089C2FB3C823939B7C5 /* Pods-PcVolumeControlTests.debug.xcconfig */, - 495F5F7A5E85DDCE697DD73B /* Pods-PcVolumeControlTests.release.xcconfig */, - BC0C05349FA2A35B69E7936E /* Pods-PcVolumeControlUITests.debug.xcconfig */, - 086A605B7329CBA602164155 /* Pods-PcVolumeControlUITests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 9C6066ABCCE4BFEE4290D8AC /* Frameworks */ = { - isa = PBXGroup; - children = ( - 99C84E6328E6B3ED66F99F6E /* Pods_PcVolumeControl.framework */, - F56215ED55A4131802149D7F /* Pods_PcVolumeControlTests.framework */, - D95E22BFE1DA0B3954E6D2E7 /* Pods_PcVolumeControlUITests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; A927E13E1FC53AB10024D526 = { isa = PBXGroup; children = ( + A9F9DED42EA5A056003FC66E /* PcVolumeControlWidgetExtension.entitlements */, + A9B31EA42DF0F3DB00117327 /* Localizable.xcstrings */, A927E1491FC53AB10024D526 /* PcVolumeControl */, + A9B31EBC2DF108B200117327 /* PcVolumeControlTests */, + A9F9DEBE2EA59F28003FC66E /* PcVolumeControlWidget */, + B1000002000000000000AA01 /* PcVolumeControlUITests */, + A9F9DEB92EA59F28003FC66E /* Frameworks */, A927E1481FC53AB10024D526 /* Products */, - 05289F2B48ABC96006296323 /* Pods */, - 9C6066ABCCE4BFEE4290D8AC /* Frameworks */, ); sourceTree = ""; }; @@ -204,8 +173,9 @@ isa = PBXGroup; children = ( A927E1471FC53AB10024D526 /* PcVolumeControl.app */, - A927E15B1FC53AB10024D526 /* PcVolumeControlTests.xctest */, - A927E1661FC53AB10024D526 /* PcVolumeControlUITests.xctest */, + A9B31EBB2DF108B200117327 /* PcVolumeControlTests.xctest */, + A9F9DEB82EA59F28003FC66E /* PcVolumeControlWidgetExtension.appex */, + B1000001000000000000AA01 /* PcVolumeControlUITests.xctest */, ); name = Products; sourceTree = ""; @@ -213,64 +183,28 @@ A927E1491FC53AB10024D526 /* PcVolumeControl */ = { isa = PBXGroup; children = ( - A92F6C6620105AEA0045180F /* iosicons */, - A971F2461FF1DA5D00AD9167 /* Launch Screen.storyboard */, - A927E14E1FC53AB10024D526 /* Main.storyboard */, - A9B66A221FECE1910051C4C5 /* ViewControllerStart.swift */, - A927E14C1FC53AB10024D526 /* ViewController.swift */, - A971F2481FF2ABBB00AD9167 /* AboutViewController.swift */, - A9A25CCD1FEB61DD009C985B /* StreamController.swift */, - A97414AA1FDF98BC00062954 /* SliderCell.swift */, - A97414AC1FE629AC00062954 /* Session.swift */, - A971F24C1FF2BD4C00AD9167 /* DesignableSlider.swift */, - A952C1651FE8D3A6002559B3 /* Alert.swift */, - A927E14A1FC53AB10024D526 /* AppDelegate.swift */, + A9F9DEB32EA59EE5003FC66E /* PcVolumeControl.entitlements */, + A9B31E7E2DF01A1500117327 /* usecases */, + A9B31E672DF00C8A00117327 /* repos */, + A9B31E662DF00C7B00117327 /* views */, + A9B31E652DF00C4800117327 /* datasources */, + A9B31E642DECC25900117327 /* models */, + A9C1EAD12DF01A1500117327 /* viewmodels */, A927E1511FC53AB10024D526 /* Assets.xcassets */, - A9FDBC6E1FECFCE300DAE6D7 /* pcvg logo square */, A927E1561FC53AB10024D526 /* Info.plist */, - A971F24A1FF2B52B00AD9167 /* black-on-white.png */, - A971F2501FF2BDE800AD9167 /* volume-thumbslider.png */, - A9AC32CB1FECF78400D385A8 /* pcvg logo square.png */, - A9AC32C91FECEF1400D385A8 /* pcvg logo.png */, + A9B17AC0000000000000F001 /* PrivacyInfo.xcprivacy */, + A92ED6DA2CE92F1A00D40FC4 /* PCVolumeControlApp.swift */, ); path = PcVolumeControl; sourceTree = ""; }; - A92F6C6620105AEA0045180F /* iosicons */ = { + A9F9DEB92EA59F28003FC66E /* Frameworks */ = { isa = PBXGroup; children = ( - A92F6C6720105AEA0045180F /* Icon-100.png */, - A92F6C6820105AEA0045180F /* Icon-1024.png */, - A92F6C6920105AEA0045180F /* Icon-114.png */, - A92F6C6A20105AEA0045180F /* Icon-120.png */, - A92F6C6B20105AEA0045180F /* Icon-128.png */, - A92F6C6C20105AEA0045180F /* Icon-144.png */, - A92F6C6D20105AEA0045180F /* Icon-152.png */, - A92F6C6E20105AEA0045180F /* Icon-16.png */, - A92F6C6F20105AEA0045180F /* Icon-167.png */, - A92F6C7020105AEA0045180F /* Icon-172.png */, - A92F6C7120105AEA0045180F /* Icon-180.png */, - A92F6C7220105AEA0045180F /* Icon-196.png */, - A92F6C7320105AEA0045180F /* Icon-20.png */, - A92F6C7420105AEA0045180F /* Icon-256.png */, - A92F6C7520105AEA0045180F /* Icon-29.png */, - A92F6C7620105AEA0045180F /* Icon-32.png */, - A92F6C7720105AEA0045180F /* Icon-40.png */, - A92F6C7820105AEA0045180F /* Icon-48.png */, - A92F6C7920105AEA0045180F /* Icon-50.png */, - A92F6C7A20105AEA0045180F /* Icon-512.png */, - A92F6C7B20105AEA0045180F /* Icon-55.png */, - A92F6C7C20105AEA0045180F /* Icon-57.png */, - A92F6C7D20105AEA0045180F /* Icon-58.png */, - A92F6C7E20105AEA0045180F /* Icon-60.png */, - A92F6C7F20105AEA0045180F /* Icon-64.png */, - A92F6C8020105AEA0045180F /* Icon-72.png */, - A92F6C8120105AEA0045180F /* Icon-76.png */, - A92F6C8220105AEA0045180F /* Icon-80.png */, - A92F6C8320105AEA0045180F /* Icon-87.png */, - A92F6C8420105AEA0045180F /* Icon-88.png */, - ); - path = iosicons; + A9F9DEBA2EA59F28003FC66E /* WidgetKit.framework */, + A9F9DEBC2EA59F28003FC66E /* SwiftUI.framework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -280,59 +214,93 @@ isa = PBXNativeTarget; buildConfigurationList = A927E16F1FC53AB10024D526 /* Build configuration list for PBXNativeTarget "PcVolumeControl" */; buildPhases = ( - 1065C93B38DACFF50F89DF79 /* [CP] Check Pods Manifest.lock */, A927E1431FC53AB10024D526 /* Sources */, A927E1441FC53AB10024D526 /* Frameworks */, A927E1451FC53AB10024D526 /* Resources */, - BEBDDB816B648C94BC6671EB /* [CP] Embed Pods Frameworks */, + A9F9DED32EA59F2A003FC66E /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + A9F9DECD2EA59F2A003FC66E /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + A9B31E642DECC25900117327 /* models */, + A9B31E652DF00C4800117327 /* datasources */, + A9B31E662DF00C7B00117327 /* views */, + A9B31E672DF00C8A00117327 /* repos */, + A9B31E7E2DF01A1500117327 /* usecases */, + A9C1EAD12DF01A1500117327 /* viewmodels */, ); name = PcVolumeControl; productName = PcVolumeControl; productReference = A927E1471FC53AB10024D526 /* PcVolumeControl.app */; productType = "com.apple.product-type.application"; }; - A927E15A1FC53AB10024D526 /* PcVolumeControlTests */ = { + A9B31EBA2DF108B200117327 /* PcVolumeControlTests */ = { isa = PBXNativeTarget; - buildConfigurationList = A927E1721FC53AB10024D526 /* Build configuration list for PBXNativeTarget "PcVolumeControlTests" */; + buildConfigurationList = A9B31EC12DF108B200117327 /* Build configuration list for PBXNativeTarget "PcVolumeControlTests" */; buildPhases = ( - F2BF7B3B20AD85363E2E2664 /* [CP] Check Pods Manifest.lock */, - A927E1571FC53AB10024D526 /* Sources */, - A927E1581FC53AB10024D526 /* Frameworks */, - A927E1591FC53AB10024D526 /* Resources */, - 6AEFFD5810991B954268EDC0 /* [CP] Embed Pods Frameworks */, + A9B31EB72DF108B200117327 /* Sources */, + A9B31EB82DF108B200117327 /* Frameworks */, + A9B31EB92DF108B200117327 /* Resources */, ); buildRules = ( ); dependencies = ( - A927E15D1FC53AB10024D526 /* PBXTargetDependency */, + A9B31EC02DF108B200117327 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + A9B31EBC2DF108B200117327 /* PcVolumeControlTests */, ); name = PcVolumeControlTests; + packageProductDependencies = ( + ); productName = PcVolumeControlTests; - productReference = A927E15B1FC53AB10024D526 /* PcVolumeControlTests.xctest */; + productReference = A9B31EBB2DF108B200117327 /* PcVolumeControlTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - A927E1651FC53AB10024D526 /* PcVolumeControlUITests */ = { + A9F9DEB72EA59F28003FC66E /* PcVolumeControlWidgetExtension */ = { isa = PBXNativeTarget; - buildConfigurationList = A927E1751FC53AB10024D526 /* Build configuration list for PBXNativeTarget "PcVolumeControlUITests" */; + buildConfigurationList = A9F9DECF2EA59F2A003FC66E /* Build configuration list for PBXNativeTarget "PcVolumeControlWidgetExtension" */; buildPhases = ( - 26B7CE52DF6445914DB830BE /* [CP] Check Pods Manifest.lock */, - A927E1621FC53AB10024D526 /* Sources */, - A927E1631FC53AB10024D526 /* Frameworks */, - A927E1641FC53AB10024D526 /* Resources */, - 3AC8693A686B4605AD24E0C6 /* [CP] Embed Pods Frameworks */, + A9F9DEB42EA59F28003FC66E /* Sources */, + A9F9DEB52EA59F28003FC66E /* Frameworks */, + A9F9DEB62EA59F28003FC66E /* Resources */, ); buildRules = ( ); dependencies = ( - A927E1681FC53AB10024D526 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + A9F9DEBE2EA59F28003FC66E /* PcVolumeControlWidget */, + ); + name = PcVolumeControlWidgetExtension; + packageProductDependencies = ( + ); + productName = PcVolumeControlWidgetExtension; + productReference = A9F9DEB82EA59F28003FC66E /* PcVolumeControlWidgetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; + B1000007000000000000AA01 /* PcVolumeControlUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = B100000C000000000000AA01 /* Build configuration list for PBXNativeTarget "PcVolumeControlUITests" */; + buildPhases = ( + B1000006000000000000AA01 /* Sources */, + B1000004000000000000AA01 /* Frameworks */, + B1000005000000000000AA01 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + B1000009000000000000AA01 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + B1000002000000000000AA01 /* PcVolumeControlUITests */, ); name = PcVolumeControlUITests; productName = PcVolumeControlUITests; - productReference = A927E1661FC53AB10024D526 /* PcVolumeControlUITests.xctest */; + productReference = B1000001000000000000AA01 /* PcVolumeControlUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; /* End PBXNativeTarget section */ @@ -341,22 +309,26 @@ A927E13F1FC53AB10024D526 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 1200; + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 2600; + LastUpgradeCheck = 2600; ORGANIZATIONNAME = PcVolumeControl; TargetAttributes = { A927E1461FC53AB10024D526 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = BP75F4S5N3; - LastSwiftMigration = 1020; + LastSwiftMigration = 1620; ProvisioningStyle = Automatic; }; - A927E15A1FC53AB10024D526 = { - CreatedOnToolsVersion = 7.3.1; + A9B31EBA2DF108B200117327 = { + CreatedOnToolsVersion = 16.2; TestTargetID = A927E1461FC53AB10024D526; }; - A927E1651FC53AB10024D526 = { - CreatedOnToolsVersion = 7.3.1; + A9F9DEB72EA59F28003FC66E = { + CreatedOnToolsVersion = 26.0.1; + }; + B1000007000000000000AA01 = { + CreatedOnToolsVersion = 26.0.1; TestTargetID = A927E1461FC53AB10024D526; }; }; @@ -375,8 +347,9 @@ projectRoot = ""; targets = ( A927E1461FC53AB10024D526 /* PcVolumeControl */, - A927E15A1FC53AB10024D526 /* PcVolumeControlTests */, - A927E1651FC53AB10024D526 /* PcVolumeControlUITests */, + A9B31EBA2DF108B200117327 /* PcVolumeControlTests */, + A9F9DEB72EA59F28003FC66E /* PcVolumeControlWidgetExtension */, + B1000007000000000000AA01 /* PcVolumeControlUITests */, ); }; /* End PBXProject section */ @@ -386,217 +359,59 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - A92F6C8A20105AEA0045180F /* Icon-144.png in Resources */, - A971F2471FF1DA5D00AD9167 /* Launch Screen.storyboard in Resources */, - A92F6C8720105AEA0045180F /* Icon-114.png in Resources */, - A92F6C8D20105AEA0045180F /* Icon-167.png in Resources */, - A92F6C8620105AEA0045180F /* Icon-1024.png in Resources */, - A92F6C8920105AEA0045180F /* Icon-128.png in Resources */, - A971F2511FF2BDE800AD9167 /* volume-thumbslider.png in Resources */, - A92F6C8E20105AEA0045180F /* Icon-172.png in Resources */, - A92F6C9120105AEA0045180F /* Icon-20.png in Resources */, - A92F6C8820105AEA0045180F /* Icon-120.png in Resources */, - A9FDBC6F1FECFCE300DAE6D7 /* pcvg logo square in Resources */, A927E1521FC53AB10024D526 /* Assets.xcassets in Resources */, - A92F6C9B20105AEA0045180F /* Icon-58.png in Resources */, - A92F6C8F20105AEA0045180F /* Icon-180.png in Resources */, - A9AC32CC1FECF78400D385A8 /* pcvg logo square.png in Resources */, - A92F6C9020105AEA0045180F /* Icon-196.png in Resources */, - A92F6C9920105AEA0045180F /* Icon-55.png in Resources */, - A92F6C9F20105AEA0045180F /* Icon-76.png in Resources */, - A927E1501FC53AB10024D526 /* Main.storyboard in Resources */, - A92F6C8C20105AEA0045180F /* Icon-16.png in Resources */, - A92F6CA020105AEA0045180F /* Icon-80.png in Resources */, - A92F6C9420105AEA0045180F /* Icon-32.png in Resources */, - A92F6C9620105AEA0045180F /* Icon-48.png in Resources */, - A92F6C9A20105AEA0045180F /* Icon-57.png in Resources */, - A92F6C9320105AEA0045180F /* Icon-29.png in Resources */, - A92F6C9720105AEA0045180F /* Icon-50.png in Resources */, - A9AC32CA1FECEF1400D385A8 /* pcvg logo.png in Resources */, - A92F6C9220105AEA0045180F /* Icon-256.png in Resources */, - A92F6CA220105AEA0045180F /* Icon-88.png in Resources */, - A92F6C9C20105AEA0045180F /* Icon-60.png in Resources */, - A92F6C8520105AEA0045180F /* Icon-100.png in Resources */, - A92F6C8B20105AEA0045180F /* Icon-152.png in Resources */, - A92F6C9D20105AEA0045180F /* Icon-64.png in Resources */, - A92F6C9820105AEA0045180F /* Icon-512.png in Resources */, - A92F6C9E20105AEA0045180F /* Icon-72.png in Resources */, - A971F24B1FF2B52C00AD9167 /* black-on-white.png in Resources */, - A92F6CA120105AEA0045180F /* Icon-87.png in Resources */, - A92F6C9520105AEA0045180F /* Icon-40.png in Resources */, + A9B17AC0000000000000B001 /* PrivacyInfo.xcprivacy in Resources */, + A9B31EA52DF0F3DB00117327 /* Localizable.xcstrings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1591FC53AB10024D526 /* Resources */ = { + A9B31EB92DF108B200117327 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1641FC53AB10024D526 /* Resources */ = { + A9F9DEB62EA59F28003FC66E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1065C93B38DACFF50F89DF79 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PcVolumeControl-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 26B7CE52DF6445914DB830BE /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PcVolumeControlUITests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 3AC8693A686B4605AD24E0C6 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/BlueSocket/Socket.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", - "${BUILT_PRODUCTS_DIR}/RxBlocking/RxBlocking.framework", - "${BUILT_PRODUCTS_DIR}/RxTest/RxTest.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Socket.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxBlocking.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxTest.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 6AEFFD5810991B954268EDC0 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/BlueSocket/Socket.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", - "${BUILT_PRODUCTS_DIR}/RxBlocking/RxBlocking.framework", - "${BUILT_PRODUCTS_DIR}/RxTest/RxTest.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Socket.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxBlocking.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxTest.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - BEBDDB816B648C94BC6671EB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; + B1000005000000000000AA01 /* Resources */ = { + isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/BlueSocket/Socket.framework", - "${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework", - "${BUILT_PRODUCTS_DIR}/RxRelay/RxRelay.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Socket.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxRelay.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", - ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl-frameworks.sh\"\n"; - showEnvVarsInLog = 0; }; - F2BF7B3B20AD85363E2E2664 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + A927E1431FC53AB10024D526 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PcVolumeControlTests-checkManifestLockResult.txt", + A92ED6E32CE92F1A00D40FC4 /* PCVolumeControlApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A927E1431FC53AB10024D526 /* Sources */ = { + A9B31EB72DF108B200117327 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A952C1661FE8D3A6002559B3 /* Alert.swift in Sources */, - A9B66A231FECE1910051C4C5 /* ViewControllerStart.swift in Sources */, - A9A25CCE1FEB61DD009C985B /* StreamController.swift in Sources */, - A97414AD1FE629AC00062954 /* Session.swift in Sources */, - A927E14D1FC53AB10024D526 /* ViewController.swift in Sources */, - A97414AB1FDF98BC00062954 /* SliderCell.swift in Sources */, - A971F2491FF2ABBB00AD9167 /* AboutViewController.swift in Sources */, - A971F24D1FF2BD4C00AD9167 /* DesignableSlider.swift in Sources */, - A927E14B1FC53AB10024D526 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1571FC53AB10024D526 /* Sources */ = { + A9F9DEB42EA59F28003FC66E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - A927E1621FC53AB10024D526 /* Sources */ = { + B1000006000000000000AA01 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( @@ -606,34 +421,29 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - A927E15D1FC53AB10024D526 /* PBXTargetDependency */ = { + A9B31EC02DF108B200117327 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A927E1461FC53AB10024D526 /* PcVolumeControl */; - targetProxy = A927E15C1FC53AB10024D526 /* PBXContainerItemProxy */; + targetProxy = A9B31EBF2DF108B200117327 /* PBXContainerItemProxy */; + }; + A9F9DECD2EA59F2A003FC66E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A9F9DEB72EA59F28003FC66E /* PcVolumeControlWidgetExtension */; + targetProxy = A9F9DECC2EA59F2A003FC66E /* PBXContainerItemProxy */; }; - A927E1681FC53AB10024D526 /* PBXTargetDependency */ = { + B1000009000000000000AA01 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A927E1461FC53AB10024D526 /* PcVolumeControl */; - targetProxy = A927E1671FC53AB10024D526 /* PBXContainerItemProxy */; + targetProxy = B1000008000000000000AA01 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - A927E14E1FC53AB10024D526 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - A927E14F1FC53AB10024D526 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ A927E16D1FC53AB10024D526 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -663,8 +473,10 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = BP75F4S5N3; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -680,10 +492,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -694,6 +508,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -723,8 +538,10 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = BP75F4S5N3; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; @@ -734,10 +551,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -746,102 +566,288 @@ }; A927E1701FC53AB10024D526 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 784048895FDEE72E5BF0656F /* Pods-PcVolumeControl.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = BP75F4S5N3; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = PcVolumeControl/PcVolumeControl.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 2; "DEVELOPMENT_TEAM[sdk=*]" = BP75F4S5N3; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = BP75F4S5N3; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$PODS_CONFIGURATION_BUILD_DIR/SwiftSocket\"", "$(SRCROOT)/**", ); INFOPLIST_FILE = PcVolumeControl/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 2.0; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControl; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=*]" = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development moronbros.PcVolumeControl"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; A927E1711FC53AB10024D526 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0BA2255E57FA4C02678D5451 /* Pods-PcVolumeControl.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = BP75F4S5N3; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = PcVolumeControl/PcVolumeControl.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 2; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = BP75F4S5N3; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - "\"$PODS_CONFIGURATION_BUILD_DIR/SwiftSocket\"", "$(SRCROOT)", ); INFOPLIST_FILE = PcVolumeControl/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 2.0; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControl; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development moronbros.PcVolumeControl"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; - A927E1731FC53AB10024D526 /* Debug */ = { + A9B31EC22DF108B200117327 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E497C089C2FB3C823939B7C5 /* Pods-PcVolumeControlTests.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = PcVolumeControlTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControlTests; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PcVolumeControl.app/PcVolumeControl"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PcVolumeControl.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/PcVolumeControl"; }; name = Debug; }; - A927E1741FC53AB10024D526 /* Release */ = { + A9B31EC32DF108B200117327 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 495F5F7A5E85DDCE697DD73B /* Pods-PcVolumeControlTests.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = PcVolumeControlTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControlTests; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PcVolumeControl.app/PcVolumeControl"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PcVolumeControl.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/PcVolumeControl"; + }; + name = Release; + }; + A9F9DED02EA59F2A003FC66E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = PcVolumeControlWidgetExtension.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 2; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = BP75F4S5N3; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = PcVolumeControlWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = PcVolumeControlWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 PcVolumeControl. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControl.PcVolumeControlWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development moronbros.PcVolumeControl.PcVolumeControlWidget"; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + A9F9DED12EA59F2A003FC66E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = PcVolumeControlWidgetExtension.entitlements; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 2; + "DEVELOPMENT_TEAM[sdk=iphoneos*]" = BP75F4S5N3; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = PcVolumeControlWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = PcVolumeControlWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 PcVolumeControl. All rights reserved."; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControl.PcVolumeControlWidget; + PRODUCT_NAME = "$(TARGET_NAME)"; + "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development moronbros.PcVolumeControl.PcVolumeControlWidget"; + SKIP_INSTALL = YES; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; - A927E1761FC53AB10024D526 /* Debug */ = { + B100000A000000000000AA01 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BC0C05349FA2A35B69E7936E /* Pods-PcVolumeControlUITests.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - INFOPLIST_FILE = PcVolumeControlUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControlUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; TEST_TARGET_NAME = PcVolumeControl; }; name = Debug; }; - A927E1771FC53AB10024D526 /* Release */ = { + B100000B000000000000AA01 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 086A605B7329CBA602164155 /* Pods-PcVolumeControlUITests.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - INFOPLIST_FILE = PcVolumeControlUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 26.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 2.0; + MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = moronbros.PcVolumeControlUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; TEST_TARGET_NAME = PcVolumeControl; }; name = Release; @@ -867,20 +873,29 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - A927E1721FC53AB10024D526 /* Build configuration list for PBXNativeTarget "PcVolumeControlTests" */ = { + A9B31EC12DF108B200117327 /* Build configuration list for PBXNativeTarget "PcVolumeControlTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9B31EC22DF108B200117327 /* Debug */, + A9B31EC32DF108B200117327 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + A9F9DECF2EA59F2A003FC66E /* Build configuration list for PBXNativeTarget "PcVolumeControlWidgetExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( - A927E1731FC53AB10024D526 /* Debug */, - A927E1741FC53AB10024D526 /* Release */, + A9F9DED02EA59F2A003FC66E /* Debug */, + A9F9DED12EA59F2A003FC66E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - A927E1751FC53AB10024D526 /* Build configuration list for PBXNativeTarget "PcVolumeControlUITests" */ = { + B100000C000000000000AA01 /* Build configuration list for PBXNativeTarget "PcVolumeControlUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( - A927E1761FC53AB10024D526 /* Debug */, - A927E1771FC53AB10024D526 /* Release */, + B100000A000000000000AA01 /* Debug */, + B100000B000000000000AA01 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; diff --git a/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/UserInterfaceState.xcuserstate b/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index ed9024f..0000000 Binary files a/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/WorkspaceSettings.xcsettings b/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index f25782d..0000000 --- a/PcVolumeControl.xcodeproj/project.xcworkspace/xcuserdata/bill.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,18 +0,0 @@ - - - - - BuildLocationStyle - UseAppPreferences - CustomBuildLocationType - RelativeToDerivedData - DerivedDataLocationStyle - Default - EnabledFullIndexStoreVisibility - - IssueFilterStyle - ShowActiveSchemeOnly - LiveSourceIssuesEnabled - - - diff --git a/PcVolumeControl.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/PcVolumeControl.xcscheme b/PcVolumeControl.xcodeproj/xcshareddata/xcschemes/PcVolumeControl.xcscheme similarity index 57% rename from PcVolumeControl.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/PcVolumeControl.xcscheme rename to PcVolumeControl.xcodeproj/xcshareddata/xcschemes/PcVolumeControl.xcscheme index 0b16f56..46ae56a 100644 --- a/PcVolumeControl.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/PcVolumeControl.xcscheme +++ b/PcVolumeControl.xcodeproj/xcshareddata/xcschemes/PcVolumeControl.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + + + + + - - - - SchemeUserState - - PcVolumeControl.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - A927E1461FC53AB10024D526 - - primary - - - A927E15A1FC53AB10024D526 - - primary - - - A927E1651FC53AB10024D526 - - primary - - - - - diff --git a/PcVolumeControl.xcworkspace/contents.xcworkspacedata b/PcVolumeControl.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 851ff4d..0000000 --- a/PcVolumeControl.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/PcVolumeControl/AboutViewController.swift b/PcVolumeControl/AboutViewController.swift deleted file mode 100644 index 0196ee7..0000000 --- a/PcVolumeControl/AboutViewController.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// AboutViewController.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/26/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit - -class AboutViewController: UITableViewController { - - @IBOutlet weak var buildNumberLabel: UILabel! - @IBOutlet var aboutTableView: UITableView! - - @IBAction func aboutBackButtonClicked(_ sender: UIBarButtonItem) { - DispatchQueue.main.async { - self.performSegue(withIdentifier: "closeAbout", sender: "aboutvc") - } - } - @IBAction func downloadServerClicked(_ sender: UIButton) { - // When they want to download the server code - openLink(url: "https://github.com/PcVolumeControl/PcVolumeControlWindows/releases/latest") - } - @IBAction func gitButtonClicked(_ sender: UIButton) { - openLink(url: "https://github.com/PcVolumeControl") - } - - // white top carrier/battery bar - override var preferredStatusBarStyle: UIStatusBarStyle { - return .lightContent - } - - override func viewDidLoad() { - super.viewDidLoad() - setNeedsStatusBarAppearanceUpdate() // white top status bar - let color = UIColor(hex: "303030") - aboutTableView.backgroundColor = color - let version = Bundle.main.releaseVersionNumber - let build = Bundle.main.buildVersionNumber - buildNumberLabel.text = "App: v\(version ?? "1").\(build ?? "0")" - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "closeAbout" { - let destVC = segue.destination as UIViewController - destVC.modalPresentationStyle = .fullScreen - destVC.modalTransitionStyle = .flipHorizontal - } - } - - func openLink(url: String) { - if let url = URL(string: url) { - if #available(iOS 10.0, *) { - UIApplication.shared.open(url, options: [:]) - } else { - // Fallback on earlier versions not supported. 10.0 is lowest. - } - } - } -} - -extension UIColor { - convenience init(hex: String) { - let scanner = Scanner(string: hex) - scanner.scanLocation = 0 - - var rgbValue: UInt64 = 0 - - scanner.scanHexInt64(&rgbValue) - - let r = (rgbValue & 0xff0000) >> 16 - let g = (rgbValue & 0xff00) >> 8 - let b = rgbValue & 0xff - - self.init( - red: CGFloat(r) / 0xff, - green: CGFloat(g) / 0xff, - blue: CGFloat(b) / 0xff, alpha: 1 - ) - } -} -extension Bundle { - var releaseVersionNumber: String? { - return infoDictionary?["CFBundleShortVersionString"] as? String - } - var buildVersionNumber: String? { - return infoDictionary?["CFBundleVersion"] as? String - } -} diff --git a/PcVolumeControl/Alert.swift b/PcVolumeControl/Alert.swift deleted file mode 100644 index f3340f0..0000000 --- a/PcVolumeControl/Alert.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// Alert.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/18/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import Foundation -import UIKit - -class Alert { - class func showBasic(title: String, message: String, vc: UIViewController) { - let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - vc.present(alert, animated: true) - } - -} diff --git a/PcVolumeControl/AppDelegate.swift b/PcVolumeControl/AppDelegate.swift deleted file mode 100644 index bce4105..0000000 --- a/PcVolumeControl/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// PcVolumeControl -// -// Created by Bill Booth on 11/21/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } -} diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-1024.png index ad5886c..71cd591 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-1024.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-1024.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-120.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-120.png index 15152d5..1db7d16 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-120.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-120.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-121.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-121.png index 15152d5..1db7d16 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-121.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-121.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-152.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-152.png index 3d227a7..da23db8 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-152.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-152.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-167.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-167.png index a21f85b..b68d0b0 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-167.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-167.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-180.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-180.png index 78e42de..15e1e71 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-180.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-180.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-20.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-20.png index 3ae6eda..5e9c432 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-20.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-20.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-29.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-29.png index f929e12..90b8991 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-29.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-29.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-40.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-40.png index 6887efa..996f920 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-40.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-40.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-41.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-41.png index 6887efa..996f920 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-41.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-41.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-42.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-42.png index 6887efa..996f920 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-42.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-42.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-58.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-58.png index a4b48d4..56669fa 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-58.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-58.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-60.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-60.png index d23e0d9..43374f7 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-60.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-60.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-61.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-61.png index a4b48d4..56669fa 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-61.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-61.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-76.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-76.png index b22ae89..a962650 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-76.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-76.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-80.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-80.png index 8a8beca..4725761 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-80.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-80.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-81.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-81.png index 8a8beca..4725761 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-81.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-81.png differ diff --git a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-87.png b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-87.png index 110eb24..c113972 100644 Binary files a/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-87.png and b/PcVolumeControl/Assets.xcassets/AppIcon.appiconset/Icon-87.png differ diff --git a/PcVolumeControl/Assets.xcassets/LaunchBackground.colorset/Contents.json b/PcVolumeControl/Assets.xcassets/LaunchBackground.colorset/Contents.json new file mode 100644 index 0000000..7120822 --- /dev/null +++ b/PcVolumeControl/Assets.xcassets/LaunchBackground.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.258", + "green" : "0.255", + "red" : "0.256" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/Contents.json b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/Contents.json new file mode 100644 index 0000000..55e37da --- /dev/null +++ b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "pcvc_logo.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "pcvc_logo@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "pcvc_logo@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo.png b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo.png new file mode 100644 index 0000000..de8ecc9 Binary files /dev/null and b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo.png differ diff --git a/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@2x.png b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@2x.png new file mode 100644 index 0000000..c098db4 Binary files /dev/null and b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@2x.png differ diff --git a/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@3x.png b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@3x.png new file mode 100644 index 0000000..00b4da7 Binary files /dev/null and b/PcVolumeControl/Assets.xcassets/PCVCLogo.imageset/pcvc_logo@3x.png differ diff --git a/PcVolumeControl/Base.lproj/LaunchScreen.storyboard b/PcVolumeControl/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index cdf5a88..0000000 --- a/PcVolumeControl/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PcVolumeControl/Base.lproj/Main.storyboard b/PcVolumeControl/Base.lproj/Main.storyboard deleted file mode 100644 index 1e6450e..0000000 --- a/PcVolumeControl/Base.lproj/Main.storyboard +++ /dev/null @@ -1,520 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PcVolumeControl/DesignableSlider.swift b/PcVolumeControl/DesignableSlider.swift deleted file mode 100644 index da6cc7c..0000000 --- a/PcVolumeControl/DesignableSlider.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// DesignableSlider.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/26/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit - -@IBDesignable -class DesignableSlider: UISlider { - - // This is here for the sole purpose of styling the thumb image on the sliders. - @IBInspectable var thumbImage: UIImage? { - didSet { - setThumbImage(thumbImage, for: .normal) - } - } -} diff --git a/PcVolumeControl/Info.plist b/PcVolumeControl/Info.plist index 9d81e01..e011921 100644 --- a/PcVolumeControl/Info.plist +++ b/PcVolumeControl/Info.plist @@ -17,33 +17,56 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.8 + 2.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + com.cwb.pcvolumecontrol + CFBundleURLSchemes + + pcvolumecontrol + + + CFBundleVersion - 4 + $(CURRENT_PROJECT_VERSION) + ITSAppUsesNonExemptEncryption + + LSApplicationCategoryType + public.app-category.developer-tools LSRequiresIPhoneOS - UILaunchStoryboardName - Launch Screen - UIMainStoryboardFile - Main + NSBonjourServices + + _pcvolumecontrol._tcp + + NSLocalNetworkUsageDescription + This app searches for PC Volume Control servers on the local network. + UILaunchScreen + + UIColorName + LaunchBackground + UIRequiredDeviceCapabilities - armv7 + arm64 - UIStatusBarStyle - UIStatusBarStyleLightContent UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown diff --git a/PcVolumeControl/Launch Screen.storyboard b/PcVolumeControl/Launch Screen.storyboard deleted file mode 100644 index 45ac740..0000000 --- a/PcVolumeControl/Launch Screen.storyboard +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PcVolumeControl/PCVolumeControlApp.swift b/PcVolumeControl/PCVolumeControlApp.swift new file mode 100644 index 0000000..3110871 --- /dev/null +++ b/PcVolumeControl/PCVolumeControlApp.swift @@ -0,0 +1,38 @@ +import SwiftUI + +@main +struct PCVolumeControlApp: App { + @StateObject private var aliasManager = AliasManager() + @StateObject private var motion = MotionProvider() + @Environment(\.scenePhase) private var scenePhase + + var body: some Scene { + WindowGroup { + MainView() + .environmentObject(aliasManager) + .environmentObject(motion) + .onAppear { motion.start() } + .onChange(of: scenePhase) { _, newPhase in + switch newPhase { + case .active: + motion.start() + case .inactive, .background: + motion.stop() + @unknown default: + break + } + } + .onOpenURL { url in + handleDeepLink(url) + } + } + } + + private func handleDeepLink(_ url: URL) { + guard url.scheme == "pcvolumecontrol" else { return } + + if url.host == "connect" { + appLog("Widget tapped - opening app for connection/reconnection") + } + } +} diff --git a/PcVolumeControl.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/PcVolumeControl/PcVolumeControl.entitlements similarity index 62% rename from PcVolumeControl.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to PcVolumeControl/PcVolumeControl.entitlements index 18d9810..8fae23e 100644 --- a/PcVolumeControl.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ b/PcVolumeControl/PcVolumeControl.entitlements @@ -2,7 +2,9 @@ - IDEDidComputeMac32BitWarning - + com.apple.security.application-groups + + group.cwb.PcVolumeControl + diff --git a/PcVolumeControl/PrivacyInfo.xcprivacy b/PcVolumeControl/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..d36cc0a --- /dev/null +++ b/PcVolumeControl/PrivacyInfo.xcprivacy @@ -0,0 +1,24 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + 1C8F.1 + + + + + diff --git a/PcVolumeControl/Session.swift b/PcVolumeControl/Session.swift deleted file mode 100644 index 42d2095..0000000 --- a/PcVolumeControl/Session.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// Session.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/16/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import Foundation -import UIKit - -class Session { - // This is a single session. - var id: String - var muted: Bool - var name: String - var volume: Double - - init(id: String, muted: Bool, name: String, volume: Double) { - self.id = id - self.muted = muted - self.name = name - self.volume = volume - } -} diff --git a/PcVolumeControl/SliderCell.swift b/PcVolumeControl/SliderCell.swift deleted file mode 100644 index b7c568b..0000000 --- a/PcVolumeControl/SliderCell.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// SliderCell.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/11/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit - -protocol SliderCellDelegate { - func didChangeVolume(id: String, newvalue: Double, name: String) - func didToggleMute(id: String, muted: Bool, name: String) -} - -// This covers individual cells, with one session per cell. -class SliderCell: UITableViewCell { - - @IBOutlet weak var actualSlider: UISlider! - @IBOutlet weak var sliderTextField: UITextField! - @IBOutlet weak var sliderMuteSwitch: UISwitch! - - var sessionItem: Session! - var delegate: SliderCellDelegate? - - func setSessionParameter(session: Session) { - sessionItem = session - sliderTextField.text = session.name - actualSlider.value = Float(session.volume) - sliderMuteSwitch.isOn = !session.muted - } - - @IBAction func volumeChanged(_ sender: UISlider) { - delegate?.didChangeVolume(id: sessionItem.id, newvalue: Double(actualSlider.value), name: sessionItem.name) - } - @IBAction func muteValueChanged(_ sender: UISwitch) { - delegate?.didToggleMute(id: sessionItem.id, muted: sender.isOn, name: sessionItem.name) - } -} diff --git a/PcVolumeControl/StreamController.swift b/PcVolumeControl/StreamController.swift deleted file mode 100644 index 6304cdc..0000000 --- a/PcVolumeControl/StreamController.swift +++ /dev/null @@ -1,249 +0,0 @@ -// -// StreamController.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/20/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import Foundation -import UIKit -import RxSwift -import RxCocoa -import Socket - -protocol StreamControllerDelegate { - func didGetServerUpdate() - func bailToConnectScreen() - func tearDownConnection() - func didConnectToServer() - func isAttemptingConnection() - func failedToConnect() -} - -class StreamController: NSObject { - // This class uses RxSwift to communicate over a TCP socket. - // Note that HTTP is not used. It is a raw TCP socket. - var clientSocket: Socket? - - var address: String - var port: Int32 - var lastState: String - var fullState: FullState? - var serverConnected: Bool? - var delegate: StreamControllerDelegate? - let TCPTimeout: UInt = 2000 - - // Rx stuff - let bag = DisposeBag() - var lastMessageSubject = PublishSubject() - - enum CodingError: Error { - case JSONDecodeProblem // garbage data, bad decode - } - enum ConnectionError: Error { - case ServerConnectionError // IP:port or FQDN:port wrong or not reachable. - } - - init(address: String, port: Int32, delegate: StreamControllerDelegate) { - // This is run on initial tap of the 'connect' button or on any spontaneous reconnect. - - // The address used here is an IP. We could do validation and error messaging related to the name resolution - // within this stream controller, but it is done before we get here. - self.address = address - self.port = port - self.serverConnected = false - self.delegate = delegate - self.lastState = "" - self.clientSocket = try! Socket.create() - } - - private func serverUpdated() { - self.delegate?.didGetServerUpdate() - - } - private func connectionIssue() { - self.delegate?.bailToConnectScreen() - serverConnected = false - disconnect() - } - func tearDownServerConnection() { - self.delegate?.tearDownConnection() - serverConnected = false - disconnect() - } - func didConnectToServer() { - // Signal to delegates that the socket is open. - self.delegate?.didConnectToServer() - } - - func disconnect() { - if let cs = clientSocket { - cs.close() - print("Socket disconnected by user.") - } - } - - func connectNoSend() { - self.delegate?.isAttemptingConnection() - do { - let mySocket = try Socket.create() - clientSocket = mySocket - try clientSocket?.connect(to: address, port: port, timeout: TCPTimeout) - print("socket connected!") - while true { - if clientSocket?.isConnected == false { - self.delegate?.tearDownConnection() - break - } - let result = pollSocket(socket: mySocket) - if result != nil { - print("result: \(String(describing: result))\n") - lastMessageSubject.onNext(result!) - self.delegate?.didConnectToServer() // segue now - - } else { - break - } - } - } - catch let error { - guard let _ = error as? Socket.Error else { - self.delegate?.failedToConnect() - return - } - } - // No socket error, but we could still have something else. - print("Unhandled non-socket error!") - print("Socket destination address and port: \(self.address):\(self.port)") - self.delegate?.failedToConnect() - } - - func sendString(input: String) { - print("Client has data to send to the server...\n\(input)") - if let cs = clientSocket { - try! cs.write(from: input) - } - } - - func pollSocket(socket: Socket) -> String? { - var shouldKeepRunning = true - - var readData = Data(capacity: 1024) - var responseString = "" - - do { - repeat { - let bytesRead = try socket.read(into: &readData) - - if bytesRead > 0 { - guard let response = String(data: readData, encoding: .utf8) else { - print("Error string decoding response...") - readData.count = 0 - break - } - responseString += response - if response.hasSuffix("\n") { - print("newline detected! That's the end of a message from the server.") - return responseString - } - print("This iOS client got a response from: \(socket.remoteHostname):\(socket.remotePort): \(response) ") - } - - if bytesRead == 0 { - - shouldKeepRunning = false - break - } - - readData.count = 0 - - } while shouldKeepRunning - - print("Socket: \(socket.remoteHostname):\(socket.remotePort) closed...") - socket.close() - serverConnected = false - // Tell the main VC so it can show an alert and bail. - self.delegate?.tearDownConnection() - - } - catch let error { - guard let _ = error as? Socket.Error else { - print("Unexpected error by connection at \(socket.remoteHostname):\(socket.remotePort)...") - return "Error!" - } - } - // If we got to this point, the server closed the connection. - socket.close() - connectionIssue() - return "Socket has been closed!" - } - - func processMessages() { - let distinct = lastMessageSubject.distinctUntilChanged() - let _ = distinct.subscribe { - guard let message = $0.element else { return } - - do { - try self.JSONDecode(input: message) - } catch CodingError.JSONDecodeProblem { - print("JSONSubscription: JSON decode failed!!!!") - print("Here is what we attempted to decode:\n\n\(message)") - } catch { - print("JSONSubscription: fell off the end...") - } - } - } - - func JSONDecode(input: String) throws { - - // try to decode a JSON string. If it's partial, throw an error. - let json = input.data(using: .utf8) - do { - guard let fs = try JSONDecoder().decode(FullState?.self, from: json!) else { - return - } - print("JSONDecode: Successfully decoded the payload.") - serverConnected = true - fullState = fs - serverUpdated() - print("JSONDecode: pushing initial server update into fullstate...") - - } catch Swift.DecodingError.dataCorrupted { - // partial message received, probably - throw CodingError.JSONDecodeProblem - } catch { - // should never get here? - print(error.localizedDescription) - connectionIssue() - } - } -} - -class FullState : Codable { - struct theDefaultDevice : Codable { - let deviceId: String - let masterMuted: Bool - let masterVolume: Float - let name: String - let sessions: [Session] - - } - struct Session : Codable { - let id: String - let muted: Bool - let name: String - let volume: Double - } - let defaultDevice: theDefaultDevice - let deviceIds: [String: String] - let protocolVersion: Int - let applicationVersion: String - - init(protocolVersion: Int, applicationVersion: String, deviceIds: [String:String], defaultDevice: theDefaultDevice) { - self.protocolVersion = protocolVersion - self.applicationVersion = applicationVersion - self.deviceIds = deviceIds - self.defaultDevice = defaultDevice - } -} diff --git a/PcVolumeControl/ViewController.swift b/PcVolumeControl/ViewController.swift deleted file mode 100644 index 42c0eba..0000000 --- a/PcVolumeControl/ViewController.swift +++ /dev/null @@ -1,556 +0,0 @@ -// -// ViewController.swift -// PcVolumeControl -// -// Created by Bill Booth on 11/21/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit -import Foundation - - -@objcMembers -class ViewController: UIViewController, UITextFieldDelegate { - - let protocolVersion = 7 - var SController: StreamController? - var alreadySwitched: Bool? - var selectedDefaultDevice: (String, String)? - var allSessions = [Session]() // Array used to build slider table - var IPaddr: String! - var PortNum: UInt32? - var disconnectRequested: Bool = false - var initialDraw: Bool = false - var defaults = UserDefaults.standard - - @IBOutlet weak var defaultDeviceView: UIView! - @IBOutlet weak var pickerTextField: UITextField! - @IBOutlet weak var masterVolumeSlider: DesignableSlider! - @IBOutlet weak var masterMuteButton: UISwitch! - - @IBAction func masterMuteSwitch(_ sender: UISwitch) { - - let id = SController?.fullState?.defaultDevice.deviceId - var defaultDevId: AMasterChannelUpdate.adflDevice? - // Volume is not changing. - guard let masterVolume = SController?.fullState?.defaultDevice.masterVolume else { return } - if sender.isOn { - // Unmute the master. - defaultDevId = AMasterChannelUpdate.adflDevice(deviceId: id!, masterMuted: false, masterVolume: Float(masterVolume)) - } - else - { - // Mute the master. - defaultDevId = AMasterChannelUpdate.adflDevice(deviceId: id!, masterMuted: true, masterVolume: Float(masterVolume)) - } - let data = AMasterChannelUpdate(protocolVersion: protocolVersion, defaultDevice: (defaultDevId!)) - - let encoder = JSONEncoder() - let dataAsBytes = try! encoder.encode(data) - dump(dataAsBytes) - // The data is supposed to be an array of Uint8. - guard let dataAsString = String(bytes: dataAsBytes, encoding: .utf8) else { return } - let dataWithNewline = dataAsString + "\n" - SController?.sendString(input: dataWithNewline) - } - - @IBAction func masterVolumeChanged(_ sender: UISlider) { - - guard let id = SController?.fullState?.defaultDevice.deviceId else { reloadTheWorld(); return } - var defaultDevId: AMasterChannelUpdate.adflDevice? - // mute value is not changing. - guard let masterMuted = SController?.fullState?.defaultDevice.masterMuted else { return } - let volumeValue = sender.value - defaultDevId = AMasterChannelUpdate.adflDevice(deviceId: id, masterMuted: masterMuted, masterVolume: volumeValue) - - let data = AMasterChannelUpdate(protocolVersion: protocolVersion, defaultDevice: (defaultDevId)!) - let encoder = JSONEncoder() - - let dataAsBytes = try! encoder.encode(data) - dump(dataAsBytes) - // The data is supposed to be an array of Uint8. - guard let dataAsString = String(bytes: dataAsBytes, encoding: .utf8) else { return } - let dataWithNewline = dataAsString + "\n" - SController?.sendString(input: dataWithNewline) - } - - // bottom sliders for sessions - @IBOutlet weak var sliderTableView: UITableView! - - // bottom toolbar buttons - @IBOutlet weak var bottomToolbar: UIToolbar! - - // Very bottom toolbar with disconnect button - @IBOutlet weak var disconnectButton: UIBarButtonItem! - @IBOutlet weak var editCellsButton: UIBarButtonItem! - @IBAction func disconnectButtonClicked(_ sender: UIBarButtonItem) { - print("Disconnect requested by user...") - disconnectRequested = true - SController?.disconnect() - bailToConnectScreen() - } - - @IBAction func editCellButtonClicked(_ sender: UIBarButtonItem) { - // Toggle editing of the cells - reordering or deleting. - self.sliderTableView.isEditing = !self.sliderTableView.isEditing - if self.sliderTableView.isEditing { - sender.title = "Done" - sender.tintColor = .white - } else { - sender.title = "Reorder Sliders" - sender.tintColor = .none - } - } - - override func viewDidLoad() { - super.viewDidLoad() - - if initialDraw == true { - reloadTheWorld() - initialDraw = false - } - - setNeedsStatusBarAppearanceUpdate() // white top status bar - disconnectRequested = false - - // Detection that the app was minimized so we can close TCP connections - let notificationCenter = NotificationCenter.default - // If the app is backgrounded with the home button, tear down the TCP connection. - notificationCenter.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.willResignActiveNotification, object: nil) - // When the app is brough back to foreground, go to the initial connection screen. - notificationCenter.addObserver(self, selector: #selector(appWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil) - notificationCenter.addObserver(self, selector: #selector(appDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) - - // table view stuff for the slider screen - sliderTableView.delegate = self - sliderTableView.dataSource = self - sliderTableView.tableFooterView = UIView(frame: CGRect.zero) // remove footer - sliderTableView.estimatedRowHeight = 140.0 - sliderTableView.rowHeight = UITableView.automaticDimension - - constructPicker() - - alreadySwitched = false - - // Make this a delegate for the TCP Stream Controller class. - SController?.delegate = self - - if SController?.fullState?.defaultDevice == nil { - view.setNeedsDisplay() - } - } - - // When going back to the start screen, make sure the modal here takes up the entire screen. - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "BackToStartSegue" { - let destVC = segue.destination as UIViewController - destVC.modalPresentationStyle = .fullScreen - destVC.modalTransitionStyle = .crossDissolve - } - } - - // white top carrier/battery bar - override var preferredStatusBarStyle: UIStatusBarStyle { - return .lightContent - } - - struct ADefaultDeviceUpdate : Codable { - struct adflDevice : Codable { - let deviceId: String - } - let protocolVersion: Int - let defaultDevice: adflDevice - } - - struct AMasterChannelUpdate : Codable { - struct adflDevice : Codable { - let deviceId: String - let masterMuted: Bool - let masterVolume: Float - } - let protocolVersion: Int - let defaultDevice: adflDevice - } - - struct ASessionUpdate : Codable { - struct adflDevice : Codable { - let sessions: [OneSession] - let deviceId: String - - } - let protocolVersion: Int - let defaultDevice: adflDevice - - } - struct OneSession : Codable { - let name: String - let id: String - let volume: Float - let muted: Bool - } - - func appMovedToBackground() { - // Tear down the TCP connection any time they minimize or exit the app. - print("App moved to background. TCP Connection should be torn down now...") - if SController?.clientSocket?.isConnected == true { - disconnectRequested = true - SController?.disconnect() - } - } - - func appWillEnterForeground() { - // If the app is brought out of the background, we _always_ restart. - print("App moved to foreground. Force reconnection...") - if alreadySwitched == false { - bailToConnectScreen() - alreadySwitched = true - } - } - func appDidBecomeActive() { - print("App moved from background selection screen to foreground.") - if alreadySwitched == false { - bailToConnectScreen() - } - } - - func createDisconnectAlert(title: String, message: String) { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) - alert.addAction(UIAlertAction(title: "Quit", style: UIAlertAction.Style.default, handler: { (action) in alert.dismiss(animated:true, completion: nil); self.bailToConnectScreen()})) - self.present(alert, animated: true, completion: nil) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - func initSessions() { - // This finds all sessions and overwrites the global session state. - print("Sessions are being re-intialized...") - allSessions.removeAll() - guard let sessions = SController?.fullState?.defaultDevice.sessions else { - createDisconnectAlert(title: "Whoops", message: "Full state sent from the server was not loaded for some reason.") - return - } - for x : FullState.Session in sessions { - allSessions.append(Session(id: x.id, muted: x.muted, name: x.name, volume: Double(x.volume))) - } - // always sort alphabetically for a consistent view - allSessions.sort { - $0.name.localizedCaseInsensitiveCompare($1.name) == ComparisonResult.orderedAscending - } - // While we are reloading here, initialize the title showing in the initial picker view. - guard let state = SController?.fullState?.defaultDevice.name else { return } - - DispatchQueue.main.async { - self.pickerTextField.text = state - self.pickerTextField.tintColor = .clear - } - /* - of all the sessions here, if we have already reordered the stack, move our cells around - so the prioritized ones are up top and everything else appears below. - */ - - if let dfl = defaults.object(forKey: "customOrderedCells") as? [String] { - // We found a customized ordering. - if dfl.count > allSessions.count { - // TODO: This is kinda hacky. There has to be a better way. - defaults.set([], forKey: "customOrderedCells") - defaults.synchronize() - return - } - for item in allSessions { - if dfl.contains(item.id) { - // The ID we are looking at has a custom ordering. - if let cIdx = dfl.firstIndex(of: item.id) { - // allSessions is mutated in this loop. Get the new index. - if let aIdx = allSessions.firstIndex(where: {$0.id == item.id}) { - allSessions.remove(at: aIdx) - allSessions.insert(item, at: cIdx) - } - } - } - } - } - } - - func findDeviceId(longName: String) -> String { - // Look through the device IDs to get the short-form device ID. - // This takes in the long-form session ID as input. - - var deviceName = "Unknown" - if let ids = SController?.fullState?.deviceIds { - for (shortId, _) in ids { - if longName.contains(shortId) { - deviceName = shortId - } - } - } - return deviceName - } - - func reloadTheWorld() { - // Reload everything! All the things! - // bail if the client and server protocols mismatch. - - if SController?.fullState?.protocolVersion != protocolVersion { - createDisconnectAlert(title: "Error", message: "Client and server protocols mismatch.") - } - - guard let masterMuteState = SController?.fullState?.defaultDevice.masterMuted else { - print("Master mute state could not be set!") - return - } - masterMuteButton.isOn = !masterMuteState - let masterVolume = SController?.fullState?.defaultDevice.masterVolume ?? 50.0 - masterVolumeSlider?.value = masterVolume - - // Bottom slider table stack with all sessions - // re-populate the array of current sessions and reload the sliders. - initSessions() - - sliderTableView.reloadData() - } -} - -/* -This controls the picker view for the master/default device. -*/ -extension ViewController: UIPickerViewDelegate, UIPickerViewDataSource { - - func constructPicker() { - let devicePicker = UIPickerView() - devicePicker.delegate = self - pickerTextField.inputView = devicePicker - pickerTextField.text = selectedDefaultDevice?.1 - - // TODO: change the default selected item to be the current default. - createToolbar() // done button - } - - func createToolbar() { - // make a toolbar with a 'done' button for the picker. - let toolBar = UIToolbar() - toolBar.sizeToFit() - - let doneButton = UIBarButtonItem(title: "Set Output Device", style: .plain, target: self, - action: #selector(ViewController.outputDeviceSelected)) - let spacer = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) // shift it right - toolBar.setItems([spacer, doneButton, spacer], animated: false) - toolBar.isUserInteractionEnabled = true - pickerTextField.inputAccessoryView = toolBar - - toolBar.barTintColor = .gray - toolBar.tintColor = .white - } - - func getDeviceIds() -> [(String, String)] { - // return an array of tuples showing all available device IDs and pretty names - var y = [(String, String)]() - if SController == nil { - print("full state is nil. bailing...") - bailToConnectScreen() - } - if let deviceIDs = SController?.fullState?.deviceIds { - for (shortId, prettyName) in deviceIDs { - y.append((shortId, prettyName)) - } - } - - return y - } - - func outputDeviceSelected() { - view.endEditing(true) - - // When they select the default, we need to update state and send a new master device to the server. - guard let id = selectedDefaultDevice?.0 else { - // They didn't change anything. They just hit 'Done'. - return - } - let defaultDevId = ADefaultDeviceUpdate.adflDevice(deviceId: id) - let data = ADefaultDeviceUpdate(protocolVersion: protocolVersion, defaultDevice: defaultDevId) - - let encoder = JSONEncoder() - let dataAsBytes = try! encoder.encode(data) - dump(dataAsBytes) - // The data is supposed to be an array of Uint8. - let dataAsString = String(bytes: dataAsBytes, encoding: .utf8) - let dataWithNewline = dataAsString! + "\n" - - SController?.sendString(input: dataWithNewline) - } - - //picker view overrides - func numberOfComponents(in pickerView: UIPickerView) -> Int { - return 1 - } - func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { - let deviceids = getDeviceIds() - return deviceids[row].1 - } - func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { - let deviceids = getDeviceIds() - return deviceids.count - } - func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { - selectedDefaultDevice = getDeviceIds()[row] - pickerTextField.text = getDeviceIds()[row].1 - } -} - -extension ViewController: UITableViewDataSource, UITableViewDelegate { - // This code controls the tableView rows the sliders live in. - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return allSessions.count - } - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - - let cell = tableView.dequeueReusableCell(withIdentifier: "sliderCell") as! SliderCell - cell.delegate = self - - let targetSession = allSessions[indexPath.row] - print("Updating cell index path: \(indexPath.row), target: \(targetSession.name)") - cell.setSessionParameter(session: targetSession) - - // Customize the reordercontrol/hamburger icon background - cell.backgroundColor = .gray - // TODO: We really should disable the sliders/switches in each cell during editing. - - return cell - } - func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle { - // return .delete to get a delete button on the left side of the cell. - return .none - } - - func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool { - // indentation on the left side of the cell - return false - } - func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) { - let movedObject = self.allSessions[sourceIndexPath.row] - allSessions.remove(at: sourceIndexPath.row) - allSessions.insert(movedObject, at: destinationIndexPath.row) - NSLog("%@", "\(sourceIndexPath.row) => \(destinationIndexPath.row) \(allSessions)") - // The sessions have been customized. Write the state/order into defaults so initsessions can read them. - var customOrdering = [String]() - for (index, session) in allSessions.enumerated() { - customOrdering.append(session.id) - print("Session '\(session.name)' custom-ordered to index: \(index)") - } - defaults.set(customOrdering, forKey: "customOrderedCells") - defaults.synchronize() - } -} - -/* - The cells where the sessions show up are custom UITableViewCells. - */ -extension ViewController: SliderCellDelegate { - func didChangeVolume(id: String, newvalue: Double, name: String) { - print("\n\nVolume changed on \(id) to: \(newvalue)") - - let defaultDeviceShortId = findDeviceId(longName: id) - - for session in (SController?.fullState?.defaultDevice.sessions)! { - if session.id == id { - // Pull the current mute value for this session. - let currentMuteValue = session.muted - let encoder = JSONEncoder() - // TODO: return current muted state and use that to make the onesession instance. - let onesession = OneSession(name: name, id: id, volume: Float(newvalue), muted: currentMuteValue) - let adefault = ASessionUpdate.adflDevice(sessions: [onesession], deviceId: defaultDeviceShortId) - let data = ASessionUpdate(protocolVersion: protocolVersion, defaultDevice: adefault) - - let dataAsBytes = try! encoder.encode(data) - let dataAsString = String(bytes: dataAsBytes, encoding: .utf8) - let dataWithNewline = dataAsString! + "\n" - SController?.sendString(input: dataWithNewline) - break - - } - } - } - - func didToggleMute(id: String, muted: Bool, name: String) { - print("\n\nMute button hit on session \(id) to value \(muted)") - let defaultDeviceShortId = findDeviceId(longName: id) - for session in (SController?.fullState?.defaultDevice.sessions)! { - if session.id == id { - - // Pull the current volume value for this session. - let currentVolumeValue = session.volume - let encoder = JSONEncoder() - // TODO: return current muted state and use that to make the onesession instance. - let onesession = OneSession(name: name, id: id, volume: Float(currentVolumeValue), muted: !muted) - let adefault = ASessionUpdate.adflDevice(sessions: [onesession], deviceId: defaultDeviceShortId) - let data = ASessionUpdate(protocolVersion: protocolVersion, defaultDevice: adefault) - - let dataAsBytes = try! encoder.encode(data) - let dataAsString = String(bytes: dataAsBytes, encoding: .utf8) - let dataWithNewline = dataAsString! + "\n" - SController?.sendString(input: dataWithNewline) - break - - } - } - } -} - -/* - The streamcontroller is used to keep track of the TCP socket to the server. - It also handles validation/coding of the JSON strings going to/from the server. - - This view controller should not try to look for status on the stream controller - object here. Instead, delegates from the stream controller should be used to - signal important events to this view controller. - */ - -extension ViewController: StreamControllerDelegate { - - func didGetServerUpdate() { - // This is the top of everything. The entire UI is reloaded if this executes. - // It's only executed when the streamcontroller parses a valid JSON server message. - print("Server update detected. Reloading...\n") - DispatchQueue.main.async { - self.reloadTheWorld() - } - } - func bailToConnectScreen() { - // used if the TCP controller detects problems - DispatchQueue.main.async { - self.performSegue(withIdentifier: "BackToStartSegue", sender: "abort") - } - } - func tearDownConnection() { - // Check to see if the disconnect button took us here. - if disconnectRequested == true { - bailToConnectScreen() - return - } - - // Something went wrong with the socket open to the server. - let alert = UIAlertController(title: "Error", message: "The server connection was lost.", preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: { action in - self.bailToConnectScreen() - })) - DispatchQueue.main.async { - self.present(alert, animated: true) - } - - } - func didConnectToServer() {} - func isAttemptingConnection() {} - func failedToConnect() {} - - func reconnect() { - // This should tear down what we have, then cause a reload of everything. - SController?.disconnect() - SController?.connectNoSend() - } -} - - diff --git a/PcVolumeControl/ViewControllerStart.swift b/PcVolumeControl/ViewControllerStart.swift deleted file mode 100644 index 366ed05..0000000 --- a/PcVolumeControl/ViewControllerStart.swift +++ /dev/null @@ -1,298 +0,0 @@ -// -// ViewControllerStart.swift -// PcVolumeControl -// -// Created by Bill Booth on 12/21/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import UIKit -import Foundation -import Socket - -class ViewControllerStart: UIViewController, UITextFieldDelegate { - // This is controlling the initial connection screen. - - let asyncQueue = DispatchQueue(label: "asyncQueue", attributes: .concurrent) - var serverConnection: Bool? - var spinnerView: UIView? = nil - var SController: StreamController? = nil - var defaults = UserDefaults.standard // to persist the IP/port entered previously - - @IBOutlet weak var Cbutton: UIButton! - @IBOutlet weak var ServerIPField: UITextField! - @IBOutlet weak var ServerPortField: UITextField! - - @IBOutlet weak var frontAboutButton: UIBarButtonItem! - @IBAction func frontAboutButtonClicked(_ sender: UIBarButtonItem) { - performSegue(withIdentifier: "showAbout", sender: "nothing") - } - - @IBAction func ConnectButtonClicked(_ sender: UIButton) { - // handoff to the main viewcontroller - // This function is going to validate both address and port. We do it here and not in the stream controller - // because we want to fail fast and have all validation code/user alerts in a single spot. - - let userInputServer = self.ServerIPField.text - var IPaddr = "127.0.0.1" // a sensible initialization/default because it's a valid address, but semantically makes no sense. - - // This only checks to see if we can make an Int32 out of the port number. Validation is done below. - guard let PortNum = Int32(self.ServerPortField.text!) else { - let _ = Alert.showBasic(title: "Error", message: "Bad port number specified.\nThe default is 3000. The port number needs to be between 1-65535.", vc: self) - return - } - - // Check if the IP field is blank. - if userInputServer!.isEmpty { - let _ = Alert.showBasic(title: "Error", message: "A host name or IPv4 address is required in order to connect to your PCVolumeControl server.", vc: self) - return - } else { - // Regex match for a v4 address - if userInputServer!.matches("^[0-9]") && userInputServer!.matches("[0-9]$") { - // pretty sure it's an IPv4 address, but is it valid? - if !isValidIP(s: userInputServer!) { - let _ = Alert.showBasic(title: "Error", message: "The entry '\(userInputServer!)' was not a valid IPv4 address.", vc: self) - return - } else { - IPaddr = userInputServer! - } - } else { - // Try resolving it. - print("DEBUG: resolving....") - guard let ip = getIPs(dnsName: userInputServer!) else { - print("DNS resolution failed on this user input: \(userInputServer!)") - let _ = Alert.showBasic(title: "Error", message: "DNS resolution failed for hostname\n'\(userInputServer!)'", vc: self) - return - } - IPaddr = ip // We got an address, so assign it. - print("DNS resolution for hostname '\(userInputServer!)' yielded: \(IPaddr)") - } - } - - if !isValidPort(p: PortNum) { - let _ = Alert.showBasic(title: "Error", message: "Bad port number specified.\nThe default is 3000. The port number needs to be between 1-65535.", vc: self) - return - } - - // Whether it's a name or an IP, the last successfully-used will become the default here. - defaults.set(userInputServer!, forKey: "IPaddr") - defaults.set(PortNum, forKey: "PortNum") - - // The stream controller only deals in IP addresses for its socket connections. - SController = StreamController(address: IPaddr, port: PortNum, delegate: self) - SController?.delegate = self - - // Start looking for messages in the publish subject. - SController?.processMessages() - - // Make the initial server connection and get the first message. - asyncQueue.async { - self.SController?.connectNoSend() - } - } - - - override func viewDidLoad() { - super.viewDidLoad() - - // Do any additional setup after loading the view. - ServerIPField.delegate = self - ServerPortField.delegate = self - ServerIPField.returnKeyType = UIReturnKeyType.next - ServerIPField.tag = 1 - ServerPortField.tag = 2 - ServerIPField.autocorrectionType = .no - ServerPortField.autocorrectionType = .no - ServerIPField.keyboardType = .numbersAndPunctuation - ServerPortField.keyboardType = .numberPad - ServerPortField.textColor = .black - - setNeedsStatusBarAppearanceUpdate() // light upper bar - - // connect button styling - Cbutton.styleButton(cornerRadius: 8, borderWidth: 2, borderColor: UIColor.gray.cgColor) - addDoneButtonOnKeyboard() - - if let ipaddr = defaults.string(forKey: "IPaddr") { - ServerIPField.text = ipaddr - } - if let port = defaults.string(forKey: "PortNum") { - ServerPortField.text = port - } - - } - - // TODO: This hasn't been tested with multiple addresses in the response. - func getIPs(dnsName: String) -> String? { - let host = CFHostCreateWithName(nil, dnsName as CFString).takeRetainedValue() - CFHostStartInfoResolution(host, .addresses, nil) - var success: DarwinBoolean = false - if let addresses = CFHostGetAddressing(host, &success)?.takeUnretainedValue() as NSArray? { - for case let theAddress as NSData in addresses { - var hostname = [CChar](repeating: 0, count: Int(NI_MAXHOST)) - if getnameinfo(theAddress.bytes.assumingMemoryBound(to: sockaddr.self), socklen_t(theAddress.length), - &hostname, socklen_t(hostname.count), nil, 0, NI_NUMERICHOST) == 0 { - let numAddress = String(cString: hostname) - return numAddress - } - } - } - - return nil - } - - // used to move between IP and Port fields - func textFieldShouldReturn(_ textField: UITextField) -> Bool - { - if let nextField = textField.superview?.viewWithTag(textField.tag + 1) as? UITextField { - nextField.becomeFirstResponder() - } else { - textField.resignFirstResponder() - } - return false - } - - override var preferredStatusBarStyle: UIStatusBarStyle { - return .lightContent - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if segue.identifier == "ConnectSegue" { - let destVC = segue.destination as! ViewController - destVC.SController = self.SController // give them our stream controller - destVC.initialDraw = true // signal to viewDidLoad() to reload everything. - destVC.modalPresentationStyle = .fullScreen - destVC.modalTransitionStyle = .crossDissolve - } - if segue.identifier == "showAbout" { - let destVC = segue.destination as UIViewController - destVC.modalPresentationStyle = .fullScreen - destVC.modalTransitionStyle = .flipHorizontal - } - } - func addDoneButtonOnKeyboard() - { - let doneToolbar: UIToolbar = UIToolbar() - doneToolbar.barStyle = UIBarStyle.default - - let flexSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.flexibleSpace, target: nil, action: nil) - let done: UIBarButtonItem = UIBarButtonItem(title: "Done", style: UIBarButtonItem.Style.done, target: self, action: #selector(ViewControllerStart.doneButtonAction(_:))) - var items = [UIBarButtonItem]() - items.append(flexSpace) - items.append(done) - items.append(flexSpace) - - doneToolbar.items = items - doneToolbar.sizeToFit() - - ServerPortField.inputAccessoryView = doneToolbar - - } - - @objc func doneButtonAction(_ sender: UIBarButtonItem!) - { - view.endEditing(true) - } - // This obviously only supports v4, but if they used a hostname and got a AAAA record back, we would technically work with v6. - func isValidIP(s: String) -> Bool { - let parts = s.components(separatedBy: ".") - let nums = parts.compactMap { Int($0) } - return parts.count == 4 && nums.count == 4 && nums.filter { $0 >= 0 && $0 < 256}.count == 4 - } - - func isValidPort(p: Int32) -> Bool { - let portRange = 1...65535 - if portRange.contains(Int(p)){ - return true - } - return false - } -} - -extension ViewControllerStart: StreamControllerDelegate { - func isAttemptingConnection() { - let timeout = 3.0 // in seconds - - print("Connection is in progress...") - let semaphore = DispatchSemaphore(value: 0) - asyncQueue.async { - DispatchQueue.main.async { - self.spinnerView = UIViewController.displaySpinner(onView: self.view) - // This signal allows us to fail fast. - semaphore.signal() - } - } - // This timeout code will be hit/executed only if the doesn't go away after the timeout. - // In normal operation, the spinner should be gone very quickly. Less than a second. - if semaphore.wait(timeout: .now() + timeout) == .timedOut { - print("Timeout hit during initial server connection") - } - } - func didConnectToServer() { - print("Server connection complete. Moving to main VC.") - asyncQueue.async { - DispatchQueue.main.async { - if let spinner = self.spinnerView { - UIViewController.removeSpinner(spinner: spinner) - } - // go to the next screen, pushing along the stream controller instance. - self.performSegue(withIdentifier: "ConnectSegue", sender: self.SController) - } - } - } - - func failedToConnect() { - DispatchQueue.main.async { [self] in - let _ = Alert.showBasic(title: "Connection Error", message: "Connection to the server failed.\n\nIs the endpoint correct?\nIs the TCP port open?", vc: self) - } - if let spinner = spinnerView { - UIViewController.removeSpinner(spinner: spinner) - } - } - func didGetServerUpdate() {} - func bailToConnectScreen() {} - func tearDownConnection() {} -} - -// This is the spinner shown when the socket is being set up. -extension UIViewController { - class func displaySpinner(onView : UIView) -> UIView { - - let spinnerView = UIView.init(frame: onView.bounds) - spinnerView.backgroundColor = UIColor.init(red: 0.5, green: 0.5, blue: 0.5, alpha: 0.5) - let ai = UIActivityIndicatorView.init(style: .whiteLarge) - ai.startAnimating() - ai.center = spinnerView.center - - spinnerView.addSubview(ai) - onView.addSubview(spinnerView) - - return spinnerView - } - - class func removeSpinner(spinner :UIView) { - DispatchQueue.main.async { - spinner.removeFromSuperview() - } - } -} - -// Customizing the Connect button a bit -extension UIButton { - func styleButton(cornerRadius: CGFloat, borderWidth: CGFloat, borderColor: CGColor) { - self.layer.cornerRadius = cornerRadius - self.layer.borderWidth = borderWidth - self.layer.borderColor = borderColor - } -} - -// Extend String so we can allow regex matching on the domain name/IP entered. -extension String { - func matches(_ regex: String) -> Bool { - return self.range(of: regex, options: .regularExpression, range: nil, locale: nil) != nil - } -} diff --git a/PcVolumeControl/datasources/ServersLocalDataSource.swift b/PcVolumeControl/datasources/ServersLocalDataSource.swift new file mode 100644 index 0000000..febf791 --- /dev/null +++ b/PcVolumeControl/datasources/ServersLocalDataSource.swift @@ -0,0 +1,32 @@ +import Foundation + +/// Purely synchronous, stateless access to the persisted “recent servers” list. +protocol ServersLocalDataSourceProtocol { + /// Return the list in most-recent–first order. + func loadRecent() -> [DiscoveredServer] + + /// Overwrite the stored list (idempotent). + func saveRecent(_ list: [DiscoveredServer]) +} + +struct ServersLocalDataSource: ServersLocalDataSourceProtocol { + private let defaults: UserDefaults + private static let key = "recentServers" + + init(defaults: UserDefaults = .standard) { + self.defaults = defaults + } + + func loadRecent() -> [DiscoveredServer] { + guard + let data = defaults.data(forKey: Self.key), + let decoded = try? JSONDecoder().decode([DiscoveredServer].self, from: data) + else { return [] } + return decoded + } + + func saveRecent(_ list: [DiscoveredServer]) { + guard let encoded = try? JSONEncoder().encode(list) else { return } + defaults.set(encoded, forKey: Self.key) + } +} diff --git a/PcVolumeControl/datasources/TCPConnectionDataSource.swift b/PcVolumeControl/datasources/TCPConnectionDataSource.swift new file mode 100644 index 0000000..0fc9cb9 --- /dev/null +++ b/PcVolumeControl/datasources/TCPConnectionDataSource.swift @@ -0,0 +1,94 @@ +import Foundation +import Network + + +protocol TCPConnectionDataSourceProtocol { + func openConnection(to server: DiscoveredServer) async throws -> Connection +} + +struct TCPConnectionDataSource: TCPConnectionDataSourceProtocol { + + func openConnection(to server: DiscoveredServer) async throws -> Connection { + + let host = NWEndpoint.Host(server.address) + guard let port = NWEndpoint.Port(rawValue: server.port) else { + throw TCPConnectionError.invalidPort(server.port) + } + + // TCP keepalive detects a silently dropped peer in ~25s (10s idle + 5s x3 probes) as a read error. + let tcpOptions = NWProtocolTCP.Options() + tcpOptions.enableKeepalive = true + tcpOptions.keepaliveIdle = 10 // seconds idle before first probe + tcpOptions.keepaliveInterval = 5 // seconds between probes + tcpOptions.keepaliveCount = 3 // missed probes before declaring dead + let parameters = NWParameters(tls: nil, tcp: tcpOptions) + + let nwConnection = NWConnection(host: host, port: port, using: parameters) + let queue = DispatchQueue(label: "TCPConnection-\(UUID().uuidString)") + + return try await withThrowingTaskGroup(of: Connection.self) { group in + group.addTask { + try await withCheckedThrowingContinuation { continuation in + // Use a class wrapper to make hasResumed thread-safe + final class ResumeState: @unchecked Sendable { + private let lock = NSLock() + private var _hasResumed = false + + var hasResumed: Bool { + lock.lock() + defer { lock.unlock() } + return _hasResumed + } + + func markResumed() -> Bool { + lock.lock() + defer { lock.unlock() } + if _hasResumed { + return false + } + _hasResumed = true + return true + } + } + + let resumeState = ResumeState() + + nwConnection.stateUpdateHandler = { state in + switch state { + case .ready: + if resumeState.markResumed() { + continuation.resume(returning: Connection(nw: nwConnection)) + } + case .failed(let error): + if resumeState.markResumed() { + continuation.resume(throwing: error) + } + case .cancelled: + if resumeState.markResumed() { + continuation.resume(throwing: TCPConnectionError.cancelledBeforeReady) + } + default: + break // .setup / .preparing / .waiting – keep waiting + } + } + + nwConnection.start(queue: queue) + } + } + + group.addTask { + try await Task.sleep(nanoseconds: 5_000_000_000) // 5 seconds + throw TCPConnectionError.connectionTimeout(server.address, server.port) + } + + defer { + group.cancelAll() + if nwConnection.state != .ready { + nwConnection.cancel() + } + } + + return try await group.next()! + } + } +} diff --git a/PcVolumeControl/datasources/VolumeTransportDataSource.swift b/PcVolumeControl/datasources/VolumeTransportDataSource.swift new file mode 100644 index 0000000..e36bd0a --- /dev/null +++ b/PcVolumeControl/datasources/VolumeTransportDataSource.swift @@ -0,0 +1,50 @@ +import Foundation + +protocol VolumeTransportDataSourceProtocol { + func outgoing(_ data: Data) async throws + func incoming() -> AsyncThrowingStream + func close() +} + +struct VolumeTransportDataSource: VolumeTransportDataSourceProtocol { + let connection: Connection + private let newline = Data([0x0A]) + + func outgoing(_ data: Data) async throws { + try await connection.send(data + newline) + } + + func incoming() -> AsyncThrowingStream { + .streamNewlineDelimitedBytes(from: connection.bytes()) + } + + func close() { + connection.close() + } +} + +private extension AsyncThrowingStream where Element == Data, Failure == Error { + static func streamNewlineDelimitedBytes(from upstream: AsyncThrowingStream) + -> AsyncThrowingStream + { + AsyncThrowingStream { continuation in + var buffer = Data() + let task = Task { + do { + for try await chunk in upstream { + buffer.append(chunk) + while let nl = buffer.firstIndex(of: 0x0A) { + let frame = buffer.prefix(upTo: nl) + buffer.removeSubrange(...nl) + continuation.yield(Data(frame)) + } + } + continuation.finish() + } catch { + continuation.finish(throwing: error) + } + } + continuation.onTermination = { _ in task.cancel() } + } + } +} diff --git a/PcVolumeControl/iosicons/Icon-100.png b/PcVolumeControl/iosicons/Icon-100.png deleted file mode 100644 index 7a8a278..0000000 Binary files a/PcVolumeControl/iosicons/Icon-100.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-1024.png b/PcVolumeControl/iosicons/Icon-1024.png deleted file mode 100644 index ad5886c..0000000 Binary files a/PcVolumeControl/iosicons/Icon-1024.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-114.png b/PcVolumeControl/iosicons/Icon-114.png deleted file mode 100644 index 83c3d7c..0000000 Binary files a/PcVolumeControl/iosicons/Icon-114.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-120.png b/PcVolumeControl/iosicons/Icon-120.png deleted file mode 100644 index 15152d5..0000000 Binary files a/PcVolumeControl/iosicons/Icon-120.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-128.png b/PcVolumeControl/iosicons/Icon-128.png deleted file mode 100644 index 5ac39f6..0000000 Binary files a/PcVolumeControl/iosicons/Icon-128.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-144.png b/PcVolumeControl/iosicons/Icon-144.png deleted file mode 100644 index f0683dd..0000000 Binary files a/PcVolumeControl/iosicons/Icon-144.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-152.png b/PcVolumeControl/iosicons/Icon-152.png deleted file mode 100644 index 3d227a7..0000000 Binary files a/PcVolumeControl/iosicons/Icon-152.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-16.png b/PcVolumeControl/iosicons/Icon-16.png deleted file mode 100644 index d1f7c24..0000000 Binary files a/PcVolumeControl/iosicons/Icon-16.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-167.png b/PcVolumeControl/iosicons/Icon-167.png deleted file mode 100644 index a21f85b..0000000 Binary files a/PcVolumeControl/iosicons/Icon-167.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-172.png b/PcVolumeControl/iosicons/Icon-172.png deleted file mode 100644 index ee1d7fb..0000000 Binary files a/PcVolumeControl/iosicons/Icon-172.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-180.png b/PcVolumeControl/iosicons/Icon-180.png deleted file mode 100644 index 78e42de..0000000 Binary files a/PcVolumeControl/iosicons/Icon-180.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-196.png b/PcVolumeControl/iosicons/Icon-196.png deleted file mode 100644 index ea30aa2..0000000 Binary files a/PcVolumeControl/iosicons/Icon-196.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-20.png b/PcVolumeControl/iosicons/Icon-20.png deleted file mode 100644 index 3ae6eda..0000000 Binary files a/PcVolumeControl/iosicons/Icon-20.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-256.png b/PcVolumeControl/iosicons/Icon-256.png deleted file mode 100644 index 1d817d4..0000000 Binary files a/PcVolumeControl/iosicons/Icon-256.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-29.png b/PcVolumeControl/iosicons/Icon-29.png deleted file mode 100644 index f929e12..0000000 Binary files a/PcVolumeControl/iosicons/Icon-29.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-32.png b/PcVolumeControl/iosicons/Icon-32.png deleted file mode 100644 index a1c8943..0000000 Binary files a/PcVolumeControl/iosicons/Icon-32.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-40.png b/PcVolumeControl/iosicons/Icon-40.png deleted file mode 100644 index 6887efa..0000000 Binary files a/PcVolumeControl/iosicons/Icon-40.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-48.png b/PcVolumeControl/iosicons/Icon-48.png deleted file mode 100644 index 900d978..0000000 Binary files a/PcVolumeControl/iosicons/Icon-48.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-50.png b/PcVolumeControl/iosicons/Icon-50.png deleted file mode 100644 index b19152c..0000000 Binary files a/PcVolumeControl/iosicons/Icon-50.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-512.png b/PcVolumeControl/iosicons/Icon-512.png deleted file mode 100644 index 742fa5b..0000000 Binary files a/PcVolumeControl/iosicons/Icon-512.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-55.png b/PcVolumeControl/iosicons/Icon-55.png deleted file mode 100644 index 6f065a2..0000000 Binary files a/PcVolumeControl/iosicons/Icon-55.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-57.png b/PcVolumeControl/iosicons/Icon-57.png deleted file mode 100644 index f7116a5..0000000 Binary files a/PcVolumeControl/iosicons/Icon-57.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-58.png b/PcVolumeControl/iosicons/Icon-58.png deleted file mode 100644 index a4b48d4..0000000 Binary files a/PcVolumeControl/iosicons/Icon-58.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-60.png b/PcVolumeControl/iosicons/Icon-60.png deleted file mode 100644 index d23e0d9..0000000 Binary files a/PcVolumeControl/iosicons/Icon-60.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-64.png b/PcVolumeControl/iosicons/Icon-64.png deleted file mode 100644 index 8bf4b3a..0000000 Binary files a/PcVolumeControl/iosicons/Icon-64.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-72.png b/PcVolumeControl/iosicons/Icon-72.png deleted file mode 100644 index f36a345..0000000 Binary files a/PcVolumeControl/iosicons/Icon-72.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-76.png b/PcVolumeControl/iosicons/Icon-76.png deleted file mode 100644 index b22ae89..0000000 Binary files a/PcVolumeControl/iosicons/Icon-76.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-80.png b/PcVolumeControl/iosicons/Icon-80.png deleted file mode 100644 index 8a8beca..0000000 Binary files a/PcVolumeControl/iosicons/Icon-80.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-87.png b/PcVolumeControl/iosicons/Icon-87.png deleted file mode 100644 index 110eb24..0000000 Binary files a/PcVolumeControl/iosicons/Icon-87.png and /dev/null differ diff --git a/PcVolumeControl/iosicons/Icon-88.png b/PcVolumeControl/iosicons/Icon-88.png deleted file mode 100644 index 47183f7..0000000 Binary files a/PcVolumeControl/iosicons/Icon-88.png and /dev/null differ diff --git a/PcVolumeControl/models/Connection.swift b/PcVolumeControl/models/Connection.swift new file mode 100644 index 0000000..75bc5c7 --- /dev/null +++ b/PcVolumeControl/models/Connection.swift @@ -0,0 +1,50 @@ +import Foundation +import Network + +enum TCPConnectionError: LocalizedError { + case invalidPort(UInt16) + case cancelledBeforeReady + case connectionTimeout(String, UInt16) + + var errorDescription: String? { + switch self { + case .invalidPort(let port): + return "Invalid port: \(port)" + case .cancelledBeforeReady: + return "Connection was cancelled before becoming ready" + case .connectionTimeout(let address, let port): + return "Connection timeout to \(address):\(port). The server did not respond within 5 seconds." + } + } +} + +struct Connection { + let nw: NWConnection + + func send(_ data: Data) async throws { + try await withCheckedThrowingContinuation { cont in + nw.send(content: data, completion: .contentProcessed { err in + err.map { cont.resume(throwing: $0) } ?? cont.resume() + }) + } + } + + func bytes() -> AsyncThrowingStream { + AsyncThrowingStream { continuation in + // Tear down the socket when the consumer cancels or the stream finishes. + continuation.onTermination = { [nw] _ in nw.cancel() } + func receiveNext() { + nw.receive(minimumIncompleteLength: 1, + maximumLength: 65_536) { data, _, isComplete, error in + if let error { continuation.finish(throwing: error); return } + if let data { continuation.yield(data) } + if isComplete { continuation.finish() } + else { receiveNext() } + } + } + receiveNext() + } + } + + func close() { nw.cancel() } +} diff --git a/PcVolumeControl/models/DiscoveredServer.swift b/PcVolumeControl/models/DiscoveredServer.swift new file mode 100644 index 0000000..f764eec --- /dev/null +++ b/PcVolumeControl/models/DiscoveredServer.swift @@ -0,0 +1,45 @@ +class DiscoveredServer: Hashable, Codable { + var id: String + var address: String + var port: UInt16 + var computerName: String? + + init(address: String, port: UInt16, computerName: String? = nil) { + self.address = address + self.port = port + self.computerName = computerName + self.id = address + String(port) + } + + func toString() -> String { + return "\(self.address):\(self.port)" + } + + static func == (lhs: DiscoveredServer, rhs: DiscoveredServer) -> Bool { + return lhs.toString() == rhs.toString() + } + + func hash(into hasher: inout Hasher) { + hasher.combine(self.toString()) + } + + enum CodingKeys: String, CodingKey { + case id, address, port, computerName + } + + required init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: CodingKeys.self) + address = try container.decode(String.self, forKey: .address) + port = try container.decode(UInt16.self, forKey: .port) + computerName = try container.decodeIfPresent(String.self, forKey: .computerName) + id = try container.decode(String.self, forKey: .id) + } + + func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(address, forKey: .address) + try container.encode(port, forKey: .port) + try container.encodeIfPresent(computerName, forKey: .computerName) + try container.encode(id, forKey: .id) + } +} diff --git a/PcVolumeControl/models/Log.swift b/PcVolumeControl/models/Log.swift new file mode 100644 index 0000000..b3859b8 --- /dev/null +++ b/PcVolumeControl/models/Log.swift @@ -0,0 +1,13 @@ +import Foundation + +/// Lightweight logging shim used in place of bare `print`. +/// +/// In Debug builds this writes to the console exactly like `print`. In Release +/// builds the body compiles to nothing and the message is never evaluated, so +/// diagnostic output (and its string-interpolation cost) never ships to users' +/// device consoles. Shared by the app and the widget extension. +func appLog(_ message: @autoclosure () -> Any) { + #if DEBUG + print(message()) + #endif +} diff --git a/PcVolumeControl/models/SharedConnectionState.swift b/PcVolumeControl/models/SharedConnectionState.swift new file mode 100644 index 0000000..2ab0d7a --- /dev/null +++ b/PcVolumeControl/models/SharedConnectionState.swift @@ -0,0 +1,91 @@ +import Foundation + +/// Shared connection state between app and widget +struct SharedConnectionState: Codable { + var isConnected: Bool + var lastSeenAlive: Date + var serverName: String? + var serverAddress: String? + var masterVolume: Double + var chatVolume: Double? + var chatSessionName: String? + + init( + isConnected: Bool = false, + lastSeenAlive: Date = Date(), + serverName: String? = nil, + serverAddress: String? = nil, + masterVolume: Double = 0, + chatVolume: Double? = nil, + chatSessionName: String? = nil + ) { + self.isConnected = isConnected + self.lastSeenAlive = lastSeenAlive + self.serverName = serverName + self.serverAddress = serverAddress + self.masterVolume = masterVolume + self.chatVolume = chatVolume + self.chatSessionName = chatSessionName + } + + /// Returns true if the connection state is older than 45 seconds + var isStale: Bool { + Date().timeIntervalSince(lastSeenAlive) > 45 + } + + /// Returns a human-readable string indicating how long ago the state was updated + var staleDurationString: String { + let interval = Date().timeIntervalSince(lastSeenAlive) + if interval < 60 { + return "\(Int(interval))s ago" + } else if interval < 3600 { + return "\(Int(interval/60))m ago" + } else { + return "\(Int(interval/3600))h ago" + } + } + + var displayServerName: String { + serverName ?? serverAddress ?? "Unknown" + } +} + +/// Helper for reading/writing shared state to App Group container +struct SharedStateManager { + static let appGroupIdentifier = "group.cwb.PcVolumeControl" + private static let stateKey = "connectionState" + + static func readState() -> SharedConnectionState? { + guard let sharedDefaults = UserDefaults(suiteName: appGroupIdentifier) else { + appLog("Failed to access shared UserDefaults with suite: \(appGroupIdentifier)") + return nil + } + + guard let data = sharedDefaults.data(forKey: stateKey) else { + return nil + } + + do { + return try JSONDecoder().decode(SharedConnectionState.self, from: data) + } catch { + appLog("Failed to decode shared state: \(error)") + return nil + } + } + + static func writeState(_ state: SharedConnectionState) { + guard let sharedDefaults = UserDefaults(suiteName: appGroupIdentifier) else { + appLog("Failed to access shared UserDefaults for writing") + return + } + + do { + let data = try JSONEncoder().encode(state) + sharedDefaults.set(data, forKey: stateKey) + sharedDefaults.synchronize() + } catch { + appLog("Failed to encode shared state: \(error)") + } + } + +} diff --git a/PcVolumeControl/models/VolumeUpdateDTOs.swift b/PcVolumeControl/models/VolumeUpdateDTOs.swift new file mode 100644 index 0000000..1081254 --- /dev/null +++ b/PcVolumeControl/models/VolumeUpdateDTOs.swift @@ -0,0 +1,40 @@ +import Foundation + +// Outgoing JSON wire-protocol payloads sent to the server (encode-only). + +// to change the default device +struct ADefaultDeviceUpdate : Codable { + struct adflDevice : Codable { + let deviceId: String + } + let protocolVersion: Int + let defaultDevice: adflDevice +} + +// volume and/or mute for a master device +struct AMasterChannelUpdate : Codable { + struct adflDevice : Codable { + let deviceId: String + let masterMuted: Bool + let masterVolume: Double + } + let protocolVersion: Int + let defaultDevice: adflDevice +} + +// individual session slider/mute updates +struct ASessionUpdate : Codable { + struct adflDevice : Codable { + let sessions: [OneSession] + let deviceId: String + } + let protocolVersion: Int + let defaultDevice: adflDevice +} + +struct OneSession : Codable { + let name: String + let id: String + let volume: Double + let muted: Bool +} diff --git a/PcVolumeControl/repos/AliasManager.swift b/PcVolumeControl/repos/AliasManager.swift new file mode 100644 index 0000000..232e373 --- /dev/null +++ b/PcVolumeControl/repos/AliasManager.swift @@ -0,0 +1,56 @@ +import Foundation +import SwiftUI + +/// Manages user-defined aliases for devices and sessions +class AliasManager: ObservableObject { + private let deviceAliasesKey = "deviceAliases" + private let sessionAliasesKey = "sessionAliases" + @Published var deviceAliases: [String: String] = [:] + @Published var sessionAliases: [String: String] = [:] + private let defaults = UserDefaults.standard + + init() { + loadAliases() + } + + func loadAliases() { + if let savedDeviceAliases = defaults.dictionary(forKey: deviceAliasesKey) as? [String: String] { + deviceAliases = savedDeviceAliases + } + + if let savedSessionAliases = defaults.dictionary(forKey: sessionAliasesKey) as? [String: String] { + sessionAliases = savedSessionAliases + } + } + + func saveAliases() { + defaults.set(deviceAliases, forKey: deviceAliasesKey) + defaults.set(sessionAliases, forKey: sessionAliasesKey) + } + + func setDeviceAlias(originalId: String, alias: String) { + if alias.isEmpty { + deviceAliases.removeValue(forKey: originalId) + } else { + deviceAliases[originalId] = alias + } + saveAliases() + } + + func setSessionAlias(originalId: String, alias: String) { + if alias.isEmpty { + sessionAliases.removeValue(forKey: originalId) + } else { + sessionAliases[originalId] = alias + } + saveAliases() + } + + func displayNameForDevice(deviceId: String, originalName: String) -> String { + return deviceAliases[deviceId] ?? originalName + } + + func displayNameForSession(sessionId: String, originalName: String) -> String { + return sessionAliases[sessionId] ?? originalName + } +} diff --git a/PcVolumeControl/repos/MDNSDiscoveryService.swift b/PcVolumeControl/repos/MDNSDiscoveryService.swift new file mode 100644 index 0000000..1f12d7c --- /dev/null +++ b/PcVolumeControl/repos/MDNSDiscoveryService.swift @@ -0,0 +1,133 @@ +import Foundation +import Network + +class MDNSDiscoveryService: ObservableObject { + @Published var discoveredServers: [DiscoveredServer] = [] + @Published var isDiscovering = false + + private var browser: NWBrowser? + private let browserQueue = DispatchQueue(label: "mdns.browser.queue") + + func startDiscovery() { + guard browser == nil else { return } + + let parameters = NWParameters() + parameters.includePeerToPeer = true + + let browserDescriptor = NWBrowser.Descriptor.bonjour(type: "_pcvolumecontrol._tcp", domain: "local.") + browser = NWBrowser(for: browserDescriptor, using: parameters) + + browser?.stateUpdateHandler = { [weak self] (state: NWBrowser.State) in + DispatchQueue.main.async { + switch state { + case .ready: + self?.isDiscovering = true + case .failed, .cancelled: + self?.isDiscovering = false + default: + break + } + } + } + + browser?.browseResultsChangedHandler = { [weak self] _, changes in + self?.handleBrowseResults(changes: changes) + } + + browser?.start(queue: browserQueue) + } + + func stopDiscovery() { + guard browser != nil else { return } + + browser?.cancel() + browser = nil + DispatchQueue.main.async { + self.isDiscovering = false + self.discoveredServers.removeAll() + } + } + + private func handleBrowseResults(changes: Set) { + for change in changes { + switch change { + case .added(let result): + if case .service = result.endpoint { + resolveService(result: result) + } + case .removed(let result): + removeServer(result: result) + case .changed(old: _, new: let newResult, flags: _): + resolveService(result: newResult) + default: + break + } + } + } + + private func resolveService(result: NWBrowser.Result) { + guard case let .service(name: serviceName, type: _, domain: _, interface: _) = result.endpoint else { + return + } + + let connection = NWConnection(to: result.endpoint, using: .tcp) + + connection.stateUpdateHandler = { [weak self] (state: NWConnection.State) in + switch state { + case .ready: + if let endpoint = connection.currentPath?.remoteEndpoint, + case let .hostPort(host: host, port: port) = endpoint { + + let rawHostString = "\(host)" + let cleanedAddress = self?.cleanIPAddress(rawHostString) ?? rawHostString + let computerName = self?.extractComputerName(from: serviceName) + let server = DiscoveredServer(address: cleanedAddress, port: port.rawValue, computerName: computerName) + + DispatchQueue.main.async { + // Remove any existing server with the same address and add the new one + self?.discoveredServers.removeAll { $0.address == cleanedAddress } + self?.discoveredServers.append(server) + } + } + connection.cancel() + case .failed: + connection.cancel() + default: + break + } + } + + connection.start(queue: browserQueue) + } + + private func removeServer(result: NWBrowser.Result) { + guard case let .service(name: serviceName, type: _, domain: _, interface: _) = result.endpoint else { + return + } + + DispatchQueue.main.async { + self.discoveredServers.removeAll { $0.id.contains(serviceName) } + } + } + + private func cleanIPAddress(_ rawAddress: String) -> String { + // Remove interface identifier from IP address (e.g., "192.168.1.100%en0" -> "192.168.1.100") + if let percentIndex = rawAddress.firstIndex(of: "%") { + return String(rawAddress[.. String? { + // Service name format "COMPUTERNAME-pcvolumecontrol-PORT"; take the part before the first hyphen. + let components = serviceName.components(separatedBy: "-") + guard components.count >= 2, !components[0].isEmpty else { + return nil + } + return components[0] + } + + deinit { + stopDiscovery() + } +} diff --git a/PcVolumeControl/repos/SavedServerManager.swift b/PcVolumeControl/repos/SavedServerManager.swift new file mode 100644 index 0000000..92eea05 --- /dev/null +++ b/PcVolumeControl/repos/SavedServerManager.swift @@ -0,0 +1,34 @@ +class SavedServerManager: ObservableObject { + func loadSavedServers() { + let decoder = JSONDecoder() + + if let lastConnectedData = defaults.object(forKey: "lastConnectedServer") as? Data, + let lastConnectedServer = try? decoder.decode(DiscoveredServer.self, from: lastConnectedData) { + selectedServer = lastConnectedServer + } + + if let savedServers = defaults.object(forKey: "recentServers") as? Data, + let loadedServers = try? decoder.decode([DiscoveredServer].self, from: savedServers) { + usedServers = loadedServers + + // Fall back to the most recent history entry if no last-connected server was set. + if selectedServer.address.isEmpty && !usedServers.isEmpty { + selectedServer = usedServers[0] + } + } + } + + func saveRecentServers() { + let encoder = JSONEncoder() + if let encoded = try? encoder.encode(usedServers) { + defaults.set(encoded, forKey: "recentServers") + } + } + + func saveLastConnectedServer(server: DiscoveredServer) { + let encoder = JSONEncoder() + if let encoded = try? encoder.encode(server) { + defaults.set(encoded, forKey: "lastConnectedServer") + } + } +} diff --git a/PcVolumeControl/repos/ServersRepository.swift b/PcVolumeControl/repos/ServersRepository.swift new file mode 100644 index 0000000..30e7215 --- /dev/null +++ b/PcVolumeControl/repos/ServersRepository.swift @@ -0,0 +1,15 @@ +import Network + +struct ServersRepository { + let local: ServersLocalDataSourceProtocol + let remote: TCPConnectionDataSourceProtocol + + func connect(to server: DiscoveredServer) async throws -> VolumeControlRepository { + let connection = try await remote.openConnection(to: server) + let transport = VolumeTransportDataSource(connection: connection) + return VolumeControlRepository(transport: transport) + } + + func recent() -> [DiscoveredServer] { local.loadRecent() } + func saveRecent(_ list: [DiscoveredServer]) { local.saveRecent(list) } +} diff --git a/PcVolumeControl/repos/VolumeControlRepository.swift b/PcVolumeControl/repos/VolumeControlRepository.swift new file mode 100644 index 0000000..a1dc78d --- /dev/null +++ b/PcVolumeControl/repos/VolumeControlRepository.swift @@ -0,0 +1,73 @@ +import Foundation + +struct VolumeControlRepository { + static let protocolVersion = 7 + + let transport: VolumeTransportDataSourceProtocol + let deviceIdLookup = DeviceIdLookup() + + func fullStateStream() -> AsyncThrowingStream { + AsyncThrowingStream { continuation in + let task = Task { + do { + for try await msgBytes in transport.incoming() { + let state = try JSONDecoder().decode(FullState.self, from: msgBytes) + deviceIdLookup.ingest(state.deviceIds) + continuation.yield(state) + } + continuation.finish() + } catch { + continuation.finish(throwing: error) + } + } + // Propagate consumer cancellation down the stream chain. + continuation.onTermination = { _ in task.cancel() } + } + } + + func pushDefaultDevice(id: String) async throws { + let dto = ADefaultDeviceUpdate( + protocolVersion: VolumeControlRepository.protocolVersion, + defaultDevice: ADefaultDeviceUpdate.adflDevice(deviceId: id) + ) + try await send(dto) + } + + func pushMasterValues(id: String, muted: Bool, volume: Double) async throws { + let dto = AMasterChannelUpdate( + protocolVersion: VolumeControlRepository.protocolVersion, + defaultDevice: AMasterChannelUpdate.adflDevice( + deviceId: id, + masterMuted: muted, + masterVolume: volume + ) + ) + try await send(dto) + } + + func pushSessionValues(name: String, id: String, volume: Double, muted: Bool) async throws { + let shortId = deviceIdLookup.shortId(for: id) ?? id + let dto = ASessionUpdate( + protocolVersion: VolumeControlRepository.protocolVersion, + defaultDevice: ASessionUpdate.adflDevice( + sessions: [OneSession(name: name, id: id, volume: volume, muted: muted)], + deviceId: shortId + ) + ) + try await send(dto) + } + + private func send(_ dto: T) async throws { + try await transport.outgoing(JSONEncoder().encode(dto)) + } +} + +final class DeviceIdLookup { + private var table = [String: String]() + func ingest(_ mapping: [String: String]) { + table.merge(mapping) { _, new in new } + } + func shortId(for longName: String) -> String? { + table.first { longName.contains($0.key) }?.key + } +} diff --git a/PcVolumeControl/usecases/ConnectToServerUseCase.swift b/PcVolumeControl/usecases/ConnectToServerUseCase.swift new file mode 100644 index 0000000..cb55c73 --- /dev/null +++ b/PcVolumeControl/usecases/ConnectToServerUseCase.swift @@ -0,0 +1,10 @@ +import Network + +struct ConnectToServerUseCase { + let repo: ServersRepository + + func execute(address: String, port: UInt16) async throws -> VolumeControlRepository { + let server = DiscoveredServer(address: address, port: port, computerName: nil) + return try await repo.connect(to: server) + } +} diff --git a/PcVolumeControl/usecases/VolumeControlUseCases.swift b/PcVolumeControl/usecases/VolumeControlUseCases.swift new file mode 100644 index 0000000..6b6dcff --- /dev/null +++ b/PcVolumeControl/usecases/VolumeControlUseCases.swift @@ -0,0 +1,18 @@ +struct SendDefaultDeviceUpdateUseCase { + let repo: VolumeControlRepository + func execute(_ id: String) async throws { try await repo.pushDefaultDevice(id: id) } +} + +struct SendMasterChannelUpdateUseCase { + let repo: VolumeControlRepository + func execute(id: String, muted: Bool, volume: Double) async throws { + try await repo.pushMasterValues(id: id, muted: muted, volume: volume) + } +} + +struct SendSessionUpdateUseCase { + let repo: VolumeControlRepository + func execute(name: String, id: String, vol: Double, muted: Bool) async throws { + try await repo.pushSessionValues(name: name, id: id, volume: vol, muted: muted) + } +} diff --git a/PcVolumeControl/viewmodels/MainViewModel.swift b/PcVolumeControl/viewmodels/MainViewModel.swift new file mode 100644 index 0000000..9d0c192 --- /dev/null +++ b/PcVolumeControl/viewmodels/MainViewModel.swift @@ -0,0 +1,641 @@ +import Foundation +import Network +import UIKit +import WidgetKit + +@MainActor +final class MainViewModel: ObservableObject { + /// Default server port used when the user leaves the port field blank. + static let defaultPort: UInt16 = 3000 + + // UI-bound state + @Published var address = "" + @Published var port: UInt16 = 0 + @Published var isLoading = false + @Published var error: String? + @Published var fullState: FullState? + + // Server management state + @Published var recentServers: [DiscoveredServer] = [] + @Published var discoveredServers: [DiscoveredServer] = [] + @Published var isAutoDiscovered = false + @Published var currentDiscoveredServer: DiscoveredServer? = nil + + // Reconnection state + enum ConnectionStatus: Equatable { case connected, reconnecting, lost } + @Published var connectionStatus: ConnectionStatus = .connected + + /// True only when the connection is live; controls are interactive only then. + var isConnectionLive: Bool { connectionStatus == .connected } + + private let connect: ConnectToServerUseCase + private var defUpdate: SendDefaultDeviceUpdateUseCase + private var masterUpdate: SendMasterChannelUpdateUseCase + private var sessionUpdate: SendSessionUpdateUseCase + + private let serversRepo: ServersRepository + private var streamTask: Task? + private var heartbeatTask: Task? + private var reconnectTask: Task? + private var currentRepo: VolumeControlRepository? + private var isInBackground = false + private var userInitiatedDisconnect = false + private var lastConnectedServer: DiscoveredServer? + // Reconnect backoff/window. Settable so tests don't have to wait in realtime. + var reconnectInitialDelaySeconds: Double = 5 + var reconnectMaxDelaySeconds: Double = 30 + var reconnectWindowSeconds: Double = 120 // ~2 minutes total before giving up + + // Network path monitoring: detects WiFi/cellular interface changes a stalled socket won't report. + private var pathMonitor: NWPathMonitor? + private let pathMonitorQueue = DispatchQueue(label: "cwb.PcVolumeControl.path-monitor") + private var lastPathSignature: String? + private var connectedOverWiFi = false + private var connectedOverCellular = false + + init(connect: ConnectToServerUseCase, + defUpdate: SendDefaultDeviceUpdateUseCase, + masterUpdate: SendMasterChannelUpdateUseCase, + sessionUpdate: SendSessionUpdateUseCase, + serversRepo: ServersRepository) + { + self.connect = connect + self.defUpdate = defUpdate + self.masterUpdate = masterUpdate + self.sessionUpdate = sessionUpdate + self.serversRepo = serversRepo + + NotificationCenter.default.addObserver( + forName: UIApplication.didEnterBackgroundNotification, + object: nil, + queue: .main + ) { [weak self] _ in + Task { @MainActor in + self?.appDidEnterBackground() + } + } + + NotificationCenter.default.addObserver( + forName: UIApplication.willEnterForegroundNotification, + object: nil, + queue: .main + ) { [weak self] _ in + Task { @MainActor in + self?.appWillEnterForeground() + } + } + } + + deinit { + NotificationCenter.default.removeObserver(self) + streamTask?.cancel() + heartbeatTask?.cancel() + reconnectTask?.cancel() + pathMonitor?.cancel() + if let repo = currentRepo { + repo.transport.close() + } + } + + func connectToServer(address: String, port: UInt16) { + // Resolve a blank port (0) to the default so UI state and saved recents reflect the real port. + let resolvedPort = port == 0 ? Self.defaultPort : port + self.port = resolvedPort + + disconnect() + + Task { + isLoading = true + do { + let repo = try await connect.execute(address: address, port: resolvedPort) + currentRepo = repo + + defUpdate = SendDefaultDeviceUpdateUseCase(repo: repo) + masterUpdate = SendMasterChannelUpdateUseCase(repo: repo) + sessionUpdate = SendSessionUpdateUseCase(repo: repo) + + lastConnectedServer = DiscoveredServer(address: address, port: resolvedPort, computerName: nil) + userInitiatedDisconnect = false + + subscribe(to: repo) + isLoading = false + connectionStatus = .connected + + if UserDefaults(suiteName: "group.cwb.PcVolumeControl") == nil { + appLog("App Group access FAILED - check Developer Portal configuration") + } + } catch { + isLoading = false + connectionStatus = .connected + self.error = error.localizedDescription + currentRepo = nil + fullState = nil + } + } + } + + func disconnect() { + // Mark as user-initiated so we don't auto-reconnect + userInitiatedDisconnect = true + forceDisconnect() + updateSharedStateDisconnected() + // Reset to the idle/connected default for the next session. + connectionStatus = .connected + } + + private func forceDisconnect() { + streamTask?.cancel() + streamTask = nil + heartbeatTask?.cancel() + heartbeatTask = nil + reconnectTask?.cancel() + reconnectTask = nil + stopPathMonitor() + + if let repo = currentRepo { + closeConnection(repo) + currentRepo = nil + } + + // Clear the full state to trigger UI reset + fullState = nil + } + + private func closeConnection(_ repo: VolumeControlRepository) { + repo.transport.close() + } + + // MARK: - App Lifecycle Handlers + + private func appDidEnterBackground() { + isInBackground = true + // Pause the stream and reconnect tasks but keep the connection alive + streamTask?.cancel() + streamTask = nil + heartbeatTask?.cancel() + heartbeatTask = nil + reconnectTask?.cancel() + reconnectTask = nil + stopPathMonitor() + } + + private func appWillEnterForeground() { + isInBackground = false + + guard !userInitiatedDisconnect, let server = lastConnectedServer else { + return + } + + // If the socket survived the background, just resume streaming. + if let repo = currentRepo, isConnectionHealthy(repo) { + connectionStatus = .connected + subscribe(to: repo) + return + } + + // Connection died while backgrounded: keep stale sliders on screen and reconnect behind the banner. + if let repo = currentRepo { + repo.transport.close() + currentRepo = nil + } + startReconnectLoop(to: server) + } + + private func isConnectionHealthy(_ repo: VolumeControlRepository) -> Bool { + if let transport = repo.transport as? VolumeTransportDataSource { + return transport.connection.nw.state == .ready + } + return false + } + + /// Called when the live stream ends unexpectedly; keeps `fullState` and drives auto-reconnect. + private func handleConnectionLost() { + // Ignore losses we caused ourselves or while paused in the background. + guard !userInitiatedDisconnect, !isInBackground else { return } + // React only once; the byte stream and NWConnection state can both report the same drop. + guard connectionStatus == .connected else { return } + + // Tear down the dead socket but deliberately keep `fullState`. + streamTask = nil + heartbeatTask?.cancel() + heartbeatTask = nil + if let repo = currentRepo { + repo.transport.close() + currentRepo = nil + } + updateSharedStateDisconnected() + + guard let server = lastConnectedServer else { + connectionStatus = .lost + return + } + startReconnectLoop(to: server) + } + + /// Watch the connection state; a local network drop parks the socket in `.waiting` with no error. + private func monitorConnectionState(_ repo: VolumeControlRepository) { + guard let transport = repo.transport as? VolumeTransportDataSource else { return } + transport.connection.nw.stateUpdateHandler = { [weak self] state in + let lost: Bool + switch state { + case .failed, .waiting: lost = true + default: lost = false + } + guard lost else { return } + Task { @MainActor in + self?.handleConnectionLost() + } + } + } + + /// Watch the system network path; an interface change won't fault a stalled socket, so probe by reconnecting. + private func startPathMonitor() { + pathMonitor?.cancel() + lastPathSignature = nil + let monitor = NWPathMonitor() + pathMonitor = monitor + monitor.pathUpdateHandler = { [weak self] path in + let usesWiFi = path.usesInterfaceType(.wifi) + let usesCellular = path.usesInterfaceType(.cellular) + let satisfied = path.status == .satisfied + Task { @MainActor in + self?.handlePathUpdate(usesWiFi: usesWiFi, usesCellular: usesCellular, satisfied: satisfied) + } + } + monitor.start(queue: pathMonitorQueue) + } + + private func stopPathMonitor() { + pathMonitor?.cancel() + pathMonitor = nil + lastPathSignature = nil + } + + private func handlePathUpdate(usesWiFi: Bool, usesCellular: Bool, satisfied: Bool) { + let signature = "\(satisfied)-\(usesWiFi)-\(usesCellular)" + let isFirst = lastPathSignature == nil + let changed = signature != lastPathSignature + lastPathSignature = signature + + // First callback is the baseline: record which interface we connected over. + if isFirst { + connectedOverWiFi = usesWiFi + connectedOverCellular = usesCellular + return + } + guard changed else { return } + + if connectionStatus == .connected { + // Our interface vanished (or all connectivity lost): probe via reconnect. + let ourInterfaceGone = (connectedOverWiFi && !usesWiFi) || (connectedOverCellular && !usesCellular) + if !satisfied || ourInterfaceGone { + handleConnectionLost() + } + } else { + // Reconnecting/lost: a usable path change is a good moment to probe rather than waiting for backoff. + if satisfied, !userInitiatedDisconnect, !isInBackground, let server = lastConnectedServer { + startReconnectLoop(to: server) + } + } + } + + /// Reconnects with backoff; lands on `.connected` or `.lost` without clearing `fullState` or bouncing to the connect screen. + func startReconnectLoop(to server: DiscoveredServer) { + reconnectTask?.cancel() + reconnectTask = Task { + connectionStatus = .reconnecting + let deadline = Date().addingTimeInterval(reconnectWindowSeconds) + var delay = reconnectInitialDelaySeconds + var attempt = 0 + while !Task.isCancelled && Date() < deadline { + attempt += 1 + do { + let repo = try await connect.execute(address: server.address, port: server.port) + if Task.isCancelled { repo.transport.close(); return } + currentRepo = repo + defUpdate = SendDefaultDeviceUpdateUseCase(repo: repo) + masterUpdate = SendMasterChannelUpdateUseCase(repo: repo) + sessionUpdate = SendSessionUpdateUseCase(repo: repo) + subscribe(to: repo) + // Mark live immediately so a fresh drop is detected again. + connectionStatus = .connected + return + } catch { + appLog("Reconnection attempt \(attempt) failed: \(error.localizedDescription)") + } + if Task.isCancelled || Date() >= deadline { break } + try? await Task.sleep(for: .seconds(delay)) + delay = min(delay * 2, reconnectMaxDelaySeconds) // 5 -> 10 -> 20 -> 30 (capped) + } + if !Task.isCancelled { connectionStatus = .lost } + } + } + + /// User-triggered retry from the "Server disconnected" banner. + func reconnect() { + guard let server = lastConnectedServer else { return } + userInitiatedDisconnect = false + startReconnectLoop(to: server) + } + + private func subscribe(to repo: VolumeControlRepository) { + streamTask = Task { + do { + for try await state in repo.fullStateStream() { + // Stop applying updates after cancellation so an in-flight value can't resurrect state. + if Task.isCancelled { break } + fullState = state // view state only here + connectionStatus = .connected + updateSharedState(with: state) // Update widget state + } + // Stream ended without throwing (server closed the connection). + if !Task.isCancelled { handleConnectionLost() } + } catch { + // RST / keepalive timeout / read error. + if !Task.isCancelled { handleConnectionLost() } + } + } + + // Watch the connection state (catches local network loss where the byte stream stalls without error). + monitorConnectionState(repo) + + // Watch the network path (catches WiFi <-> cellular interface changes). + startPathMonitor() + + // Start heartbeat to keep widget fresh + startHeartbeat() + } + + private func startHeartbeat() { + heartbeatTask?.cancel() + heartbeatTask = Task { + while !Task.isCancelled { + try? await Task.sleep(for: .seconds(30)) + if !Task.isCancelled, let state = fullState { + updateSharedState(with: state) + } + } + } + } + + // MARK: - Shared State Management (for Widget) + + private func updateSharedState(with state: FullState) { + // TODO: track chat session info (chatVolume/chatSessionName left nil for now). + let sharedState = SharedConnectionState( + isConnected: true, + lastSeenAlive: Date(), + serverName: lastConnectedServer?.computerName, + serverAddress: lastConnectedServer?.address, + masterVolume: state.defaultDevice.masterVolume, + chatVolume: nil, + chatSessionName: nil + ) + + SharedStateManager.writeState(sharedState) + + WidgetCenter.shared.reloadTimelines(ofKind: "PcVolumeControlWidget") + } + + private func updateSharedStateDisconnected() { + if var existingState = SharedStateManager.readState() { + existingState.isConnected = false + SharedStateManager.writeState(existingState) + } else { + let disconnectedState = SharedConnectionState( + isConnected: false, + lastSeenAlive: Date(), + serverName: lastConnectedServer?.computerName, + serverAddress: lastConnectedServer?.address + ) + SharedStateManager.writeState(disconnectedState) + } + + WidgetCenter.shared.reloadTimelines(ofKind: "PcVolumeControlWidget") + } + + var hasActiveConnection: Bool { + return currentRepo != nil + } + + // UI intents + func updateDefaultDevice(id: String) { Task { try? await defUpdate.execute(id) } } + func updateMaster(id: String, muted: Bool, vol: Double) { + Task { try? await masterUpdate.execute(id: id, muted: muted, volume: vol) } + } + func updateSession(name: String, id: String, vol: Double, muted: Bool) { + Task { try? await sessionUpdate.execute(name: name, id: id, vol: vol, muted: muted) } + } + + func updateSession(_ session: FullState.Session) async throws { + try await sessionUpdate.execute(name: session.name, id: session.id, vol: session.volume, muted: session.muted) + } + + // MARK: - Server Management + + func loadRecentServers() { + recentServers = serversRepo.recent() + + // Auto-fill the most recent server if fields are empty + if address.isEmpty && !recentServers.isEmpty { + let mostRecent = recentServers.first! + address = mostRecent.address + port = mostRecent.port + } + } + + func selectServer(_ server: DiscoveredServer) { + address = server.address + port = server.port + connectToServer(address: address, port: port) + } + + func saveSuccessfulConnection() { + let newServer = DiscoveredServer(address: address, port: port, computerName: nil) + + // Add to the beginning and remove any duplicates + var updatedServers = [newServer] + for server in recentServers { + if server.address != newServer.address || server.port != newServer.port { + updatedServers.append(server) + } + } + + // Limit to 5 most recent servers + recentServers = Array(updatedServers.prefix(5)) + serversRepo.saveRecent(recentServers) + } + + func handleDiscoveredServers(_ servers: [DiscoveredServer]) { + discoveredServers = servers + + guard let firstServer = servers.first else { + isAutoDiscovered = false + currentDiscoveredServer = nil + return + } + + // Only auto-fill if fields are empty or currently showing auto-discovered content + let shouldAutoFill = address.isEmpty || isAutoDiscovered + + if shouldAutoFill { + address = firstServer.address + port = firstServer.port + currentDiscoveredServer = firstServer + isAutoDiscovered = true + } + } + + func handleManualAddressChange(_ newValue: String) { + // If user manually changes address and it doesn't match discovered server, clear auto-discovery flag + if isAutoDiscovered, let discoveredServer = currentDiscoveredServer { + if newValue != discoveredServer.address { + isAutoDiscovered = false + currentDiscoveredServer = nil + } + } + } + + func handleManualPortChange(_ newValue: UInt16) { + // If user manually changes port and it doesn't match discovered server, clear auto-discovery flag + if isAutoDiscovered, let discoveredServer = currentDiscoveredServer { + if newValue != discoveredServer.port { + isAutoDiscovered = false + currentDiscoveredServer = nil + } + } + } + + // MARK: - Unified Server List + + enum ServerListItem: Identifiable { + case discovered(DiscoveredServer) + case recent(DiscoveredServer) + case manual + + var id: String { + switch self { + case .discovered(let server): + return "discovered_\(server.id)" + case .recent(let server): + return "recent_\(server.id)" + case .manual: + return "manual_entry" + } + } + + var server: DiscoveredServer? { + switch self { + case .discovered(let server), .recent(let server): + return server + case .manual: + return nil + } + } + + var isDiscovered: Bool { + if case .discovered = self { return true } + return false + } + + var isRecent: Bool { + if case .recent = self { return true } + return false + } + + var isManual: Bool { + if case .manual = self { return true } + return false + } + } + + var unifiedServerList: [ServerListItem] { + var items: [ServerListItem] = [] + var seenAddresses: Set = [] + + // Add discovered servers first (most recent at top) + for server in discoveredServers { + let key = "\(server.address):\(server.port)" + if !seenAddresses.contains(key) { + items.append(.discovered(server)) + seenAddresses.insert(key) + } + } + + // Add recent servers that haven't been seen yet + for server in recentServers { + let key = "\(server.address):\(server.port)" + if !seenAddresses.contains(key) { + items.append(.recent(server)) + seenAddresses.insert(key) + } + } + + items.append(.manual) + + return items + } + + func deleteServerFromList(_ item: ServerListItem) { + // The manual-entry row has no backing server and is not deletable. + guard let server = item.server else { return } + + // A server can be both live-discovered (mDNS) and a saved recent + // connection. unifiedServerList dedupes those into a single row, so a + // single swipe-to-delete must clear BOTH representations -- otherwise the + // hidden recent duplicate resurfaces as a separate "recent connection" row. + // (A still-broadcasting server may reappear on the next discovery cycle.) + let isSameServer: (DiscoveredServer) -> Bool = { + $0.address == server.address && $0.port == server.port + } + + discoveredServers.removeAll(where: isSameServer) + + let recentCountBefore = recentServers.count + recentServers.removeAll(where: isSameServer) + if recentServers.count != recentCountBefore { + serversRepo.saveRecent(recentServers) + } + + // Clear any auto-discovery bookkeeping tied to the deleted server. + if let current = currentDiscoveredServer, isSameServer(current) { + currentDiscoveredServer = nil + isAutoDiscovered = false + } + } +} + + +class FullState: Codable, Equatable { + static func == (lhs: FullState, rhs: FullState) -> Bool { + return lhs.protocolVersion == rhs.protocolVersion && + lhs.deviceIds == rhs.deviceIds && + lhs.defaultDevice.deviceId == rhs.defaultDevice.deviceId && + lhs.defaultDevice.masterMuted == rhs.defaultDevice.masterMuted && + lhs.defaultDevice.masterVolume == rhs.defaultDevice.masterVolume && + lhs.defaultDevice.name == rhs.defaultDevice.name && + lhs.defaultDevice.sessions == rhs.defaultDevice.sessions + } + struct theDefaultDevice: Codable, Equatable { + let deviceId: String + var masterMuted: Bool + var masterVolume: Double + let name: String + var sessions: [Session] + } + struct Session: Codable, Identifiable, Equatable { + let id: String + var muted: Bool + var name: String + var volume: Double + } + var defaultDevice: theDefaultDevice + let deviceIds: [String: String] + let protocolVersion: Int + + init(protocolVersion: Int, deviceIds: [String:String], defaultDevice: theDefaultDevice) { + self.protocolVersion = protocolVersion + self.deviceIds = deviceIds + self.defaultDevice = defaultDevice + } +} diff --git a/PcVolumeControl/viewmodels/SliderViewModel.swift b/PcVolumeControl/viewmodels/SliderViewModel.swift new file mode 100644 index 0000000..eae5f81 --- /dev/null +++ b/PcVolumeControl/viewmodels/SliderViewModel.swift @@ -0,0 +1,324 @@ +// +// SliderViewModel.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/4/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import Foundation +import Combine +import SwiftUI + +@MainActor +final class SliderViewModel: ObservableObject { + // Inputs + @Published var fullState: FullState? { + didSet { apply(fullState) } + } + + // Outputs the views bind to + @Published var sessions: [FullState.Session] = [] + @Published private(set) var defaultDevice: FullState.theDefaultDevice? + @Published private(set) var devices: [String: String] = [:] + + // Computed property for master mute state + var isMasterMuted: Bool { + defaultDevice?.masterMuted ?? false + } + + // User prefs + @AppStorage(UserDefaultsKeys.preserveSessionOrder) private var preserveSessionOrder = false + private var savedOrder: [String] { + get { UserDefaults.standard.array(forKey: "savedSessionOrder") as? [String] ?? [] } + set { UserDefaults.standard.set(newValue, forKey: "savedSessionOrder") } + } + private var editingIds = Set() // debounce guard + + // Chat-balance + @Published var chatBalanceSessionId: String? + @Published var chatBalanceMode = false + @Published var showChatBalanceInfo = false + + // MARK: – Public intents called by the view + func beginEditing(_ id: String?) { + if let id { + editingIds.insert(id) + } + } + func endEditing (_ id: String?) { + if let id { + editingIds.remove(id) + } + } + + func reorder(from source: IndexSet, to destination: Int) { + sessions.move(fromOffsets: source, toOffset: destination) + if preserveSessionOrder { + savedOrder = sessions.map { $0.id } + } + } + + func toggleChatBalance(for id: String) { + if chatBalanceSessionId == id && chatBalanceMode { + // Disable chat balance for this session + chatBalanceMode = false + chatBalanceSessionId = nil + + // Clear any editing state from non-chat sessions + for session in sessions where session.id != id { + editingIds.remove(session.id) + } + } else { + // Enable chat balance for this session + chatBalanceSessionId = id + chatBalanceMode = true + + // Check if user has seen the info before + if !UserDefaults.standard.bool(forKey: UserDefaultsKeys.hasSeenChatBalanceInfo) { + showChatBalanceInfo = true + } + } + } + + func dismissChatBalanceInfo() { + showChatBalanceInfo = false + UserDefaults.standard.set(true, forKey: UserDefaultsKeys.hasSeenChatBalanceInfo) + } + + func commitChatBalanceChanges(onCommit: @escaping (FullState.Session) -> Void) { + guard chatBalanceMode else { return } + + // Mark all sessions as editing to prevent server updates from overwriting during commit + for session in sessions { + editingIds.insert(session.id) + } + + // Send updates for all sessions that were affected by chat balance + for session in sessions { + onCommit(session) + } + + // Clear editing state after debounce period + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + for session in self.sessions { + self.editingIds.remove(session.id) + } + } + } + func applyChatBalance(id _: String, vol: Double) { + guard let chatSessionId = chatBalanceSessionId else { return } + + // Crossfade approach: Chat volume directly controls the inverse of other volumes + // Chat at 0% = Others at 100% + // Chat at 50% = Others at 50% + // Chat at 100% = Others at 0% + + let chatVolume = vol + let othersVolume = 100.0 - chatVolume + + // Mark all non-chat sessions as editing to prevent server updates during drag + for session in sessions where session.id != chatSessionId { + editingIds.insert(session.id) + } + + // Apply the inverse volume to all other sessions + for index in sessions.indices { + let session = sessions[index] + + if session.id == chatSessionId { + // This is the chat balance session, don't modify it here + continue + } + + // Set all other sessions to the inverse of chat volume + sessions[index].volume = othersVolume + } + } + + // MARK: – Private + private func apply(_ state: FullState?) { + guard let state else { return } + + updateMasterRespectingDebounce(with: state.defaultDevice) + updateSessionsRespectingDebounce(with: state.defaultDevice.sessions) + devices = state.deviceIds + } + + // Parse session name from ID and fallback name using new protocol + private func parseSessionDisplayName(sessionId: String, fallbackName: String) -> String { + // Check for new protocol format: |PCVC# + if let pcvcRange = sessionId.range(of: "|PCVC#") { + let purposeStart = sessionId.index(pcvcRange.upperBound, offsetBy: 0) + let purpose = String(sessionId[purposeStart...]) + + // Convert purpose to user-friendly display name + switch purpose.lowercased() { + case "discord-voice": + return "Discord (Voice)" + case "discord-notifications": + return "Discord (Notifications)" + default: + // For other purposes, capitalize and format nicely + let formattedPurpose = purpose.replacingOccurrences(of: "-", with: " ") + .split(separator: " ") + .map { $0.prefix(1).uppercased() + $0.dropFirst().lowercased() } + .joined(separator: " ") + return "\(fallbackName) (\(formattedPurpose))" + } + } + + // Use existing backward compatible logic + return fallbackName + } + + private func updateSessionsRespectingDebounce(with incoming: [FullState.Session]) { + // Apply new naming protocol to sessions + let processedSessions = incoming.map { session in + let displayName = parseSessionDisplayName(sessionId: session.id, fallbackName: session.name) + return FullState.Session( + id: session.id, + muted: session.muted, + name: displayName, + volume: session.volume + ) + } + + // If preserving order and we have a saved order, use it + if preserveSessionOrder && !savedOrder.isEmpty { + updateWithSavedOrder(incomingSessions: processedSessions) + } + // If we have sessions and user has reordered, preserve current order + else if !sessions.isEmpty { + updatePreservingCurrentOrder(incomingSessions: processedSessions) + } + // Otherwise sort alphabetically, but respect editingIds + else { + let sortedSessions = processedSessions.sorted { + $0.name.localizedCaseInsensitiveCompare($1.name) == .orderedAscending + } + + // If any sessions are being edited, preserve their values + if !editingIds.isEmpty { + sessions = sortedSessions.map { incoming in + if editingIds.contains(incoming.id), + let existing = sessions.first(where: { $0.id == incoming.id }) { + // Keep current values for editing session + return FullState.Session( + id: existing.id, + muted: existing.muted, + name: incoming.name, + volume: existing.volume + ) + } else { + return incoming + } + } + } else { + sessions = sortedSessions + } + } + } + + private func updateMasterRespectingDebounce(with device: FullState.theDefaultDevice) { + // If editing, preserve current values, otherwise use server values + if editingIds.contains("master"), let current = defaultDevice { + // Keep current volume/mute values but update name/id + defaultDevice = FullState.theDefaultDevice( + deviceId: device.deviceId, + masterMuted: current.masterMuted, + masterVolume: current.masterVolume, + name: device.name, + sessions: device.sessions + ) + } else { + defaultDevice = device + } + } + + + private func updateWithSavedOrder(incomingSessions: [FullState.Session]) { + // Handle duplicate session IDs by keeping only the first occurrence + var incomingDict = [String: FullState.Session]() + for session in incomingSessions { + if incomingDict[session.id] == nil { + incomingDict[session.id] = session + } + } + var orderedSessions = [FullState.Session]() + var remainingSessions = [FullState.Session]() + + // Add sessions in saved order + for sessionId in savedOrder { + if let session = incomingDict[sessionId] { + if editingIds.contains(sessionId), + let existingIdx = sessions.firstIndex(where: { $0.id == sessionId }) { + // Keep current values for editing session + let existing = sessions[existingIdx] + orderedSessions.append(FullState.Session( + id: sessionId, + muted: existing.muted, + name: session.name, + volume: existing.volume + )) + } else { + orderedSessions.append(session) + } + } + } + + // Add new sessions not in saved order + for session in incomingSessions { + if !savedOrder.contains(session.id) { + remainingSessions.append(session) + } + } + + remainingSessions.sort { $0.name.localizedCaseInsensitiveCompare($1.name) == .orderedAscending } + sessions = orderedSessions + remainingSessions + + // Update saved order + savedOrder = sessions.map { $0.id } + } + + private func updatePreservingCurrentOrder(incomingSessions: [FullState.Session]) { + // Handle duplicate session IDs by keeping only the first occurrence + var incomingDict = [String: FullState.Session]() + for session in incomingSessions { + if incomingDict[session.id] == nil { + incomingDict[session.id] = session + } + } + var updatedSessions = [FullState.Session]() + + // Update existing sessions, preserving order + for session in sessions { + guard let incoming = incomingDict[session.id] else { continue } + + if editingIds.contains(session.id) { + // Keep current values for editing session + updatedSessions.append(FullState.Session( + id: session.id, + muted: session.muted, + name: incoming.name, + volume: session.volume + )) + } else { + updatedSessions.append(incoming) + } + } + + // Add new sessions at the end + let existingIds = Set(sessions.map { $0.id }) + let newSessions = incomingSessions.filter { !existingIds.contains($0.id) } + let sortedNewSessions = newSessions.sorted { + $0.name.localizedCaseInsensitiveCompare($1.name) == .orderedAscending + } + + sessions = updatedSessions + sortedNewSessions + + if preserveSessionOrder { + savedOrder = sessions.map { $0.id } + } + } +} diff --git a/PcVolumeControl/views/ChatBalanceInfoOverlay.swift b/PcVolumeControl/views/ChatBalanceInfoOverlay.swift new file mode 100644 index 0000000..89c1852 --- /dev/null +++ b/PcVolumeControl/views/ChatBalanceInfoOverlay.swift @@ -0,0 +1,98 @@ +// +// ChatBalanceInfoOverlay.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/4/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import SwiftUI + +struct ChatBalanceInfoOverlay: View { + var onDismiss: () -> Void + + var body: some View { + VStack { + // Overlay content positioned at the top + VStack(spacing: 12) { + HStack { + Image(systemName: "arrow.up.arrow.down.circle.fill") + .foregroundColor(.pcvcBlue) + .font(.system(size: 20)) + + Text("CHAT BALANCE ACTIVATED") + .font(.headline) + .fontWeight(.bold) + .foregroundColor(.white) + + Spacer() + } + + Text("Move the highlighted slider to automatically balance all other application volumes. Use the menu on any session to change which one is the chat balance control.") + .font(.subheadline) + .foregroundColor(.gray) + .multilineTextAlignment(.leading) + + HStack { + Spacer() + Button("OK!") { + onDismiss() + } + .font(.callout) + .fontWeight(.medium) + .foregroundColor(.yellow) + .padding(.horizontal, 16) + .padding(.vertical, 8) + .background( + RoundedRectangle(cornerRadius: 8) + .fill(Color.pcvcBlue.opacity(0.2)) + ) + } + } + .padding(20) + .background( + RoundedRectangle(cornerRadius: 16) + .fill(Color.black.opacity(0.9)) + .overlay( + RoundedRectangle(cornerRadius: 16) + .stroke(Color.pcvcBlue.opacity(0.5), lineWidth: 1) + ) + ) + .padding(.horizontal, 20) + .padding(.top, 60) // Position near top but below status bar + + Spacer() // Push content to top and allow taps below + } + .background( + // Semi-transparent background that allows seeing content below + Color.black.opacity(0.3) + .ignoresSafeArea() + .onTapGesture { + onDismiss() + } + ) + } +} + +#Preview { + ZStack { + Color.almostBlack.ignoresSafeArea() + + // Mock slider content + VStack { + Text("Slider Content Below") + .foregroundColor(.white) + .font(.title) + + Rectangle() + .fill(Color.gray.opacity(0.3)) + .frame(height: 60) + .cornerRadius(10) + .padding(.horizontal) + } + + ChatBalanceInfoOverlay { + } + } + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/ConnectingView.swift b/PcVolumeControl/views/ConnectingView.swift new file mode 100644 index 0000000..07bd2a9 --- /dev/null +++ b/PcVolumeControl/views/ConnectingView.swift @@ -0,0 +1,26 @@ +// +// ConnectingView.swift +// PCVolumeControl (iOS) +// +// Created by Bill Booth on 1/1/24. +// + +import SwiftUI + +struct ConnectingView: View { + + var body: some View { + ZStack { + Color.black.opacity(0.4) + .ignoresSafeArea() + ProgressView() + .progressViewStyle(CircularProgressViewStyle(tint: Color.sliderPink)) + .scaleEffect(3) + } + } +} + +#Preview { + ConnectingView() + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/ErrorOverlay.swift b/PcVolumeControl/views/ErrorOverlay.swift new file mode 100644 index 0000000..f9d54eb --- /dev/null +++ b/PcVolumeControl/views/ErrorOverlay.swift @@ -0,0 +1,86 @@ +// +// ErrorOverlay.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/3/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import SwiftUI + +// A dismissable error overlay with OK button and X close button +struct DismissableErrorOverlay: View { + var message: String + var onDismiss: () -> Void + + var body: some View { + ZStack { + // Semi-transparent blurred background + Color.black.opacity(0.5) + .ignoresSafeArea() + .background(Material.ultraThinMaterial) + .onTapGesture { + onDismiss() + } + + // Alert box in the center + VStack(spacing: 15) { + // Alert header with title and X button + HStack { + Text("Connection Error") + .font(.headline) + .foregroundColor(.white) + + Spacer() + + Button { + onDismiss() + } label: { + Image(systemName: "xmark.circle.fill") + .foregroundColor(.white.opacity(0.7)) + .font(.title3) + } + .buttonStyle(.plain) + } + + Divider() + .background(Color.white.opacity(0.2)) + + // Error message + Text(message) + .font(.subheadline) + .multilineTextAlignment(.center) + .foregroundColor(.white) + .padding(.vertical, 10) + + // OK button + Button { + onDismiss() + } label: { + Text("OK") + .font(.headline) + .foregroundColor(.white) + .frame(width: 100, height: 44) + .background(Color.sliderPink) + .cornerRadius(8) + } + } + .padding() + .background(Color.almostBlack) + .cornerRadius(12) + .overlay( + RoundedRectangle(cornerRadius: 12) + .stroke(Color.sliderPink.opacity(0.3), lineWidth: 1) + ) + .shadow(color: Color.black.opacity(0.5), radius: 10, x: 0, y: 5) + .padding(.horizontal, 30) + .frame(maxWidth: 400) + } + .zIndex(999) + } +} + +#Preview { + DismissableErrorOverlay(message: "Connection to server lost. Please check your network connection and try again.") { + } +} diff --git a/PcVolumeControl/views/IntroTourGate.swift b/PcVolumeControl/views/IntroTourGate.swift new file mode 100644 index 0000000..cd8bd05 --- /dev/null +++ b/PcVolumeControl/views/IntroTourGate.swift @@ -0,0 +1,20 @@ +// +// IntroTourGate.swift +// PcVolumeControl +// +// Decides whether the first-launch intro tour should auto-present. +// + +import Foundation + +enum IntroTourGate { + // Fastlane snapshot launches with --screenshotMode and needs + // deterministic screens, so the tour never auto-shows there. + static func shouldShowTour( + hasSeenTour: Bool, + arguments: [String] = ProcessInfo.processInfo.arguments + ) -> Bool { + if arguments.contains("--screenshotMode") { return false } + return !hasSeenTour + } +} diff --git a/PcVolumeControl/views/IntroTourView.swift b/PcVolumeControl/views/IntroTourView.swift new file mode 100644 index 0000000..10a5366 --- /dev/null +++ b/PcVolumeControl/views/IntroTourView.swift @@ -0,0 +1,140 @@ +// +// IntroTourView.swift +// PcVolumeControl +// +// Three-page first-launch welcome tour. Page 2 pushes the server +// setup guide. Skip and Get Started both call onFinish; the caller +// is responsible for persisting hasSeenIntroTour and dismissing. +// + +import SwiftUI + +struct IntroTourView: View { + var onFinish: () -> Void + + @State private var page = 0 + + var body: some View { + NavigationStack { + ZStack { + Color.almostBlack.ignoresSafeArea() + + TabView(selection: $page) { + whatItIsPage.tag(0) + serverPage.tag(1) + connectPage.tag(2) + } + .tabViewStyle(.page) + .indexViewStyle(.page(backgroundDisplayMode: .always)) + } + .toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button("Skip") { + onFinish() + } + .foregroundColor(.gray) + .accessibilityHint("Closes the intro tour") + } + } + } + .preferredColorScheme(.dark) + } + + private var whatItIsPage: some View { + VStack(spacing: 20) { + Spacer() + Image("PCVCLogo") + .renderingMode(.template) + .resizable() + .scaledToFit() + .frame(width: 96, height: 96) + .foregroundStyle(.white) + Text("Control your PC's audio from your phone") + .font(.title2) + .fontWeight(.bold) + .foregroundColor(.white) + .multilineTextAlignment(.center) + Text("Adjust the volume of every application on your Windows PC remotely. Turn the game down without leaving voice chat behind.") + .font(.subheadline) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + Spacer() + Spacer() + } + .padding(.horizontal, 32) + } + + private var serverPage: some View { + VStack(spacing: 20) { + Spacer() + Image(systemName: "desktopcomputer") + .font(.system(size: 64)) + .foregroundColor(.sliderPink) + .accessibilityHidden(true) + Text("Your PC needs the free server") + .font(.title2) + .fontWeight(.bold) + .foregroundColor(.white) + .multilineTextAlignment(.center) + Text("This app talks to the PcVolumeControl server, a small program that runs on your Windows PC.") + .font(.subheadline) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + NavigationLink { + ServerSetupGuideView() + } label: { + Text("Show me how to set it up") + .font(.headline) + .foregroundColor(.white) + .padding(.horizontal, 24) + .padding(.vertical, 12) + .background(Capsule().fill(Color.sliderPink)) + } + Text("You can also do this later from the connection screen.") + .font(.caption) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + Spacer() + Spacer() + } + .padding(.horizontal, 32) + } + + private var connectPage: some View { + VStack(spacing: 20) { + Spacer() + Image(systemName: "wifi") + .font(.system(size: 64)) + .foregroundColor(.green) + .accessibilityHidden(true) + Text("Connecting is automatic") + .font(.title2) + .fontWeight(.bold) + .foregroundColor(.white) + .multilineTextAlignment(.center) + Text("On the same Wi-Fi network, your PC appears in the server list with a green Wi-Fi badge. Tap it to connect, or enter an IP address and port manually.") + .font(.subheadline) + .foregroundColor(.gray) + .multilineTextAlignment(.center) + Button { + onFinish() + } label: { + Text("Get Started") + .font(.headline) + .foregroundColor(.white) + .padding(.horizontal, 32) + .padding(.vertical, 12) + .background(Capsule().fill(Color.sliderPink)) + } + Spacer() + Spacer() + } + .padding(.horizontal, 32) + } +} + +#Preview { + IntroTourView { + } + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/MainView.swift b/PcVolumeControl/views/MainView.swift new file mode 100644 index 0000000..bf585ae --- /dev/null +++ b/PcVolumeControl/views/MainView.swift @@ -0,0 +1,299 @@ +// +// MainView.swift +// PCVolumeControl (iOS) +// +// Created by Bill Booth on 12/29/23. +// + +import Combine +import Network +import SwiftUI + +struct MainView: View { + @StateObject private var viewModel: MainViewModel + @StateObject private var mdnsService = MDNSDiscoveryService() + @State private var path = NavigationPath() + enum FocusedField { + case address, port + } + @FocusState private var focusedField: FocusedField? + @AppStorage(UserDefaultsKeys.hasSeenIntroTour) private var hasSeenIntroTour = false + @State private var showIntroTour = false + @State private var showSetupGuide = false + + init() { + let local = ServersLocalDataSource() + let remote = TCPConnectionDataSource() + let repo = ServersRepository(local: local, remote: remote) + let connectUseCase = ConnectToServerUseCase(repo: repo) + + let placeholderTransport = VolumeTransportDataSource(connection: Connection(nw: NWConnection(host: "127.0.0.1", port: 80, using: .tcp))) + let placeholderRepo = VolumeControlRepository(transport: placeholderTransport) + + _viewModel = StateObject( + wrappedValue: MainViewModel( + connect: connectUseCase, + defUpdate: SendDefaultDeviceUpdateUseCase(repo: placeholderRepo), + masterUpdate: SendMasterChannelUpdateUseCase(repo: placeholderRepo), + sessionUpdate: SendSessionUpdateUseCase(repo: placeholderRepo), + serversRepo: repo + ) + ) + } + + var body: some View { + NavigationStack(path: $path) { + ZStack { + MotionMeshBackground() + .ignoresSafeArea() + + VStack(spacing: 0) { + // App logo header + Image("PCVCLogo") + .renderingMode(.template) + .resizable() + .scaledToFit() + .frame(width: 78, height: 78) + .foregroundStyle(.white) + .accessibilityLabel("PcVolumeControl") + .padding(.top, 12) + .padding(.bottom, 16) + + List { + ForEach(viewModel.unifiedServerList) { item in + ServerListRowView( + item: item, + manualAddress: $viewModel.address, + manualPort: $viewModel.port, + focusedField: $focusedField, + onConnect: { server in + if let server = server { + viewModel.selectServer(server) + } else { + // Manual connection + connectToServer() + } + } + ) + .listRowBackground(Color.clear) + } + .onDelete { indexSet in + for index in indexSet { + let item = viewModel.unifiedServerList[index] + // Allow deletion for all servers except manual entry row + if !item.isManual { + viewModel.deleteServerFromList(item) + } + } + } + } + .listStyle(.plain) + .scrollContentBackground(.hidden) + // Pin the top: no rubber-band overscroll, so rows can never + // ride up over the logo header above them. + .scrollBounceBehavior(.basedOnSize) + + // Persistent path to the server setup guide. Pinned + // below the list so a user with an empty server list + // always sees it. + Button { + showSetupGuide = true + } label: { + HStack(spacing: 6) { + Image(systemName: "questionmark.circle.fill") + .foregroundColor(.sliderPink) + Text("Don't have the PC server yet? Set it up") + .foregroundColor(.white) + } + .font(.footnote) + .padding(.vertical, 12) + .accessibilityElement(children: .combine) + } + .accessibilityHint("Opens the Windows server setup guide") + } + .readableContentWidth() + } + .onTapGesture { + // Dismiss keyboard when tapping outside text fields + focusedField = nil + } + .overlay { + if viewModel.isLoading { + ConnectingView() + } + } + .sheet(isPresented: $showSetupGuide) { + NavigationStack { + ServerSetupGuideView() + .toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button("Done") { + showSetupGuide = false + } + } + } + } + } + .fullScreenCover(isPresented: $showIntroTour) { + IntroTourView { + hasSeenIntroTour = true + showIntroTour = false + } + } + .alert(alertTitle, isPresented: Binding(get:{ viewModel.error != nil }, + set:{ _ in viewModel.error = nil })) { + Button("OK", role: .cancel) { } + } message: { + Text(viewModel.error ?? "") + } + .navigationDestination(for: String.self) { destination in + if destination == "sliders" { + SliderView(path: $path) + .environmentObject(viewModel) + } + } + .onChange(of: viewModel.fullState) { oldValue, newValue in + // Only navigate on the transition into a connection. Navigating on + // every non-nil update lets a state update racing a disconnect + // re-push the slider view, making disconnect appear unresponsive. + if oldValue == nil && newValue != nil && path.isEmpty { + // Save successful connection to recent servers + viewModel.saveSuccessfulConnection() + path.append("sliders") + } + } + .onChange(of: viewModel.error) { oldValue, newValue in + // If there's an error, make sure we're back on the main view + if newValue != nil && !path.isEmpty { + path = NavigationPath() + } + } + .onChange(of: path) { oldPath, newPath in + // If user navigated back to main view, ensure we disconnect + if !oldPath.isEmpty && newPath.isEmpty && viewModel.fullState != nil { + viewModel.disconnect() + } + } + .onAppear { + if IntroTourGate.shouldShowTour(hasSeenTour: hasSeenIntroTour) { + // Defer one run-loop turn so the NavigationStack finishes its + // first layout before the fullScreenCover presents; presenting + // synchronously in onAppear can be dropped on first launch. + Task { @MainActor in showIntroTour = true } + } + #if DEBUG + if configureForScreenshotsIfNeeded() { return } + #endif + viewModel.loadRecentServers() + mdnsService.startDiscovery() + } + .onDisappear { + mdnsService.stopDiscovery() + } + .onChange(of: mdnsService.discoveredServers) { oldServers, newServers in + viewModel.handleDiscoveredServers(newServers) + } + .onChange(of: viewModel.address) { oldValue, newValue in + viewModel.handleManualAddressChange(newValue) + } + .onChange(of: viewModel.port) { oldValue, newValue in + viewModel.handleManualPortChange(newValue) + } + } // NavigationStack + } + + // MARK: - Computed Properties + + private var alertTitle: String { + if let error = viewModel.error, error.contains("timeout") { + return "Connection Timeout" + } + return "Connection Error" + } + + // MARK: - Private Methods + + private func connectToServer() { + // Port resolution (blank -> default) is handled by the view model. + viewModel.connectToServer(address: viewModel.address, port: viewModel.port) + } + + #if DEBUG + // Configures deterministic state for fastlane snapshot. + // + // Returns true when launched with --screenshotMode, in which case live mDNS + // discovery and recent-server loading are skipped so the screens are stable. + // The connection screen then shows a fixed manual server address. Passing + // --mockConnected additionally injects a live session so the slider and + // settings screens can be captured without a real PC server. + private func configureForScreenshotsIfNeeded() -> Bool { + let arguments = ProcessInfo.processInfo.arguments + guard arguments.contains("--screenshotMode") else { return false } + + // Start from a clean, deterministic list (no live discovery or recents). + viewModel.recentServers = [] + viewModel.discoveredServers = [] + + // Auto-discovery showcase: a server broadcasting over mDNS appears in the + // list and auto-fills the connection fields, exactly like live discovery. + if arguments.contains("--mockDiscovered") { + let server = DiscoveredServer(address: "192.168.0.42", port: 3000, computerName: "MYPC") + viewModel.handleDiscoveredServers([server]) + return true + } + + // Deterministic manual-entry values for the plain connection screen. + viewModel.address = "192.168.0.17" + viewModel.port = 3000 + + guard arguments.contains("--mockConnected") else { return true } + + // Delay lets the NavigationStack finish its initial layout before the + // fullState change triggers navigation to SliderView. + Task { @MainActor in + try? await Task.sleep(for: .milliseconds(300)) + // Volumes are on a 0...100 scale (see SessionCell/TopCell slider range). + let sessions = [ + FullState.Session(id: "1", muted: false, name: "Spotify", volume: 65), + FullState.Session(id: "2", muted: false, name: "Discord", volume: 80), + FullState.Session(id: "3", muted: true, name: "Chrome", volume: 40), + FullState.Session(id: "4", muted: false, name: "System Sounds", volume: 30), + ] + let device = FullState.theDefaultDevice( + deviceId: "mock-device", + masterMuted: false, + masterVolume: 75, + name: "Speakers (HDMI)", + sessions: sessions + ) + // Multiple output devices so the master-device selector has a + // meaningful list; "mock-device" is the selected default. + viewModel.fullState = FullState( + protocolVersion: 7, + deviceIds: [ + "mock-device": "Speakers (HDMI)", + "headphones": "Headphones (Bluetooth)", + "realtek": "Realtek Digital Output", + "monitor": "Monitor Audio (DisplayPort)", + ], + defaultDevice: device + ) + } + return true + } + #endif +} + +#Preview { + MainView() + .preferredColorScheme(.dark) +} + +#Preview("With Recent Servers") { + // Create a preview version with mock recent servers + let preview = MainView() + // Note: In a real implementation, you'd mock the ServersLocalDataSource + // to return test data, but this gives an idea of the UI + return preview + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/ServerListRowView.swift b/PcVolumeControl/views/ServerListRowView.swift new file mode 100644 index 0000000..56345fa --- /dev/null +++ b/PcVolumeControl/views/ServerListRowView.swift @@ -0,0 +1,190 @@ +// +// ServerListRowView.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/6/25. +// + +import SwiftUI + +struct ServerListRowView: View { + let item: MainViewModel.ServerListItem + @Binding var manualAddress: String + @Binding var manualPort: UInt16 + var focusedField: FocusState.Binding + let onConnect: (DiscoveredServer?) -> Void + + @State private var portText: String = "" + + var body: some View { + if item.isManual { + HStack { + VStack(alignment: .leading, spacing: 12) { + VStack(alignment: .leading, spacing: 4) { + Text("Server IP or Hostname") + .font(.caption) + .foregroundColor(.gray) + TextField("192.168.1.100", text: $manualAddress) + .textFieldStyle(CustomTextFieldStyle()) + .focused(focusedField, equals: .address) + } + + VStack(alignment: .leading, spacing: 4) { + Text("Server Port") + .font(.caption) + .foregroundColor(.gray) + TextField("3000", text: $portText) + .textFieldStyle(CustomTextFieldStyle()) + .keyboardType(.numberPad) + .focused(focusedField, equals: .port) + .onChange(of: portText) { _, newValue in + if newValue.isEmpty { + manualPort = 0 + } else if let port = UInt16(newValue), port >= 1 && port <= 65535 { + manualPort = port + } + } + + if !isPortValid { + Text("Please enter a valid TCP port (1-65535)") + .font(.caption2) + .foregroundColor(.red) + .padding(.top, 2) + } + } + } + .frame(maxWidth: .infinity, alignment: .leading) + + Spacer() + + Button { + onConnect(item.server) + } label: { + Image(systemName: "arrow.right.circle.fill") + .foregroundColor(.sliderPink) + .font(.title2) + .frame(width: 44, height: 44) + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + .accessibilityLabel("Connect") + } + .padding(.vertical, 8) + .onAppear { + if manualPort == 0 { + portText = "" + } else { + portText = String(manualPort) + } + } + .onChange(of: manualPort) { _, newValue in + if newValue == 0 { + portText = "" + } else { + portText = String(newValue) + } + } + } else if let server = item.server { + Button { + onConnect(item.server) + } label: { + HStack { + VStack(alignment: .leading, spacing: 4) { + HStack { + Text(server.address) + .foregroundColor(.white) + .font(.headline) + + if item.isDiscovered { + Image(systemName: "wifi") + .foregroundColor(.green) + .font(.caption) + } + } + + Text("Port: \(String(server.port))") + .foregroundColor(.gray) + .font(.subheadline) + + HStack { + if let computerName = server.computerName { + Text("(\(computerName))") + .foregroundColor(.green) + .font(.caption) + } + + if item.isDiscovered { + Text("Auto-discovered") + .foregroundColor(.green) + .font(.caption2) + } else if item.isRecent { + Text("Recent connection") + .foregroundColor(.gray) + .font(.caption2) + } + + Spacer() + } + } + .frame(maxWidth: .infinity, alignment: .leading) + + Spacer() + + Image(systemName: "arrow.right.circle.fill") + .foregroundColor(.sliderPink) + .font(.title2) + .frame(width: 44, height: 44) + } + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + .accessibilityLabel("Connect to \(server.computerName ?? server.address)") + .padding(.vertical, 8) + } + } + + // Port validation computed property + private var isPortValid: Bool { + if portText.isEmpty { + return true + } + + guard let port = UInt16(portText) else { + return false + } + + return port >= 1 && port <= 65535 + } +} + +#Preview { + @Previewable @FocusState var focusedField: MainView.FocusedField? + + VStack(spacing: 10) { + // Discovered server row + ServerListRowView( + item: .discovered(DiscoveredServer(address: "192.168.1.100", port: 3000, computerName: "DESKTOP-PC")), + manualAddress: .constant(""), + manualPort: .constant(0), + focusedField: $focusedField + ) { _ in } + + // Recent server row + ServerListRowView( + item: .recent(DiscoveredServer(address: "10.0.0.5", port: 8080, computerName: nil)), + manualAddress: .constant(""), + manualPort: .constant(0), + focusedField: $focusedField + ) { _ in } + + // Manual entry row + ServerListRowView( + item: .manual, + manualAddress: .constant("192.168.1.50"), + manualPort: .constant(0), + focusedField: $focusedField + ) { _ in } + } + .padding() + .background(Color.almostBlack) +} diff --git a/PcVolumeControl/views/ServerSetupGuideView.swift b/PcVolumeControl/views/ServerSetupGuideView.swift new file mode 100644 index 0000000..fabb9e4 --- /dev/null +++ b/PcVolumeControl/views/ServerSetupGuideView.swift @@ -0,0 +1,142 @@ +// +// ServerSetupGuideView.swift +// PcVolumeControl +// +// Step-by-step guide for installing the Windows companion server. +// Designed to work both pushed onto a NavigationStack (intro tour, +// Settings) and wrapped in a sheet (connect screen footer). +// + +import SwiftUI + +// Single source of truth for the Windows server download location. +enum ServerDownload { + static let releasesURL = URL(string: "https://github.com/PcVolumeControl/PcVolumeControlWindows/releases/latest")! + static let organizationURL = URL(string: "https://github.com/PcVolumeControl")! + static var supportedProtocolVersion: Int { VolumeControlRepository.protocolVersion } +} + +struct ServerSetupGuideView: View { + var body: some View { + ScrollView { + VStack(alignment: .leading, spacing: 16) { + Text("PcVolumeControl needs a small, free server running on your Windows PC. Set it up once and this app can find it automatically.") + .font(.subheadline) + .foregroundColor(.gray) + + SetupStepRow(number: 1, title: "Download the server") { + Text("On your Windows PC, download the latest installer from GitHub.") + Link(destination: ServerDownload.releasesURL) { + HStack(spacing: 4) { + Image(systemName: "link") + Text("PcVolumeControlWindows releases") + } + .font(.footnote) + .foregroundColor(.sliderPink) + } + .accessibilityLabel("Download PcVolumeControlWindows releases on GitHub") + ShareLink(item: ServerDownload.releasesURL) { + HStack(spacing: 4) { + Image(systemName: "square.and.arrow.up") + Text("Share download link") + } + .font(.footnote) + .foregroundColor(.sliderPink) + } + .accessibilityLabel("Share the download link to open on your PC") + } + + SetupStepRow(number: 2, title: "Install and run it") { + Text("Run the installer, then start the server. If Windows Firewall asks, click Allow so the server can accept connections on private networks.") + } + + SetupStepRow(number: 3, title: "Find the address") { + Text("The server window shows your PC's IP address and port. The default port is 3000.") + } + + SetupStepRow(number: 4, title: "Connect from this app") { + Text("With your device on the same Wi-Fi network as the PC, your computer usually appears in the server list automatically. Otherwise, type the IP address and port manually.") + } + + VStack(alignment: .leading, spacing: 6) { + Text("Trouble connecting?") + .font(.subheadline) + .fontWeight(.semibold) + .foregroundColor(.white) + Text("Make sure this device and PC are on the same network, the server is allowed through Windows Firewall, and no VPN is active on either device. VPNs often block local discovery.") + .font(.footnote) + .foregroundColor(.gray) + } + .padding(.top, 8) + + VStack(alignment: .leading, spacing: 6) { + Text("We're open source. Report bugs, ask questions, or submit pull requests on GitHub!") + .font(.footnote) + .foregroundColor(.gray) + Link(destination: ServerDownload.organizationURL) { + HStack(spacing: 4) { + Image(systemName: "link") + Text("Find us on GitHub") + } + .font(.footnote) + .foregroundColor(.sliderPink) + } + .accessibilityLabel("Find PcVolumeControl on GitHub") + } + .padding(.top, 4) + + Text("App \(Bundle.main.appVersion) · Server protocol v\(ServerDownload.supportedProtocolVersion)") + .font(.caption2) + .foregroundColor(.gray.opacity(0.5)) + .frame(maxWidth: .infinity, alignment: .center) + .padding(.top, 8) + } + .padding(20) + .readableContentWidth() + } + .background(Color.almostBlack.ignoresSafeArea()) + .navigationTitle("Set Up Your PC") + .navigationBarTitleDisplayMode(.inline) + .preferredColorScheme(.dark) + } +} + +// One numbered step card: pink number badge, title, and free-form body +// content (text plus optional links). +private struct SetupStepRow: View { + let number: Int + let title: String + @ViewBuilder var content: Content + + var body: some View { + HStack(alignment: .top, spacing: 12) { + Text("\(number)") + .font(.headline) + .foregroundColor(.white) + .frame(width: 28, height: 28) + .background(Circle().fill(Color.sliderPink)) + .accessibilityHidden(true) + + VStack(alignment: .leading, spacing: 6) { + Text(title) + .font(.headline) + .foregroundColor(.white) + content + .font(.subheadline) + .foregroundColor(.gray) + } + + Spacer(minLength: 0) + } + .padding(14) + .background(RoundedRectangle(cornerRadius: 12).fill(Color.white.opacity(0.06))) + .accessibilityElement(children: .combine) + } +} + +#Preview { + NavigationStack { + ServerSetupGuideView() + } + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/SessionCell.swift b/PcVolumeControl/views/SessionCell.swift new file mode 100644 index 0000000..234ffc5 --- /dev/null +++ b/PcVolumeControl/views/SessionCell.swift @@ -0,0 +1,444 @@ +// +// SessionCell.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/4/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import SwiftUI + + +struct HorizontalTickSlider: View { + @Binding var value: Double + let range: ClosedRange + let steps: Int + var accessibilityLabel: String = "Volume" + let onEditingChanged: (Bool) -> Void + let onValueChange: (Double) -> Void + let onCommit: () -> Void + + var body: some View { + ZStack { + // 1) Tick marks under the track + GeometryReader { _ in + HStack(spacing: 0) { + ForEach(0...steps, id: \.self) { index in + if index == 0 { + Rectangle() + .frame(width: 1, height: 8) + .foregroundColor(.secondary.opacity(0.5)) + } else { + Spacer() + Rectangle() + .frame(width: 1, height: 8) + .foregroundColor(.secondary.opacity(0.5)) + } + } + } + .padding(.horizontal, 8) + } + .frame(height: 8) + .offset(y: 8) + + // 2) The actual Slider + Slider(value: $value, in: range) { editing in + onEditingChanged(editing) + if !editing { + onCommit() + } + } + .onChange(of: value) { oldValue, newValue in + onValueChange(newValue) + } + .accentColor(.sliderPink) + .frame(height: 44) + .padding(.horizontal, 8) + .accessibilityLabel(accessibilityLabel) + .accessibilityValue("\(Int(value)) percent") + } + .frame(height: 44) + } +} + +struct RecessedCapsuleToggleStyle: ToggleStyle { + @ScaledMetric(relativeTo: .body) private var knobSize: CGFloat = 38 + @ScaledMetric(relativeTo: .body) private var trackWidth: CGFloat = 90 + + func makeBody(configuration: Configuration) -> some View { + let horizontalPadding: CGFloat = 4 + let verticalPadding: CGFloat = 4 + let trackHeight = knobSize + verticalPadding * 2.5 + let maxOffset = (trackWidth - knobSize) / 2 - horizontalPadding + + return Button { + let haptic = UIImpactFeedbackGenerator(style: .medium) + haptic.impactOccurred() + withAnimation(.easeOut(duration: 0.2)) { + configuration.isOn.toggle() + } + } label: { + ZStack { + // 1) Recessed track + Capsule() + .fill(configuration.isOn ? Color.white.opacity(0.12) : Color.red.opacity(0.7)) + .frame(width: trackWidth, height: trackHeight) + .overlay( // inner‐highlight + Capsule() + .stroke(Color.white.opacity(0.3), lineWidth: 4.5) + .blur(radius: 2) + .offset(x: 1, y: -3) + .mask( + Capsule().fill( + LinearGradient( + gradient: .init(colors: [.black, .clear]), + startPoint: .topLeading, + endPoint: .bottomTrailing + ) + ) + ) + ) + .overlay( // inner‐shadow + Capsule() + .stroke(Color.black.opacity(0.9), lineWidth: 4.5) + .blur(radius: 1.5) + .offset(x: 1, y: 3) + .mask( + Capsule().fill( + LinearGradient( + gradient: .init(colors: [.clear, .black]), + startPoint: .topLeading, + endPoint: .bottomTrailing + ) + ) + ) + ) + + // 2) Knob inset by our padding + Circle() + .fill(Color(Color.almostBlack)) + .frame(width: knobSize, height: knobSize) + .shadow(color: .black.opacity(0.2), radius: 2, x: 0, y: 1) + .offset(x: configuration.isOn ? maxOffset : -maxOffset) + // ← **here** we overlay the Toggle’s label onto the knob + .overlay( + configuration.label + .font(.caption2) + .minimumScaleFactor(0.5) + .lineLimit(1) + ) + } + } + .accessibilityAddTraits(.isToggle) + .accessibilityValue(configuration.isOn ? "on" : "off") + .buttonStyle(PlainButtonStyle()) + } +} + + + + +struct SessionCell: View { + @Binding var session: FullState.Session + var isChat: Bool = false + var chatMode: Bool = false + var isMasterMuted: Bool = false + var isChatBalanceActive: Bool = false + var onBeginEditing: () -> Void + var onEndEditing: () -> Void + var onChatSelect: (String) -> Void + var onVolumeDuringDrag: (String, Double) -> Void + var onCommit: (FullState.Session) -> Void + var onChatBalanceCommit: (() -> Void)? + var backgroundColor: Color = .almostBlack + var toggleMuted: Color = .sliderPink + var toggleUnmuted: Color = .white + + @EnvironmentObject private var aliasManager: AliasManager + @Environment(\.editMode) private var editMode + + // Local state for slider to prevent visual jumps + @State private var localVolume: Double = 0 + @State private var ignoreServerUpdates = false + // Animate slider changes only while the cell is settled on-screen; off during appear so scroll-in snaps. + @State private var animationsEnabled = false + // Show a dialog to edit the alias for this session + @State private var isEditingAlias = false + @State private var newAlias = "" + + private var isInEditMode: Bool { + editMode?.wrappedValue == .active + } + + // The volume the slider should display: zero whenever the session or the + // master is muted, otherwise the session's real volume. Centralized here so + // every place that sets localVolume stays mute-aware, including onAppear + // when a cell is recreated after scrolling back on-screen. + static func displayVolume(volume: Double, muted: Bool, masterMuted: Bool) -> Double { + (muted || masterMuted) ? 0 : volume + } + + private var displayVolume: Double { + SessionCell.displayVolume( + volume: session.volume, + muted: session.muted, + masterMuted: isMasterMuted + ) + } + + var body: some View { + VStack(spacing: 12) { + // Drag handle indicator - only visible in edit mode + if isInEditMode { + HStack { + Spacer() + Image(systemName: "line.3.horizontal") + .foregroundColor(.white.opacity(0.3)) + .font(.system(size: 12, weight: .medium)) + Spacer() + } + .padding(.top, 8) + } + + HStack { + // Chat balance indicator + if isChat { + Image(systemName: "arrow.up.arrow.down.circle.fill") + .foregroundColor(.pcvcBlue) + .font(.system(size: 16)) + } + + // Use alias if available, otherwise use original name + Text(aliasManager.displayNameForSession(sessionId: session.id, originalName: session.name)) + .font(.subheadline) + .fontWeight(.medium) + .foregroundColor(.white) + .lineLimit(1) + .truncationMode(.middle) + + Spacer() + + // Chat balance mode indicator + if chatMode && !isChat { + Text("AUTO") + .font(.caption2) + .fontWeight(.bold) + .foregroundColor(.pcvcBlue.opacity(0.8)) + .padding(.horizontal, 6) + .padding(.vertical, 2) + .background( + RoundedRectangle(cornerRadius: 4) + .fill(Color.pcvcBlue.opacity(0.2)) + ) + } + + // Context menu button + Menu { + Button { + onChatSelect(session.id) + } label: { + Label( + isChat ? "Remove from Chat Balance" : "Set as Chat Balance", + systemImage: isChat ? "xmark.circle" : "arrow.up.arrow.down.circle" + ) + } + + Button { + showAliasEditingPrompt() + } label: { + Label("Rename", systemImage: "pencil") + } + } label: { + Image(systemName: "ellipsis.circle") + .foregroundColor(.gray) + .font(.system(size: 20)) + .frame(width: 44, height: 44) + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + } + .padding(.horizontal, 8) + .padding(.top, isInEditMode ? 0 : 8) + + // Volume controls - all in one horizontal row + HStack(spacing: 12) { + // Volume slider + HorizontalTickSlider( + value: $localVolume, + range: 0...100, + steps: 10, + accessibilityLabel: "Volume for \(aliasManager.displayNameForSession(sessionId: session.id, originalName: session.name))", + onEditingChanged: { editing in + if editing { + ignoreServerUpdates = true + onBeginEditing() + } else { + let haptic = UISelectionFeedbackGenerator() + haptic.selectionChanged() + session.volume = localVolume + onVolumeDuringDrag(session.id, localVolume) + if isChat && isChatBalanceActive { + onChatBalanceCommit?() + } else { + onCommit(session) + } + + // Allow server updates immediately after committing + ignoreServerUpdates = false + onEndEditing() + } + }, + onValueChange: { newValue in + // live updates during drag + if isChat && chatMode { + onVolumeDuringDrag(session.id, newValue) + } + }, + onCommit: { + // final commit already handled above + } + ) + .disabled(session.muted || isMasterMuted || (isChatBalanceActive && !isChat)) + .padding(.leading, 8) + // Animate localVolume only when the cell is settled on-screen and not dragging. + .animation((animationsEnabled && !ignoreServerUpdates) ? .easeOut(duration: 0.3) : nil, value: localVolume) + + Toggle(isOn: Binding( + get: { !session.muted }, + set: { newValue in + session.muted = !newValue + onCommit(session) + } + ) + ) { + if session.muted { + Image(systemName: "speaker.slash.fill") + .foregroundColor(toggleMuted) + .offset(x: -22) + .imageScale(.large) + + } else { + Text("\(Int(localVolume))") + .foregroundColor(toggleUnmuted) + .offset(x: 22) + .font(.system(.body, design: .rounded)) + } + } + .toggleStyle(RecessedCapsuleToggleStyle()) + .disabled(isMasterMuted) + } + .padding(.horizontal, 12) + .padding(.bottom, 12) + + } + .background( + RoundedRectangle(cornerRadius: 12) + .fill(backgroundColor.opacity(0.55)) + .overlay( + // Blue outline for chat balance session + isChat ? + RoundedRectangle(cornerRadius: 12) + .stroke(Color.pcvcBlue, lineWidth: 2) + : nil + ) + .shadow(color: .black.opacity(0.2), radius: 2, x: 0, y: 1) + ) + .onAppear { + // Snap to current value on appear; re-enable animation next runloop so scroll-in catch-ups don't slide. + animationsEnabled = false + localVolume = displayVolume + DispatchQueue.main.async { animationsEnabled = true } + } + .onDisappear { animationsEnabled = false } + .onChange(of: session.volume) { _, _ in + // Only update our local value if we're not ignoring server updates + if !ignoreServerUpdates { + localVolume = displayVolume + } + } + .onChange(of: session.muted) { _, _ in + localVolume = displayVolume + } + .onChange(of: isMasterMuted) { _, _ in + localVolume = displayVolume + } + // Add alias editing dialog + .alert("Set Custom Name", isPresented: $isEditingAlias) { + TextField("Custom name", text: $newAlias) + .autocorrectionDisabled() + .autocapitalization(.words) + + Button("Save") { + // Save the new alias if it's not empty + aliasManager.setSessionAlias(originalId: session.id, alias: newAlias) + } + + Button("Clear", role: .destructive) { + // Remove any existing alias + aliasManager.setSessionAlias(originalId: session.id, alias: "") + } + + Button("Cancel", role: .cancel) {} + } message: { + Text("Enter a custom name for \"\(session.name)\"") + } + } + + private func showAliasEditingPrompt() { + // Initialize with current alias if exists + newAlias = aliasManager.sessionAliases[session.id] ?? "" + isEditingAlias = true + } +} + +#Preview { + @Previewable @State var mockSession = FullState.Session( + id: "radio.exe", + muted: false, + name: "Radio", + volume: 75.0 + ) + + SessionCell( + session: $mockSession, + isChat: false, + chatMode: false, + isMasterMuted: false, + isChatBalanceActive: false, + onBeginEditing: { }, + onEndEditing: { }, + onChatSelect: { _ in }, + onVolumeDuringDrag: { _, _ in }, + onCommit: { _ in }, + onChatBalanceCommit: nil + ) + .environmentObject(AliasManager()) + .preferredColorScheme(.dark) + .padding() +} + +#Preview("Chat Balance Mode") { + @Previewable @State var mockSession = FullState.Session( + id: "discord.exe", + muted: false, + name: "Discord", + volume: 50.0 + ) + + SessionCell( + session: $mockSession, + isChat: true, + chatMode: true, + isMasterMuted: false, + isChatBalanceActive: true, + onBeginEditing: { }, + onEndEditing: { }, + onChatSelect: { _ in }, + onVolumeDuringDrag: { _, _ in }, + onCommit: { _ in }, + onChatBalanceCommit: { } + ) + .environmentObject(AliasManager()) + .preferredColorScheme(.dark) + .padding() +} diff --git a/PcVolumeControl/views/SettingsView.swift b/PcVolumeControl/views/SettingsView.swift new file mode 100644 index 0000000..bc61ff2 --- /dev/null +++ b/PcVolumeControl/views/SettingsView.swift @@ -0,0 +1,227 @@ +// +// SettingsView.swift +// PcVolumeControl +// +// +// + +import SwiftUI + +struct UserDefaultsKeys { + static let preserveSessionOrder = "preserveSessionOrder" + static let hasSeenChatBalanceInfo = "hasSeenChatBalanceInfo" + static let hasSeenIntroTour = "hasSeenIntroTour" +} + +struct SettingsView: View { + @Environment(\.dismiss) var dismiss + @AppStorage(UserDefaultsKeys.preserveSessionOrder) private var preserveSessionOrder = true + @State private var showIntroTour = false + + var body: some View { + NavigationStack { + Form { + Section(header: Text("Session Preferences")) { + Toggle("Preserve Session Order", isOn: $preserveSessionOrder) + .tint(.sliderPink) + + Text("When enabled, your manually arranged session order will be preserved when you restart the app.") + .font(.caption) + .foregroundColor(.gray) + } + + Section(header: Text("Custom Names")) { + Text("You can create custom names for both devices and sessions by tapping their names or using the pencil icons.") + .font(.caption) + .foregroundColor(.gray) + + NavigationLink(destination: AliasListView()) { + Text("Manage Custom Names") + } + } + + Section(header: Text("Help")) { + NavigationLink(destination: ServerSetupGuideView()) { + Text("PC Server Setup Guide") + } + + Button("Replay Intro Tour") { + showIntroTour = true + } + .foregroundColor(.white) + } + + Section(header: Text("About")) { + VStack(alignment: .leading, spacing: 10) { + Text("PC Volume Control") + .font(.headline) + + Text("Control your PC application volume from your iOS device.") + .font(.caption) + .foregroundColor(.gray) + HStack { + Text("Version 2.0.0") + .font(.caption) + Text("Protocol Version: 7") + .font(.caption) + } + } + .padding(.vertical, 8) + } + } + .navigationTitle("Settings") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .navigationBarTrailing) { + Button("Done") { + dismiss() + } + } + } + .background(Color.almostBlack.edgesIgnoringSafeArea(.all)) + .fullScreenCover(isPresented: $showIntroTour) { + IntroTourView { + showIntroTour = false + } + } + } + .preferredColorScheme(.dark) + } +} + + +struct AliasListView: View { + @EnvironmentObject private var aliasManager: AliasManager + @State private var deviceAliasToEdit: (key: String, value: String)? = nil + @State private var sessionAliasToEdit: (key: String, value: String)? = nil + @State private var newAlias = "" + + var body: some View { + List { + Section(header: Text("Master Devices")) { + if aliasManager.deviceAliases.isEmpty { + Text("No custom device names set") + .foregroundColor(.gray) + .italic() + } else { + ForEach(Array(aliasManager.deviceAliases), id: \.key) { key, value in + HStack { + VStack(alignment: .leading) { + Text(value) + .fontWeight(.medium) + Text(key) + .font(.caption) + .foregroundColor(.gray) + } + + Spacer() + + // Edit button + Button { + deviceAliasToEdit = (key, value) + newAlias = value + } label: { + Image(systemName: "pencil") + .imageScale(.medium) + .foregroundColor(.sliderPink) + .frame(width: 44, height: 44) + .contentShape(Rectangle()) + } + } + .contentShape(Rectangle()) + .onTapGesture { + // Tapping the row also opens the edit dialog + deviceAliasToEdit = (key, value) + newAlias = value + } + } + } + } + + Section(header: Text("Sessions")) { + if aliasManager.sessionAliases.isEmpty { + Text("No custom session names set") + .foregroundColor(.gray) + .italic() + } else { + ForEach(Array(aliasManager.sessionAliases), id: \.key) { key, value in + HStack { + VStack(alignment: .leading) { + Text(value) + .fontWeight(.medium) + Text(key) + .font(.caption) + .foregroundColor(.gray) + } + + Spacer() + + // Edit button + Button { + sessionAliasToEdit = (key, value) + newAlias = value + } label: { + Image(systemName: "pencil") + .imageScale(.medium) + .foregroundColor(.sliderPink) + .frame(width: 44, height: 44) + .contentShape(Rectangle()) + } + } + .contentShape(Rectangle()) + .onTapGesture { + // Tapping the row also opens the edit dialog + sessionAliasToEdit = (key, value) + newAlias = value + } + } + } + } + } + .navigationTitle("Custom Names") + // Edit name alert + .alert("Edit Custom Name", isPresented: .init( + get: { deviceAliasToEdit != nil || sessionAliasToEdit != nil }, + set: { if !$0 { + // Just clear the editing state, don't make any changes to the actual aliases + deviceAliasToEdit = nil + sessionAliasToEdit = nil + }} + )) { + TextField("Enter new name", text: $newAlias) + .autocorrectionDisabled() + .autocapitalization(.words) + + Button("Save") { + if let device = deviceAliasToEdit { + aliasManager.setDeviceAlias(originalId: device.key, alias: newAlias) + } else if let session = sessionAliasToEdit { + aliasManager.setSessionAlias(originalId: session.key, alias: newAlias) + } + deviceAliasToEdit = nil + sessionAliasToEdit = nil + } + + Button("Delete", role: .destructive) { + if let device = deviceAliasToEdit { + aliasManager.setDeviceAlias(originalId: device.key, alias: "") + } else if let session = sessionAliasToEdit { + aliasManager.setSessionAlias(originalId: session.key, alias: "") + } + deviceAliasToEdit = nil + sessionAliasToEdit = nil + } + + Button("Cancel", role: .cancel) { + // Simply clear the edit states without making changes + deviceAliasToEdit = nil + sessionAliasToEdit = nil + // Don't modify aliases when canceling + } + } + } +} + +#Preview { + SettingsView() +} diff --git a/PcVolumeControl/views/SliderView.swift b/PcVolumeControl/views/SliderView.swift new file mode 100644 index 0000000..8f84fdb --- /dev/null +++ b/PcVolumeControl/views/SliderView.swift @@ -0,0 +1,169 @@ +import SwiftUI + +struct SliderView: View { + @EnvironmentObject private var mainVM: MainViewModel + @StateObject private var vm = SliderViewModel() + @Binding var path: NavigationPath + + @State private var showSettings = false + @State private var showOverlay = false + + // Connection-status banner; lives outside the disabled content so its buttons stay tappable. + @ViewBuilder + private var connectionBanner: some View { + switch mainVM.connectionStatus { + case .reconnecting: + HStack(spacing: 8) { + ProgressView() + .tint(.white) + .scaleEffect(0.8) + Text("Connection lost \u{2013} reconnecting\u{2026}") + .font(.caption) + .foregroundColor(.white) + } + .padding(.vertical, 8) + .frame(maxWidth: .infinity) + .background(Color.orange.opacity(0.85)) + + case .lost: + HStack(spacing: 10) { + Image(systemName: "exclamationmark.triangle.fill") + .foregroundColor(.white) + Text("Server disconnected") + .font(.caption) + .fontWeight(.semibold) + .foregroundColor(.white) + Spacer() + Button("Reconnect") { mainVM.reconnect() } + .font(.caption.bold()) + .foregroundColor(.white) + Button { + mainVM.disconnect() + path = NavigationPath() + } label: { + Image(systemName: "xmark") + .foregroundColor(.white.opacity(0.85)) + } + .accessibilityLabel("Leave") + } + .padding(.horizontal, 14) + .padding(.vertical, 8) + .frame(maxWidth: .infinity) + .background(Color.red.opacity(0.85)) + + case .connected: + EmptyView() + } + } + + var body: some View { + ZStack { + MotionMeshBackground() + .ignoresSafeArea() + + VStack(spacing: 0) { + connectionBanner + + // Frozen and dimmed unless the connection is live. + VStack(spacing: 0) { + TopCell( + internalDefault: .constant(vm.defaultDevice), + internalDevices: .constant(vm.devices), + onBeginEditing: { vm.beginEditing(nil) }, + onEndEditing: { vm.endEditing(nil) }, + onMasterCommit: mainVM.updateMaster, + onDefaultDeviceChange: mainVM.updateDefaultDevice, + onShowSettings: { showSettings = true }, + onDisconnect: { + // Disconnect authoritatively before popping; a bare path change can race a server re-push. + mainVM.disconnect() + path = NavigationPath() + } + ) + + List { + ForEach($vm.sessions) { $session in + SessionCell( + session: $session, + isChat: vm.chatBalanceSessionId == session.id, + chatMode: vm.chatBalanceMode, + isMasterMuted: vm.isMasterMuted, + isChatBalanceActive: vm.chatBalanceMode, + onBeginEditing: { vm.beginEditing(session.id) }, + onEndEditing: { vm.endEditing(session.id) }, + onChatSelect: vm.toggleChatBalance, + onVolumeDuringDrag: vm.applyChatBalance, + onCommit: { sess in + Task { try? await mainVM.updateSession(sess) } + }, + onChatBalanceCommit: vm.chatBalanceSessionId == session.id ? { + vm.commitChatBalanceChanges { sess in + Task { try? await mainVM.updateSession(sess) } + } + } : nil + ) + } + .onMove(perform: vm.reorder) + .listRowSeparator(.hidden) + .listRowInsets(EdgeInsets()) + .listRowBackground(Color.clear) + } + .listStyle(.plain) + .scrollContentBackground(.hidden) + } + .disabled(!mainVM.isConnectionLive) + .opacity(mainVM.isConnectionLive ? 1 : 0.5) + } + .toolbar(.hidden, for: .navigationBar) + .readableContentWidth() + + if showOverlay { + DismissableErrorOverlay(message: "Connection to server lost") { + showOverlay = false + } + } + + if vm.showChatBalanceInfo { + ChatBalanceInfoOverlay { + vm.dismissChatBalanceInfo() + } + } + } + .sheet(isPresented: $showSettings) { SettingsView() } + .navigationBarBackButtonHidden() + .onReceive(mainVM.$fullState) { newState in + vm.fullState = newState + } + } +} + +#Preview { + @Previewable @State var mockPath = NavigationPath() + + NavigationStack(path: $mockPath) { + ZStack { + Color.almostBlack.ignoresSafeArea() + Text("SliderView Preview") + .foregroundColor(.white) + .font(.title) + } + .environmentObject(AliasManager()) + .preferredColorScheme(.dark) + } +} + +#Preview("Static Layout") { + ZStack { + Color.almostBlack.ignoresSafeArea() + + VStack { + Text("Slider Layout Preview") + .font(.title) + .foregroundColor(.white) + .padding() + + Spacer() + } + } + .preferredColorScheme(.dark) +} diff --git a/PcVolumeControl/views/TopCell.swift b/PcVolumeControl/views/TopCell.swift new file mode 100644 index 0000000..343fedf --- /dev/null +++ b/PcVolumeControl/views/TopCell.swift @@ -0,0 +1,347 @@ +// +// TopCell.swift +// PcVolumeControl +// +// Created by Bill Booth on 6/4/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import SwiftUI + +struct TopCell: View { + @Binding var internalDefault: FullState.theDefaultDevice? + @Binding var internalDevices: [String: String] + + var onBeginEditing: () -> Void + var onEndEditing: () -> Void + var onMasterCommit: (String, Bool, Double) -> Void + var onDefaultDeviceChange: (String) -> Void + var onShowSettings: () -> Void + var onDisconnect: () -> Void + + @EnvironmentObject private var aliasManager: AliasManager + + // Local state for master volume slider to prevent visual jumps + @State private var localMasterVolume: Double = 0 + @State private var ignoreServerUpdates = false + @State private var showDevicePicker = false + + var body: some View { + VStack(spacing: 12) { + // Drag handle indicator (matching SessionCell) + HStack { + Spacer() +// Image(systemName: "line.3.horizontal") +// .foregroundColor(.masterAccent.opacity(0.3)) +// .font(.system(size: 12, weight: .medium)) +// Spacer() + } + .padding(.top, 8) + + // Device name header with long-press gesture + if let device = internalDefault { + HStack { + Image("PCVCLogo") + .renderingMode(.template) + .resizable() + .scaledToFit() + .frame(width: 18, height: 18) + .foregroundColor(.masterAccent) + + Button { + showDevicePicker = true + } label: { + HStack(spacing: 4) { + Text(aliasManager.displayNameForDevice(deviceId: internalDevices[device.deviceId] ?? "", originalName: internalDevices[device.deviceId] ?? "Master Device")) + .font(.subheadline) + .fontWeight(.medium) + .foregroundColor(.white) + .lineLimit(1) + .truncationMode(.middle) + + Image(systemName: "chevron.down") + .foregroundColor(.masterAccent.opacity(0.6)) + .font(.system(size: 10, weight: .semibold)) + } + .contentShape(Rectangle()) + } + .buttonStyle(.plain) + .accessibilityLabel("Select master device") + .accessibilityHint("Opens a picker to choose the active output device") + + Spacer() + + // Overflow menu (edit name, settings, disconnect) + Menu { + Button { + showAliasEditingPrompt() + } label: { + Label("Edit Name", systemImage: "pencil") + } + Button { + onShowSettings() + } label: { + Label("Settings", systemImage: "gearshape") + } + Button(role: .destructive) { + onDisconnect() + } label: { + Label("Disconnect", systemImage: "power") + } + } label: { + Image(systemName: "slider.horizontal.3") + .font(.system(size: 18)) + .foregroundColor(.masterAccent.opacity(0.8)) + .frame(width: 44, height: 44) + .contentShape(Rectangle()) + } + .accessibilityLabel("More options") + } + .padding(.horizontal, 12) + + // Master Volume Controls - Slider and Mute inline + HStack(spacing: 12) { + // Volume slider + HorizontalTickSlider( + value: $localMasterVolume, + range: 0...100, + steps: 10, + accessibilityLabel: "Master volume", + onEditingChanged: { editing in + if editing { + ignoreServerUpdates = true + onBeginEditing() + } else { + let haptic = UISelectionFeedbackGenerator() + haptic.selectionChanged() + onMasterCommit(device.deviceId, device.masterMuted, localMasterVolume) + + // Allow server updates immediately after committing + ignoreServerUpdates = false + onEndEditing() + } + }, + onValueChange: { _ in }, + onCommit: {} + ) + .accentColor(.masterAccent) + .padding(.leading, 8) + + // Mute toggle with volume percentage + Toggle(isOn: Binding( + get: { !device.masterMuted }, + set: { newValue in + onMasterCommit(device.deviceId, !newValue, device.masterVolume) + } + )) { + if device.masterMuted { + Image(systemName: "speaker.slash.fill") + .foregroundColor(.red) + .offset(x: -22) + .imageScale(.large) + } else { + Text("\(Int(localMasterVolume))") + .foregroundColor(.masterAccent) + .offset(x: 22) + .font(.system(.body, design: .rounded)) + } + } + .toggleStyle(RecessedCapsuleToggleStyle()) + .accessibilityLabel("Master mute") + .accessibilityValue(device.masterMuted ? "muted" : "unmuted") + } + .padding(.horizontal, 12) + .padding(.bottom, 12) + } + } + .frame(maxWidth: .infinity) + .background(Color.masterBackground.opacity(0.55)) + .onAppear { + if let device = internalDefault { + localMasterVolume = device.masterVolume + } + } + .onChange(of: internalDefault?.masterVolume) { _, newValue in + if !ignoreServerUpdates, let volume = newValue { + localMasterVolume = volume + } + } + .onChange(of: internalDefault?.masterMuted) { _, masterMuted in + guard let masterMuted, let device = internalDefault else { return } + withAnimation(.easeOut(duration: 0.3)) { + localMasterVolume = masterMuted ? 0 : device.masterVolume + } + } + // Device picker sheet + .sheet(isPresented: $showDevicePicker) { + DevicePickerSheet( + devices: internalDevices, + selectedDeviceId: internalDefault?.deviceId, + onSelect: { key in + onDefaultDeviceChange(key) + } + ) + .environmentObject(aliasManager) + .presentationDetents([.medium, .large]) + .presentationDragIndicator(.visible) + } + // Add alias editing dialog for master device + .alert("Set Master Device Name", isPresented: $isEditingAlias) { + TextField("Custom name", text: $newAlias) + .autocorrectionDisabled() + .autocapitalization(.words) + + Button("Save") { + if let device = internalDefault { + aliasManager.setDeviceAlias(originalId: device.name, alias: newAlias) + } + } + + Button("Clear", role: .destructive) { + if let device = internalDefault { + aliasManager.setDeviceAlias(originalId: device.name, alias: "") + } + } + + Button("Cancel", role: .cancel) {} + } message: { + if let device = internalDefault { + Text("Enter a custom name for \"\(internalDevices[device.name] ?? device.name)\"") + } + } + } + + // Dialog state for editing master device alias + @State private var isEditingAlias = false + @State private var newAlias = "" + + private func showAliasEditingPrompt() { + // Initialize with current alias if exists + if let device = internalDefault { + newAlias = aliasManager.deviceAliases[device.name] ?? "" + } + isEditingAlias = true + } +} + +private struct DevicePickerSheet: View { + let devices: [String: String] + let selectedDeviceId: String? + let onSelect: (String) -> Void + + @EnvironmentObject private var aliasManager: AliasManager + @Environment(\.dismiss) private var dismiss + + private func displayName(for key: String) -> String { + let original = devices[key] ?? "" + return aliasManager.displayNameForDevice(deviceId: original, originalName: original) + } + + private var sortedKeys: [String] { + devices.keys.sorted { + displayName(for: $0).localizedCaseInsensitiveCompare(displayName(for: $1)) == .orderedAscending + } + } + + var body: some View { + NavigationStack { + ScrollViewReader { proxy in + List { + ForEach(sortedKeys, id: \.self) { key in + let isSelected = key == selectedDeviceId + Button { + onSelect(key) + dismiss() + } label: { + HStack { + Text(displayName(for: key)) + .foregroundColor(.primary) + .fontWeight(isSelected ? .semibold : .regular) + Spacer() + if isSelected { + Image(systemName: "checkmark") + .foregroundColor(.masterAccent) + .fontWeight(.semibold) + } + } + .contentShape(Rectangle()) + } + .listRowBackground(isSelected ? Color.masterAccent.opacity(0.15) : nil) + } + } + .onAppear { + if let selectedDeviceId { + proxy.scrollTo(selectedDeviceId, anchor: .center) + } + } + } + .navigationTitle("Select Master Device") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .cancellationAction) { + Button("Cancel") { dismiss() } + } + } + } + } +} + +#Preview { + @Previewable @State var mockDevice: FullState.theDefaultDevice? = FullState.theDefaultDevice( + deviceId: "speaker-12345", + masterMuted: false, + masterVolume: 80.0, + name: "External Speakers", + sessions: [] + ) + + @Previewable @State var mockDevices = [ + "speaker-12345": "External Speakers", + "headphones-67890": "Headphones (Bluetooth)", + "monitor-11111": "Monitor Audio (HDMI)" + ] + + TopCell( + internalDefault: $mockDevice, + internalDevices: $mockDevices, + onBeginEditing: { }, + onEndEditing: { }, + onMasterCommit: { _, _, _ in }, + onDefaultDeviceChange: { _ in }, + onShowSettings: { }, + onDisconnect: { } + ) + .environmentObject(AliasManager()) + .preferredColorScheme(.dark) + .padding() +} + +#Preview("Muted State") { + @Previewable @State var mockDevice: FullState.theDefaultDevice? = FullState.theDefaultDevice( + deviceId: "speaker-12345", + masterMuted: true, + masterVolume: 80.0, + name: "Speakers (Realtek High Definition Audio)", + sessions: [] + ) + + @Previewable @State var mockDevices = [ + "speaker-12345": "Speakers (Realtek High Definition Audio)", + "headphones-67890": "Headphones (Bluetooth)", + "monitor-11111": "Monitor Audio (HDMI)" + ] + + TopCell( + internalDefault: $mockDevice, + internalDevices: $mockDevices, + onBeginEditing: { }, + onEndEditing: { }, + onMasterCommit: { _, _, _ in }, + onDefaultDeviceChange: { _ in }, + onShowSettings: { }, + onDisconnect: { } + ) + .environmentObject(AliasManager()) + .preferredColorScheme(.dark) + .padding() +} diff --git a/PcVolumeControl/views/UIStyling.swift b/PcVolumeControl/views/UIStyling.swift new file mode 100644 index 0000000..ebf625a --- /dev/null +++ b/PcVolumeControl/views/UIStyling.swift @@ -0,0 +1,50 @@ +// +// UIStyling.swift +// PCVolumeControl (iOS) +// +// Created by Bill Booth on 1/13/24. +// + +import SwiftUI + + +extension Color { + static let almostBlack = Color(red: 30 / 255, green: 30 / 255, blue: 30 / 255) + static let sliderPink = Color(red: 255 / 255, green: 56 / 255, blue: 122 / 255) + static let pcvcBlue = Color(red: 70 / 255, green: 33 / 255, blue: 255 / 255) + static let masterBackground = Color(red: 40 / 255, green: 40 / 255, blue: 50 / 255) + static let masterAccent = Color(red: 251 / 255, green: 192 / 255, blue: 45 / 255) // Gold accent for master controls +} + +extension View { + // Caps foreground content to a comfortable, centered column and keeps it + // centered in the available space. A no-op on iPhone (the screen is narrower + // than the cap); on iPad it stops controls from stretching edge-to-edge. + func readableContentWidth(_ maxWidth: CGFloat = 600) -> some View { + self + .frame(maxWidth: maxWidth) + .frame(maxWidth: .infinity, alignment: .center) + } +} + +extension Bundle { + var appVersion: String { + infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown" + } +} + +// Custom styling for text fields +struct CustomTextFieldStyle: TextFieldStyle { + // periphery:ignore - _body is the TextFieldStyle protocol requirement, invoked by SwiftUI + func _body(configuration: TextField) -> some View { + configuration + .padding(15) + .background(Color.almostBlack) + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(Color.gray.opacity(0.3), lineWidth: 1) + ) + .foregroundColor(.white) + } +} diff --git a/PcVolumeControl/views/background/MotionMeshBackground.swift b/PcVolumeControl/views/background/MotionMeshBackground.swift new file mode 100644 index 0000000..930ee5a --- /dev/null +++ b/PcVolumeControl/views/background/MotionMeshBackground.swift @@ -0,0 +1,48 @@ +import SwiftUI +import simd + +struct MotionMeshBackground: View { + @EnvironmentObject private var motion: MotionProvider + @Environment(\.accessibilityReduceMotion) private var reduceMotion + + var body: some View { + TimelineView(.animation(minimumInterval: 1.0 / 30.0, paused: false)) { context in + let phase = reduceMotion ? 0 : context.date.timeIntervalSinceReferenceDate + mesh(phase: phase) + } + .ignoresSafeArea() + } + + private func mesh(phase: Double) -> some View { + let tilt = reduceMotion ? Tilt.zero : motion.tilt + let points = meshPoints(phase: phase, tilt: tilt) + return MeshGradient( + width: MotionMeshPalette.columns, + height: MotionMeshPalette.rows, + points: points, + colors: MotionMeshPalette.colors, + smoothsColors: true + ) + } + + private func meshPoints(phase: Double, tilt: Tilt) -> [SIMD2] { + let base = MotionMeshPalette.basePoints + let tiltOffset = SIMD2(Float(tilt.roll), Float(tilt.pitch)) * MotionMeshPalette.tiltAmplitude + var result: [SIMD2] = [] + result.reserveCapacity(base.count) + for i in 0..] = { + var points: [SIMD2] = [] + for row in 0..(x, y)) + } + } + return points + }() + + static func isInteriorPoint(index: Int) -> Bool { + let col = index % columns + let row = index / columns + return col > 0 && col < columns - 1 && row > 0 && row < rows - 1 + } + + private static let edgeIndigo = Color(red: 0x0A / 255.0, green: 0x0E / 255.0, blue: 0x1F / 255.0) + private static let deepIndigo = Color(red: 0x10 / 255.0, green: 0x14 / 255.0, blue: 0x28 / 255.0) + private static let deepBlue = Color(red: 0x1B / 255.0, green: 0x2A / 255.0, blue: 0x6B / 255.0) + private static let violet = Color(red: 0x3A / 255.0, green: 0x1E / 255.0, blue: 0x78 / 255.0) + private static let teal = Color(red: 0x0E / 255.0, green: 0x3B / 255.0, blue: 0x4E / 255.0) + private static let midnight = Color(red: 0x14 / 255.0, green: 0x18 / 255.0, blue: 0x35 / 255.0) + + static let colors: [Color] = [ + edgeIndigo, edgeIndigo, edgeIndigo, edgeIndigo, + edgeIndigo, deepBlue, violet, edgeIndigo, + edgeIndigo, teal, midnight, edgeIndigo, + edgeIndigo, deepIndigo, deepBlue, edgeIndigo, + edgeIndigo, edgeIndigo, edgeIndigo, edgeIndigo, + ] + + static func ambientOffset(forIndex i: Int, phase: Double) -> SIMD2 { + let fi = Float(i) + let fx = sin(Float(phase) * (0.22 + 0.07 * fi) + fi * 1.7) + let fy = cos(Float(phase) * (0.18 + 0.05 * fi) + fi * 2.3) + return SIMD2(fx, fy) * ambientAmplitude + } +} diff --git a/PcVolumeControl/views/background/MotionProvider.swift b/PcVolumeControl/views/background/MotionProvider.swift new file mode 100644 index 0000000..853e0bc --- /dev/null +++ b/PcVolumeControl/views/background/MotionProvider.swift @@ -0,0 +1,103 @@ +import Foundation +import CoreMotion +import Combine + +struct Tilt: Equatable { + var roll: Double + var pitch: Double + + static let zero = Tilt(roll: 0, pitch: 0) +} + +protocol MotionSource: AnyObject { + var isAvailable: Bool { get } + func start(handler: @escaping (_ roll: Double, _ pitch: Double) -> Void) + func stop() +} + +final class CoreMotionSource: MotionSource { + private let manager = CMMotionManager() + + init(updateInterval: TimeInterval = 1.0 / 30.0) { + manager.deviceMotionUpdateInterval = updateInterval + } + + var isAvailable: Bool { manager.isDeviceMotionAvailable } + + func start(handler: @escaping (Double, Double) -> Void) { + guard manager.isDeviceMotionAvailable else { return } + guard !manager.isDeviceMotionActive else { return } + manager.startDeviceMotionUpdates(to: .main) { motion, _ in + guard let motion else { return } + handler(motion.attitude.roll, motion.attitude.pitch) + } + } + + func stop() { + guard manager.isDeviceMotionActive else { return } + manager.stopDeviceMotionUpdates() + } +} + +@MainActor +final class MotionProvider: ObservableObject { + @Published private(set) var tilt: Tilt = .zero + + private let source: MotionSource + private let smoothing: Double + private let maxAngleRadians: Double + private var isRunning = false + + init( + source: MotionSource = CoreMotionSource(), + smoothing: Double = 0.12, + maxAngleDegrees: Double = 25 + ) { + self.source = source + self.smoothing = smoothing + self.maxAngleRadians = maxAngleDegrees * .pi / 180 + } + + func start() { + guard !isRunning else { return } + guard source.isAvailable else { return } + isRunning = true + source.start { [weak self] roll, pitch in + Task { @MainActor in + self?.consume(roll: roll, pitch: pitch) + } + } + } + + func stop() { + guard isRunning else { return } + isRunning = false + source.stop() + decayToZero() + } + + private func consume(roll rawRoll: Double, pitch rawPitch: Double) { + let clampedRoll = clamp(rawRoll, to: maxAngleRadians) + let clampedPitch = clamp(rawPitch, to: maxAngleRadians) + let targetRoll = clampedRoll / maxAngleRadians + let targetPitch = clampedPitch / maxAngleRadians + let newRoll = tilt.roll + smoothing * (targetRoll - tilt.roll) + let newPitch = tilt.pitch + smoothing * (targetPitch - tilt.pitch) + tilt = Tilt(roll: newRoll, pitch: newPitch) + } + + private func decayToZero() { + tilt = Tilt( + roll: tilt.roll + smoothing * (0 - tilt.roll), + pitch: tilt.pitch + smoothing * (0 - tilt.pitch) + ) + } + + private func clamp(_ value: Double, to magnitude: Double) -> Double { + return max(-magnitude, min(magnitude, value)) + } + + func _testIngest(roll: Double, pitch: Double) { + consume(roll: roll, pitch: pitch) + } +} diff --git a/PcVolumeControlTests/Info.plist b/PcVolumeControlTests/Info.plist index ba72822..2d98bea 100644 --- a/PcVolumeControlTests/Info.plist +++ b/PcVolumeControlTests/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -16,9 +16,7 @@ BNDL CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 - + \ No newline at end of file diff --git a/PcVolumeControlTests/IntroTourGateTests.swift b/PcVolumeControlTests/IntroTourGateTests.swift new file mode 100644 index 0000000..63f2b21 --- /dev/null +++ b/PcVolumeControlTests/IntroTourGateTests.swift @@ -0,0 +1,29 @@ +// +// IntroTourGateTests.swift +// PcVolumeControlTests +// + +import XCTest +@testable import PcVolumeControl + +final class IntroTourGateTests: XCTestCase { + + func testShowsTourOnFirstLaunch() { + XCTAssertTrue(IntroTourGate.shouldShowTour(hasSeenTour: false, arguments: [])) + } + + func testDoesNotShowTourWhenAlreadySeen() { + XCTAssertFalse(IntroTourGate.shouldShowTour(hasSeenTour: true, arguments: [])) + } + + func testScreenshotModeSuppressesTour() { + XCTAssertFalse(IntroTourGate.shouldShowTour(hasSeenTour: false, arguments: ["--screenshotMode"])) + } + + func testScreenshotModeWithOtherArgumentsStillSuppresses() { + XCTAssertFalse(IntroTourGate.shouldShowTour( + hasSeenTour: false, + arguments: ["--screenshotMode", "--mockConnected"] + )) + } +} diff --git a/PcVolumeControlTests/MainViewModelSimpleTests.swift b/PcVolumeControlTests/MainViewModelSimpleTests.swift new file mode 100644 index 0000000..27a5d48 --- /dev/null +++ b/PcVolumeControlTests/MainViewModelSimpleTests.swift @@ -0,0 +1,372 @@ +// +// MainViewModelSimpleTests.swift +// PcVolumeControlTests +// +// Created by Bill Booth on 6/4/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import XCTest +import UIKit +@testable import PcVolumeControl + +@MainActor +final class MainViewModelSimpleTests: XCTestCase { + + var sut: MainViewModel! + var mockRepository: MockVolumeTransport! + + override func setUp() { + super.setUp() + + // Create a minimal test setup + mockRepository = MockVolumeTransport() + + // Create use cases with mock repository + let volumeRepo = VolumeControlRepository(transport: mockRepository) + let serversRepo = ServersRepository( + local: MockLocalDataSource(), + remote: MockTCPDataSource() + ) + + let connectUseCase = ConnectToServerUseCase(repo: serversRepo) + let defUpdateUseCase = SendDefaultDeviceUpdateUseCase(repo: volumeRepo) + let masterUpdateUseCase = SendMasterChannelUpdateUseCase(repo: volumeRepo) + let sessionUpdateUseCase = SendSessionUpdateUseCase(repo: volumeRepo) + + sut = MainViewModel( + connect: connectUseCase, + defUpdate: defUpdateUseCase, + masterUpdate: masterUpdateUseCase, + sessionUpdate: sessionUpdateUseCase, + serversRepo: serversRepo + ) + } + + override func tearDown() { + sut = nil + mockRepository = nil + super.tearDown() + } + + // MARK: - Basic Initialization Tests + + func testInitialState() { + XCTAssertEqual(sut.address, "") + XCTAssertEqual(sut.port, 0) + XCTAssertFalse(sut.isLoading) + XCTAssertNil(sut.error) + XCTAssertNil(sut.fullState) + XCTAssertFalse(sut.hasActiveConnection) + } + + // MARK: - Property Tests + + func testHasActiveConnectionProperty() { + // Initially no connection + XCTAssertFalse(sut.hasActiveConnection) + + // After disconnecting + sut.disconnect() + XCTAssertFalse(sut.hasActiveConnection) + } + + func testDisconnectClearsState() { + // Given - simulate having state + sut.fullState = createMockFullState() + + // When + sut.disconnect() + + // Then + XCTAssertNil(sut.fullState) + XCTAssertFalse(sut.hasActiveConnection) + } + + // MARK: - App Lifecycle Tests + + func testAppLifecycleNotificationObservers() { + // Test that notification observers are set up + // This tests that the init method sets up observers without crashing + XCTAssertNotNil(sut) + + // Post background notification + NotificationCenter.default.post(name: UIApplication.didEnterBackgroundNotification, object: nil) + + // Post foreground notification + NotificationCenter.default.post(name: UIApplication.willEnterForegroundNotification, object: nil) + + // Should not crash and should maintain state + XCTAssertNotNil(sut) + } + + // MARK: - Update Session Tests + + func testUpdateSessionWithObject() async throws { + // Given + let testSession = FullState.Session( + id: "test.exe", + muted: true, + name: "Test App", + volume: 80.0 + ) + + // When - this will call the actual use case but with mock transport + try await sut.updateSession(testSession) + + // Then - verify the mock transport received data + XCTAssertTrue(mockRepository.outgoingDataCalled) + XCTAssertFalse(mockRepository.sentData.isEmpty) + } + + // MARK: - Error Handling Tests + + func testConnectToServerWithInvalidAddress() async { + // Given + let invalidAddress = "invalid.address" + let port: UInt16 = 8080 + + // When + await sut.connectToServer(address: invalidAddress, port: port) + + // Then - should handle error gracefully + XCTAssertFalse(sut.isLoading) + // Error might be set depending on the mock behavior + XCTAssertFalse(sut.hasActiveConnection) + } + + // MARK: - State Tests + + func testFullStateProperty() { + // Given + let mockState = createMockFullState() + + // When + sut.fullState = mockState + + // Then + XCTAssertNotNil(sut.fullState) + XCTAssertEqual(sut.fullState?.protocolVersion, 7) + XCTAssertEqual(sut.fullState?.defaultDevice.deviceId, "device1") + } + + // MARK: - Port Resolution Tests + + func testConnectWithZeroPortDefaultsTo3000() { + // Given a manual connection with an empty port field (port == 0) + sut.address = "192.168.1.100" + + // When connecting + sut.connectToServer(address: "192.168.1.100", port: 0) + + // Then the view model reflects the resolved default port + XCTAssertEqual(sut.port, 3000) + } + + func testSaveSuccessfulConnectionPersistsResolvedPort() { + // Given a zero-port connection that resolves to the default + sut.address = "10.0.0.5" + sut.connectToServer(address: "10.0.0.5", port: 0) + + // When the successful connection is saved + sut.saveSuccessfulConnection() + + // Then the persisted recent server has the resolved port, not 0 + XCTAssertEqual(sut.recentServers.first?.port, 3000) + } + + // MARK: - Connection Loss / Reconnect Tests + + func testReconnectLoopEndsInLostWhenServerUnreachable() async { + // Given a tiny retry window/delay and an unreachable server (mock TCP throws) + sut.reconnectInitialDelaySeconds = 0.01 + sut.reconnectMaxDelaySeconds = 0.02 + sut.reconnectWindowSeconds = 0.1 + + // When the reconnect loop runs + sut.startReconnectLoop(to: DiscoveredServer(address: "192.0.2.1", port: 3000)) + + // Then it ends in the .lost state after exhausting attempts + for _ in 0..<300 { + if sut.connectionStatus == .lost { break } + try? await Task.sleep(nanoseconds: 10_000_000) // 10ms + } + XCTAssertEqual(sut.connectionStatus, .lost) + XCTAssertFalse(sut.isConnectionLive) + } + + func testReconnectGoesThroughReconnectingState() async { + sut.reconnectInitialDelaySeconds = 0.02 + sut.reconnectMaxDelaySeconds = 0.02 + sut.reconnectWindowSeconds = 0.1 + sut.startReconnectLoop(to: DiscoveredServer(address: "192.0.2.1", port: 3000)) + + // It should enter .reconnecting before settling on .lost + var sawReconnecting = false + for _ in 0..<300 { + if sut.connectionStatus == .reconnecting { sawReconnecting = true } + if sut.connectionStatus == .lost { break } + try? await Task.sleep(nanoseconds: 10_000_000) + } + XCTAssertTrue(sawReconnecting) + XCTAssertEqual(sut.connectionStatus, .lost) + } + + // MARK: - Server List Deletion Tests + + func testDeletingServerThatIsBothDiscoveredAndRecentClearsItInOneSwipe() { + // Given a server that is both live-discovered over mDNS and a saved + // recent connection (same address:port, different DiscoveredServer + // instances). The unified list dedupes these into a single row. + let discovered = DiscoveredServer(address: "192.168.0.42", port: 3000, computerName: "CHOSS") + let recent = DiscoveredServer(address: "192.168.0.42", port: 3000, computerName: nil) + sut.discoveredServers = [discovered] + sut.recentServers = [recent] + + let rowsBefore = sut.unifiedServerList.filter { !$0.isManual } + XCTAssertEqual(rowsBefore.count, 1, "Discovered and recent duplicates should collapse to one row") + XCTAssertTrue(rowsBefore.first?.isDiscovered ?? false) + + // When the user swipes to delete that single row once + sut.deleteServerFromList(rowsBefore[0]) + + // Then the row must not resurface as a "recent connection" duplicate + let rowsAfter = sut.unifiedServerList.filter { !$0.isManual } + XCTAssertEqual(rowsAfter.count, 0, "One delete should remove both the discovered and recent representations") + XCTAssertTrue(sut.discoveredServers.isEmpty) + XCTAssertTrue(sut.recentServers.isEmpty) + } + + func testDeletingPlainRecentServerStillWorks() { + // Regression: a recent-only server (no live discovery) still deletes. + let recent = DiscoveredServer(address: "10.0.0.5", port: 8080, computerName: nil) + sut.recentServers = [recent] + + let rows = sut.unifiedServerList.filter { !$0.isManual } + XCTAssertEqual(rows.count, 1) + + sut.deleteServerFromList(rows[0]) + + XCTAssertTrue(sut.recentServers.isEmpty) + XCTAssertEqual(sut.unifiedServerList.filter { !$0.isManual }.count, 0) + } + + // MARK: - Integration Tests + + func testConnectDisconnectCycle() async { + // Given + let address = "192.168.1.100" + let port: UInt16 = 3000 + + // When - Connect + await sut.connectToServer(address: address, port: port) + + // Then - Should complete without crashing + XCTAssertFalse(sut.isLoading) + + // When - Disconnect + sut.disconnect() + + // Then + XCTAssertNil(sut.fullState) + XCTAssertFalse(sut.hasActiveConnection) + } + + // MARK: - Async Operation Tests + + func testUpdateMethodsDoNotCrash() { + // Test that update methods can be called without crashing + + sut.updateDefaultDevice(id: "test-device") + sut.updateMaster(id: "master-device", muted: true, vol: 50.0) + sut.updateSession(name: "Test", id: "test.exe", vol: 75.0, muted: false) + + // If we get here without crashing, the test passes + XCTAssertNotNil(sut) + } + + // MARK: - Memory Management Tests + + func testDeinitCleansUpObservers() { + // This test ensures that deinit doesn't crash + // The actual cleanup is hard to test directly, but we can verify + // that creating and destroying the view model doesn't leak + + weak var weakSUT = sut + sut = nil + + // Give time for cleanup + let expectation = XCTestExpectation(description: "Cleanup") + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + expectation.fulfill() + } + wait(for: [expectation], timeout: 1.0) + + // The object should be deallocated + XCTAssertNil(weakSUT) + } + + // MARK: - Helper Methods + + private func createMockFullState() -> FullState { + let session1 = FullState.Session(id: "app1.exe", muted: false, name: "App1", volume: 50.0) + let session2 = FullState.Session(id: "app2.exe", muted: true, name: "App2", volume: 75.0) + + let defaultDevice = FullState.theDefaultDevice( + deviceId: "device1", + masterMuted: false, + masterVolume: 80.0, + name: "Default Device", + sessions: [session1, session2] + ) + + let deviceIds = ["device1": "Default Device", "device2": "Secondary Device"] + + return FullState( + protocolVersion: 7, + deviceIds: deviceIds, + defaultDevice: defaultDevice + ) + } +} + +// MARK: - Simple Mock Objects + +class MockVolumeTransport: VolumeTransportDataSourceProtocol { + var outgoingDataCalled = false + var sentData: [Data] = [] + var isCloseCalled = false + + func outgoing(_ data: Data) async throws { + outgoingDataCalled = true + sentData.append(data) + } + + func incoming() -> AsyncThrowingStream { + AsyncThrowingStream { continuation in + // Mock stream that just finishes + continuation.finish() + } + } + + func close() { + isCloseCalled = true + } +} + +class MockLocalDataSource: ServersLocalDataSourceProtocol { + func loadRecent() -> [DiscoveredServer] { + return [] + } + + func saveRecent(_ list: [DiscoveredServer]) { + // Mock implementation + } +} + +class MockTCPDataSource: TCPConnectionDataSourceProtocol { + func openConnection(to server: DiscoveredServer) async throws -> Connection { + // For testing, we'll throw an error to simulate connection failure + throw NSError(domain: "MockConnectionError", code: 1, userInfo: [NSLocalizedDescriptionKey: "Mock connection failed"]) + } +} diff --git a/PcVolumeControlTests/MotionProviderTests.swift b/PcVolumeControlTests/MotionProviderTests.swift new file mode 100644 index 0000000..de79310 --- /dev/null +++ b/PcVolumeControlTests/MotionProviderTests.swift @@ -0,0 +1,107 @@ +import XCTest +@testable import PcVolumeControl + +final class FakeMotionSource: MotionSource { + var isAvailable: Bool + var handler: ((Double, Double) -> Void)? + var isStarted = false + var stopCount = 0 + + init(isAvailable: Bool = true) { + self.isAvailable = isAvailable + } + + func start(handler: @escaping (Double, Double) -> Void) { + self.handler = handler + isStarted = true + } + + func stop() { + stopCount += 1 + isStarted = false + handler = nil + } + + func emit(roll: Double, pitch: Double) { + handler?(roll, pitch) + } +} + +@MainActor +final class MotionProviderTests: XCTestCase { + + func test_tilt_starts_at_zero() { + let provider = MotionProvider(source: FakeMotionSource()) + XCTAssertEqual(provider.tilt, .zero) + } + + func test_unavailable_source_keeps_tilt_at_zero() { + let source = FakeMotionSource(isAvailable: false) + let provider = MotionProvider(source: source) + provider.start() + XCTAssertFalse(source.isStarted, "Should not start when source is unavailable") + XCTAssertEqual(provider.tilt, .zero) + } + + func test_step_input_damps_over_samples() { + let provider = MotionProvider(source: FakeMotionSource(), smoothing: 0.5, maxAngleDegrees: 90) + let target: Double = .pi / 2 + provider._testIngest(roll: target, pitch: target) + XCTAssertEqual(provider.tilt.roll, 0.5, accuracy: 0.001, "First sample should be half-way to 1.0") + provider._testIngest(roll: target, pitch: target) + XCTAssertEqual(provider.tilt.roll, 0.75, accuracy: 0.001) + provider._testIngest(roll: target, pitch: target) + XCTAssertEqual(provider.tilt.roll, 0.875, accuracy: 0.001) + } + + func test_input_beyond_max_saturates_at_one() { + let provider = MotionProvider( + source: FakeMotionSource(), + smoothing: 1.0, + maxAngleDegrees: 25 + ) + let twoX: Double = (50.0 * .pi / 180.0) + provider._testIngest(roll: twoX, pitch: twoX) + XCTAssertEqual(provider.tilt.roll, 1.0, accuracy: 0.001) + XCTAssertEqual(provider.tilt.pitch, 1.0, accuracy: 0.001) + provider._testIngest(roll: -twoX, pitch: -twoX) + XCTAssertEqual(provider.tilt.roll, -1.0, accuracy: 0.001) + XCTAssertEqual(provider.tilt.pitch, -1.0, accuracy: 0.001) + } + + func test_stop_is_idempotent_and_releases_source() { + let source = FakeMotionSource() + let provider = MotionProvider(source: source) + provider.start() + XCTAssertTrue(source.isStarted) + provider.stop() + provider.stop() + XCTAssertEqual(source.stopCount, 1, "Stop should be idempotent") + XCTAssertFalse(source.isStarted) + } + + func test_start_is_idempotent() { + let source = FakeMotionSource() + let provider = MotionProvider(source: source) + provider.start() + provider.start() + XCTAssertTrue(source.isStarted) + provider.stop() + } + + func test_consume_via_source_callback_updates_tilt() { + let source = FakeMotionSource() + let provider = MotionProvider(source: source, smoothing: 1.0, maxAngleDegrees: 25) + provider.start() + let oneRadAtMax: Double = (25.0 * .pi / 180.0) + let exp = expectation(description: "tilt updated") + Task { @MainActor in + source.emit(roll: oneRadAtMax, pitch: -oneRadAtMax) + try? await Task.sleep(nanoseconds: 20_000_000) + XCTAssertEqual(provider.tilt.roll, 1.0, accuracy: 0.001) + XCTAssertEqual(provider.tilt.pitch, -1.0, accuracy: 0.001) + exp.fulfill() + } + wait(for: [exp], timeout: 1.0) + } +} diff --git a/PcVolumeControlTests/PcVolumeControlTests.swift b/PcVolumeControlTests/PcVolumeControlTests.swift deleted file mode 100644 index 28442b5..0000000 --- a/PcVolumeControlTests/PcVolumeControlTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// PcVolumeControlTests.swift -// PcVolumeControlTests -// -// Created by Bill Booth on 11/21/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import XCTest -@testable import PcVolumeControl - -class PcVolumeControlTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/PcVolumeControlTests/SessionCellVolumeTests.swift b/PcVolumeControlTests/SessionCellVolumeTests.swift new file mode 100644 index 0000000..a87143f --- /dev/null +++ b/PcVolumeControlTests/SessionCellVolumeTests.swift @@ -0,0 +1,42 @@ +// +// SessionCellVolumeTests.swift +// PcVolumeControlTests +// +// Verifies that the slider's displayed volume respects mute state, so a muted +// session (or a session under a muted master) reads 0 regardless of the cell's +// view lifecycle (e.g. being recreated after scrolling off-screen). +// + +import XCTest +@testable import PcVolumeControl + +final class SessionCellVolumeTests: XCTestCase { + + func testUnmutedReturnsSessionVolume() { + XCTAssertEqual( + SessionCell.displayVolume(volume: 75, muted: false, masterMuted: false), + 75 + ) + } + + func testMutedSessionReturnsZero() { + XCTAssertEqual( + SessionCell.displayVolume(volume: 75, muted: true, masterMuted: false), + 0 + ) + } + + func testMutedMasterReturnsZero() { + XCTAssertEqual( + SessionCell.displayVolume(volume: 75, muted: false, masterMuted: true), + 0 + ) + } + + func testMutedSessionAndMasterReturnsZero() { + XCTAssertEqual( + SessionCell.displayVolume(volume: 75, muted: true, masterMuted: true), + 0 + ) + } +} diff --git a/PcVolumeControlUITests/Info.plist b/PcVolumeControlUITests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/PcVolumeControlUITests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/PcVolumeControlUITests/PcVolumeControlUITests.swift b/PcVolumeControlUITests/PcVolumeControlUITests.swift deleted file mode 100644 index bc62208..0000000 --- a/PcVolumeControlUITests/PcVolumeControlUITests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// PcVolumeControlUITests.swift -// PcVolumeControlUITests -// -// Created by Bill Booth on 11/21/17. -// Copyright © 2017 PcVolumeControl. All rights reserved. -// - -import XCTest - -class PcVolumeControlUITests: XCTestCase { - - override func setUp() { - super.setUp() - - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. - XCUIApplication().launch() - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - -} diff --git a/PcVolumeControlUITests/ScreenshotTests.swift b/PcVolumeControlUITests/ScreenshotTests.swift new file mode 100644 index 0000000..c93ef15 --- /dev/null +++ b/PcVolumeControlUITests/ScreenshotTests.swift @@ -0,0 +1,69 @@ +import XCTest + +@MainActor +final class ScreenshotTests: XCTestCase { + + override func setUp() { + super.setUp() + continueAfterFailure = false + } + + func testCaptureConnectionScreen() { + let app = XCUIApplication() + app.launchArguments = ["--screenshotMode"] + setupSnapshot(app) + app.launch() + snapshot("01_ConnectionScreen") + } + + func testCaptureAutoDiscoveryScreen() { + let app = XCUIApplication() + app.launchArguments = ["--screenshotMode", "--mockDiscovered"] + setupSnapshot(app) + app.launch() + // The injected server appears as an auto-discovered row, whose connect + // button carries the server's computer name as its accessibility label. + let discoveredRow = app.buttons["Connect to MYPC"] + XCTAssert(discoveredRow.waitForExistence(timeout: 5)) + snapshot("02_AutoDiscovery") + } + + func testCaptureSliderScreen() { + let app = XCUIApplication() + app.launchArguments = ["--screenshotMode", "--mockConnected"] + setupSnapshot(app) + app.launch() + // Wait for the slider view to appear (the overflow menu button is unique to SliderView). + let moreOptions = app.buttons["More options"] + XCTAssert(moreOptions.waitForExistence(timeout: 5)) + snapshot("03_SliderScreen") + } + + func testCaptureDeviceSelectorScreen() { + let app = XCUIApplication() + app.launchArguments = ["--screenshotMode", "--mockConnected"] + setupSnapshot(app) + app.launch() + let selectDevice = app.buttons["Select master device"] + XCTAssert(selectDevice.waitForExistence(timeout: 5)) + selectDevice.tap() + // The slide-up sheet carries the navigation title "Select Master Device". + let sheetTitle = app.staticTexts["Select Master Device"] + XCTAssert(sheetTitle.waitForExistence(timeout: 3)) + snapshot("04_DeviceSelector") + } + + func testCaptureSettingsScreen() { + let app = XCUIApplication() + app.launchArguments = ["--screenshotMode", "--mockConnected"] + setupSnapshot(app) + app.launch() + let moreOptions = app.buttons["More options"] + XCTAssert(moreOptions.waitForExistence(timeout: 5)) + moreOptions.tap() + let settingsButton = app.buttons["Settings"] + XCTAssert(settingsButton.waitForExistence(timeout: 3)) + settingsButton.tap() + snapshot("05_SettingsScreen") + } +} diff --git a/PcVolumeControlUITests/SnapshotHelper.swift b/PcVolumeControlUITests/SnapshotHelper.swift new file mode 100644 index 0000000..6dec130 --- /dev/null +++ b/PcVolumeControlUITests/SnapshotHelper.swift @@ -0,0 +1,313 @@ +// +// SnapshotHelper.swift +// Example +// +// Created by Felix Krause on 10/8/15. +// + +// ----------------------------------------------------- +// IMPORTANT: When modifying this file, make sure to +// increment the version number at the very +// bottom of the file to notify users about +// the new SnapshotHelper.swift +// ----------------------------------------------------- + +import Foundation +import XCTest + +@MainActor +func setupSnapshot(_ app: XCUIApplication, waitForAnimations: Bool = true) { + Snapshot.setupSnapshot(app, waitForAnimations: waitForAnimations) +} + +@MainActor +func snapshot(_ name: String, waitForLoadingIndicator: Bool) { + if waitForLoadingIndicator { + Snapshot.snapshot(name) + } else { + Snapshot.snapshot(name, timeWaitingForIdle: 0) + } +} + +/// - Parameters: +/// - name: The name of the snapshot +/// - timeout: Amount of seconds to wait until the network loading indicator disappears. Pass `0` if you don't want to wait. +@MainActor +func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) { + Snapshot.snapshot(name, timeWaitingForIdle: timeout) +} + +enum SnapshotError: Error, CustomDebugStringConvertible { + case cannotFindSimulatorHomeDirectory + case cannotRunOnPhysicalDevice + + var debugDescription: String { + switch self { + case .cannotFindSimulatorHomeDirectory: + return "Couldn't find simulator home location. Please, check SIMULATOR_HOST_HOME env variable." + case .cannotRunOnPhysicalDevice: + return "Can't use Snapshot on a physical device." + } + } +} + +@objcMembers +@MainActor +open class Snapshot: NSObject { + static var app: XCUIApplication? + static var waitForAnimations = true + static var cacheDirectory: URL? + static var screenshotsDirectory: URL? { + return cacheDirectory?.appendingPathComponent("screenshots", isDirectory: true) + } + static var deviceLanguage = "" + static var currentLocale = "" + + open class func setupSnapshot(_ app: XCUIApplication, waitForAnimations: Bool = true) { + + Snapshot.app = app + Snapshot.waitForAnimations = waitForAnimations + + do { + let cacheDir = try getCacheDirectory() + Snapshot.cacheDirectory = cacheDir + setLanguage(app) + setLocale(app) + setLaunchArguments(app) + } catch let error { + NSLog(error.localizedDescription) + } + } + + class func setLanguage(_ app: XCUIApplication) { + guard let cacheDirectory = self.cacheDirectory else { + NSLog("CacheDirectory is not set - probably running on a physical device?") + return + } + + let path = cacheDirectory.appendingPathComponent("language.txt") + + do { + let trimCharacterSet = CharacterSet.whitespacesAndNewlines + deviceLanguage = try String(contentsOf: path, encoding: .utf8).trimmingCharacters(in: trimCharacterSet) + app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))"] + } catch { + NSLog("Couldn't detect/set language...") + } + } + + class func setLocale(_ app: XCUIApplication) { + guard let cacheDirectory = self.cacheDirectory else { + NSLog("CacheDirectory is not set - probably running on a physical device?") + return + } + + let path = cacheDirectory.appendingPathComponent("locale.txt") + + do { + let trimCharacterSet = CharacterSet.whitespacesAndNewlines + currentLocale = try String(contentsOf: path, encoding: .utf8).trimmingCharacters(in: trimCharacterSet) + } catch { + NSLog("Couldn't detect/set locale...") + } + + if currentLocale.isEmpty && !deviceLanguage.isEmpty { + currentLocale = Locale(identifier: deviceLanguage).identifier + } + + if !currentLocale.isEmpty { + app.launchArguments += ["-AppleLocale", "\"\(currentLocale)\""] + } + } + + class func setLaunchArguments(_ app: XCUIApplication) { + guard let cacheDirectory = self.cacheDirectory else { + NSLog("CacheDirectory is not set - probably running on a physical device?") + return + } + + let path = cacheDirectory.appendingPathComponent("snapshot-launch_arguments.txt") + app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"] + + do { + let launchArguments = try String(contentsOf: path, encoding: String.Encoding.utf8) + let regex = try NSRegularExpression(pattern: "(\\\".+?\\\"|\\S+)", options: []) + let matches = regex.matches(in: launchArguments, options: [], range: NSRange(location: 0, length: launchArguments.count)) + let results = matches.map { result -> String in + (launchArguments as NSString).substring(with: result.range) + } + app.launchArguments += results + } catch { + NSLog("Couldn't detect/set launch_arguments...") + } + } + + open class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) { + if timeout > 0 { + waitForLoadingIndicatorToDisappear(within: timeout) + } + + NSLog("snapshot: \(name)") // more information about this, check out https://docs.fastlane.tools/actions/snapshot/#how-does-it-work + + if Snapshot.waitForAnimations { + sleep(1) // Waiting for the animation to be finished (kind of) + } + + #if os(OSX) + guard let app = self.app else { + NSLog("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().") + return + } + + app.typeKey(XCUIKeyboardKeySecondaryFn, modifierFlags: []) + #else + + guard self.app != nil else { + NSLog("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().") + return + } + + let screenshot = XCUIScreen.main.screenshot() + #if os(iOS) && !targetEnvironment(macCatalyst) + let image = XCUIDevice.shared.orientation.isLandscape ? fixLandscapeOrientation(image: screenshot.image) : screenshot.image + #else + let image = screenshot.image + #endif + + guard var simulator = ProcessInfo().environment["SIMULATOR_DEVICE_NAME"], let screenshotsDir = screenshotsDirectory else { return } + + do { + // The simulator name contains "Clone X of " inside the screenshot file when running parallelized UI Tests on concurrent devices + let regex = try NSRegularExpression(pattern: "Clone [0-9]+ of ") + let range = NSRange(location: 0, length: simulator.count) + simulator = regex.stringByReplacingMatches(in: simulator, range: range, withTemplate: "") + + let path = screenshotsDir.appendingPathComponent("\(simulator)-\(name).png") + #if swift(<5.0) + try UIImagePNGRepresentation(image)?.write(to: path, options: .atomic) + #else + try image.pngData()?.write(to: path, options: .atomic) + #endif + } catch let error { + NSLog("Problem writing screenshot: \(name) to \(screenshotsDir)/\(simulator)-\(name).png") + NSLog(error.localizedDescription) + } + #endif + } + + class func fixLandscapeOrientation(image: UIImage) -> UIImage { + #if os(watchOS) + return image + #else + if #available(iOS 10.0, *) { + let format = UIGraphicsImageRendererFormat() + format.scale = image.scale + let renderer = UIGraphicsImageRenderer(size: image.size, format: format) + return renderer.image { context in + image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) + } + } else { + return image + } + #endif + } + + class func waitForLoadingIndicatorToDisappear(within timeout: TimeInterval) { + #if os(tvOS) + return + #endif + + guard let app = self.app else { + NSLog("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().") + return + } + + let networkLoadingIndicator = app.otherElements.deviceStatusBars.networkLoadingIndicators.element + let networkLoadingIndicatorDisappeared = XCTNSPredicateExpectation(predicate: NSPredicate(format: "exists == false"), object: networkLoadingIndicator) + _ = XCTWaiter.wait(for: [networkLoadingIndicatorDisappeared], timeout: timeout) + } + + class func getCacheDirectory() throws -> URL { + let cachePath = "Library/Caches/tools.fastlane" + // on OSX config is stored in /Users//Library + // and on iOS/tvOS/WatchOS it's in simulator's home dir + #if os(OSX) + let homeDir = URL(fileURLWithPath: NSHomeDirectory()) + return homeDir.appendingPathComponent(cachePath) + #elseif arch(i386) || arch(x86_64) || arch(arm64) + guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else { + throw SnapshotError.cannotFindSimulatorHomeDirectory + } + let homeDir = URL(fileURLWithPath: simulatorHostHome) + return homeDir.appendingPathComponent(cachePath) + #else + throw SnapshotError.cannotRunOnPhysicalDevice + #endif + } +} + +private extension XCUIElementAttributes { + var isNetworkLoadingIndicator: Bool { + if hasAllowListedIdentifier { return false } + + let hasOldLoadingIndicatorSize = frame.size == CGSize(width: 10, height: 20) + let hasNewLoadingIndicatorSize = frame.size.width.isBetween(46, and: 47) && frame.size.height.isBetween(2, and: 3) + + return hasOldLoadingIndicatorSize || hasNewLoadingIndicatorSize + } + + var hasAllowListedIdentifier: Bool { + let allowListedIdentifiers = ["GeofenceLocationTrackingOn", "StandardLocationTrackingOn"] + + return allowListedIdentifiers.contains(identifier) + } + + func isStatusBar(_ deviceWidth: CGFloat) -> Bool { + if elementType == .statusBar { return true } + guard frame.origin == .zero else { return false } + + let oldStatusBarSize = CGSize(width: deviceWidth, height: 20) + let newStatusBarSize = CGSize(width: deviceWidth, height: 44) + + return [oldStatusBarSize, newStatusBarSize].contains(frame.size) + } +} + +private extension XCUIElementQuery { + var networkLoadingIndicators: XCUIElementQuery { + let isNetworkLoadingIndicator = NSPredicate { (evaluatedObject, _) in + guard let element = evaluatedObject as? XCUIElementAttributes else { return false } + + return element.isNetworkLoadingIndicator + } + + return self.containing(isNetworkLoadingIndicator) + } + + @MainActor + var deviceStatusBars: XCUIElementQuery { + guard let app = Snapshot.app else { + fatalError("XCUIApplication is not set. Please call setupSnapshot(app) before snapshot().") + } + + let deviceWidth = app.windows.firstMatch.frame.width + + let isStatusBar = NSPredicate { (evaluatedObject, _) in + guard let element = evaluatedObject as? XCUIElementAttributes else { return false } + + return element.isStatusBar(deviceWidth) + } + + return self.containing(isStatusBar) + } +} + +private extension CGFloat { + func isBetween(_ numberA: CGFloat, and numberB: CGFloat) -> Bool { + return numberA...numberB ~= self + } +} + +// Please don't remove the lines below +// They are used to detect outdated configuration files +// SnapshotHelperVersion [1.30] diff --git a/PcVolumeControlWidget/AppIntent.swift b/PcVolumeControlWidget/AppIntent.swift new file mode 100644 index 0000000..e1c183f --- /dev/null +++ b/PcVolumeControlWidget/AppIntent.swift @@ -0,0 +1,19 @@ +// +// AppIntent.swift +// PcVolumeControlWidget +// +// Created by Bill Booth on 10/19/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import WidgetKit +import AppIntents + +struct ConfigurationAppIntent: WidgetConfigurationIntent { + static var title: LocalizedStringResource { "Configuration" } + static var description: IntentDescription { "This is an example widget." } + + // An example configurable parameter. + @Parameter(title: "Favorite Emoji", default: "😃") + var favoriteEmoji: String +} diff --git a/PcVolumeControlWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/PcVolumeControlWidget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/PcVolumeControlWidget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PcVolumeControlWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/PcVolumeControlWidget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/PcVolumeControlWidget/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PcVolumeControlWidget/Assets.xcassets/Contents.json b/PcVolumeControlWidget/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/PcVolumeControlWidget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PcVolumeControlWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/PcVolumeControlWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/PcVolumeControlWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/PcVolumeControlWidget/Info.plist b/PcVolumeControlWidget/Info.plist new file mode 100644 index 0000000..0f118fb --- /dev/null +++ b/PcVolumeControlWidget/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/PcVolumeControlWidget/PcVolumeControlWidget.swift b/PcVolumeControlWidget/PcVolumeControlWidget.swift new file mode 100644 index 0000000..1edcb72 --- /dev/null +++ b/PcVolumeControlWidget/PcVolumeControlWidget.swift @@ -0,0 +1,398 @@ +// +// PcVolumeControlWidget.swift +// PcVolumeControlWidget +// +// Created by Bill Booth on 10/19/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import WidgetKit +import SwiftUI + +// MARK: - Widget Timeline Provider + +struct Provider: TimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date(), state: placeholderState()) + } + + func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) { + let state = SharedStateManager.readState() ?? placeholderState() + let entry = SimpleEntry(date: Date(), state: state) + completion(entry) + } + + func getTimeline(in context: Context, completion: @escaping (Timeline) -> ()) { + let currentDate = Date() + let state = SharedStateManager.readState() ?? placeholderState() + + // Create entry for current state + let entry = SimpleEntry(date: currentDate, state: state) + + // Refresh every 30 seconds to update staleness indicators + let nextUpdate = Calendar.current.date(byAdding: .second, value: 30, to: currentDate)! + let timeline = Timeline(entries: [entry], policy: .after(nextUpdate)) + + completion(timeline) + } + + private func placeholderState() -> SharedConnectionState { + SharedConnectionState( + isConnected: false, + serverName: "Desktop PC", + masterVolume: 75, + chatVolume: 60, + chatSessionName: "Discord" + ) + } +} + +struct SimpleEntry: TimelineEntry { + let date: Date + let state: SharedConnectionState +} + +// MARK: - Widget Entry View + +struct PcVolumeControlWidgetEntryView : View { + var entry: Provider.Entry + @Environment(\.widgetFamily) var widgetFamily + + var body: some View { + switch widgetFamily { + case .systemSmall: + SmallWidgetView(state: entry.state) + .containerBackground(Color.black, for: .widget) + case .accessoryCircular: + CircularWidgetView(state: entry.state) + .containerBackground(for: .widget) { + Color.clear + } + case .accessoryRectangular: + RectangularWidgetView(state: entry.state) + .containerBackground(for: .widget) { + Color.clear + } + case .accessoryInline: + InlineWidgetView(state: entry.state) + default: + SmallWidgetView(state: entry.state) + .containerBackground(Color.black, for: .widget) + } + } +} + +// MARK: - Small Home Screen Widget + +struct SmallWidgetView: View { + let state: SharedConnectionState + + var body: some View { + VStack(spacing: 6) { + // Header with connection status + HStack { + Circle() + .fill(connectionColor) + .frame(width: 8, height: 8) + + Text(state.displayServerName) + .font(.caption2) + .fontWeight(.medium) + .foregroundColor(.white) + .lineLimit(1) + + Spacer() + } + + // Connection status text + Text(connectionStatusText) + .font(.caption2) + .foregroundColor(.gray) + .frame(maxWidth: .infinity, alignment: .leading) + + Spacer() + + // Volume information + if state.isConnected && !state.isStale { + VStack(spacing: 4) { + // Master volume with circular progress indicator + ZStack { + // Background circle + Circle() + .stroke(Color.gray.opacity(0.3), lineWidth: 6) + .frame(width: 70, height: 70) + + // Progress circle + Circle() + .trim(from: 0, to: state.masterVolume / 100) + .stroke( + Color.yellow, + style: StrokeStyle(lineWidth: 6, lineCap: .round) + ) + .frame(width: 70, height: 70) + .rotationEffect(.degrees(-90)) + + // Volume percentage text + VStack(spacing: 1) { + Text("\(Int(state.masterVolume))%") + .font(.title3) + .fontWeight(.bold) + .foregroundColor(.white) + Text("Master") + .font(.caption2) + .foregroundColor(.gray) + } + } + + // Chat balance volume if available + if let chatVolume = state.chatVolume { + HStack(spacing: 6) { + Text(state.chatSessionName ?? "Chat") + .font(.caption2) + .foregroundColor(.gray) + .lineLimit(1) + + Spacer() + + // Mini progress bar for chat + ZStack(alignment: .leading) { + RoundedRectangle(cornerRadius: 2) + .fill(Color.gray.opacity(0.3)) + .frame(width: 35, height: 4) + + RoundedRectangle(cornerRadius: 2) + .fill(Color.blue) + .frame(width: 35 * (chatVolume / 100), height: 4) + } + + Text("\(Int(chatVolume))%") + .font(.caption2) + .fontWeight(.semibold) + .foregroundColor(Color.blue.opacity(0.8)) + } + .padding(.horizontal, 4) + } + } + } else { + // Stale or disconnected state + VStack(spacing: 4) { + Image(systemName: "antenna.radiowaves.left.and.right.slash") + .font(.title3) + .foregroundColor(.orange) + + Text(state.isConnected ? "Connection stale" : "Disconnected") + .font(.caption) + .foregroundColor(.gray) + + if !state.isStale { + Text("Master: \(Int(state.masterVolume))%") + .font(.caption2) + .foregroundColor(.gray) + } + } + } + + Spacer() + + // Tap to open indicator + Text("Tap to open") + .font(.caption2) + .foregroundColor(.gray.opacity(0.6)) + } + .padding(.horizontal, 12) + .padding(.vertical, 10) + .widgetURL(URL(string: "pcvolumecontrol://connect")) + } + + private var connectionColor: Color { + if state.isConnected && !state.isStale { + return .green + } else if state.isConnected { + return .orange + } else { + return .gray + } + } + + private var connectionStatusText: String { + if state.isConnected && !state.isStale { + return "Connected" + } else if state.isConnected { + return "Last seen \(state.staleDurationString)" + } else { + return "Not connected" + } + } +} + +// MARK: - Lock Screen Circular Widget + +struct CircularWidgetView: View { + let state: SharedConnectionState + + var body: some View { + ZStack { + // Background ring showing connection status + Circle() + .stroke(connectionColor, lineWidth: 4) + + VStack(spacing: 2) { + if state.isConnected && !state.isStale { + // Show volume when connected + Text("\(Int(state.masterVolume))") + .font(.title3) + .fontWeight(.bold) + Text("%") + .font(.caption2) + } else { + // Show warning when disconnected + Image(systemName: "exclamationmark") + .font(.title2) + .foregroundColor(connectionColor) + } + } + } + .widgetURL(URL(string: "pcvolumecontrol://connect")) + } + + private var connectionColor: Color { + if state.isConnected && !state.isStale { + return .green + } else { + return .orange + } + } +} + +// MARK: - Lock Screen Rectangular Widget + +struct RectangularWidgetView: View { + let state: SharedConnectionState + + var body: some View { + HStack(spacing: 8) { + // Connection indicator + Circle() + .fill(connectionColor) + .frame(width: 8, height: 8) + + if state.isConnected && !state.isStale { + // Connected: Show volumes + VStack(alignment: .leading, spacing: 2) { + Text("\(state.displayServerName)") + .font(.caption) + .fontWeight(.medium) + .lineLimit(1) + + HStack(spacing: 8) { + Text("M: \(Int(state.masterVolume))%") + .font(.caption2) + + if let chatVolume = state.chatVolume { + Text("C: \(Int(chatVolume))%") + .font(.caption2) + } + } + .foregroundColor(.secondary) + } + } else { + // Disconnected: Show status + VStack(alignment: .leading, spacing: 2) { + Text(state.displayServerName) + .font(.caption) + .fontWeight(.medium) + .lineLimit(1) + + Text("Tap to connect") + .font(.caption2) + .foregroundColor(.secondary) + } + } + + Spacer() + } + .widgetURL(URL(string: "pcvolumecontrol://connect")) + } + + private var connectionColor: Color { + if state.isConnected && !state.isStale { + return .green + } else { + return .orange + } + } +} + +// MARK: - Lock Screen Inline Widget + +struct InlineWidgetView: View { + let state: SharedConnectionState + + var body: some View { + if state.isConnected && !state.isStale { + Text("🔊 \(state.displayServerName): \(Int(state.masterVolume))%") + } else { + Text("⚠️ \(state.displayServerName): Tap to connect") + } + } +} + +// MARK: - Widget Configuration + +struct PcVolumeControlWidget: Widget { + let kind: String = "PcVolumeControlWidget" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + PcVolumeControlWidgetEntryView(entry: entry) + } + .configurationDisplayName("PC Volume") + .description("View and control your PC's volume.") + .supportedFamilies([ + .systemSmall, + .accessoryCircular, + .accessoryRectangular, + .accessoryInline + ]) + } +} + +// MARK: - Previews + +#Preview(as: .systemSmall) { + PcVolumeControlWidget() +} timeline: { + SimpleEntry(date: .now, state: SharedConnectionState( + isConnected: true, + serverName: "Desktop PC", + masterVolume: 75, + chatVolume: 60, + chatSessionName: "Discord" + )) + SimpleEntry(date: .now, state: SharedConnectionState( + isConnected: false, + serverName: "Desktop PC", + masterVolume: 75 + )) +} + +#Preview(as: .accessoryCircular) { + PcVolumeControlWidget() +} timeline: { + SimpleEntry(date: .now, state: SharedConnectionState( + isConnected: true, + serverName: "Desktop PC", + masterVolume: 75 + )) +} + +#Preview(as: .accessoryRectangular) { + PcVolumeControlWidget() +} timeline: { + SimpleEntry(date: .now, state: SharedConnectionState( + isConnected: true, + serverName: "Desktop PC", + masterVolume: 75, + chatVolume: 60 + )) +} diff --git a/PcVolumeControlWidget/PcVolumeControlWidgetBundle.swift b/PcVolumeControlWidget/PcVolumeControlWidgetBundle.swift new file mode 100644 index 0000000..84b9a5a --- /dev/null +++ b/PcVolumeControlWidget/PcVolumeControlWidgetBundle.swift @@ -0,0 +1,17 @@ +// +// PcVolumeControlWidgetBundle.swift +// PcVolumeControlWidget +// +// Created by Bill Booth on 10/19/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import WidgetKit +import SwiftUI + +@main +struct PcVolumeControlWidgetBundle: WidgetBundle { + var body: some Widget { + PcVolumeControlWidget() + } +} diff --git a/PcVolumeControlWidget/PcVolumeControlWidgetControl.swift b/PcVolumeControlWidget/PcVolumeControlWidgetControl.swift new file mode 100644 index 0000000..92df24a --- /dev/null +++ b/PcVolumeControlWidget/PcVolumeControlWidgetControl.swift @@ -0,0 +1,78 @@ +// +// PcVolumeControlWidgetControl.swift +// PcVolumeControlWidget +// +// Created by Bill Booth on 10/19/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import AppIntents +import SwiftUI +import WidgetKit + +struct PcVolumeControlWidgetControl: ControlWidget { + static let kind: String = "cwb.PcVolumeControl.PcVolumeControlWidget" + + var body: some ControlWidgetConfiguration { + AppIntentControlConfiguration( + kind: Self.kind, + provider: Provider() + ) { value in + ControlWidgetToggle( + "Start Timer", + isOn: value.isRunning, + action: StartTimerIntent(value.name) + ) { isRunning in + Label(isRunning ? "On" : "Off", systemImage: "timer") + } + } + .displayName("Timer") + .description("A an example control that runs a timer.") + } +} + +extension PcVolumeControlWidgetControl { + struct Value { + var isRunning: Bool + var name: String + } + + struct Provider: AppIntentControlValueProvider { + func previewValue(configuration: TimerConfiguration) -> Value { + PcVolumeControlWidgetControl.Value(isRunning: false, name: configuration.timerName) + } + + func currentValue(configuration: TimerConfiguration) async throws -> Value { + let isRunning = true // Check if the timer is running + return PcVolumeControlWidgetControl.Value(isRunning: isRunning, name: configuration.timerName) + } + } +} + +struct TimerConfiguration: ControlConfigurationIntent { + static let title: LocalizedStringResource = "Timer Name Configuration" + + @Parameter(title: "Timer Name", default: "Timer") + var timerName: String +} + +struct StartTimerIntent: SetValueIntent { + static let title: LocalizedStringResource = "Start a timer" + + @Parameter(title: "Timer Name") + var name: String + + @Parameter(title: "Timer is running") + var value: Bool + + init() {} + + init(_ name: String) { + self.name = name + } + + func perform() async throws -> some IntentResult { + // Start the timer… + return .result() + } +} diff --git a/PcVolumeControlWidget/PcVolumeControlWidgetLiveActivity.swift b/PcVolumeControlWidget/PcVolumeControlWidgetLiveActivity.swift new file mode 100644 index 0000000..3d86bec --- /dev/null +++ b/PcVolumeControlWidget/PcVolumeControlWidgetLiveActivity.swift @@ -0,0 +1,81 @@ +// +// PcVolumeControlWidgetLiveActivity.swift +// PcVolumeControlWidget +// +// Created by Bill Booth on 10/19/25. +// Copyright © 2025 PcVolumeControl. All rights reserved. +// + +import ActivityKit +import WidgetKit +import SwiftUI + +struct PcVolumeControlWidgetAttributes: ActivityAttributes { + public struct ContentState: Codable, Hashable { + // Dynamic stateful properties about your activity go here! + var emoji: String + } + + // Fixed non-changing properties about your activity go here! + var name: String +} + +struct PcVolumeControlWidgetLiveActivity: Widget { + var body: some WidgetConfiguration { + ActivityConfiguration(for: PcVolumeControlWidgetAttributes.self) { context in + // Lock screen/banner UI goes here + VStack { + Text("Hello \(context.state.emoji)") + } + .activityBackgroundTint(Color.cyan) + .activitySystemActionForegroundColor(Color.black) + + } dynamicIsland: { context in + DynamicIsland { + // Expanded UI goes here. Compose the expanded UI through + // various regions, like leading/trailing/center/bottom + DynamicIslandExpandedRegion(.leading) { + Text("Leading") + } + DynamicIslandExpandedRegion(.trailing) { + Text("Trailing") + } + DynamicIslandExpandedRegion(.bottom) { + Text("Bottom \(context.state.emoji)") + // more content + } + } compactLeading: { + Text("L") + } compactTrailing: { + Text("T \(context.state.emoji)") + } minimal: { + Text(context.state.emoji) + } + .widgetURL(URL(string: "http://www.apple.com")) + .keylineTint(Color.red) + } + } +} + +extension PcVolumeControlWidgetAttributes { + fileprivate static var preview: PcVolumeControlWidgetAttributes { + PcVolumeControlWidgetAttributes(name: "World") + } +} + +extension PcVolumeControlWidgetAttributes.ContentState { + fileprivate static var smiley: PcVolumeControlWidgetAttributes.ContentState { + PcVolumeControlWidgetAttributes.ContentState(emoji: "😀") + } + + fileprivate static var starEyes: PcVolumeControlWidgetAttributes.ContentState { + PcVolumeControlWidgetAttributes.ContentState(emoji: "🤩") + } +} + +#Preview("Notification", as: .content, using: PcVolumeControlWidgetAttributes.preview) { + PcVolumeControlWidgetLiveActivity() +} contentStates: { + PcVolumeControlWidgetAttributes.ContentState.smiley + PcVolumeControlWidgetAttributes.ContentState.starEyes +} diff --git a/PcVolumeControlWidget/PrivacyInfo.xcprivacy b/PcVolumeControlWidget/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..d773e0e --- /dev/null +++ b/PcVolumeControlWidget/PrivacyInfo.xcprivacy @@ -0,0 +1,23 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + 1C8F.1 + + + + + diff --git a/PcVolumeControl.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/PcVolumeControlWidgetExtension.entitlements similarity index 62% rename from PcVolumeControl.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to PcVolumeControlWidgetExtension.entitlements index f9b0d7c..8fae23e 100644 --- a/PcVolumeControl.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/PcVolumeControlWidgetExtension.entitlements @@ -2,7 +2,9 @@ - PreviewsEnabled - + com.apple.security.application-groups + + group.cwb.PcVolumeControl + diff --git a/Podfile b/Podfile deleted file mode 100644 index dca97c2..0000000 --- a/Podfile +++ /dev/null @@ -1,29 +0,0 @@ -# BlueSocket minimum-supported ios version is 10.0. -platform :ios, '10.0' - -target 'PcVolumeControl' do - # Comment the next line if you're not using Swift and don't want to use dynamic frameworks - use_frameworks! - pod 'RxSwift', '~> 5' - pod 'RxCocoa', '~> 5' - pod 'BlueSocket' - - # Pods for PcVolumeControl - - target 'PcVolumeControlTests' do - inherit! :search_paths - # Pods for testing - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' - pod 'BlueSocket' - end - - target 'PcVolumeControlUITests' do - inherit! :search_paths - # Pods for testing - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' - pod 'BlueSocket' - end - -end diff --git a/Podfile.lock b/Podfile.lock deleted file mode 100644 index 42bf62b..0000000 --- a/Podfile.lock +++ /dev/null @@ -1,40 +0,0 @@ -PODS: - - BlueSocket (1.0.52) - - RxBlocking (5.1.1): - - RxSwift (~> 5) - - RxCocoa (5.1.1): - - RxRelay (~> 5) - - RxSwift (~> 5) - - RxRelay (5.1.1): - - RxSwift (~> 5) - - RxSwift (5.1.1) - - RxTest (5.1.1): - - RxSwift (~> 5) - -DEPENDENCIES: - - BlueSocket - - RxBlocking (~> 5) - - RxCocoa (~> 5) - - RxSwift (~> 5) - - RxTest (~> 5) - -SPEC REPOS: - trunk: - - BlueSocket - - RxBlocking - - RxCocoa - - RxRelay - - RxSwift - - RxTest - -SPEC CHECKSUMS: - BlueSocket: 1acd943acb07b55905291d608649fcfbf8cbd57d - RxBlocking: 5f700a78cad61ce253ebd37c9a39b5ccc76477b4 - RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601 - RxRelay: d77f7d771495f43c556cbc43eebd1bb54d01e8e9 - RxSwift: 81470a2074fa8780320ea5fe4102807cb7118178 - RxTest: 711632d5644dffbeb62c936a521b5b008a1e1faa - -PODFILE CHECKSUM: 99deca2ca9e88817d84f606d070c9f31c01a0d5c - -COCOAPODS: 1.10.0.rc.1 diff --git a/Pods/BlueSocket/LICENSE b/Pods/BlueSocket/LICENSE deleted file mode 100644 index d9a10c0..0000000 --- a/Pods/BlueSocket/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/Pods/BlueSocket/README.md b/Pods/BlueSocket/README.md deleted file mode 100644 index 91b8abd..0000000 --- a/Pods/BlueSocket/README.md +++ /dev/null @@ -1,490 +0,0 @@ -

- - APIDoc - - - Build Status - Master - - macOS - iOS - Linux - Apache 2 - - Slack Status - -

- -# BlueSocket - -Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. - -## Prerequisites - -### Swift - -* Swift Open Source `swift-4.0.0-RELEASE` toolchain (**Minimum REQUIRED for latest release**) -* Swift Open Source `swift-4.2-RELEASE` toolchain (**Recommended**) -* Swift toolchain included in *Xcode Version 10.0 (10A255) or higher*. - -### macOS - -* macOS 10.11.6 (*El Capitan*) or higher. -* Xcode Version 9.0 (9A325) or higher using one of the above toolchains. -* Xcode Version 10.0 (10A255) or higher using the included toolchain (*Recommended*). - -### iOS - -* iOS 10.0 or higher -* Xcode Version 9.0 (9A325) or higher using one of the above toolchains. -* Xcode Version 10.0 (10A255) or higher using the included toolchain (*Recommended*). - -### Linux - -* Ubuntu 16.04 (or 16.10 but only tested on 16.04). -* One of the Swift Open Source toolchain listed above. - -### Other Platforms - -* **BlueSocket** is **NOT** supported on *watchOS* since POSIX/BSD/Darwin sockets are not supported on the actual device although they are supported in the simulator. -* **BlueSocket** should work on *tvOS* but has **NOT** been tested. - -### Add-ins - -* [BlueSSLService](https://github.com/IBM-Swift/BlueSSLService.git) can be used to add **SSL/TLS** support. - - If using this package, please note that the **libssl-dev** package is required to be installed when building on Linux. - - -## Build - -To build Socket from the command line: - -``` -% cd -% swift build -``` - -## Testing - -To run the supplied unit tests for **Socket** from the command line: - -``` -% cd -% swift build -% swift test - -``` - -## Using BlueSocket - -### Including in your project - -#### Swift Package Manager - -To include BlueSocket into a Swift Package Manager package, add it to the `dependencies` attribute defined in your `Package.swift` file. You can select the version using the `majorVersion` and `minor` parameters. For example: -``` - dependencies: [ - .Package(url: "https://github.com/IBM-Swift/BlueSocket.git", majorVersion: , minor: ) - ] -``` - -#### Carthage -To include BlueSocket in a project using Carthage, add a line to your `Cartfile` with the GitHub organization and project names and version. For example: -``` - github "IBM-Swift/BlueSocket" ~> . -``` - -#### CocoaPods -To include BlueSocket in a project using CocoaPods, you just add `BlueSocket` to your `Podfile`, for example: -``` - platform :ios, '10.0' - - target 'MyApp' do - use_frameworks! - pod 'BlueSocket' - end -``` - -### Before starting - -The first thing you need to do is import the Socket framework. This is done by the following: -``` -import Socket -``` - -### Family, Type and Protocol Support - -**BlueSocket** supports the following families, types and protocols: -- *Families:* - - IPV4: `Socket.ProtocolFamily.inet` - - IPV6: `Socket.ProtocolFamily.inet6` - - UNIX: `Socket.ProtocolFamily.unix` -- *Types:* - - Stream: `Socket.SocketType.stream` - - Datagram: `Socket.SocketType.datagram` -- *Protocols:* - - TCP: `Socket.SocketProtocol.tcp` - - UDP: `Socket.SocketProtocol.udp` - - UNIX: `Socket.SocketProtocol.unix` - -### Creating a socket. - -**BlueSocket** provides four different factory methods that are used to create an instance. These are: -- `create()` - This creates a fully configured default socket. A default socket is created with `family: .inet`, `type: .stream`, and `proto: .tcp`. -- `create(family family: ProtocolFamily, type: SocketType, proto: SocketProtocol)` - This API allows you to create a configured `Socket` instance customized for your needs. You can customize the protocol family, socket type and socket protocol. -- `create(connectedUsing signature: Signature)` - This API will allow you create a `Socket` instance and have it attempt to connect to a server based on the information you pass in the `Socket.Signature`. -- `create(fromNativeHandle nativeHandle: Int32, address: Address?)` - This API lets you wrap a native file descriptor describing an existing socket in a new instance of `Socket`. - -#### Setting the read buffer size. - -**BlueSocket** allows you to set the size of the read buffer that it will use. Then, depending on the needs of the application, you can change it to a higher or lower value. The default is set to `Socket.SOCKET_DEFAULT_READ_BUFFER_SIZE` which has a value of `4096`. The minimum read buffer size is `Socket.SOCKET_MINIMUM_READ_BUFFER_SIZE` which is set to `1024`. Below illustrates how to change the read buffer size (exception handling omitted for brevity): -``` -let mySocket = try Socket.create() -mySocket.readBufferSize = 32768 -``` -The example above sets the default read buffer size to *32768*. This setting should be done *prior* to using the `Socket` instance for the first time. - -### Closing a socket. - -To close the socket of an open instance, the following function is provided: -- `close()` - This function will perform the necessary tasks in order to cleanly close an open socket. - -### Listen on a socket (TCP/UNIX). - -To use **BlueSocket** to listen for an connection on a socket the following API is provided: -- `listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG, allowPortReuse: Bool = true, node: String? = nil)` -The first parameter `port`, is the port to be used to listen on. The second parameter, `maxBacklogSize` allows you to set the size of the queue holding pending connections. The function will determine the appropriate socket configuration based on the `port` specified. For convenience on macOS, the constant `Socket.SOCKET_MAX_DARWIN_BACKLOG` can be set to use the maximum allowed backlog size. The default value for all platforms is `Socket.SOCKET_DEFAULT_MAX_BACKLOG`, currently set to *50*. For server use, it may be necessary to increase this value. To allow the reuse of the listening port, set `allowPortReuse` to `true`. If set to `false`, a error will occur if you attempt to listen on a port already in use. The `DEFAULT` behavior is to `allow` port reuse. The last parameter, `node`, can be used to listen on a *specific address*. The value passed is an *optional String* containing the numerical network address (for IPv4, numbers and dots notation, for iPv6, hexidecimal strting). The `DEFAULT` behavior is to search for an appropriate interface. If `node` is improperly formatted a **SOCKET_ERR_GETADDRINFO_FAILED** error will be returned. If `node` is properly formatted but the address specified is not available, a **SOCKET_ERR_BIND_FAILED** will be returned. -- `listen(on path: String, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)` -This API can only be used with the `.unix` protocol family. The first parameter `path`, is the path to be used to listen on. The second parameter, `maxBacklogSize` allows you to set the size of the queue holding pending connections. The function will determine the appropriate socket configuration based on the `port` specified. For convenience on macOS, the constant `Socket.SOCKET_MAX_DARWIN_BACKLOG` can be set to use the maximum allowed backlog size. The default value for all platforms is `Socket.SOCKET_DEFAULT_MAX_BACKLOG`, currently set to *50*. For server use, it may be necessary to increase this value. - -#### Example: - -The following example creates a default `Socket` instance and then *immediately* starts listening on port `1337`. *Note: Exception handling omitted for brevity, see the complete example below for an example of exception handling.* -```swift -var socket = try Socket.create() -try socket.listen(on: 1337) -``` - -### Accepting a connection from a listening socket (TCP/UNIX). - -When a listening socket detects an incoming connection request, control is returned to your program. You can then either accept the connection or continue listening or both if your application is multi-threaded. **BlueSocket** supports two distinct ways of accepting an incoming connection. They are: -- `acceptClientConnection(invokeDelegate: Bool = true)` - This function accepts the connection and returns a *new* `Socket` instance based on the newly connected socket. The instance that was listening in unaffected. If `invokeDelegate` is `false` and the `Socket` has an `SSLService` delegate attached, you **MUST** call the `invokeDelegateOnAccept` method using the `Socket` instance that is returned by this function. -- `invokeDelegateOnAccept(for newSocket: Socket)` - If the `Socket` instance has a `SSLService` delegate, this will invoke the delegates accept function to perform SSL negotiation. It should be called with the `Socket` instance returned by `acceptClientConnection`. This function will throw an exception if called with the wrong `Socket` instance, called multiple times, or if the `Socket` instance does **NOT** have a `SSLService` delegate. -- `acceptConnection()` - This function accepts the incoming connection, *replacing and closing* the existing listening socket. The properties that were formerly associated with the listening socket are replaced by the properties that are relevant to the newly connected socket. - -### Connecting a socket to a server (TCP/UNIX). - -In addition to the `create(connectedUsing:)` factory method described above, **BlueSocket** supports three additional instance functions for connecting a `Socket` instance to a server. They are: -- `connect(to host: String, port: Int32, timeout: UInt = 0)` - This API allows you to connect to a server based on the `hostname` and `port` you provide. Note: an `exception` will be thrown by this function if the value of `port` is not in the range `1-65535`. Optionally, you can set `timeout` to the number of milliseconds to wait for the connect. Note: If the socket is in blocking mode it will be changed to non-blocking mode *temporarily* if a `timeout` greater than zero (0) is provided. The returned socket will be *set back to its original setting (blocking or non-blocking)*. If the socket is set to *non-blocking* and **no timeout value is provided**, an exception will be thrown. Alternatively, you can set the socket to *non-blocking* after successfully connecting. -- `connect(to path: String)` - This API can only be used with the `.unix` protocol family. It allows you to connect to a server based on the `path` you provide. -- `connect(using signature: Signature)` - This API allows you specify the connection information by providing a `Socket.Signature` instance containing the information. Refer to `Socket.Signature` in *Socket.swift* for more information. - -### Reading data from a socket (TCP/UNIX). - -**BlueSocket** supports four different ways to read data from a socket. These are (in recommended use order): -- `read(into data: inout Data)` - This function reads all the data available on a socket and returns it in the `Data` object that was passed. -- `read(into data: NSMutableData)` - This function reads all the data available on a socket and returns it in the `NSMutableData` object that was passed. -- `readString()` - This function reads all the data available on a socket and returns it as an `String`. A `nil` is returned if no data is available for reading. -- `read(into buffer: UnsafeMutablePointer, bufSize: Int, truncate: Bool = false)` - This function allows you to read data into a buffer of a specified size by providing an *unsafe* pointer to that buffer and an integer the denotes the size of that buffer. This API (in addition to other types of exceptions) will throw a `Socket.SOCKET_ERR_RECV_BUFFER_TOO_SMALL` if the buffer provided is too small, unless `truncate = true` in which case the socket will act as if only `bufSize` bytes were read (unretrieved bytes will be returned in the next call). If `truncate = false`, you will need to call again with proper buffer size (see `Error.bufferSizeNeeded`in *Socket.swift* for more information). -- **Note:** All of the read APIs above except `readString()` can return zero (0). This can indicate that the remote connection was closed or it could indicate that the socket would block (assuming you've turned off blocking). To differentiate between the two, the property `remoteConnectionClosed` can be checked. If `true`, the socket remote partner has closed the connection and this `Socket` instance should be closed. - -### Writing data to a Socket (TCP/UNIX). - -In addition to reading from a socket, **BlueSocket** also supplies four methods for writing data to a socket. These are (in recommended use order): -- `write(from data: Data)` - This function writes the data contained within the `Data` object to the socket. -- `write(from data: NSData)` - This function writes the data contained within the `NSData` object to the socket. -- `write(from string: String)` - This function writes the data contained in the `String` provided to the socket. -- `write(from buffer: UnsafeRawPointer, bufSize: Int)` - This function writes the data contained within the buffer of the specified size by providing an *unsafe* pointer to that buffer and an integer that denotes the size of that buffer. - -### Listening for a datagram message (UDP). - -**BlueSocket** supports three different ways to listen for incoming datagrams. These are (in recommended use order): -- `listen(forMessage data: inout Data, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)` - This function listens for an incoming datagram, reads it and returns it in the passed `Data` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. -- `listen(forMessage data: NSMutableData, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)` - This function listens for an incoming datagram, reads it and returns it in the passed `NSMutableData` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. -- `listen(forMessage buffer: UnsafeMutablePointer, bufSize: Int, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG)` - This function listens for an incoming datagram, reads it and returns it in the passed `Data` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. -- **Note 1:** These functions will determine the appropriate socket configuration based on the `port` specified. Setting the value of `port` to zero (0) will cause the function to determine a suitable free port. -- **Note 2:** The parameter, `maxBacklogSize` allows you to set the size of the queue holding pending connections. The function will determine the appropriate socket configuration based on the `port` specified. For convenience on macOS, the constant `Socket.SOCKET_MAX_DARWIN_BACKLOG` can be set to use the maximum allowed backlog size. The default value for all platforms is `Socket.SOCKET_DEFAULT_MAX_BACKLOG`, currently set to *50*. For server use, it may be necessary to increase this value. - -### Reading a datagram (UDP). - -**BlueSocket** supports three different ways to read incoming datagrams. These are (in recommended use order): -- `readDatagram(into data: inout Data)` - This function reads an incoming datagram and returns it in the passed `Data` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. -- `readDatagram(into data: NSMutableData)` - This function reads an incoming datagram and returns it in the passed `NSMutableData` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. -- `readDatagram(into buffer: UnsafeMutablePointer, bufSize: Int)` - This function reads an incoming datagram and returns it in the passed `Data` object. It returns a tuple containing the number of bytes read and the `Address` of where the data originated. If the amount of data read is more than `bufSize` only `bufSize` will be returned. The remainder of the data read will be discarded. - -### Writing a datagram (UDP). - -**BlueSocket** also supplies four methods for writing datagrams to a socket. These are (in recommended use order): -- `write(from data: Data, to address: Address)` - This function writes the datagram contained within the `Data` object to the socket. -- `write(from data: NSData, to address: Address)` - This function writes the datagram contained within the `NSData` object to the socket. -- `write(from string: String, to address: Address)` - This function writes the datagram contained in the `String` provided to the socket. -- `write(from buffer: UnsafeRawPointer, bufSize: Int, to address: Address)` - This function writes the data contained within the buffer of the specified size by providing an *unsafe* pointer to that buffer and an integer that denotes the size of that buffer. -- **Note:** In all four of the APIs above, the `address` parameter represents the address for the destination you are sending the datagram to. - -### IMPORTANT NOTE about NSData and NSMutableData - -The read and write APIs above that use either `NSData` or `NSMutableData` will *probably* be **deprecated** in the not so distant future. - -### Miscellaneous Utility Functions - -- `hostnameAndPort(from address: Address)` - This *class function* provides a means to extract the hostname and port from a given `Socket.Address`. On successful completion, a tuple containing the `hostname` and `port` are returned. -- `checkStatus(for sockets: [Socket])` - This *class function* allows you to check status of an array of `Socket` instances. Upon completion, a tuple containing two `Socket` arrays is returned. The first array contains the `Socket` instances are that have data available to be read and the second array contains `Socket` instances that can be written to. This API does *not* block. It will check the status of each `Socket` instance and then return the results. -- `wait(for sockets: [Socket], timeout: UInt, waitForever: Bool = false)` - This *class function* allows for monitoring an array of `Socket` instances, waiting for either a timeout to occur or data to be readable at one of the monitored `Socket` instances. If a timeout of zero (0) is specified, this API will check each socket and return immediately. Otherwise, it will wait until either the timeout expires or data is readable from one or more of the monitored `Socket` instances. If a timeout occurs, this API will return `nil`. If data is available on one or more of the monitored `Socket` instances, those instances will be returned in an array. If the `waitForever` flag is set to true, the function will wait indefinitely for data to become available *regardless of the timeout value specified*. -- `createAddress(host: String, port: Int32)` - This *class* function allows for the creation of `Address` enum given a `host` and `port`. On success, this function returns an `Address` or `nil` if the `host` specified doesn't exist. -- `isReadableOrWritable(waitForever: Bool = false, timeout: UInt = 0)` - This *instance function* allows to determine whether a `Socket` instance is readable and/or writable. A tuple is returned containing two `Bool` values. The first, if true, indicates the `Socket` instance has data to read, the second, if true, indicates that the `Socket` instance can be written to. `waitForever` if true, causes this routine to wait until the `Socket` is either readable or writable or an error occurs. If false, the `timeout` parameter specifies how long to wait. If a value of zero `(0)` is specified for the timeout value, this function will check the *current* status and *immediately* return. This function returns a tuple containing two booleans, the first `readable` and the second, `writable`. They are set to true if the `Socket` is either readable or writable repsectively. If neither is set to true, a timeout has occurred. **Note:** If you're attempting to write to a newly connected *Socket*, you should ensure that it's *writable* before attempting the operation. -- `setBlocking(shouldBlock: Bool)` - This *instance function* allows you control whether or not this `Socket` instance should be placed in blocking mode or not. **Note:** All `Socket` instances are, by *default*, created in *blocking mode*. -- `setReadTimeout(value: UInt = 0)` - This *instance function* allows you to set a timeout for read operations. `value` is a `UInt` the specifies the time for the read operation to wait before returning. In the event of a timeout, the read operation will return `0` bytes read and `errno` will be set to `EAGAIN`. -- `setWriteTimeout(value: UInt = 0)` - This *instance function* allows you to set a timeout for write operations. `value` is a `UInt` the specifies the time for the write operation to wait before returning. In the event of a timeout, the write operation will return `0` bytes written and `errno` will be set to `EAGAIN` for *TCP* and *UNIX* sockets, for *UDP*, the write operation will *succeed* regardless of the timeout value. -- `udpBroadcast(enable: Bool)` - This *instance function* is used to enable broadcast mode on a UDP socket. Pass `true` to enable broadcast, `false` to disable. This function will throw an exception if the `Socket` instance is not a UDP socket. - -### Complete Example - -The following example shows how to create a relatively simple multi-threaded echo server using the new `GCD based` **Dispatch** API. What follows is code for a simple echo server that once running, can be accessed via `telnet ::1 1337`. -```swift - -import Foundation -import Socket -import Dispatch - -class EchoServer { - - static let quitCommand: String = "QUIT" - static let shutdownCommand: String = "SHUTDOWN" - static let bufferSize = 4096 - - let port: Int - var listenSocket: Socket? = nil - var continueRunningValue = true - var connectedSockets = [Int32: Socket]() - let socketLockQueue = DispatchQueue(label: "com.ibm.serverSwift.socketLockQueue") - var continueRunning: Bool { - set(newValue) { - socketLockQueue.sync { - self.continueRunningValue = newValue - } - } - get { - return socketLockQueue.sync { - self.continueRunningValue - } - } - } - - init(port: Int) { - self.port = port - } - - deinit { - // Close all open sockets... - for socket in connectedSockets.values { - socket.close() - } - self.listenSocket?.close() - } - - func run() { - - let queue = DispatchQueue.global(qos: .userInteractive) - - queue.async { [unowned self] in - - do { - // Create an IPV6 socket... - try self.listenSocket = Socket.create(family: .inet6) - - guard let socket = self.listenSocket else { - - print("Unable to unwrap socket...") - return - } - - try socket.listen(on: self.port) - - print("Listening on port: \(socket.listeningPort)") - - repeat { - let newSocket = try socket.acceptClientConnection() - - print("Accepted connection from: \(newSocket.remoteHostname) on port \(newSocket.remotePort)") - print("Socket Signature: \(String(describing: newSocket.signature?.description))") - - self.addNewConnection(socket: newSocket) - - } while self.continueRunning - - } - catch let error { - guard let socketError = error as? Socket.Error else { - print("Unexpected error...") - return - } - - if self.continueRunning { - - print("Error reported:\n \(socketError.description)") - - } - } - } - dispatchMain() - } - - func addNewConnection(socket: Socket) { - - // Add the new socket to the list of connected sockets... - socketLockQueue.sync { [unowned self, socket] in - self.connectedSockets[socket.socketfd] = socket - } - - // Get the global concurrent queue... - let queue = DispatchQueue.global(qos: .default) - - // Create the run loop work item and dispatch to the default priority global queue... - queue.async { [unowned self, socket] in - - var shouldKeepRunning = true - - var readData = Data(capacity: EchoServer.bufferSize) - - do { - // Write the welcome string... - try socket.write(from: "Hello, type 'QUIT' to end session\nor 'SHUTDOWN' to stop server.\n") - - repeat { - let bytesRead = try socket.read(into: &readData) - - if bytesRead > 0 { - guard let response = String(data: readData, encoding: .utf8) else { - - print("Error decoding response...") - readData.count = 0 - break - } - if response.hasPrefix(EchoServer.shutdownCommand) { - - print("Shutdown requested by connection at \(socket.remoteHostname):\(socket.remotePort)") - - // Shut things down... - self.shutdownServer() - - return - } - print("Server received from connection at \(socket.remoteHostname):\(socket.remotePort): \(response) ") - let reply = "Server response: \n\(response)\n" - try socket.write(from: reply) - - if (response.uppercased().hasPrefix(EchoServer.quitCommand) || response.uppercased().hasPrefix(EchoServer.shutdownCommand)) && - (!response.hasPrefix(EchoServer.quitCommand) && !response.hasPrefix(EchoServer.shutdownCommand)) { - - try socket.write(from: "If you want to QUIT or SHUTDOWN, please type the name in all caps. 😃\n") - } - - if response.hasPrefix(EchoServer.quitCommand) || response.hasSuffix(EchoServer.quitCommand) { - - shouldKeepRunning = false - } - } - - if bytesRead == 0 { - - shouldKeepRunning = false - break - } - - readData.count = 0 - - } while shouldKeepRunning - - print("Socket: \(socket.remoteHostname):\(socket.remotePort) closed...") - socket.close() - - self.socketLockQueue.sync { [unowned self, socket] in - self.connectedSockets[socket.socketfd] = nil - } - - } - catch let error { - guard let socketError = error as? Socket.Error else { - print("Unexpected error by connection at \(socket.remoteHostname):\(socket.remotePort)...") - return - } - if self.continueRunning { - print("Error reported by connection at \(socket.remoteHostname):\(socket.remotePort):\n \(socketError.description)") - } - } - } - } - - func shutdownServer() { - print("\nShutdown in progress...") - - self.continueRunning = false - - // Close all open sockets... - for socket in connectedSockets.values { - - self.socketLockQueue.sync { [unowned self, socket] in - self.connectedSockets[socket.socketfd] = nil - socket.close() - } - } - - DispatchQueue.main.sync { - exit(0) - } - } -} - -let port = 1337 -let server = EchoServer(port: port) -print("Swift Echo Server Sample") -print("Connect with a command line window by entering 'telnet ::1 \(port)'") - -server.run() -``` -This server can be built by specifying the following `Package.swift` file using Swift 4. -```swift -import PackageDescription - -let package = Package( - name: "EchoServer", - dependencies: [ - .package(url: "https://github.com/IBM-Swift/BlueSocket.git", from:"1.0.8"), - ], - targets: [ - .target( - name: "EchoServer", - dependencies: [ - "Socket" - ]), - ] -) -``` -Or if you are still using Swift 3, by specifying the following `Package.swift` file. -```swift -import PackageDescription - -let package = Package( - name: "EchoServer", - dependencies: [ - .Package(url: "https://github.com/IBM-Swift/BlueSocket.git", majorVersion: 1, minor: 0), - ], - exclude: ["EchoServer.xcodeproj"] -) -``` - -The following command sequence will build and run the echo server on Linux. If running on macOS or with any toolchain **NEWER** than the 8/18 toolchain, you can omit the `-Xcc -fblocks` switch as it's no longer needed. -``` -$ swift build -Xcc -fblocks -$ .build/debug/EchoServer -Swift Echo Server Sample -Connect with a command line window by entering 'telnet ::1 1337' -Listening on port: 1337 -``` - -## Community - -We love to talk server-side Swift and Kitura. Join our [Slack](http://swift-at-ibm-slack.mybluemix.net/) to meet the team! - -## License - -This library is licensed under Apache 2.0. Full license text is available in [LICENSE](https://github.com/IBM-Swift/BlueSocket/blob/master/LICENSE). diff --git a/Pods/BlueSocket/Sources/Socket/Socket.swift b/Pods/BlueSocket/Sources/Socket/Socket.swift deleted file mode 100644 index b46f715..0000000 --- a/Pods/BlueSocket/Sources/Socket/Socket.swift +++ /dev/null @@ -1,3759 +0,0 @@ -// -// Socket.swift -// BlueSocket -// -// Created by Bill Abt on 11/9/15. -// Copyright © 2016 IBM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#if os(macOS) || os(iOS) || os(tvOS) - import Darwin -#elseif os(Linux) - import Glibc -#endif - -import Foundation - -// MARK: Socket - -/// -/// **Socket:** Low level BSD sockets wrapper. -/// -public class Socket: SocketReader, SocketWriter { - - // MARK: Constants - - // MARK: -- Generic - - public static let SOCKET_MINIMUM_READ_BUFFER_SIZE = 1024 - public static let SOCKET_DEFAULT_READ_BUFFER_SIZE = 4096 - public static let SOCKET_DEFAULT_SSL_READ_BUFFER_SIZE = 32768 - public static let SOCKET_MAXIMUM_SSL_READ_BUFFER_SIZE = 8000000 - public static let SOCKET_DEFAULT_MAX_BACKLOG = 50 - #if os(macOS) || os(iOS) || os(tvOS) - public static let SOCKET_MAX_DARWIN_BACKLOG = 128 - #endif - - public static let SOCKET_INVALID_PORT = Int32(0) - public static let SOCKET_INVALID_DESCRIPTOR = Int32(-1) - - public static let INADDR_ANY = in_addr_t(0) - - public static let NO_HOSTNAME = "No hostname" - - // MARK: -- Errors: Domain and Codes - - public static let SOCKET_ERR_DOMAIN = "com.ibm.oss.Socket.ErrorDomain" - - public static let SOCKET_ERR_UNABLE_TO_CREATE_SOCKET = -9999 - public static let SOCKET_ERR_BAD_DESCRIPTOR = -9998 - public static let SOCKET_ERR_ALREADY_CONNECTED = -9997 - public static let SOCKET_ERR_NOT_CONNECTED = -9996 - public static let SOCKET_ERR_NOT_LISTENING = -9995 - public static let SOCKET_ERR_ACCEPT_FAILED = -9994 - public static let SOCKET_ERR_SETSOCKOPT_FAILED = -9993 - public static let SOCKET_ERR_BIND_FAILED = -9992 - public static let SOCKET_ERR_INVALID_HOSTNAME = -9991 - public static let SOCKET_ERR_INVALID_PORT = -9990 - public static let SOCKET_ERR_GETADDRINFO_FAILED = -9989 - public static let SOCKET_ERR_CONNECT_FAILED = -9988 - public static let SOCKET_ERR_MISSING_CONNECTION_DATA = -9987 - public static let SOCKET_ERR_SELECT_FAILED = -9986 - public static let SOCKET_ERR_LISTEN_FAILED = -9985 - public static let SOCKET_ERR_INVALID_BUFFER = -9984 - public static let SOCKET_ERR_INVALID_BUFFER_SIZE = -9983 - public static let SOCKET_ERR_RECV_FAILED = -9982 - public static let SOCKET_ERR_RECV_BUFFER_TOO_SMALL = -9981 - public static let SOCKET_ERR_WRITE_FAILED = -9980 - public static let SOCKET_ERR_GET_FCNTL_FAILED = -9979 - public static let SOCKET_ERR_SET_FCNTL_FAILED = -9978 - public static let SOCKET_ERR_NOT_IMPLEMENTED = -9977 - public static let SOCKET_ERR_NOT_SUPPORTED_YET = -9976 - public static let SOCKET_ERR_BAD_SIGNATURE_PARAMETERS = -9975 - public static let SOCKET_ERR_INTERNAL = -9974 - public static let SOCKET_ERR_WRONG_PROTOCOL = -9973 - public static let SOCKET_ERR_NOT_ACTIVE = -9972 - public static let SOCKET_ERR_CONNECTION_RESET = -9971 - public static let SOCKET_ERR_SET_RECV_TIMEOUT_FAILED = -9970 - public static let SOCKET_ERR_SET_WRITE_TIMEOUT_FAILED = -9969 - public static let SOCKET_ERR_CONNECT_TIMEOUT = -9968 - public static let SOCKET_ERR_GETSOCKOPT_FAILED = -9967 - public static let SOCKET_ERR_INVALID_DELEGATE_CALL = -9966 - public static let SOCKET_ERR_MISSING_SIGNATURE = -9965 - public static let SOCKET_ERR_PARAMETER_ERROR = -9964 - - /// - /// Specialized Operation Exception - /// - enum OperationInterrupted: Swift.Error { - - /// Low level socket accept was interrupted. - /// - **Note:** This is typically _NOT_ an error. - case accept - - /// Low level datagram read was interrupted. - /// - **Note:** This is typically _NOT_ an error. - case readDatagram(length: Int) - } - - /// - /// Flag to indicate the endian-ness of the host. (Readonly) - /// - public static let isLittleEndian: Bool = Int(littleEndian: 42) == 42 - - // MARK: Enums - - // MARK: -- ProtocolFamily - - /// - /// Socket Protocol Family Values - /// - /// **Note:** Only the following are supported at this time: - /// inet = AF_INET (IPV4) - /// inet6 = AF_INET6 (IPV6) - /// unix = AF_UNIX - /// - public enum ProtocolFamily { - - /// AF_INET (IPV4) - case inet - - /// AF_INET6 (IPV6) - case inet6 - - /// AF_UNIX - case unix - - /// - /// Return the value for a particular case. (Readonly) - /// - var value: Int32 { - - switch self { - - case .inet: - return Int32(AF_INET) - - case .inet6: - return Int32(AF_INET6) - - case .unix: - return Int32(AF_UNIX) - } - } - /// - /// Return enum equivalent of a raw value - /// - /// - Parameter forValue: Value for which enum value is desired - /// - /// - Returns: Optional contain enum value or nil - /// - static func getFamily(forValue: Int32) -> ProtocolFamily? { - - switch forValue { - - case Int32(AF_INET): - return .inet - case Int32(AF_INET6): - return .inet6 - case Int32(AF_UNIX): - return .unix - default: - return nil - } - } - - } - - // MARK: -- SocketType - - /// - /// Socket Type Values - /// - /// **Note:** Only the following are supported at this time: - /// stream = SOCK_STREAM (Provides sequenced, reliable, two-way, connection-based byte streams.) - /// datagram = SOCK_DGRAM (Supports datagrams (connectionless, unreliable messages of a fixed maximum length).) - /// - public enum SocketType { - - /// SOCK_STREAM (Provides sequenced, reliable, two-way, connection-based byte streams.) - case stream - - /// SOCK_DGRAM (Supports datagrams (connectionless, unreliable messages of a fixed maximum length).) - case datagram - - /// - /// Return the value for a particular case. (Readonly) - /// - var value: Int32 { - - switch self { - - case .stream: - #if os(Linux) - return Int32(SOCK_STREAM.rawValue) - #else - return SOCK_STREAM - #endif - case .datagram: - #if os(Linux) - return Int32(SOCK_DGRAM.rawValue) - #else - return SOCK_DGRAM - #endif - } - } - - /// - /// Return enum equivalent of a raw value - /// - /// - Parameter forValue: Value for which enum value is desired - /// - /// - Returns: Optional contain enum value or nil - /// - static func getType(forValue: Int32) -> SocketType? { - - #if os(Linux) - switch forValue { - - case Int32(SOCK_STREAM.rawValue): - return .stream - case Int32(SOCK_DGRAM.rawValue): - return .datagram - default: - return nil - } - #else - switch forValue { - - case SOCK_STREAM: - return .stream - case SOCK_DGRAM: - return .datagram - default: - return nil - } - #endif - } - } - - // MARK: -- SocketProtocol - - /// - /// Socket Protocol Values - /// - /// **Note:** Only the following are supported at this time: - /// tcp = IPPROTO_TCP - /// udp = IPPROTO_UDP - /// unix = Unix Domain Socket (raw value = 0) - /// - public enum SocketProtocol: Int32 { - - /// IPPROTO_TCP - case tcp - - /// IPPROTO_UDP - case udp - - /// Unix Domain - case unix - - /// - /// Return the value for a particular case. (Readonly) - /// - var value: Int32 { - - switch self { - - case .tcp: - return Int32(IPPROTO_TCP) - case .udp: - return Int32(IPPROTO_UDP) - case .unix: - return Int32(0) - } - } - - /// - /// Return enum equivalent of a raw value - /// - /// - Parameter forValue: Value for which enum value is desired - /// - /// - Returns: Optional contain enum value or nil - /// - static func getProtocol(forValue: Int32) -> SocketProtocol? { - - switch forValue { - - case Int32(IPPROTO_TCP): - return .tcp - case Int32(IPPROTO_UDP): - return .udp - case Int32(0): - return .unix - default: - return nil - } - } - } - - // MARK: -- Socket Address - - /// - /// Socket Address - /// - public enum Address { - - /// sockaddr_in - case ipv4(sockaddr_in) - - /// sockaddr_in6 - case ipv6(sockaddr_in6) - - /// sockaddr_un - case unix(sockaddr_un) - - /// - /// Size of address. (Readonly) - /// - public var size: Int { - - switch self { - - case .ipv4( _): - return MemoryLayout<(sockaddr_in)>.size - case .ipv6( _): - return MemoryLayout<(sockaddr_in6)>.size - case .unix( _): - return MemoryLayout<(sockaddr_un)>.size - } - } - - /// - /// The protocol family of the address. (Readonly) - /// - public var family: ProtocolFamily { - switch self { - case .ipv4(_): - return ProtocolFamily.inet - case .ipv6(_): - return ProtocolFamily.inet6 - case .unix(_): - return ProtocolFamily.unix - } - } - } - - // MARK: Structs - - // MARK: -- Signature - - /// - /// Socket signature: contains the characteristics of the socket. - /// - public struct Signature: CustomStringConvertible { - - // MARK: -- Public Properties - - /// - /// Protocol Family - /// - public internal(set) var protocolFamily: ProtocolFamily - - /// - /// Socket Type. (Readonly) - /// - public internal(set) var socketType: SocketType - - /// - /// Socket Protocol. (Readonly) - /// - public internal(set) var proto: SocketProtocol - - /// - /// Host name for connection. (Readonly) - /// - public internal(set) var hostname: String? = Socket.NO_HOSTNAME - - /// - /// Port for connection. (Readonly) - /// - public internal(set) var port: Int32 = Socket.SOCKET_INVALID_PORT - - /// - /// Path for .unix type sockets. (Readonly) - /// - public internal(set) var path: String? = nil - - /// - /// Address info for socket. (Readonly) - /// - public internal(set) var address: Address? = nil - - /// - /// Flag to indicate whether `Socket` is secure or not. (Readonly) - /// - public internal(set) var isSecure: Bool = false - - /// - /// `True` is socket bound, `false` otherwise. - /// - public internal(set) var isBound: Bool = false - - /// - /// Returns a string description of the error. - /// - public var description: String { - - return "Signature: family: \(protocolFamily), type: \(socketType), protocol: \(proto), address: \(address as Socket.Address?), hostname: \(hostname as String?), port: \(port), path: \(String(describing: path)), bound: \(isBound), secure: \(isSecure)" - } - - // MARK: -- Public Functions - - /// - /// Create a socket signature - /// - /// - Parameters: - /// - protocolFamily: The family of the socket to create. - /// - socketType: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - address: Address info for the socket. - /// - /// - Returns: New Signature instance - /// - public init?(protocolFamily: Int32, socketType: Int32, proto: Int32, address: Address?) throws { - - guard let family = ProtocolFamily.getFamily(forValue: protocolFamily), - let type = SocketType.getType(forValue: socketType), - let pro = SocketProtocol.getProtocol(forValue: proto) else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Bad family, type or protocol passed.") - } - - // Validate the parameters... - if type == .stream { - guard pro == .tcp || pro == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if type == .datagram { - guard pro == .udp || pro == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp or .unix for the protocol.") - } - } - - self.protocolFamily = family - self.socketType = type - self.proto = pro - - self.address = address - - } - - /// - /// Create a socket signature - /// - /// - Parameters: - /// - socketType: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - address: Address info for the socket. - /// - hostname: Hostname for this signature. - /// - port: Port for this signature. - /// - /// - Returns: New Signature instance - /// - public init?(socketType: SocketType, proto: SocketProtocol, address: Address, hostname: String?, port: Int32?) throws { - - // Validate the parameters... - if socketType == .stream { - guard proto == .tcp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if socketType == .datagram { - guard proto == .udp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp or .unix for the protocol.") - } - } - - self.protocolFamily = address.family - self.socketType = socketType - self.proto = proto - - self.address = address - self.hostname = hostname - if let port = port { - self.port = port - } - } - - /// - /// Create a socket signature - /// - /// - Parameters: - /// - protocolFamily: The protocol family to use (only `.inet` and `.inet6` supported by this `init` function). - /// - socketType: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - hostname: Hostname for this signature. - /// - port: Port for this signature. - /// - /// - Returns: New Signature instance - /// - public init?(protocolFamily: ProtocolFamily, socketType: SocketType, proto: SocketProtocol, hostname: String?, port: Int32?) throws { - - // Make sure we have what we need... - guard let _ = hostname, - let port = port, protocolFamily == .inet || protocolFamily == .inet6 else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Missing hostname, port or both or invalid protocol family.") - } - - self.protocolFamily = protocolFamily - - // Validate the parameters... - if socketType == .stream { - guard proto == .tcp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if socketType == .datagram { - guard proto == .udp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp or .unix for the protocol.") - } - } - - self.socketType = socketType - self.proto = proto - - self.hostname = hostname - self.port = port - } - - /// - /// Create a socket signature - /// - /// - Parameters: - /// - socketType: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - path: Pathname for this signature. - /// - /// - Returns: New Signature instance - /// - public init?(socketType: SocketType, proto: SocketProtocol, path: String?) throws { - - // Make sure we have what we need... - guard let path = path, !path.isEmpty else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Missing pathname.") - } - - // Default to Unix socket protocol family... - self.protocolFamily = .unix - - self.socketType = socketType - self.proto = proto - - // Validate the parameters... - if socketType == .stream { - guard proto == .tcp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if socketType == .datagram { - guard proto == .udp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp or .unix for the protocol.") - } - } - - self.path = path - - // Create the address... - var remoteAddr = sockaddr_un() - remoteAddr.sun_family = sa_family_t(AF_UNIX) - - let lengthOfPath = path.utf8.count - - // Validate the length... - guard lengthOfPath < MemoryLayout.size(ofValue: remoteAddr.sun_path) else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Pathname supplied is too long.") - } - - // Copy the path to the remote address... - _ = withUnsafeMutablePointer(to: &remoteAddr.sun_path.0) { ptr in - - path.withCString { - strncpy(ptr, $0, lengthOfPath) - } - } - - #if !os(Linux) - remoteAddr.sun_len = UInt8(MemoryLayout.size + MemoryLayout.size + path.utf8.count + 1) - #endif - - self.address = .unix(remoteAddr) - } - - /// - /// Create a socket signature - /// - /// - Parameters: - /// - protocolFamily: The family of the socket to create. - /// - socketType: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - address: Address info for the socket. - /// - hostname: Hostname for this signature. - /// - port: Port for this signature. - /// - /// - Returns: New Signature instance - /// - internal init?(protocolFamily: Int32, socketType: Int32, proto: Int32, address: Address?, hostname: String?, port: Int32?) throws { - - // This constructor requires all items be present... - guard let family = ProtocolFamily.getFamily(forValue: protocolFamily), - let type = SocketType.getType(forValue: socketType), - let pro = SocketProtocol.getProtocol(forValue: proto), - let _ = hostname, - let port = port else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Incomplete parameters.") - } - - self.protocolFamily = family - self.socketType = type - self.proto = pro - - // Validate the parameters... - if type == .stream { - guard pro == .tcp || pro == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if type == .datagram { - guard pro == .udp else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp for the protocol.") - } - } - - self.address = address - - self.hostname = hostname - self.port = port - } - - /// - /// Retrieve the UNIX address as an UnsafeMutablePointer - /// - /// - Returns: Tuple containing the pointer plus the size. - /// **IMPORTANT: The pointer returned needs to be deallocated after use.** - /// - internal func unixAddress() throws -> (UnsafeMutablePointer, Int) { - - // Throw an exception if the path is not set... - if path == nil { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Specified path contains zero (0) bytes.") - } - - let utf8 = path!.utf8 - - // macOS has a size identifier in front, Linux does not... - #if os(Linux) - let addrLen = MemoryLayout.size - #else - let addrLen = MemoryLayout.size + MemoryLayout.size + utf8.count + 1 - #endif - let addrPtr = UnsafeMutablePointer.allocate(capacity: addrLen) - - var memLoc = 0 - - // macOS uses one byte for sa_family_t, Linux uses two... - // Note: on Linux, account for endianess... - #if os(Linux) - let afUnixShort = UInt16(AF_UNIX) - if isLittleEndian { - addrPtr[memLoc] = UInt8(afUnixShort & 0xFF) - memLoc += 1 - addrPtr[memLoc] = UInt8((afUnixShort >> 8) & 0xFF) - memLoc += 1 - } else { - addrPtr[memLoc] = UInt8((afUnixShort >> 8) & 0xFF) - memLoc += 1 - addrPtr[memLoc] = UInt8(afUnixShort & 0xFF) - memLoc += 1 - } - #else - addrPtr[memLoc] = UInt8(addrLen) - memLoc += 1 - addrPtr[memLoc] = UInt8(AF_UNIX) - memLoc += 1 - #endif - - // Copy the pathname... - for char in utf8 { - addrPtr[memLoc] = char - memLoc += 1 - } - - addrPtr[memLoc] = 0 - - return (addrPtr, addrLen) - } - - } - - // MARK: -- Error - - /// - /// `Socket` specific error structure. - /// - public struct Error: Swift.Error, CustomStringConvertible { - - // MARK: -- Public Properties - - /// - /// The error domain. - /// - public let domain: String = SOCKET_ERR_DOMAIN - - /// - /// The error code: **see constants above for possible errors** (Readonly) - /// - public internal(set) var errorCode: Int32 - - /// - /// The reason for the error **(if available)** (Readonly) - /// - public internal(set) var errorReason: String? - - /// - /// Returns a string description of the error. (Readonly) - /// - public var description: String { - - let reason: String = self.errorReason ?? "Reason: Unavailable" - return "Error code: \(self.errorCode)(0x\(String(self.errorCode, radix: 16, uppercase: true))), \(reason)" - } - - /// - /// The buffer size needed to complete the read. (Readonly) - /// - public internal(set) var bufferSizeNeeded: Int32 - - // MARK: -- Public Functions - - /// - /// Initializes an Error Instance - /// - /// - Parameters: - /// - code: Error code - /// - reason: Optional Error Reason - /// - /// - Returns: Error instance - /// - init(code: Int, reason: String?) { - - self.errorCode = Int32(code) - self.errorReason = reason - self.bufferSizeNeeded = 0 - } - - /// - /// Initializes an Error Instance for a too small receive buffer error. - /// - /// - Parameter bufferSize: Required buffer size - /// - /// - Returns: Error Instance - /// - init(bufferSize: Int) { - - self.init(code: Socket.SOCKET_ERR_RECV_BUFFER_TOO_SMALL, reason: "Socket has an invalid buffer, the size is too small") - self.bufferSizeNeeded = Int32(bufferSize) - } - - /// - /// Initializes an Error instance using SSLError - /// - /// - Parameter error: SSLError instance to be transformed - /// - /// - Returns: Error Instance - /// - init(with error: SSLError) { - - self.init(code: error.errCode, reason: error.description) - } - } - - // MARK: Properties - - // MARK: -- Private - - /// - /// Internal read buffer. - /// **Note:** The readBuffer is actually allocating unmanaged memory that'll - /// be deallocated when we're done with it. - /// - var readBuffer: UnsafeMutablePointer = UnsafeMutablePointer.allocate(capacity: Socket.SOCKET_DEFAULT_READ_BUFFER_SIZE) - - /// - /// Internal Storage Buffer initially created with `Socket.SOCKET_DEFAULT_READ_BUFFER_SIZE`. - /// - var readStorage: NSMutableData = NSMutableData(capacity: Socket.SOCKET_DEFAULT_READ_BUFFER_SIZE)! - - /// - /// `True` if a delegate accept is pending. - /// - var needsAcceptDelegateCall: Bool = false - - - // MARK: -- Public - - /// - /// The file descriptor representing this socket. (Readonly) - /// - public internal(set) var socketfd: Int32 = SOCKET_INVALID_DESCRIPTOR - - /// - /// The signature for the socket. (Readonly) - /// **Note:** See Signature above. - /// - public internal(set) var signature: Signature? = nil - - /// - /// The delegate that provides the SSL implementation. - /// - public var delegate: SSLServiceDelegate? = nil { - - didSet { - - // If setting an SSL delegate, bump up the read buffer size... - if delegate != nil { - readBufferSize = Socket.SOCKET_DEFAULT_SSL_READ_BUFFER_SIZE - } - } - } - - /// - /// Internal Read buffer size for all open sockets. - /// **Note:** Changing this value will cause the internal read buffer to - /// be discarded and reallocated with the new size. The value must be - /// set to at least `Socket.SOCKET_MINIMUM_READ_BUFFER_SIZE`. If set - /// to something smaller, it will be automatically set to the minimum - /// size as defined by `Socket.SOCKET_MINIMUM_READ_BUFFER_SIZE`. - /// - public var readBufferSize: Int = Socket.SOCKET_DEFAULT_READ_BUFFER_SIZE { - - // If the buffer size changes we need to reallocate the buffer... - didSet { - - // Ensure minimum buffer size... - if readBufferSize < Socket.SOCKET_MINIMUM_READ_BUFFER_SIZE { - - readBufferSize = Socket.SOCKET_MINIMUM_READ_BUFFER_SIZE - } - - if readBufferSize != oldValue { - - #if swift(>=4.1) - readBuffer.deinitialize(count: readBufferSize) - readBuffer.deallocate() - readBuffer = UnsafeMutablePointer.allocate(capacity: readBufferSize) - readBuffer.initialize(to: 0) - #else - readBuffer.deinitialize() - readBuffer.deallocate(capacity: oldValue) - readBuffer = UnsafeMutablePointer.allocate(capacity: readBufferSize) - readBuffer.initialize(to: 0, count: readBufferSize) - #endif - } - } - } - - /// - /// Maximum size of the queue containing pending connections. - /// **Note:** Default value is `Socket.SOCKET_DEFAULT_MAX_BACKLOG` - /// - public var maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG - - /// - /// `True` if this socket is connected. `False` otherwise. (Readonly) - /// - public internal(set) var isConnected: Bool = false - - /// - /// `True` if this socket is blocking. `False` otherwise. (Readonly) - /// - public internal(set) var isBlocking: Bool = true - - /// - /// `True` if this socket is listening. `False` otherwise. (Readonly) - /// - public internal(set) var isListening: Bool = false - - /// - /// `True` if this socket's remote connection has closed. (Readonly) - /// **Note:** This is only valid after a Socket is connected. - /// - public internal(set) var remoteConnectionClosed: Bool = false - - /// - /// `True` if the socket is listening or connected. (Readonly) - /// - public var isActive: Bool { - - return isListening || isConnected - } - - /// - /// `True` if this a server, `false` otherwise. (Readonly) - /// - public var isServer: Bool { - - return isListening - } - - /// - /// `True` if this socket is secure, `false` otherwise. (Readonly) - /// - public var isSecure: Bool { - - guard let sig = signature else { - return false - } - return sig.isSecure - } - - /// - /// Listening port (-1 if not listening). (Readonly) - /// - public var listeningPort: Int32 { - - guard let sig = signature, isListening else { - return Int32(-1) - } - return sig.port - } - - /// - /// The remote host name this socket is connected to. (Readonly) - /// - public var remoteHostname: String { - - guard let sig = signature, - let host = sig.hostname else { - return Socket.NO_HOSTNAME - } - - return host - } - - /// - /// The remote port this socket is connected to. (Readonly) - /// - public var remotePort: Int32 { - - guard let sig = signature, sig.port != Socket.SOCKET_INVALID_PORT else { - return Socket.SOCKET_INVALID_PORT - } - - return sig.port - } - - /// - /// The path this socket is connected to or listening on. (Readonly) - /// - public var remotePath: String? { - - guard let sig = signature, - let path = sig.path else { - return nil - } - - return path - } - - - // MARK: Class Functions - - /// - /// Create a configured Socket instance. - /// **Note:** Calling with no parameters will create a default socket: IPV4, stream, TCP. - /// - /// - Parameters: - /// - family: The family of the socket to create. - /// - type: The type of socket to create. - /// - proto: The protocool to use for the socket. - /// - /// - Returns: New Socket instance - /// - public class func create(family: ProtocolFamily = .inet, type: SocketType = .stream, proto: SocketProtocol = .tcp) throws -> Socket { - - // Validate the parameters... - if type == .stream { - guard proto == .tcp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Stream socket must use either .tcp or .unix for the protocol.") - } - } - if type == .datagram { - guard proto == .udp || proto == .unix else { - - throw Error(code: Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Datagram socket must use .udp or .unix for the protocol.") - } - } - - return try Socket(family: family, type: type, proto: proto) - } - - /// - /// Create a configured and connected Socket instance. - /// - /// - Parameter signature: The socket signature containing the connection information. - /// - /// - Returns: New Socket instance. **Note:** Connection status should be checked via the *isConnected* property on the returned socket. - /// - public class func create(connectedUsing signature: Signature) throws -> Socket { - - let socket = try Socket(family: signature.protocolFamily, type: signature.socketType, proto: signature.proto) - - try socket.connect(using: signature) - - return socket - } - - /// - /// Create an instance for existing open socket fd. - /// - /// - Parameters: - /// - nativeHandle: Open file descriptor. - /// - address: The Address associated with the open fd. - /// - /// - Returns: New Socket instance - /// - public class func create(fromNativeHandle nativeHandle: Int32, address: Address?) throws -> Socket { - - guard let addr = address else { - - throw Error(code: Socket.SOCKET_ERR_MISSING_CONNECTION_DATA, reason: "Unable to access socket connection data.") - } - - return try Socket(fd: nativeHandle, remoteAddress: addr) - } - - /// - /// Extract the string form of IP address and the port. - /// - /// - Parameter fromAddress: The Address struct. - /// - /// - Returns: Optional Tuple containing the hostname and port. - /// - public class func hostnameAndPort(from address: Address) -> (hostname: String, port: Int32)? { - - var port: Int32 = 0 - var bufLen: Int = 0 - var buf: [CChar] - - switch address { - - case .ipv4(let address_in): - var addr_in = address_in - bufLen = Int(INET_ADDRSTRLEN) - buf = [CChar](repeating: 0, count: bufLen) - inet_ntop(Int32(addr_in.sin_family), &addr_in.sin_addr, &buf, socklen_t(bufLen)) - if isLittleEndian { - port = Int32(UInt16(addr_in.sin_port).byteSwapped) - } else { - port = Int32(UInt16(addr_in.sin_port)) - } - - case .ipv6(let address_in): - var addr_in = address_in - bufLen = Int(INET6_ADDRSTRLEN) - buf = [CChar](repeating: 0, count: bufLen) - inet_ntop(Int32(addr_in.sin6_family), &addr_in.sin6_addr, &buf, socklen_t(bufLen)) - if isLittleEndian { - port = Int32(UInt16(addr_in.sin6_port).byteSwapped) - } else { - port = Int32(UInt16(addr_in.sin6_port)) - } - - default: - return nil - } - - if let s = String(validatingUTF8: buf) { - return (s, port) - - } - - return nil - } - - /// - /// Check whether one or more sockets are available for reading and/or writing - /// - /// - Parameter sockets: Array of Sockets to be tested. - /// - /// - Returns: Tuple containing two arrays of Sockets, one each representing readable and writable sockets. - /// - public class func checkStatus(for sockets: [Socket]) throws -> (readables: [Socket], writables: [Socket]) { - - var readables: [Socket] = [] - var writables: [Socket] = [] - - for socket in sockets { - - let result = try socket.isReadableOrWritable() - if result.readable { - readables.append(socket) - } - if result.writable { - writables.append(socket) - } - } - - return (readables, writables) - } - - /// - /// Monitor an array of sockets, returning when data is available or timeout occurs. - /// - /// - Parameters: - /// - sockets: An array of sockets to be monitored. - /// - timeout: Timeout (in msec) before returning. A timeout value of 0 will return immediately. - /// - waitForever: If `true`, this function will wait indefinitely regardless of timeout value. Defaults to `false`. - /// - /// - Returns: An optional array of sockets which have data available or nil if a timeout expires. - /// - public class func wait(for sockets: [Socket], timeout: UInt, waitForever: Bool = false) throws -> [Socket]? { - - // Validate we have sockets to look for and they are valid... - for socket in sockets { - - if socket.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket has an invalid descriptor") - } - if socket.signature == nil { - - throw Error(code: Socket.SOCKET_ERR_MISSING_SIGNATURE, reason: "The socket is missing a signature") - } - if !socket.isActive && !socket.signature!.isBound { - - throw Error(code: Socket.SOCKET_ERR_NOT_ACTIVE, reason: "The socket is not active") - } - } - - // Setup the timeout... - var timer = timeval() - if timeout > 0 && !waitForever { - - // First get seconds... - let secs = Int(Double(timeout / 1000)) - timer.tv_sec = secs - - // Now get the leftover millisecs... - let msecs = Int32(Double(timeout % 1000)) - - // Note: timeval expects microseconds, convert now... - let uSecs = msecs * 1000 - - // Now the leftover microseconds... - #if os(Linux) - timer.tv_usec = Int(uSecs) - #else - timer.tv_usec = Int32(uSecs) - #endif - } - - // Setup the array of readfds... - var readfds = fd_set() - readfds.zero() - - var highSocketfd: Int32 = 0 - for socket in sockets { - - if socket.socketfd > highSocketfd { - highSocketfd = socket.socketfd - } - readfds.set(socket.socketfd) - } - - // Issue the select... - var count: Int32 = 0 - if waitForever { - count = select(highSocketfd + Int32(1), &readfds, nil, nil, nil) - } else { - count = select(highSocketfd + Int32(1), &readfds, nil, nil, &timer) - } - - // A count of less than zero indicates select failed... - if count < 0 { - - throw Error(code: Socket.SOCKET_ERR_SELECT_FAILED, reason: String(validatingUTF8: strerror(errno)) ?? "Error: \(errno)") - } - - // A count equal zero, indicates we timed out... - if count == 0 { - return nil - } - - // Build the array of returned sockets... - return sockets.filter { readfds.isSet($0.socketfd) } - } - - /// - /// Creates an Address for a given host and port. - /// - /// - Parameters: - /// - hostname: Hostname for this signature. - /// - port: Port for this signature. - /// - /// - Returns: An Address instance, or `nil` if the hostname and port are not valid. - /// - public class func createAddress(for host: String, on port: Int32) -> Address? { - - var info: UnsafeMutablePointer? - - // Retrieve the info on our target... - let status: Int32 = getaddrinfo(host, String(port), nil, &info) - if status != 0 { - - return nil - } - - // Defer cleanup of our target info... - defer { - - if info != nil { - freeaddrinfo(info) - } - } - - var address: Address - if info!.pointee.ai_family == Int32(AF_INET) { - - var addr = sockaddr_in() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv4(addr) - - } else if info!.pointee.ai_family == Int32(AF_INET6) { - - var addr = sockaddr_in6() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv6(addr) - - } else { - - return nil - } - - return address - } - - // MARK: Lifecycle Functions - - // MARK: -- Private - - /// - /// Internal initializer to create a configured Socket instance. - /// - /// - Parameters: - /// - family: The family of the socket to create. - /// - type: The type of socket to create. - /// - proto: The protocol to use for the socket. - /// - /// - Returns: New Socket instance - /// - private init(family: ProtocolFamily, type: SocketType, proto: SocketProtocol) throws { - - // Initialize the read buffer... - #if swift(>=4.1) - self.readBuffer.initialize(to: 0) - #else - self.readBuffer.initialize(to: 0, count: readBufferSize) - #endif - - // If the family is .unix, set the protocol to .unix as well... - var sockProto = proto - if family == .unix { - sockProto = .unix - } - - // Create the socket... - #if os(Linux) - self.socketfd = Glibc.socket(family.value, type.value, sockProto.value) - #else - self.socketfd = Darwin.socket(family.value, type.value, sockProto.value) - #endif - - // If error, throw an appropriate exception... - if self.socketfd < 0 { - - self.socketfd = Socket.SOCKET_INVALID_DESCRIPTOR - throw Error(code: Socket.SOCKET_ERR_UNABLE_TO_CREATE_SOCKET, reason: self.lastError()) - } - - try self.ignoreSIGPIPE(on: self.socketfd) - - // Create the signature... - try self.signature = Signature( - protocolFamily: family.value, - socketType: type.value, - proto: sockProto.value, - address: nil) - } - - /// - /// Private constructor to create an instance for existing open socket fd. - /// - /// - Parameters: - /// - fd: Open file descriptor. - /// - remoteAddress: The Address associated with the open fd. - /// - /// - Returns: New Socket instance - /// - private init(fd: Int32, remoteAddress: Address, path: String? = nil) throws { - - self.isConnected = true - self.isListening = false - #if swift(>=4.1) - self.readBuffer.initialize(to: 0) - #else - self.readBuffer.initialize(to: 0, count: readBufferSize) - #endif - - self.socketfd = fd - - // Create the signature... - #if os(Linux) - let type = Int32(SOCK_STREAM.rawValue) - #else - let type = SOCK_STREAM - #endif - - try self.ignoreSIGPIPE(on: self.socketfd) - - if path != nil { - - try self.signature = Signature(socketType: .stream, proto: .unix, path: path) - - } else { - if let (hostname, port) = Socket.hostnameAndPort(from: remoteAddress) { - try self.signature = Signature( - protocolFamily: remoteAddress.family.value, - socketType: type, - proto: Int32(IPPROTO_TCP), - address: remoteAddress, - hostname: hostname, - port: port) - } else { - try self.signature = Signature( - protocolFamily: remoteAddress.family.value, - socketType: type, - proto: Int32(IPPROTO_TCP), - address: remoteAddress) - } - } - } - - /// - /// Cleanup: close the socket, free memory buffers. - /// - deinit { - - if self.socketfd > 0 { - - self.close() - } - - // Destroy and free the readBuffer... - #if swift(>=4.1) - self.readBuffer.deinitialize(count: readBufferSize) - self.readBuffer.deallocate() - #else - self.readBuffer.deinitialize() - self.readBuffer.deallocate(capacity: self.readBufferSize) - #endif - } - - // MARK: Public Functions - - // MARK: -- Accept - - /// - /// Accepts an incoming client connection request on the current instance, leaving the current instance still listening. - /// - /// - Parameters: - /// - invokeDelegate: Whether to invoke the delegate's `onAccept()` function after accepting - /// a new connection. Defaults to `true` - /// - /// - Returns: New Socket instance representing the newly accepted socket. - /// - public func acceptClientConnection(invokeDelegate: Bool = true) throws -> Socket { - - // The socket must've been created, not connected and listening... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket has an invalid descriptor") - } - - if self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_ALREADY_CONNECTED, reason: "The socket is not connected") - } - - if !self.isListening { - - throw Error(code: Socket.SOCKET_ERR_NOT_LISTENING, reason: "The socket is not listening") - } - - // Accept the remote connection... - var socketfd2: Int32 = Socket.SOCKET_INVALID_DESCRIPTOR - var address: Address? = nil - - var keepRunning: Bool = true - repeat { - do { - guard let acceptAddress = try Address(addressProvider: { (addressPointer, addressLengthPointer) in - #if os(Linux) - let fd = Glibc.accept(self.socketfd, addressPointer, addressLengthPointer) - #else - let fd = Darwin.accept(self.socketfd, addressPointer, addressLengthPointer) - #endif - - if fd < 0 { - - // The operation was interrupted, continue the loop... - if errno == EINTR { - throw OperationInterrupted.accept - } - - // Note: if you're running tests inside Xcode and the tests stop on this line - // and the tests fail, but they work if you run `swift test` on the - // command line, Hit `Deactivate Breakpoints` in Xcode and try again - throw Error(code: Socket.SOCKET_ERR_ACCEPT_FAILED, reason: self.lastError()) - } - socketfd2 = fd - }) else { - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine incoming socket protocol family.") - } - address = acceptAddress - - } catch OperationInterrupted.accept { - - continue - } - - keepRunning = false - - } while keepRunning - - // Create the new socket... - // Note: The current socket continues to listen. - let newSocket = try Socket(fd: socketfd2, remoteAddress: address!, path: self.signature?.path) - - // If there's a delegate, turn on the needs accept flag... - if self.delegate != nil { - newSocket.needsAcceptDelegateCall = true - } - - // Let the delegate do post accept handling and verification... - if invokeDelegate, self.delegate != nil { - try invokeDelegateOnAccept(for: newSocket) - } - - // Return the new socket... - return newSocket - } - - /// - /// Invokes the delegate's `onAccept()` function for a client socket. This should be performed - /// only with a Socket obtained by calling `acceptClientConnection(invokeDelegate: false)`. - /// - /// - Parameters: - /// - newSocket: The newly accepted Socket that requires further processing by our delegate - /// - public func invokeDelegateOnAccept(for newSocket: Socket) throws { - - // Only allow this if the socket needs it, otherwise it's a error... - if !newSocket.needsAcceptDelegateCall { - - throw Error(code: Socket.SOCKET_ERR_INVALID_DELEGATE_CALL, reason: "Socket does not need a delegate accept call") - } - - do { - - if self.delegate != nil { - try self.delegate?.onAccept(socket: newSocket) - newSocket.signature?.isSecure = true - self.needsAcceptDelegateCall = false - } - - } catch let error { - - guard let sslError = error as? SSLError else { - throw error - } - - throw Error(with: sslError) - } - } - - /// - /// Accepts an incoming connection request replacing the existing socket with the newly accepted one. - /// - public func acceptConnection() throws { - - // The socket must've been created, not connected and listening... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_ALREADY_CONNECTED, reason: "Socket is not connected") - } - - if !self.isListening { - - throw Error(code: Socket.SOCKET_ERR_NOT_LISTENING, reason: "Socket is not listening") - } - - // Accept the remote connection... - var socketfd2: Int32 = Socket.SOCKET_INVALID_DESCRIPTOR - var address: Address? = nil - - var keepRunning: Bool = true - repeat { - do { - guard let acceptAddress = try Address(addressProvider: { (addressPointer, addressLengthPointer) in - #if os(Linux) - let fd = Glibc.accept(self.socketfd, addressPointer, addressLengthPointer) - #else - let fd = Darwin.accept(self.socketfd, addressPointer, addressLengthPointer) - #endif - - if fd < 0 { - - // The operation was interrupted, continue the loop... - if errno == EINTR { - throw OperationInterrupted.accept - } - - // Note: if you're running tests inside Xcode and the tests stop on this line - // and the tests fail, but they work if you run `swift test` on the - // command line, Hit `Deactivate Breakpoints` in Xcode and try again - throw Error(code: Socket.SOCKET_ERR_ACCEPT_FAILED, reason: self.lastError()) - } - socketfd2 = fd - }) else { - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine incoming socket protocol family.") - } - address = acceptAddress - - } catch OperationInterrupted.accept { - - continue - } - - keepRunning = false - - } while keepRunning - - // Close the old socket... - self.close() - - // Save the address... - self.signature!.address = address - - // Replace the existing socketfd with the new one... - self.socketfd = socketfd2 - - if let (hostname, port) = Socket.hostnameAndPort(from: address!) { - self.signature!.hostname = hostname - self.signature!.port = port - } - - // We're connected but no longer listening... - self.isConnected = true - self.isListening = false - - // Let the delegate do post accept handling and verification... - do { - - if self.delegate != nil { - try self.delegate?.onAccept(socket: self) - self.signature?.isSecure = true - } - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - } - - // MARK: -- Close - - /// - /// Closes the current socket. - /// - public func close() { - - self.close(withSSLCleanup: true) - } - - // MARK: -- Connect - - /// - /// Connects to the named host on the specified port. - /// - /// - Parameters: - /// - host: The host name to connect to. - /// - port: The port to be used. - /// - timeout: Timeout to use (in msec). *Note: If the socket is in blocking mode it - /// will be changed to non-blocking mode temporarily if a timeout greater - /// than zero (0) is provided. The returned socket will be set back to its - /// original setting (blocking or non-blocking).* - /// - familyOnly: Setting this to `true` will only connect to a socket of the family of the - /// current instance of *Socket*. Setting it to `false`, will allow connection - /// to foreign sockets of a different family. Default is *false*. - /// - public func connect(to host: String, port: Int32, timeout: UInt = 0, familyOnly: Bool = false) throws { - - // The socket must've been created and must not be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_ALREADY_CONNECTED, reason: "Socket is already connected") - } - - if host.utf8.count == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_HOSTNAME, reason: "Socket has an invalid hostname") - } - - if !self.isBlocking && timeout == 0 { - - throw Error(code: Socket.SOCKET_ERR_PARAMETER_ERROR, reason: "No timeout set on call for non-blocking socket.") - } - - if port == 0 || port > 65535 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_PORT, reason: "The port specified is invalid. Must be in the range of 1-65535.") - } - - // Tell the delegate to initialize as a client... - do { - - try self.delegate?.initialize(asServer: false) - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - - // Create the hints for our search... - let socketType: SocketType = signature?.socketType ?? .stream - #if os(Linux) - var hints = addrinfo( - ai_flags: AI_PASSIVE, - ai_family: familyOnly ? signature?.protocolFamily.value ?? AF_UNSPEC : AF_UNSPEC, - ai_socktype: socketType.value, - ai_protocol: 0, - ai_addrlen: 0, - ai_addr: nil, - ai_canonname: nil, - ai_next: nil) - #else - var hints = addrinfo( - ai_flags: AI_PASSIVE, - ai_family: familyOnly ? signature?.protocolFamily.value ?? AF_UNSPEC : AF_UNSPEC, - ai_socktype: socketType.value, - ai_protocol: 0, - ai_addrlen: 0, - ai_canonname: nil, - ai_addr: nil, - ai_next: nil) - #endif - - var targetInfo: UnsafeMutablePointer? - - // Retrieve the info on our target... - var status: Int32 = getaddrinfo(host, String(port), &hints, &targetInfo) - if status != 0 { - - var errorString: String - if status == EAI_SYSTEM { - errorString = String(validatingUTF8: strerror(errno)) ?? "Unknown error code." - } else { - errorString = String(validatingUTF8: gai_strerror(status)) ?? "Unknown error code." - } - throw Error(code: Socket.SOCKET_ERR_GETADDRINFO_FAILED, reason: errorString) - } - - // Defer cleanup of our target info... - defer { - - if targetInfo != nil { - freeaddrinfo(targetInfo) - } - } - - var socketDescriptor: Int32? - defer { - // if we throw an error, be sure we clean up any dangling socket properly. - // note that we set this variable to nil when we assign the socket to `self.socketfd`. - if let sock = socketDescriptor, sock != Socket.SOCKET_INVALID_DESCRIPTOR { - #if os(Linux) - _ = Glibc.close(socketDescriptor!) - #else - _ = Darwin.close(socketDescriptor!) - #endif - } - } - - var info = targetInfo - while info != nil { - - #if os(Linux) - socketDescriptor = Glibc.socket(info!.pointee.ai_family, info!.pointee.ai_socktype, info!.pointee.ai_protocol) - #else - socketDescriptor = Darwin.socket(info!.pointee.ai_family, info!.pointee.ai_socktype, info!.pointee.ai_protocol) - #endif - if socketDescriptor == -1 { - continue - } - - // Check to see if the socket is in non-blocking mode or if a timeout is provided - // If either is the case, set our trial socket to be non-blocking as well... - if !self.isBlocking || timeout > 0 { - - let flags = fcntl(socketDescriptor!, F_GETFL) - if flags < 0 { - - throw Error(code: Socket.SOCKET_ERR_GET_FCNTL_FAILED, reason: self.lastError()) - } - - let result = fcntl(socketDescriptor!, F_SETFL, flags | O_NONBLOCK) - if result < 0 { - - throw Error(code: Socket.SOCKET_ERR_SET_FCNTL_FAILED, reason: self.lastError()) - } - } - - // Connect to the server... - #if os(Linux) - status = Glibc.connect(socketDescriptor!, info!.pointee.ai_addr, info!.pointee.ai_addrlen) - #else - status = Darwin.connect(socketDescriptor!, info!.pointee.ai_addr, info!.pointee.ai_addrlen) - #endif - - // Break if successful... - if status == 0 { - break - } - - // If this is a non-blocking socket, check errno for EINPROGRESS and if set we've got a timeout, wait the appropriate time... - if errno == EINPROGRESS { - - if timeout > 0 { - - // Set up for the select call... - var writefds = fd_set() - writefds.zero() - writefds.set(socketDescriptor!) - - var timer = timeval() - - // First get seconds... - let secs = Int(Double(timeout / 1000)) - timer.tv_sec = secs - - // Now get the leftover millisecs... - let msecs = Int32(Double(timeout % 1000)) - - // Note: timeval expects microseconds, convert now... - let uSecs = msecs * 1000 - - // Now the leftover microseconds... - #if os(Linux) - timer.tv_usec = Int(uSecs) - #else - timer.tv_usec = Int32(uSecs) - #endif - - let count = select(socketDescriptor! + Int32(1), nil, &writefds, nil, &timer) - if count < 0 { - - throw Error(code: Socket.SOCKET_ERR_SELECT_FAILED, reason: self.lastError()) - } - - // If the socket is writable, we're probably connected, but check anyway to be sure... - // Otherwise, we've timed out waiting to connect. - if writefds.isSet(socketDescriptor!) { - - // Check the socket... - var result: Int = 0 - var resultLength = socklen_t(MemoryLayout.size) - if getsockopt(socketDescriptor!, SOL_SOCKET, SO_ERROR, &result, &resultLength) < 0 { - - throw Error(code: Socket.SOCKET_ERR_GETSOCKOPT_FAILED, reason: self.lastError()) - } - - // Check the result of the socket connect... - if result == 0 { - - // Success, we're connected, clear status and break out of the loop... - status = 0 - break - } - - } else { - - throw Error(code: Socket.SOCKET_ERR_CONNECT_TIMEOUT, reason: self.lastError()) - } - } - } - - // Close the socket that was opened... Protocol family may have changed... - #if os(Linux) - _ = Glibc.close(socketDescriptor!) - #else - _ = Darwin.close(socketDescriptor!) - #endif - socketDescriptor = nil - info = info?.pointee.ai_next - } - - // Throw if there is a status error... - if status != 0 || socketDescriptor == nil { - - if socketDescriptor != nil { - #if os(Linux) - _ = Glibc.close(socketDescriptor!) - #else - _ = Darwin.close(socketDescriptor!) - #endif - } - throw Error(code: Socket.SOCKET_ERR_GETADDRINFO_FAILED, reason: self.lastError()) - } - - // Close the existing socket (if open) before replacing it... - if self.socketfd != Socket.SOCKET_INVALID_DESCRIPTOR { - - self.close(withSSLCleanup: false) - } - - self.socketfd = socketDescriptor! - socketDescriptor = nil // clear out the temporary value -- our defer() can check for that alone - - self.isConnected = true - var address: Address - if info!.pointee.ai_family == Int32(AF_INET6) { - - var addr = sockaddr_in6() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv6(addr) - - } else if info!.pointee.ai_family == Int32(AF_INET) { - - var addr = sockaddr_in() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv4(addr) - - } else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine connected socket protocol family.") - } - - try self.ignoreSIGPIPE(on: self.socketfd) - - try self.signature = Signature( - protocolFamily: Int32(info!.pointee.ai_family), - socketType: info!.pointee.ai_socktype, - proto: info!.pointee.ai_protocol, - address: address, - hostname: host, - port: port) - - // Check to see if the socket is supposed to be blocking or non-blocking and adjust the new socket... - if self.isBlocking && timeout > 0 { - - // Socket supposed to be blocking but we've changed it to non-blocking because - // a timeout was requested... Got to change it back before proceeding... - let flags = fcntl(self.socketfd, F_GETFL) - if flags < 0 { - - throw Error(code: Socket.SOCKET_ERR_GET_FCNTL_FAILED, reason: self.lastError()) - } - - let result = fcntl(self.socketfd, F_SETFL, flags & ~O_NONBLOCK) - if result < 0 { - - throw Error(code: Socket.SOCKET_ERR_SET_FCNTL_FAILED, reason: self.lastError()) - } - } - - // Let the delegate do post connect handling and verification... - do { - - if self.delegate != nil { - try self.delegate?.onConnect(socket: self) - self.signature?.isSecure = true - } - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - } - - /// - /// Connects to the named host on the specified port. - /// - /// - Parameters path: Path to connect to. - /// - public func connect(to path: String) throws { - - // Make sure this is a UNIX socket... - guard let sig = self.signature, sig.protocolFamily == .unix else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Socket has the wrong protocol, it must be UNIX socket") - } - - // The socket must've been created and must not be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_ALREADY_CONNECTED, reason: "Socket is already connected") - } - - // Create the signature... - self.signature = try Signature(socketType: .stream, proto: .unix, path: path) - guard let signature = self.signature else { - - throw Error(code: Socket.SOCKET_ERR_MISSING_CONNECTION_DATA, reason: "Unable to access connection data.") - } - - // Now, do the connection using the supplied address... - let (addrPtr, addrLen) = try signature.unixAddress() - defer { - #if swift(>=4.1) - addrPtr.deallocate() - #else - addrPtr.deallocate(capacity: addrLen) - #endif - } - - let rc = addrPtr.withMemoryRebound(to: sockaddr.self, capacity: 1) { - - (p: UnsafeMutablePointer) -> Int32 in - - #if os(Linux) - return Glibc.connect(self.socketfd, p, socklen_t(addrLen)) - #else - return Darwin.connect(self.socketfd, p, socklen_t(addrLen)) - #endif - } - if rc < 0 { - - throw Error(code: Socket.SOCKET_ERR_CONNECT_FAILED, reason: self.lastError()) - } - - self.isConnected = true - } - - /// - /// Connect to the address or hostname/port or path pointed to by the signature passed. - /// - /// - Parameter signature: Signature containing the address hostname/port to connect to. - /// - public func connect(using signature: Signature) throws { - - // Make sure we've got a valid socket... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // Ensure we've got a proper address... - // Handle the Unix style socket first... - if let path = signature.path { - - try self.connect(to: path) - return - } - - if let address = signature.address { - - // Tell the delegate to initialize as a client... - do { - - try self.delegate?.initialize(asServer: false) - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - - // Now, do the connection using the supplied address... - let rc = address.withSockAddrPointer { sockaddr, length -> Int32 in - #if os(Linux) - return Glibc.connect(self.socketfd, sockaddr, length) - #else - return Darwin.connect(self.socketfd, sockaddr, length) - #endif - } - - if rc < 0 { - - throw Error(code: Socket.SOCKET_ERR_CONNECT_FAILED, reason: self.lastError()) - } - - // Complete the signature... - if signature.hostname != nil, signature.port != Socket.SOCKET_INVALID_PORT { - - self.signature = signature - self.isConnected = true - - } else if let (hostname, port) = Socket.hostnameAndPort(from: signature.address!) { - - var sig = signature - sig.hostname = hostname - sig.port = Int32(port) - self.signature = sig - self.isConnected = true - } - - // Let the delegate do post connect handling and verification... - do { - - if self.delegate != nil { - try self.delegate?.onConnect(socket: self) - self.signature?.isSecure = true - } - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - - return - } - - // If here, we'll check to see if we've got a hostname and port and if so, try to connect using it... - if let hostname = signature.hostname, signature.port != Socket.SOCKET_INVALID_PORT { - // Connect using hostname and port.... - try self.connect(to: hostname, port: signature.port) - return - } - - // No such luck, don't have enough info to initiate a connection... - throw Error(code: Socket.SOCKET_ERR_MISSING_CONNECTION_DATA, reason: "Unable to access connection data.") - } - - // MARK: -- Listen - - // MARK: --- TCP - - /// - /// Listen on a port, limiting the maximum number of pending connections. - /// - /// - Parameters: - /// - port: The port to listen on. - /// - maxBacklogSize: The maximum size of the queue containing pending connections. Default is *Socket.SOCKET_DEFAULT_MAX_BACKLOG*. - /// - allowPortReuse: Set to `true` to allow the port to be reused. `false` otherwise. Default is `true`. - /// - node: Can be set to listen on a *specific address*. The value passed is an *optional String* containing the numerical - /// network address (for IPv4, numbers and dots notation, for iPv6, hexidecimal strting). If `nil`, a suitable address - /// will be used. - /// - public func listen(on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG, allowPortReuse: Bool = true, node: String? = nil) throws { - - // Make sure we've got a valid socket... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // Set a flag so that this address can be re-used immediately after the connection - // closes. (TCP normally imposes a delay before an address can be re-used.) - var on: Int32 = 1 - if setsockopt(self.socketfd, SOL_SOCKET, SO_REUSEADDR, &on, socklen_t(MemoryLayout.size)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - - // Allow port reuse if the caller desires... - if allowPortReuse { - - // SO_REUSEPORT allows completely duplicate bindings by multiple processes if they - // all set SO_REUSEPORT before binding the port. This option permits multiple - // instances of a program to each receive UDP/IP multicast or broadcast datagrams - // destined for the bound port. - if setsockopt(self.socketfd, SOL_SOCKET, SO_REUSEPORT, &on, socklen_t(MemoryLayout.size)) < 0 { - - // Setting of this option on WSL (Windows Subsytem for Linux) is not supported. Check for - // the appropriate errno value and if set, ignore the error... - if errno != ENOPROTOOPT { - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - } - } - - // Get the signature for the socket... - guard let sig = self.signature else { - - throw Error(code: Socket.SOCKET_ERR_INTERNAL, reason: "Socket signature not found.") - } - - // Configure ipv6 socket so that it can share ports with ipv4 on the same port. - if sig.protocolFamily == .inet6 && sig.proto == .tcp { - if setsockopt(self.socketfd, Int32(IPPROTO_IPV6), IPV6_V6ONLY, &on, socklen_t(MemoryLayout.size)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - } - - // No SSL over UDP... - if sig.socketType != .datagram && sig.proto != .udp { - - // Tell the delegate to initialize as a server... - do { - - try self.delegate?.initialize(asServer: true) - - } catch let error { - - guard let sslError = error as? SSLError else { - - throw error - } - - throw Error(with: sslError) - } - } - - // Create the hints for our search... - #if os(Linux) - var hints = addrinfo( - ai_flags: AI_PASSIVE, - ai_family: sig.protocolFamily.value, - ai_socktype: sig.socketType.value, - ai_protocol: 0, - ai_addrlen: 0, - ai_addr: nil, - ai_canonname: nil, - ai_next: nil) - #else - var hints = addrinfo( - ai_flags: AI_PASSIVE, - ai_family: sig.protocolFamily.value, - ai_socktype: sig.socketType.value, - ai_protocol: 0, - ai_addrlen: 0, - ai_canonname: nil, - ai_addr: nil, - ai_next: nil) - #endif - - var targetInfo: UnsafeMutablePointer? - - // Retrieve the info on our target... - let status: Int32 = getaddrinfo(node ?? nil, String(port), &hints, &targetInfo) - if status != 0 { - - var errorString: String - if status == EAI_SYSTEM { - errorString = String(validatingUTF8: strerror(errno)) ?? "Unknown error code." - } else { - errorString = String(validatingUTF8: gai_strerror(errno)) ?? "Unknown error code." - } - throw Error(code: Socket.SOCKET_ERR_GETADDRINFO_FAILED, reason: errorString) - } - - // Defer cleanup of our target info... - defer { - - if targetInfo != nil { - freeaddrinfo(targetInfo) - } - } - - var info = targetInfo - var bound = false - - while info != nil { - - // Try to bind the socket to the address... - #if os(Linux) - if Glibc.bind(self.socketfd, info!.pointee.ai_addr, info!.pointee.ai_addrlen) == 0 { - - // Success... We've found our address... - bound = true - break - } - #else - if Darwin.bind(self.socketfd, info!.pointee.ai_addr, info!.pointee.ai_addrlen) == 0 { - - // Success... We've found our address... - bound = true - break - } - #endif - - // Try the next one... - info = info?.pointee.ai_next - } - - // Throw an error if we weren't able to bind to an address... - if !bound { - - throw Error(code: Socket.SOCKET_ERR_BIND_FAILED, reason: self.lastError()) - } - - // Save the address info... - var address: Address - - // If the port was set to zero, we need to retrieve the port that assigned by the OS... - if port == 0 { - guard let addressFromSockName = try Address(addressProvider: { (sockaddr, length) in - if getsockname(self.socketfd, sockaddr, length) != 0 { - throw Error(code: Socket.SOCKET_ERR_BIND_FAILED, reason: "Unable to determine listening socket address after bind.") - } - }) else { - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine listening socket protocol family.") - } - address = addressFromSockName - } else { - - if info!.pointee.ai_family == Int32(AF_INET6) { - - var addr = sockaddr_in6() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv6(addr) - - } else if info!.pointee.ai_family == Int32(AF_INET) { - - var addr = sockaddr_in() - memcpy(&addr, info!.pointee.ai_addr, Int(MemoryLayout.size)) - address = .ipv4(addr) - - } else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine listening socket protocol family.") - } - - } - - // Update our hostname and port... - if let (hostname, port) = Socket.hostnameAndPort(from: address) { - self.signature?.hostname = hostname - self.signature?.port = Int32(port) - } - - self.signature?.isBound = true - self.signature?.address = address - - // We don't actually listen for connections with a UDP socket, so we skip the next steps... - if sig.socketType == .datagram && sig.proto == .udp { - return - } - - // Now listen for connections... - #if os(Linux) - if Glibc.listen(self.socketfd, Int32(maxBacklogSize)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: self.lastError()) - } - #else - if Darwin.listen(self.socketfd, Int32(maxBacklogSize)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: self.lastError()) - } - #endif - - self.isListening = true - self.signature?.isSecure = self.delegate != nil ? true : false - } - - // MARK: --- UNIX - - /// - /// Listen on a path, limiting the maximum number of pending connections. - /// - /// - Parameters: - /// - path: The path to listen on. - /// - maxBacklogSize: The maximum size of the queue containing pending connections. Default is *Socket.SOCKET_DEFAULT_MAX_BACKLOG*. - /// - public func listen(on path: String, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) throws { - - // Make sure we've got a valid socket... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // Make sure this is a UNIX socket... - guard let sockSig = self.signature, sockSig.protocolFamily == .unix else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Socket has the wrong protocol, it must be a UNIX socket") - } - - // Set a flag so that this address can be re-used immediately after the connection - // closes. (TCP normally imposes a delay before an address can be re-used.) - var on: Int32 = 1 - if setsockopt(self.socketfd, SOL_SOCKET, SO_REUSEADDR, &on, socklen_t(MemoryLayout.size)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - - // Create the signature... - let sig = try Signature(socketType: .stream, proto: .unix, path: path) - guard let signature = sig else { - - throw Error(code:Socket.SOCKET_ERR_BAD_SIGNATURE_PARAMETERS, reason: "Socket contains invalid signature parameters") - } - - // Ensure the path doesn't exist... - #if os(Linux) - _ = Glibc.unlink(path) - #else - _ = Darwin.unlink(path) - #endif - - // Try to bind the socket to the address... - // Now, do the connection using the supplied address from the signature... - let (addrPtr, addrLen) = try signature.unixAddress() - defer { - #if swift(>=4.1) - addrPtr.deallocate() - #else - addrPtr.deallocate(capacity: addrLen) - #endif - } - - let rc = addrPtr.withMemoryRebound(to: sockaddr.self, capacity: 1) { - - (p: UnsafeMutablePointer) -> Int32 in - - #if os(Linux) - return Glibc.bind(self.socketfd, p, socklen_t(addrLen)) - #else - return Darwin.bind(self.socketfd, p, socklen_t(addrLen)) - #endif - } - - if rc < 0 { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: self.lastError()) - } - - // Now listen for connections... - #if os(Linux) - if Glibc.listen(self.socketfd, Int32(maxBacklogSize)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: self.lastError()) - } - #else - if Darwin.listen(self.socketfd, Int32(maxBacklogSize)) < 0 { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: self.lastError()) - } - #endif - - self.isListening = true - self.signature?.path = path - self.signature?.isBound = true - self.signature?.isSecure = false - self.signature?.address = signature.address - } - - // MARK: --- UDP - - /// - /// Listen for a message on a UDP socket. - /// - /// - Parameters: - /// - buffer: The buffer to return the data in. - /// - bufSize: The size of the buffer. - /// - port: Port to listen on. - /// - maxBacklogSize: The maximum size of the queue containing pending connections. Default is *Socket.SOCKET_DEFAULT_MAX_BACKLOG*. - /// - /// - Returns: Tuple containing the number of bytes read and the `Address` of the client who sent the data. - /// - public func listen(forMessage buffer: UnsafeMutablePointer, bufSize: Int, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) throws -> (bytesRead: Int, address: Address?) { - - // Make sure the buffer is valid... - if bufSize == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_BUFFER, reason: "Socket has an invalid buffer, the size is zero") - } - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Set up the socket for listening for a message unless we're already set up... - if !sig.isBound { - try self.listen(on: port, maxBacklogSize: maxBacklogSize) - } - - // If we're not bound, something went wrong... - guard self.signature?.isBound == true else { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: "") - } - - self.isListening = true - - return try self.readDatagram(into: buffer, bufSize: bufSize) - } - - /// - /// Listen for a message on a UDP socket. - /// - /// - Parameters: - /// - data: Data buffer to receive the data read. - /// - port: Port to listen on. - /// - maxBacklogSize: The maximum size of the queue containing pending connections. Default is *Socket.SOCKET_DEFAULT_MAX_BACKLOG*. - /// - /// - Returns: Tuple containing the number of bytes read and the `Address` of the client who sent the data. - /// - public func listen(forMessage data: NSMutableData, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) throws -> (bytesRead: Int, address: Address?) { - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram && sig.proto == .udp else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Set up the socket for listening for a message unless we're already set up... - if !sig.isBound { - try self.listen(on: port, maxBacklogSize: maxBacklogSize) - } - - // If we're not bound, something went wrong... - guard self.signature?.isBound == true else { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: "") - } - - self.isListening = true - - return try self.readDatagram(into: data) - } - - /// - /// Listen for a message on a UDP socket. - /// - /// - Parameters: - /// - data: Data buffer to receive the data read. - /// - port: Port to listen on. - /// - maxBacklogSize: The maximum size of the queue containing pending connections. Default is *Socket.SOCKET_DEFAULT_MAX_BACKLOG*. - /// - /// - Returns: Tuple containing the number of bytes read and the `Address` of the client who sent the data. - /// - public func listen(forMessage data: inout Data, on port: Int, maxBacklogSize: Int = Socket.SOCKET_DEFAULT_MAX_BACKLOG) throws -> (bytesRead: Int, address: Address?) { - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Set up the socket for listening for a message unless we're already set up... - if !sig.isBound { - try self.listen(on: port, maxBacklogSize: maxBacklogSize) - } - - // If we're not bound, something went wrong... - guard self.signature?.isBound == true else { - - throw Error(code: Socket.SOCKET_ERR_LISTEN_FAILED, reason: "") - } - - self.isListening = true - - return try self.readDatagram(into: &data) - } - - // MARK: -- Read - - // MARK: --- TCP/UNIX - - /// - /// Read data from the socket. - /// - /// - Parameters: - /// - buffer: The buffer to return the data in. - /// - bufSize: The size of the buffer. - /// - truncate: Whether the data should be truncated if there is more available data than could fit in `buffer`. - /// **Note:** If called with `truncate = true` unretrieved data will be returned on next `read` call. - /// - /// - Throws: `Socket.SOCKET_ERR_RECV_BUFFER_TOO_SMALL` if the buffer provided is too small and `truncate = false`. - /// Call again with proper buffer size (see `Error.bufferSizeNeeded`) or - /// use `readData(data: NSMutableData)`. - /// - /// - Returns: The number of bytes returned in the buffer. - /// - public func read(into buffer: UnsafeMutablePointer, bufSize: Int, truncate: Bool = false) throws -> Int { - - // Make sure the buffer is valid... - if bufSize == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_BUFFER, reason: "Socket has an invalid buffer, the size is zero") - } - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if !self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_NOT_CONNECTED, reason: "Socket is not connected") - } - - // See if we have cached data to send back... - if self.readStorage.length > 0 { - - if bufSize < self.readStorage.length { - - if truncate { - - memcpy(buffer, self.readStorage.bytes, bufSize) - - #if os(Linux) - // Workaround for apparent bug in NSMutableData - self.readStorage = NSMutableData(bytes: self.readStorage.bytes.advanced(by: bufSize), length:self.readStorage.length - bufSize) - #else - self.readStorage.replaceBytes(in: NSRange(location:0, length:bufSize), withBytes: nil, length: 0) - #endif - return bufSize - - } else { - - throw Error(bufferSize: self.readStorage.length) - } - } - - let returnCount = self.readStorage.length - - // - We've got data we've already read, copy to the caller's buffer... - memcpy(buffer, self.readStorage.bytes, self.readStorage.length) - - // - Reset the storage buffer... - self.readStorage.length = 0 - - return returnCount - } - - // Read all available bytes... - let count = try self.readDataIntoStorage() - - // Check for disconnect... - if count == 0 { - - return count - } - - // Did we get data? - var returnCount: Int = 0 - if self.readStorage.length > 0 { - - // Is the caller's buffer big enough? - if bufSize < self.readStorage.length { - - // It isn't should we just use the available space? - if truncate { - - // Yep, copy what storage we can and remove the bytes from the internal buffer. - memcpy(buffer, self.readStorage.bytes, bufSize) - - #if os(Linux) - // Workaround for apparent bug in NSMutableData - self.readStorage = NSMutableData(bytes: self.readStorage.bytes.advanced(by: bufSize), length:self.readStorage.length - bufSize) - #else - self.readStorage.replaceBytes(in: NSRange(location:0, length:bufSize), withBytes: nil, length: 0) - #endif - - return bufSize - - } else { - - // Nope, throw an exception telling the caller how big the buffer must be... - throw Error(bufferSize: self.readStorage.length) - } - } - - // - We've read data, copy to the callers buffer... - memcpy(buffer, self.readStorage.bytes, self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return returnCount - } - - /// - /// Read a string from the socket - /// - /// - Returns: String containing the data read from the socket. - /// - public func readString() throws -> String? { - - guard let data = NSMutableData(capacity: 2000) else { - - throw Error(code: Socket.SOCKET_ERR_INTERNAL, reason: "Unable to create temporary NSMutableData...") - } - - let rc = try self.read(into: data) - - guard let str = NSString(bytes: data.bytes, length: data.length, encoding: String.Encoding.utf8.rawValue), - rc > 0 else { - - throw Error(code: Socket.SOCKET_ERR_INTERNAL, reason: "Unable to convert data to NSString.") - } - - return String(describing: str) - } - - - /// - /// Read data from the socket. - /// - /// - Parameter data: The buffer to return the data in. - /// - /// - Returns: The number of bytes returned in the buffer. - /// - public func read(into data: NSMutableData) throws -> Int { - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if !self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_NOT_CONNECTED, reason: "Socket is not connected") - } - - // Read all available bytes... - let count = try self.readDataIntoStorage() - - // Did we get data? - var returnCount: Int = 0 - if count > 0 { - - data.append(self.readStorage.bytes, length: self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return returnCount - } - - /// - /// Read data from the socket. - /// - /// - Parameter data: The buffer to return the data in. - /// - /// - Returns: The number of bytes returned in the buffer. - /// - public func read(into data: inout Data) throws -> Int { - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - if !self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_NOT_CONNECTED, reason: "Socket is not connected") - } - - // Read all available bytes... - let count = try self.readDataIntoStorage() - - // Did we get data? - var returnCount: Int = 0 - if count > 0 { - - // - Yes, move to caller's buffer... - data.append(self.readStorage.bytes.assumingMemoryBound(to: UInt8.self), count: self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return returnCount - } - - // MARK: --- UDP - - /// - /// Read data from a UDP socket. - /// - /// - Parameters: - /// - buffer: The buffer to return the data in. - /// - bufSize: The size of the buffer. - /// - address: Address to write data to. - /// - /// - Returns: Tuple with the number of bytes returned in the buffer and the address they were received from. - /// - public func readDatagram(into buffer: UnsafeMutablePointer, bufSize: Int) throws -> (bytesRead: Int, address: Address?) { - - // Make sure the buffer is valid... - if bufSize == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_BUFFER, reason: "Socket has an invalid buffer, size is zero") - } - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Read all available bytes... - let (count, address) = try self.readDatagramIntoStorage() - - // Check for disconnect... - if count == 0 { - - return (count, nil) - } - - // Did we get data? - var returnCount: Int = 0 - if self.readStorage.length > 0 { - - // Is the caller's buffer big enough? - if bufSize < self.readStorage.length { - - // No, discard the excess data... - self.readStorage.length = bufSize - } - - // - We've read data, copy to the callers buffer... - memcpy(buffer, self.readStorage.bytes, self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return (returnCount, address) - } - - /// - /// Read data from a UDP socket. - /// - /// - Parameters: - /// - data: The buffer to return the data in. - /// - address: Address to write data to. - /// - /// - Returns: Tuple with the number of bytes returned in the buffer and the address they were received from. - /// - public func readDatagram(into data: NSMutableData) throws -> (bytesRead: Int, address: Address?) { - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Read all available bytes... - let (count, address) = try self.readDatagramIntoStorage() - - // Did we get data? - var returnCount: Int = 0 - if count > 0 { - - data.append(self.readStorage.bytes, length: self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return (returnCount, address) - } - - /// - /// Read data from a UDP socket. - /// - /// - Parameters: - /// - data: The buffer to return the data in. - /// - address: Address to write data to. - /// - /// - Returns: Tuple with the number of bytes returned in the buffer and the address they were received from. - /// - public func readDatagram(into data: inout Data) throws -> (bytesRead: Int, address: Address?) { - - // The socket must've been created... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "Socket has an invalid descriptor") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Read all available bytes... - let (count, address) = try self.readDatagramIntoStorage() - - // Did we get data? - var returnCount: Int = 0 - if count > 0 { - - // - Yes, move to caller's buffer... - data.append(self.readStorage.bytes.assumingMemoryBound(to: UInt8.self), count: self.readStorage.length) - - returnCount = self.readStorage.length - - // - Reset the storage buffer... - self.readStorage.length = 0 - } - - return (returnCount, address) - } - - // MARK: -- Write - - // MARK: --- TCP/UNIX - - /// - /// Write data to the socket. - /// - /// - Parameters: - /// - buffer: The buffer containing the data to write. - /// - bufSize: The size of the buffer. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from buffer: UnsafeRawPointer, bufSize: Int) throws -> Int { - - // Make sure the buffer is valid... - if bufSize == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_BUFFER, reason: "The buffer is not valid, its size is zero") - } - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket is not valid, it must be created and connected") - } - - if !self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_NOT_CONNECTED, reason: "The socket is not connected") - } - - var sent = 0 - var sendFlags: Int32 = 0 - #if os(Linux) - // Ignore SIGPIPE to avoid process termination if the reader has closed the connection. - // On Linux, we set the MSG_NOSIGNAL send flag. On OSX, we set SO_NOSIGPIPE during init(). - sendFlags = Int32(MSG_NOSIGNAL) - #endif - while sent < bufSize { - - var s = 0 - if self.delegate != nil { - - repeat { - - do { - - s = try self.delegate!.send(buffer: buffer.advanced(by: sent), bufSize: Int(bufSize - sent)) - - break - - } catch let error { - - guard let err = error as? SSLError else { - - throw error - } - - switch err { - - case .success: - break - - case .retryNeeded: - do { - - try wait(forRead: false) - - } catch let waitError { - - throw waitError - } - continue - - default: - throw Error(with: err) - } - - } - - } while true - - } else { - #if os(Linux) - s = Glibc.send(self.socketfd, buffer.advanced(by: sent), Int(bufSize - sent), sendFlags) - #else - s = Darwin.send(self.socketfd, buffer.advanced(by: sent), Int(bufSize - sent), sendFlags) - #endif - } - if s <= 0 { - - if errno == EAGAIN && !isBlocking { - - // We have written out as much as we can... - return sent - } - - // - Handle a connection reset by peer (ECONNRESET) and throw a different exception... - if errno == ECONNRESET { - self.remoteConnectionClosed = true - throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError()) - } - - throw Error(code: Socket.SOCKET_ERR_WRITE_FAILED, reason: self.lastError()) - } - sent += s - } - - return sent - } - - /// - /// Write data to the socket. - /// - /// - Parameter data: The NSData object containing the data to write. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from data: NSData) throws -> Int { - - // If there's no data in the NSData object, why bother? Fail silently... - if data.length == 0 { - return 0 - } - - return try write(from: data.bytes.assumingMemoryBound(to: UInt8.self), bufSize: data.length) - } - - /// - /// Write data to the socket. - /// - /// - Parameter data: The Data object containing the data to write. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from data: Data) throws -> Int { - - // If there's no data in the Data object, why bother? Fail silently... - if data.count == 0 { - return 0 - } -#if swift(>=5.0) - return try data.withUnsafeBytes() { [unowned self] (buffer: UnsafeRawBufferPointer) throws -> Int in - return try self.write(from: buffer.baseAddress!, bufSize: data.count) - } -#else - return try data.withUnsafeBytes() { [unowned self] (buffer: UnsafePointer) throws -> Int in - - return try self.write(from: buffer, bufSize: data.count) - } -#endif - - } - - /// - /// Write a string to the socket. - /// - /// - Parameter string: The string to write. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from string: String) throws -> Int { - - return try string.utf8CString.withUnsafeBufferPointer() { - - // The count returned by nullTerminatedUTF8 includes the null terminator... - return try self.write(from: $0.baseAddress!, bufSize: $0.count-1) - } - } - - // MARK: --- UDP - - /// - /// Write data to a UDP socket. - /// - /// - Parameters: - /// - buffer: The buffer containing the data to write. - /// - bufSize: The size of the buffer. - /// - address: Address to write data to. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from buffer: UnsafeRawPointer, bufSize: Int, to address: Address) throws -> Int { - - // If the remote connection has closed, disallow the operation... - if self.remoteConnectionClosed { - return 0 - } - - // Make sure the buffer is valid... - if bufSize == 0 { - - throw Error(code: Socket.SOCKET_ERR_INVALID_BUFFER, reason: "The buffer is not valid, its size is zero") - } - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket is not valid, it must be created and connected") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - return try address.withSockAddrPointer { addressPointer, addressLength -> Int in - var sent = 0 - var sendFlags: Int32 = 0 - #if os(Linux) - // Ignore SIGPIPE to avoid process termination if the reader has closed the connection. - // On Linux, we set the MSG_NOSIGNAL send flag. On OSX, we set SO_NOSIGPIPE during init(). - sendFlags = Int32(MSG_NOSIGNAL) - #endif - - while sent < bufSize { - - var s = 0 - #if os(Linux) - s = Glibc.sendto(self.socketfd, buffer.advanced(by: sent), Int(bufSize - sent), sendFlags, addressPointer, addressLength) - #else - s = Darwin.sendto(self.socketfd, buffer.advanced(by: sent), Int(bufSize - sent), sendFlags, addressPointer, addressLength) - #endif - - if s <= 0 { - - if errno == EAGAIN && !isBlocking { - - // We have written out as much as we can... - return sent - } - - // - Handle a connection reset by peer (ECONNRESET) and throw a different exception... - if errno == ECONNRESET { - self.remoteConnectionClosed = true - throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError()) - } - - throw Error(code: Socket.SOCKET_ERR_WRITE_FAILED, reason: self.lastError()) - } - sent += s - } - - return sent - } - } - - /// - /// Write data to a UDP socket. - /// - /// - Parameters: - /// - data: The NSData object containing the data to write. - /// - address: Address to write data to. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from data: NSData, to address: Address) throws -> Int { - - // Send the bytes... - return try write(from: data.bytes.assumingMemoryBound(to: UInt8.self), bufSize: data.length) - } - - /// - /// Write data to a UDP socket. - /// - /// - Parameters: - /// - data: The Data object containing the data to write. - /// - address: Address to write data to. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from data: Data, to address: Address) throws -> Int { - - // Send the bytes... -#if swift(>=5.0) - return try data.withUnsafeBytes() { [unowned self] (buffer: UnsafeRawBufferPointer) throws -> Int in - return try self.write(from: buffer.baseAddress!, bufSize: data.count, to: address) - } -#else - return try data.withUnsafeBytes() { [unowned self] (buffer: UnsafePointer) throws -> Int in - - return try self.write(from: buffer, bufSize: data.count, to: address) - } -#endif - } - - /// - /// Write a string to the UDP socket. - /// - /// - Parameters: - /// - string: The string to write. - /// - address: Address to write data to. - /// - /// - Returns: Integer representing the number of bytes written. - /// - @discardableResult public func write(from string: String, to address: Address) throws -> Int { - - return try string.utf8CString.withUnsafeBufferPointer() { - - // The count returned by nullTerminatedUTF8 includes the null terminator... - return try self.write(from: $0.baseAddress!, bufSize: $0.count-1, to: address) - } - } - - // MARK: -- Utility - - /// - /// Determines if this socket can be read from or written to. - /// - /// - Parameters: - /// - waitForever: True to wait forever, false to check and return. Default: false. - /// - timeout: Timeout (in msec) before returning. A timeout value of 0 will return immediately. - /// - /// - Returns: Tuple containing two boolean values, one for readable and one for writable. - /// - public func isReadableOrWritable(waitForever: Bool = false, timeout: UInt = 0) throws -> (readable: Bool, writable: Bool) { - - // The socket must've been created and must be connected... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket is not valid, it must be created and connected") - } - - if !self.isConnected { - - throw Error(code: Socket.SOCKET_ERR_NOT_CONNECTED, reason: "The socket is not connected") - } - - // Create a read and write file descriptor set for this socket... - var readfds = fd_set() - readfds.zero() - readfds.set(self.socketfd) - - var writefds = fd_set() - writefds.zero() - writefds.set(self.socketfd) - - // Do the wait... - var count: Int32 = 0 - if waitForever { - - // Wait forever for data... - count = select(self.socketfd + Int32(1), &readfds, &writefds, nil, nil) - - } else { - - // Default timeout of zero (i.e. don't wait)... - var timer = timeval() - - // But honor callers desires... - if timeout > 0 { - - // First get seconds... - let secs = Int(Double(timeout / 1000)) - timer.tv_sec = secs - - // Now get the leftover millisecs... - let msecs = Int32(Double(timeout % 1000)) - - // Note: timeval expects microseconds, convert now... - let uSecs = msecs * 1000 - - // Now the leftover microseconds... - #if os(Linux) - timer.tv_usec = Int(uSecs) - #else - timer.tv_usec = Int32(uSecs) - #endif - } - - // See if there's data on the socket... - count = select(self.socketfd + Int32(1), &readfds, &writefds, nil, &timer) - } - - // A count of less than zero indicates select failed... - if count < 0 { - - throw Error(code: Socket.SOCKET_ERR_SELECT_FAILED, reason: self.lastError()) - } - - // Return a tuple containing whether or not this socket is readable and/or writable... - return (readfds.isSet(self.socketfd), writefds.isSet(self.socketfd)) - } - - /// - /// Set blocking mode for socket. - /// - /// - Parameter shouldBlock: `True` to block, `false` to not. - /// - public func setBlocking(mode shouldBlock: Bool) throws { - - let flags = fcntl(self.socketfd, F_GETFL) - if flags < 0 { - - throw Error(code: Socket.SOCKET_ERR_GET_FCNTL_FAILED, reason: self.lastError()) - } - - var result: Int32 = 0 - if shouldBlock { - - result = fcntl(self.socketfd, F_SETFL, flags & ~O_NONBLOCK) - - } else { - - result = fcntl(self.socketfd, F_SETFL, flags | O_NONBLOCK) - } - - if result < 0 { - - throw Error(code: Socket.SOCKET_ERR_SET_FCNTL_FAILED, reason: self.lastError()) - } - - self.isBlocking = shouldBlock - } - - /// - /// Set read timeout. - /// - /// - Parameters: - /// - timeout: Timeout (in msec) before returning. A timeout value of 0 will return immediately. - /// - public func setReadTimeout(value: UInt = 0) throws { - - // Default timeout of zero (i.e. don't wait)... - var timer = timeval() - - // But honor callers desires... - if value > 0 { - - // First get seconds... - let secs = Int(Double(value / 1000)) - timer.tv_sec = secs - - // Now get the leftover millisecs... - let msecs = Int32(Double(value % 1000)) - - // Note: timeval expects microseconds, convert now... - let uSecs = msecs * 1000 - - // Now the leftover microseconds... - #if os(Linux) - timer.tv_usec = Int(uSecs) - #else - timer.tv_usec = Int32(uSecs) - #endif - } - - let result = setsockopt(self.socketfd, SOL_SOCKET, SO_RCVTIMEO, &timer, socklen_t(MemoryLayout.stride)) - - if result < 0 { - - throw Error(code: Socket.SOCKET_ERR_SET_RECV_TIMEOUT_FAILED, reason: self.lastError()) - } - } - - /// - /// Set write timeout. - /// - /// - Parameters: - /// - timeout: Timeout (in msec) before returning. A timeout value of 0 will return immediately. - /// - public func setWriteTimeout(value: UInt = 0) throws { - - // Default timeout of zero (i.e. don't wait)... - var timer = timeval() - - // But honor callers desires... - if value > 0 { - - // First get seconds... - let secs = Int(Double(value / 1000)) - timer.tv_sec = secs - - // Now get the leftover millisecs... - let msecs = Int32(Double(value % 1000)) - - // Note: timeval expects microseconds, convert now... - let uSecs = msecs * 1000 - - // Now the leftover microseconds... - #if os(Linux) - timer.tv_usec = Int(uSecs) - #else - timer.tv_usec = Int32(uSecs) - #endif - } - - let result = setsockopt(self.socketfd, SOL_SOCKET, SO_SNDTIMEO, &timer, socklen_t(MemoryLayout.stride)) - - if result < 0 { - - throw Error(code: Socket.SOCKET_ERR_SET_WRITE_TIMEOUT_FAILED, reason: self.lastError()) - } - } - - /// - /// Enable/disable broadcast on a UDP socket. - /// - /// - Parameters: - /// - enable: `true` to enable broadcast, `false` otherwise. - /// - public func udpBroadcast(enable: Bool) throws { - - // The socket must've been created and valid... - if self.socketfd == Socket.SOCKET_INVALID_DESCRIPTOR { - - throw Error(code: Socket.SOCKET_ERR_BAD_DESCRIPTOR, reason: "The socket is not valid, it must be created and connected") - } - - // The socket must've been created for UDP... - guard let sig = self.signature, - sig.socketType == .datagram else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "This is not a UDP socket.") - } - - // Turn on or off UDP broadcasting... - var on: Int32 = enable ? 1 : 0 - if setsockopt(self.socketfd, SOL_SOCKET, SO_BROADCAST, &on, socklen_t(MemoryLayout.size)) < 0 { - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - } - - // MARK: Private Functions - - /// - /// Closes the current socket. - /// - /// - Parameters: - /// - withSSLCleanup: `True` to deinitialize the *SSLService* if present. - /// - private func close(withSSLCleanup: Bool) { - - if self.socketfd != Socket.SOCKET_INVALID_DESCRIPTOR { - - // If we have a delegate, tell it to cleanup too... - if withSSLCleanup { - self.delegate?.deinitialize() - } - - // Note: if the socket is listening, we need to shut it down prior to closing - // or the socket will be left hanging until it times out. - #if os(Linux) - if self.isListening { - _ = Glibc.shutdown(self.socketfd, Int32(SHUT_RDWR)) - self.isListening = false - } - self.isConnected = false - _ = Glibc.close(self.socketfd) - #else - if self.isListening { - _ = Darwin.shutdown(self.socketfd, Int32(SHUT_RDWR)) - self.isListening = false - } - self.isConnected = false - _ = Darwin.close(self.socketfd) - #endif - - self.socketfd = Socket.SOCKET_INVALID_DESCRIPTOR - } - - if let _ = self.signature { - self.signature!.hostname = Socket.NO_HOSTNAME - self.signature!.port = Socket.SOCKET_INVALID_PORT - - // If we've got a path to a UNIX socket and we're listening... - // Delete the file represented by the path as this listener - // is no longer available. - if self.signature!.path != nil && self.isListening { - #if os(Linux) - _ = Glibc.unlink(self.signature!.path!) - #else - _ = Darwin.unlink(self.signature!.path!) - #endif - } - self.signature!.path = nil - self.signature!.isSecure = false - } - } - - /// - /// Private function that reads all available data on an open socket into storage. - /// - /// - Returns: number of bytes read. - /// - private func readDataIntoStorage() throws -> Int { - - // Initialize the buffer... - #if swift(>=4.1) - self.readBuffer.initialize(to: 0x0) - #else - self.readBuffer.initialize(to: 0x0, count: readBufferSize) - #endif - - var recvFlags: Int32 = 0 - if self.readStorage.length > 0 { - recvFlags |= Int32(MSG_DONTWAIT) - } - - // Read all the available data... - var count: Int = 0 - repeat { - - if self.delegate == nil { - - #if os(Linux) - count = Glibc.recv(self.socketfd, self.readBuffer, self.readBufferSize, recvFlags) - #else - count = Darwin.recv(self.socketfd, self.readBuffer, self.readBufferSize, recvFlags) - #endif - - } else { - - repeat { - - do { - - count = try self.delegate!.recv(buffer: self.readBuffer, bufSize: self.readBufferSize) - - break - - } catch let error { - - guard let err = error as? SSLError else { - - throw error - } - - switch err { - - case .success: - break - - case .retryNeeded: - do { - - try wait(forRead: true) - - } catch let waitError { - - throw waitError - } - continue - - default: - throw Error(with: err) - } - - } - - } while true - - } - // Check for error... - if count < 0 { - - switch errno { - - // - Could be an error, but if errno is EAGAIN or EWOULDBLOCK (if a non-blocking socket), - // it means there was NO data to read... - case EWOULDBLOCK, EAGAIN: - return self.readStorage.length - - case ECONNRESET: - // - Handle a connection reset by peer (ECONNRESET) and throw a different exception... - self.remoteConnectionClosed = true - throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError()) - - default: - // - Something went wrong... - throw Error(code: Socket.SOCKET_ERR_RECV_FAILED, reason: self.lastError()) - } - - } - - if count == 0 { - - self.remoteConnectionClosed = true - return 0 - } - - // Save the data in the buffer... - self.readStorage.append(self.readBuffer, length: count) - - // Didn't fill the buffer so we've got everything available... - if count < self.readBufferSize { - - break - } - - } while count > 0 - - return self.readStorage.length - } - - /// - /// Private function that reads all available data on an open socket into storage. - /// - /// - Returns: number of bytes read. - /// - private func readDatagramIntoStorage() throws -> (bytesRead: Int, fromAddress: Address?) { - - // Initialize the buffer... - #if swift(>=4.1) - self.readBuffer.initialize(to: 0x0) - #else - self.readBuffer.initialize(to: 0x0, count: readBufferSize) - #endif - var recvFlags: Int32 = 0 - if self.readStorage.length > 0 { - recvFlags |= Int32(MSG_DONTWAIT) - } - - do { - guard let address = try Address(addressProvider: { (addresssPointer, addressLengthPointer) in - - // Read all the available data... - #if os(Linux) - let count = Glibc.recvfrom(self.socketfd, self.readBuffer, self.readBufferSize, recvFlags, addresssPointer, addressLengthPointer) - #else - let count = Darwin.recvfrom(self.socketfd, self.readBuffer, self.readBufferSize, recvFlags, addresssPointer, addressLengthPointer) - #endif - - // Check for error... - if count < 0 { - - // - Could be an error, but if errno is EAGAIN or EWOULDBLOCK (if a non-blocking socket), - // it means there was NO data to read... - if errno == EAGAIN || errno == EWOULDBLOCK { - - throw OperationInterrupted.readDatagram(length: self.readStorage.length) - } - - // - Handle a connection reset by peer (ECONNRESET) and throw a different exception... - if errno == ECONNRESET { - self.remoteConnectionClosed = true - throw Error(code: Socket.SOCKET_ERR_CONNECTION_RESET, reason: self.lastError()) - } - - // - Something went wrong... - throw Error(code: Socket.SOCKET_ERR_RECV_FAILED, reason: self.lastError()) - } - - if count == 0 { - self.remoteConnectionClosed = true - throw OperationInterrupted.readDatagram(length: 0) - } - - // Save the data in the buffer... - self.readStorage.append(self.readBuffer, length: count) - }) else { - - throw Error(code: Socket.SOCKET_ERR_WRONG_PROTOCOL, reason: "Unable to determine receiving socket protocol family.") - } - - return (self.readStorage.length, address) - - } catch OperationInterrupted.readDatagram(let length) { - - return (length, nil) - } - } - - /// - /// Private function to wait for this instance to be either readable or writable. - /// - /// - Parameter forRead: `True` to wait for socket to be readable, `false` waits for it to be writable. - /// - private func wait(forRead: Bool) throws { - - repeat { - - let result = try self.isReadableOrWritable(waitForever: true) - - if forRead { - - if result.readable { - return - } else { - continue - } - - } else { - - if result.writable { - return - } else { - continue - } - } - - } while true - } - - /// - /// Private function to return the last error based on the value of errno. - /// - /// - Returns: String containing relevant text about the error. - /// - private func lastError() -> String { - - return String(validatingUTF8: strerror(errno)) ?? "Error: \(errno)" - } - - /// - /// Private function to set **NOSIGPIPE** on a socket. **No-op on Linux.** - /// - /// - Parameter fd: The socket file descriptor upon which to act. - /// - private func ignoreSIGPIPE(on fd: Int32) throws { - - #if !os(Linux) - - // Set the new socket to ignore SIGPIPE to avoid dying on interrupted connections... - // Note: Linux does not support the SO_NOSIGPIPE option. Instead, we use the - // MSG_NOSIGNAL flags passed to send. See the write() functions below. - var on: Int32 = 1 - if setsockopt(self.socketfd, SOL_SOCKET, SO_NOSIGPIPE, &on, socklen_t(MemoryLayout.size)) < 0 { - throw Error(code: Socket.SOCKET_ERR_SETSOCKOPT_FAILED, reason: self.lastError()) - } - - #endif - } -} diff --git a/Pods/BlueSocket/Sources/Socket/SocketProtocols.swift b/Pods/BlueSocket/Sources/Socket/SocketProtocols.swift deleted file mode 100644 index e718529..0000000 --- a/Pods/BlueSocket/Sources/Socket/SocketProtocols.swift +++ /dev/null @@ -1,210 +0,0 @@ -// -// SocketProtocols.swift -// BlueSocket -// -// Created by Bill Abt on 1/7/16. -// Copyright © 2016 IBM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -// MARK: Reader - -/// -/// Socket reader protocol -/// -public protocol SocketReader { - - /// - /// Reads a string. - /// - /// - Returns: Optional **String** - /// - func readString() throws -> String? - - /// - /// Reads all available data into an Data object. - /// - /// - Parameter data: **Data** object to contain read data. - /// - /// - Returns: Integer representing the number of bytes read. - /// - func read(into data: inout Data) throws -> Int - - /// - /// Reads all available data into an **NSMutableData** object. - /// - /// - Parameter data: **NSMutableData** object to contain read data. - /// - /// - Returns: Integer representing the number of bytes read. - /// - func read(into data: NSMutableData) throws -> Int -} - -// MARK: Writer - -/// -/// Socket writer protocol -/// -public protocol SocketWriter { - - /// - /// Writes data from **Data** object. - /// - /// - Parameter data: **Data** object containing the data to be written. - /// - @discardableResult func write(from data: Data) throws -> Int - - /// - /// Writes data from **NSData** object. - /// - /// - Parameter data: **NSData** object containing the data to be written. - /// - @discardableResult func write(from data: NSData) throws -> Int - - /// - /// Writes a string - /// - /// - Parameter string: **String** data to be written. - /// - @discardableResult func write(from string: String) throws -> Int -} - -// MARK: SSLServiceDelegate - -/// -/// SSL Service Delegate Protocol -/// -public protocol SSLServiceDelegate { - - /// - /// Initialize SSL Service - /// - /// - Parameter asServer: `True` for initializing a server, otherwise a client. - /// - func initialize(asServer: Bool) throws - - /// - /// Deinitialize SSL Service - /// - func deinitialize() - - /// - /// Processing on acceptance from a listening socket - /// - /// - Parameter socket: The connected Socket instance. - /// - func onAccept(socket: Socket) throws - - /// - /// Processing on connection to a listening socket - /// - /// - Parameter socket: The connected Socket instance. - /// - func onConnect(socket: Socket) throws - - /// - /// Low level writer - /// - /// - Parameters: - /// - buffer: Buffer pointer. - /// - bufSize: Size of the buffer. - /// - /// - Returns the number of bytes written. Zero indicates SSL shutdown, less than zero indicates error. - /// - func send(buffer: UnsafeRawPointer, bufSize: Int) throws -> Int - - /// - /// Low level reader - /// - /// - Parameters: - /// - buffer: Buffer pointer. - /// - bufSize: Size of the buffer. - /// - /// - Returns the number of bytes read. Zero indicates SSL shutdown, less than zero indicates error. - /// - func recv(buffer: UnsafeMutableRawPointer, bufSize: Int) throws -> Int - - #if os(Linux) - - // MARK: ALPN - - /// - /// Add a protocol to the list of supported ALPN protocol names. E.g. 'http/1.1' and 'h2'. - /// - /// - Parameters: - /// - proto: The protocol name to be added (e.g. 'h2'). - /// - func addSupportedAlpnProtocol(proto: String) - - /// - /// The negotiated ALPN protocol that has been agreed upon during the handshaking phase. - /// Will be `nil` if ALPN hasn't been used or requestsed protocol is not available. - /// - var negotiatedAlpnProtocol: String? { get } - - #endif - -} - -// MARK: SSLError - -/// -/// SSL Service Error -/// -public enum SSLError: Swift.Error, CustomStringConvertible { - - /// Success - case success - - /// Retry needed - case retryNeeded - - /// Failure with error code and reason - case fail(Int, String) - - /// The error code itself - public var errCode: Int { - - switch self { - - case .success: - return 0 - - case .retryNeeded: - return -1 - - case .fail(let errCode, _): - return Int(errCode) - } - } - - /// Error description - public var description: String { - - switch self { - - case .success: - return "Success" - - case .retryNeeded: - return "Retry operation" - - case .fail(_, let reason): - return reason - } - } -} - diff --git a/Pods/BlueSocket/Sources/Socket/SocketUtils.swift b/Pods/BlueSocket/Sources/Socket/SocketUtils.swift deleted file mode 100644 index b77fd3a..0000000 --- a/Pods/BlueSocket/Sources/Socket/SocketUtils.swift +++ /dev/null @@ -1,219 +0,0 @@ -// -// SocketUtils.swift -// BlueSocket -// -// Created by Bill Abt on 11/19/15. -// Copyright © 2016 IBM. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#if os(macOS) || os(iOS) || os(tvOS) -import Darwin -#elseif os(Linux) -import Glibc -#endif - -import Foundation - -// -// Great help with this from -// https://blog.obdev.at/representing-socket-addresses-in-swift-using-enums/ -// -extension Socket.Address { - - /// - /// Call a low level socket function using the specified socket address pointer. - /// - /// - Parameters: - /// - body: The closure containing the call to the low level function. - /// - /// - Returns: The result of executing the closure. - /// - func withSockAddrPointer(body: (UnsafePointer, socklen_t) throws -> Result) rethrows -> Result { - - /// - /// Internal function to call do the cast and call to the closure. - /// - /// - Parameter: Closure body. - /// - /// - Returns: Result of executing the closure. - /// - func castAndCall(_ address: T, _ body: (UnsafePointer, socklen_t) throws -> Result) rethrows -> Result { - var localAddress = address // We need a `var` here for the `&`. - return try withUnsafePointer(to: &localAddress) { - return try $0.withMemoryRebound(to: sockaddr.self, capacity: 1, { - return try body($0, socklen_t(MemoryLayout.size)) - }) - } - } - - switch self { - - case .ipv4(let address): - return try castAndCall(address, body) - - case .ipv6(let address): - return try castAndCall(address, body) - - case .unix(let address): - return try castAndCall(address, body) - - } - } -} - -extension Socket.Address { - - /// - /// Creates a Socket.Address - /// - /// - Parameters: - /// - addressProvider: Tuple containing pointers to the sockaddr and its length. - /// - /// - Returns: Newly initialized Socket.Address. - /// - init?(addressProvider: (UnsafeMutablePointer, UnsafeMutablePointer) throws -> Void) rethrows { - - var addressStorage = sockaddr_storage() - var addressStorageLength = socklen_t(MemoryLayout.size(ofValue: addressStorage)) - try withUnsafeMutablePointer(to: &addressStorage) { - try $0.withMemoryRebound(to: sockaddr.self, capacity: 1) { addressPointer in - try withUnsafeMutablePointer(to: &addressStorageLength) { addressLengthPointer in - try addressProvider(addressPointer, addressLengthPointer) - } - } - } - - switch Int32(addressStorage.ss_family) { - case AF_INET: - self = withUnsafePointer(to: &addressStorage) { - return $0.withMemoryRebound(to: sockaddr_in.self, capacity: 1) { - return Socket.Address.ipv4($0.pointee) - } - } - case AF_INET6: - self = withUnsafePointer(to: &addressStorage) { - return $0.withMemoryRebound(to: sockaddr_in6.self, capacity: 1) { - return Socket.Address.ipv6($0.pointee) - } - } - case AF_UNIX: - self = withUnsafePointer(to: &addressStorage) { - return $0.withMemoryRebound(to: sockaddr_un.self, capacity: 1) { - return Socket.Address.unix($0.pointee) - } - } - default: - return nil - } - } -} - -#if os(Linux) - - /// Arm archictecture only allows for 16 fds. - #if arch(arm) - let __fd_set_count = 16 - #else - let __fd_set_count = 32 - #endif - - extension fd_set { - - @inline(__always) - mutating func withCArrayAccess(block: (UnsafeMutablePointer) throws -> T) rethrows -> T { - return try withUnsafeMutablePointer(to: &__fds_bits) { - try block(UnsafeMutableRawPointer($0).assumingMemoryBound(to: Int32.self)) - } - } - } - -#else // not Linux on ARM - - // __DARWIN_FD_SETSIZE is number of *bits*, so divide by number bits in each element to get element count - // at present this is 1024 / 32 == 32 - let __fd_set_count = Int(__DARWIN_FD_SETSIZE) / 32 - - extension fd_set { - - @inline(__always) - mutating func withCArrayAccess(block: (UnsafeMutablePointer) throws -> T) rethrows -> T { - return try withUnsafeMutablePointer(to: &fds_bits) { - try block(UnsafeMutableRawPointer($0).assumingMemoryBound(to: Int32.self)) - } - } - } - -#endif - -extension fd_set { - - @inline(__always) - private static func address(for fd: Int32) -> (Int, Int32) { - var intOffset = Int(fd) / __fd_set_count - #if _endian(big) - if intOffset % 2 == 0 { - intOffset += 1 - } else { - intOffset -= 1 - } - #endif - let bitOffset = Int(fd) % __fd_set_count - let mask = Int32(bitPattern: UInt32(1 << bitOffset)) - return (intOffset, mask) - } - - /// - /// Zero the fd_set - /// - public mutating func zero() { - #if swift(>=4.1) - withCArrayAccess { $0.initialize(repeating: 0, count: __fd_set_count) } - #else - withCArrayAccess { $0.initialize(to: 0, count: __fd_set_count) } - #endif - } - - /// - /// Set an fd in an fd_set - /// - /// - Parameter fd: The fd to add to the fd_set - /// - public mutating func set(_ fd: Int32) { - let (index, mask) = fd_set.address(for: fd) - withCArrayAccess { $0[index] |= mask } - } - - /// - /// Clear an fd from an fd_set - /// - /// - Parameter fd: The fd to clear from the fd_set - /// - public mutating func clear(_ fd: Int32) { - let (index, mask) = fd_set.address(for: fd) - withCArrayAccess { $0[index] &= ~mask } - } - - /// - /// Check if an fd is present in an fd_set - /// - /// - Parameter fd: The fd to check - /// - /// - Returns: `True` if present, `false` otherwise. - /// - public mutating func isSet(_ fd: Int32) -> Bool { - let (index, mask) = fd_set.address(for: fd) - return withCArrayAccess { $0[index] & mask != 0 } - } -} diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock deleted file mode 100644 index 42bf62b..0000000 --- a/Pods/Manifest.lock +++ /dev/null @@ -1,40 +0,0 @@ -PODS: - - BlueSocket (1.0.52) - - RxBlocking (5.1.1): - - RxSwift (~> 5) - - RxCocoa (5.1.1): - - RxRelay (~> 5) - - RxSwift (~> 5) - - RxRelay (5.1.1): - - RxSwift (~> 5) - - RxSwift (5.1.1) - - RxTest (5.1.1): - - RxSwift (~> 5) - -DEPENDENCIES: - - BlueSocket - - RxBlocking (~> 5) - - RxCocoa (~> 5) - - RxSwift (~> 5) - - RxTest (~> 5) - -SPEC REPOS: - trunk: - - BlueSocket - - RxBlocking - - RxCocoa - - RxRelay - - RxSwift - - RxTest - -SPEC CHECKSUMS: - BlueSocket: 1acd943acb07b55905291d608649fcfbf8cbd57d - RxBlocking: 5f700a78cad61ce253ebd37c9a39b5ccc76477b4 - RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601 - RxRelay: d77f7d771495f43c556cbc43eebd1bb54d01e8e9 - RxSwift: 81470a2074fa8780320ea5fe4102807cb7118178 - RxTest: 711632d5644dffbeb62c936a521b5b008a1e1faa - -PODFILE CHECKSUM: 99deca2ca9e88817d84f606d070c9f31c01a0d5c - -COCOAPODS: 1.10.0.rc.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 5366029..0000000 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,3236 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 001010C53E1DC6BBCF012485920497B0 /* AsSingle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6778845A74EB8B74A40C7BC912847643 /* AsSingle.swift */; }; - 0024CE6A1DE87F16D33D1A18348EB51F /* ColdObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9DE8684B1E32151B349AC4C3BD0FB39 /* ColdObservable.swift */; }; - 00355718395C59ED8C381977C1FC8302 /* TestableObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0B560C68169CF08892FA2FB0562B80C /* TestableObserver.swift */; }; - 00F0817D74B5B5D3EBD04B2FDF815497 /* Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2323B58D158A6DD1B70E0C01A82D0250 /* Zip+arity.swift */; }; - 00FA1801533D853DDBCE33A57D28D648 /* PublishRelay+Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFB4FABD07CD59D4F94AA56C2F166D64 /* PublishRelay+Signal.swift */; }; - 016A4DDDA7932393216E3228AB332FFE /* Debounce.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD6C7230757C77AB256FE566C0829575 /* Debounce.swift */; }; - 028727FF536BF0B14F5A34D106857902 /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEC069B8B2E2182CF94B26FAC7D5103A /* Sequence.swift */; }; - 02B4224CE547E617A81BF34EF8CED6F4 /* RxBlocking-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BB6CEFFA20D51021E46594082017FF8 /* RxBlocking-dummy.m */; }; - 02C64A705AFBB72766D93EC1EF5CD60C /* UIScrollView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86CA65FAFADFF769BF2C013D4482126C /* UIScrollView+Rx.swift */; }; - 051508D26F56417C3C0A1CB690D2A80E /* Pods-PcVolumeControlUITests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D13EEC60488930A2BE8EA5A35BB19225 /* Pods-PcVolumeControlUITests-dummy.m */; }; - 052DD31A0DBCE60088D189DE2D2B16E3 /* RetryWhen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03CA2A7946DB7F1C458886EFE6C22714 /* RetryWhen.swift */; }; - 06504FFE7AB5C57B2E1626C35E42023A /* ControlEvent+Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 739B6586072863C18F6C1FA627125930 /* ControlEvent+Signal.swift */; }; - 070C93E7A528B165EE15AD7E82EAC5DC /* BooleanDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 687BE6D9BFA94187D5CAB410C60F381A /* BooleanDisposable.swift */; }; - 078528915ABA677900726FAE8A8D0D05 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 07AC0BB16FDD5E1F07581177EA2B968A /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 931EB10A575FB0180AB3B8D270F9BF62 /* SubscriptionDisposable.swift */; }; - 08512CDDFB37C15AEE6C5B1D463E0026 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82EA063964EBEA27D1BAE1B55D874A13 /* Disposable.swift */; }; - 0852333CE0B68F66F30D70F71C3C3EDF /* ObservableType+PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39A2E5CC10432212E8094E7AE8FE3147 /* ObservableType+PrimitiveSequence.swift */; }; - 088322E81AC101AC449C5BBCEBE462DA /* Socket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CACDCB7F01783F715B521DE6EF06C67 /* Socket.swift */; }; - 08A6DDF8C8858ECE6E1EA0912E1A6D37 /* First.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5CFBC3EB91E3A8009F3A6E5473CF14 /* First.swift */; }; - 0A15F6D793421163A92E18ED9E911F87 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 181CBB1C009684C3977A6C15AE440B9B /* Logging.swift */; }; - 0A42BD548A8D5A0800D7CDD82B41EFF0 /* UINavigationItem+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46436DD08BCF9F5A18AB7C70F83FB38 /* UINavigationItem+Rx.swift */; }; - 0AB3E0C7F041293384E513C0F7659943 /* AddRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6D2204E1F5D39D9E464AC69BD6FEF6B /* AddRef.swift */; }; - 0AD3E58CC964DFC9F2A57A40ADDDB041 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50482F5A113D6275248A9AC03F9CDA5A /* SkipWhile.swift */; }; - 0B6AAAE5D99A9B21991A0557A561DC22 /* Deferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = A13DC759F93839015BEB2246FCDFA805 /* Deferred.swift */; }; - 0C2AEEA5C30032AF2F9EC02C0128ED13 /* ControlEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F79FA00A6A46A94D6D1AFF1F7BFFA8D /* ControlEvent.swift */; }; - 0CF395D1004E69F1179C3858208194C9 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EB8E3160B0DB0E173919538EA7ECFF2 /* Bag.swift */; }; - 0DFDC400BF846697AA6EBE11578E8938 /* TestSchedulerVirtualTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF38FBA72F5B4A09A1C364C99BE93EF /* TestSchedulerVirtualTimeConverter.swift */; }; - 1065DC3E40BF6AB6265BBAF023890283 /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61A438B0595BA529862F9743A470E070 /* DisposeBase.swift */; }; - 10826D29F709FA504C1C2833C71F21B9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 108AD9AFB43B2E04CFA2A139925EF894 /* Event+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099E8B440B222A6AE621B3C654902672 /* Event+Equatable.swift */; }; - 108ED31E46AAAF5BB99993C62673B275 /* Pods-PcVolumeControlUITests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A4BD8970D67E3DD90F7934E8313595AE /* Pods-PcVolumeControlUITests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 12717CB375BB0264D40E4BF432018AC0 /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32E2E12FF808966D980F8B8F064F3394 /* CompositeDisposable.swift */; }; - 131B3320C9FEAC3E2D4E9D6FCEAB1669 /* RecursiveScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD106A8A5EC48162E34C74F0F8D068E8 /* RecursiveScheduler.swift */; }; - 1374413A4D7303DB7E1098FA230900AF /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6740716AB5E480DD1B9618635A89B2C1 /* SchedulerType.swift */; }; - 144B84C01342DD588EE98169B133057B /* NSView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 166A0CC13503947F6D46C3AA0196792C /* NSView+Rx.swift */; }; - 149F7625653E428DD27D2C6C6657BF8F /* AtomicInt.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB30B1587B70AC8F44EA652EE682E88C /* AtomicInt.swift */; }; - 15D0D8EE39393B4628502414BD95C248 /* NSObject+Rx+RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 851C579244CB1DB947EE2DA501458D89 /* NSObject+Rx+RawRepresentable.swift */; }; - 16318138193380BB984F425ED3ECCB95 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 164902FDBE0DFA02B59EBB10D8414AA6 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 340B4B8A27B28EDC76E34C0E1C7A509A /* DispatchQueueConfiguration.swift */; }; - 166128A64D180DD5E733D5FB2E319352 /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 480912712FCA3DA3AFAC55800DA606E2 /* ObserverType.swift */; }; - 16AB6246CF9F91EE1CB451A741537300 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA81CB87E410F5AF2D41B869CD499A90 /* InfiniteSequence.swift */; }; - 1760AF3E2CF96191F7758264E33AD9E6 /* BlueSocket-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 59EFC2D4069C6A578BF3DB7EE60F1616 /* BlueSocket-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 17B9CEBBD5764D362F71128009E4469A /* RxCocoa-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 73BBE312C3870BCDE55D9B078EE17E23 /* RxCocoa-dummy.m */; }; - 17FC91B142D50F14591274E65E0B9846 /* StartWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC5F8EB40237D39081796D6D290878A5 /* StartWith.swift */; }; - 18518C2595D036BBA6E40CEAD26C90EF /* BinaryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CEBF5062A57446C96C58A956CC92FB /* BinaryDisposable.swift */; }; - 18C782DE869CEA3E18E4D866BE29892E /* Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616DF0F168F14FB83D813C1D969335ED /* Timeout.swift */; }; - 1A8588D1B419DE1A3DB2D8A6A975E868 /* TestScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B8B4B83352419701DB8C6372C64CDDA /* TestScheduler.swift */; }; - 1B4D16DBC67DE093B1C676B478A840D0 /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC137B9D2C5A7F4B81587418A25F6D9C /* Reactive.swift */; }; - 1B57B0ECB4E176EFDD3882590110DE45 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 1DC827268B89EB2E8EEB6E80EA9CCD9E /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B4D7A0304C2AA8BBA54D3CC90D45FC9 /* Utils.swift */; }; - 1F6B55D049CA4A0F17091F158365273E /* SharedSequence+Operators+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = C79617BF9FCBFF1731059AC8EA88CDBD /* SharedSequence+Operators+arity.swift */; }; - 2059D8B5FFE163E510E12C5A6A2E61F0 /* SocketUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D21484AB05526AEB5AAC8FDCC446BF75 /* SocketUtils.swift */; }; - 20ABA3F900EAFCE434322581110ADEF2 /* SocketProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46DA9B774F2F6FA34DA8D996961ED06 /* SocketProtocols.swift */; }; - 2199F90999D502109900C03B92C3E539 /* Any+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE333EDD0DADA041038F3A19F4DA66 /* Any+Equatable.swift */; }; - 224162E63E07A1A93470F3C3D90C90E6 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09467A1E2AFCB6BADD58E02F55F6A4F9 /* Platform.Darwin.swift */; }; - 23A4EF746AB64504DEB5EFDBA5450492 /* RxCocoa-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FC2DC1AC4ADCF68A27B6F7202E10327 /* RxCocoa-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24ADAC3DBBF3422EEF81E3E1F009A639 /* WithLatestFrom.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E5999EF88C3D899FE8BFE72E0E8951 /* WithLatestFrom.swift */; }; - 24E2C0559433A57E7F0C0803B5244493 /* DefaultIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86F8264F204FF9728CE76CC2CA04937A /* DefaultIfEmpty.swift */; }; - 2533166320ACEE9728B4F16958FC90F8 /* UISearchBar+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B879DD34FC39A4CC9F6EAEB7445BBAB /* UISearchBar+Rx.swift */; }; - 2550B408EF306E05ED36C6AAB6837BF1 /* ControlProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 220456D17AD0859A62ACEBDB033E10BC /* ControlProperty.swift */; }; - 259ED997BBB03A0EB730545570FCD12B /* OperationQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83119221C3E965D4FE30DCF7A54071E4 /* OperationQueueScheduler.swift */; }; - 26140F377DA8ADCD09DEFB2967C2F527 /* Delay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79441A1750CE19E6B380E697D0D7B829 /* Delay.swift */; }; - 2691B5846201756629563EF3702BA217 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AC453398D54811E2D26DED8AE7F989F /* Errors.swift */; }; - 26D9B0739B8130FCDFA581139D0E1EFC /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B84E6AD26A488E4FC3B1A381B968AC10 /* DispatchQueue+Extensions.swift */; }; - 26DF8FD18ABF605B9A0ED6C8CCB15AD0 /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A7E8B9B962928D03BA5ABC87C3D3822 /* RecursiveLock.swift */; }; - 27E37AE40D404DFA7A4B0FE122789204 /* Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DDC66BB8BCE36CECDE5BA6A342376EC /* Driver.swift */; }; - 2885F5A85EB54DEEC9307749B0657E6D /* Using.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B1B702F762FF15B8EBFDD40A1C3F26 /* Using.swift */; }; - 28FEE3F61E1275C9E2E82FE7A97915D5 /* ObservableConvertibleType+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ED55174B34321A98809FD3DC84761D9 /* ObservableConvertibleType+Driver.swift */; }; - 290DB11F0FBE959448BD652816D8C5D8 /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF3724FA6EA3A343B5A587B0E20B7BB /* ToArray.swift */; }; - 29BC2CF35BA9356827A8ED717EBB186A /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5601C5B089E7DA00B58370D0FC120D7 /* Window.swift */; }; - 2A8FD3A693CCE3F0B20522C1DD4F82B3 /* RxCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 23D265A0A6313B6753EE030B326EFADD /* RxCocoa.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2C9DB6618E88BBFC33409F127A179632 /* Take.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9DEB3037153FAAF05EFF55933992778 /* Take.swift */; }; - 2E6BA7044FA76C5E185BC767E4D23FB3 /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D5625A644D7F35DC3122A8C34AE8C44 /* Throttle.swift */; }; - 2F4CD6F91A8A857FF4B3B9999ED49F7E /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30226535CC498A43D268D346D0376E31 /* InfiniteSequence.swift */; }; - 2FFABBE0D06F04E3AC19CA59B108BED0 /* Generate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDAF51E36E2E49A2CE5C7C225DFBE9FD /* Generate.swift */; }; - 303E0C92168D1B45A96EB56FA114AAB4 /* RxCollectionViewDataSourceProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EBDBA8FC1B6B915D20FB7BCF39F86FA /* RxCollectionViewDataSourceProxy.swift */; }; - 309554F1225D176EDAACA87A89168F4A /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6662F9FD685EDEFF18128FBF12A5853 /* TailRecursiveSink.swift */; }; - 3131E34C496127AB54417A72CCF9FFA7 /* AtomicInt.swift in Sources */ = {isa = PBXBuildFile; fileRef = C53D921AEFACB183CF6653D4DBDE8619 /* AtomicInt.swift */; }; - 31A03EE96F96218D0C4B01A5601D83EC /* Skip.swift in Sources */ = {isa = PBXBuildFile; fileRef = E757922DB463B4F6C4139D799D8188F2 /* Skip.swift */; }; - 3252EA0FD38EC25CC88D9716480FEE67 /* Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58AA9774E4130E068C4143DCE47E77B8 /* Subscription.swift */; }; - 32A9EDB5115AA69527FC18D43842B3E5 /* InvocableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24663DE5E1499CECC9AC55C674033FA6 /* InvocableType.swift */; }; - 3307BDF0CD783175D8B8E5D13E65B3C9 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7835E25BE79F606718DCBF49942D46 /* Platform.Linux.swift */; }; - 330DB3CAEB0F54399D764FC809B6C5ED /* UIStepper+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BCD7808A9ABABD4C8211067531A0651 /* UIStepper+Rx.swift */; }; - 33A0F4241786901D9FCFB1EE4F721D77 /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D843788095528E29F1214B5BCFD6CFE0 /* SynchronizedUnsubscribeType.swift */; }; - 3492924BB6DC68CCAED4C1142E7739A3 /* RxCocoa.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEC42B384C176F3FBB8E14A1BC104281 /* RxCocoa.swift */; }; - 352FC9B2FA639258CB77E7C0FB5F6840 /* RxPickerViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D598A83DEC75328A2A44744B3E7B41 /* RxPickerViewDelegateProxy.swift */; }; - 3543B45E5D92606752905CCE1737CE70 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5291EFE39BF2A9B4E10217FE9236D7E8 /* SwiftSupport.swift */; }; - 37159E819194F6FA9C48BFCD38F132B1 /* BehaviorRelay.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04DCFCD5917489D0B84218953AB52CA /* BehaviorRelay.swift */; }; - 3730C3B3838E32ABC80351B3D0B8921F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE80D5D46A21936442FD346C31626856 /* XCTest.framework */; }; - 37F572B1D4C35D5DE1AE90659641C34F /* UIAlertAction+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1563E317B323E3F76370769B9109D2D /* UIAlertAction+Rx.swift */; }; - 38970A50544688DDD6557737769CE86C /* UIRefreshControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20C3F40C837D8C31C01C9F2096CFB1D9 /* UIRefreshControl+Rx.swift */; }; - 395E7D6BF89E52E0B44E1129A1A93B3B /* SkipUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B97E75224814A71A8A8AFCD3536D66F /* SkipUntil.swift */; }; - 3B9E0F782DAA798342A01764B5423D5C /* RxTest-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 927825C3D1C54F29A91BC57C5D2EF38D /* RxTest-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3D88573155490741E0F535B6436A1193 /* Pods-PcVolumeControlTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 5207F4CB7D3CE803A751067C05FADCB4 /* Pods-PcVolumeControlTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3DB187D7166EE7E362D9DB8CD1642BE2 /* Producer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20EB781D77AEFC0011D94F24DA28F3B /* Producer.swift */; }; - 3DF06796726197AEE928AEE9C4B0510A /* RxSearchControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5C4DF39F9FAD8934D7D17B07A523428 /* RxSearchControllerDelegateProxy.swift */; }; - 3E7E4A485F70C759DBC3CF975C4FEA27 /* NSSlider+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA0DB824165FFF3867A11A35E647426 /* NSSlider+Rx.swift */; }; - 3EABFE825C3FFAF030663555D2C8080F /* UIDatePicker+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDDDCEEBC8E402CB7B1E298204F6AEAA /* UIDatePicker+Rx.swift */; }; - 3F5E886891D384105BE4158FE42DB549 /* BlockingObservable+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCE4663CDED2BA3A827DE9BA659AA19C /* BlockingObservable+Operators.swift */; }; - 401722C5C02E357B2FA0D25DEA091F99 /* CombineLatest+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DD66CDE89DD28213C55E98B69FB22 /* CombineLatest+arity.swift */; }; - 406947EA19A5E88DD007C8244BF05AA8 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBF810D29148F1F5301466D67B33FEAE /* Queue.swift */; }; - 41AFD30D5602865B660BFD4B81D66F7B /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 353624585E9506600A21FF8127232A63 /* SynchronizedDisposeType.swift */; }; - 4245BD4B8D48ABC33532FF8A51C847F3 /* TestableObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AB01AC1EE3267F3A6ED2EE30B7EE993 /* TestableObservable.swift */; }; - 439197DD2AAEE0595B8DA4474C4595CA /* BehaviorRelay+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07EA5134AF7CD060DC3BB4B3E7AE9A50 /* BehaviorRelay+Driver.swift */; }; - 44B0BF2665B93BA05D05FBE47BEF7B1B /* NSButton+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80351B824222A0C15393481E7AD8F68B /* NSButton+Rx.swift */; }; - 45AFB5D51C5929C8AB5858D694572F91 /* RxCocoaRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 7620351B28E8A341F448FBB95F32B7B0 /* RxCocoaRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 46DFBBF0E8909A488BF4D4CE03EE96C5 /* Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B10EAF3427C31A47AEF4576CF4D0D39 /* Merge.swift */; }; - 4AE58568D7FB26CB4BFEFFCD877CE69F /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F7D3B69E3AF3022081770EBECFC6401 /* DisposeBag.swift */; }; - 4B552609516064140427EEB49FA25216 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */; }; - 4C2E9FA8385F1C2C48555B0A65E5BEA2 /* Recorded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 098EA338ED568B0259919E2EED409E28 /* Recorded.swift */; }; - 4C3B5A8DA08F18DFE9C10D2BDA7D11A1 /* RxBlocking-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = DFCD7CC945B63AFA2DBFA9FB9E12AA67 /* RxBlocking-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4CDDE8B6539CCBEDC770B9E33D839F3C /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C782B445229E3ECDA116760525E46D4B /* RecursiveLock.swift */; }; - 4DAEB64861955FE51DC5DFD39B2A1C1D /* RxTableViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35CC61964335426092725FAFF66EAD20 /* RxTableViewDelegateProxy.swift */; }; - 50CA09012F4275296D278C498C72F906 /* SerialDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25AB16788DDFB81F872343984C07315 /* SerialDispatchQueueScheduler.swift */; }; - 5106BA525271A18C663077010DE6B5A9 /* Observable+Bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0D44B25231A947F6CB92AE86FF8003D /* Observable+Bind.swift */; }; - 519CF3AAEC307B5130BA02E8460DF541 /* _RXObjCRuntime.m in Sources */ = {isa = PBXBuildFile; fileRef = 30FE4976007E1812618427E7D50156AB /* _RXObjCRuntime.m */; }; - 51A4848D5778A42A3B6ED4F89BF6591E /* HistoricalSchedulerTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8034985B3EC17A7E2342F189A8E9CB5 /* HistoricalSchedulerTimeConverter.swift */; }; - 52C0835254BE9A54C26C05E8B7AC7448 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 914EE1F1ADA0DE328328CCBC5DC5CFAA /* Bag.swift */; }; - 52F4D44D7648170015E46320CE9CE425 /* ScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 423F60E8A2B399193EA0698C7B8FE4DB /* ScheduledItem.swift */; }; - 5385392A0813FB6EF0B2F0872AC03159 /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30830F72C5EF27D43304F584471C4218 /* PublishSubject.swift */; }; - 539A6B088FB388FE966FE0219B7B1619 /* TakeUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1684EA39AF315405DADFC3B55312F8 /* TakeUntil.swift */; }; - 5441B6F9D99E964B9DEF28E22DA186C3 /* NSObject+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31A0849E113149648B5B7EDE73C8C442 /* NSObject+Rx.swift */; }; - 54E3E7435B196D90946D6DB81E386250 /* SynchronizedOnType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F72A5AC6D55C67DC2497D003392DF72 /* SynchronizedOnType.swift */; }; - 551187685E606B1CA5478AACEC9882DF /* HotObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26E73CE14BAF3E57647F98CD373FE1F3 /* HotObservable.swift */; }; - 55C3BBF7346BD4FEC05801FFEE0C7A53 /* RxTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82E5DDD7234E6B2CD65D86DC6FFA4C69 /* RxTest.swift */; }; - 5615E75DEA2A72EC6D595861F179C410 /* Recorded+Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD87A13A8B9C153A3C6B9F4AEC4EA12 /* Recorded+Event.swift */; }; - 56608A2F1F1C86C132AC359E57E98FC4 /* RxTest-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 573737E40443ECB361FAE27B3F4FD968 /* RxTest-dummy.m */; }; - 5712FD6B8B944D951DA8A013B68E80E1 /* Completable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA2F982B0A4AB47A4BBD7E1C87B1B77D /* Completable.swift */; }; - 576714F3065A0965AECDFA02E202F951 /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 208033768002D1169CE4B6182DF60A3C /* AnyObserver.swift */; }; - 581460068D8BD0691BD67D4A95FF9A8B /* UITextView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BA85C8508DA2B3707CBD714AD735261 /* UITextView+Rx.swift */; }; - 5823BCC5E382DE702FBE07784AF8FC08 /* NotificationCenter+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 767F3C9AA8A5A5484ABC95488FC303F5 /* NotificationCenter+Rx.swift */; }; - 5865CDE318C87CAEA2C689C15BA40053 /* Dematerialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDED50D08B2D5C26ED0EF50C6008EC4C /* Dematerialize.swift */; }; - 58A215B8234F1616FEFBF883A7094D57 /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD6C733ABC5A0826C4EE51C10ACED04C /* Sample.swift */; }; - 593D382A4A7EEE47FDCAA668E5E3189D /* URLSession+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D9E991EE31AB6821D24FBA085FF567 /* URLSession+Rx.swift */; }; - 598FFFD4D64B8A54CD141F10274D8F4F /* RxRelay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83D73284DCEE4FE8C76234DE2ACCD393 /* RxRelay.framework */; }; - 59A6B0D9EEDC697D0013B02572F0FD7F /* Binder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 920EC7400A2B7EB2C40A30B5A7DD462B /* Binder.swift */; }; - 59ADA960FD6E41FEC7C3ADEAF7620D4C /* UITabBar+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15469A2777B60A2C46DB0212EDFB2224 /* UITabBar+Rx.swift */; }; - 5A2DD71DADD5BB1FA33948BFFF084DC3 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7EC4A07F640498E3C09CF04CA41F8AD /* InfiniteSequence.swift */; }; - 5A44C9CCB46537B7CB435E7531B114AB /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18925B68ED164CA96235E423631E2273 /* AnonymousObserver.swift */; }; - 5A8DE93ADDC0893F7BEBC2270CDB215D /* InvocableScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F1A45F65531AD9BC5F0C07C459A30B9 /* InvocableScheduledItem.swift */; }; - 5B26550079AB783C657ECDBF80F3713F /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DF60C44D5D9B4C6AB2D284F6BF01126 /* DispatchQueue+Extensions.swift */; }; - 5C1A0B9A6BDEC6800DE6E9CB15C17549 /* ShareReplayScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = F64080C1DC981269258F636EBF6F8B63 /* ShareReplayScope.swift */; }; - 5C76266AF24E20D1B75D898BA58921D8 /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2DBD42567365F39445A2168D560C3 /* ConcurrentMainScheduler.swift */; }; - 5CDE9F4B6E5C2CA57B28D5040F03F8CF /* Signal+Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35944A73E70B0BD8E6B7EF336209BA80 /* Signal+Subscription.swift */; }; - 5D02648BB692F6257886933D02A4A7EA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 5E3605A3BC245596B6DD17BBFCD55765 /* _RX.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A63C7D75B1C447583AB0AED13ABA5B8 /* _RX.m */; }; - 608126C71A7EF239FF580F12591EA453 /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D2F87CD2648E2E337CC65D7542690E8 /* ImmediateSchedulerType.swift */; }; - 6139EF22C6DB4872E39E5DF81528C7F4 /* Sink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72AC498A230F32F79390FA120F1A9F12 /* Sink.swift */; }; - 635E24A31EE03543A8FAFE0EC67A85DC /* UIImageView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10C4EF4AF0CBFFEA88F3BBF0E684121D /* UIImageView+Rx.swift */; }; - 637E7100E21DDC1CE80B56DB518EAEBA /* UINavigationController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E6BF0D3D58FA551004F59312E656C48 /* UINavigationController+Rx.swift */; }; - 6464287695ECCBB4CA2CB81462BF1178 /* NSImageView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E01A9A5EE0038D5E75A4B4414F26F09 /* NSImageView+Rx.swift */; }; - 6467FE4BA8A61320C4A98A4478485ECB /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27EDE187E0CD19195FC41A6F350FD7A8 /* Deprecated.swift */; }; - 6797FA90BF2145F3575358E2BF49B4F5 /* UIButton+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = E30D86B22BBC03C62DC23EB6F660153A /* UIButton+Rx.swift */; }; - 68A9C5850AF89F7E3B8AFEEAE2A97BB2 /* UITextField+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4789720F73E206BE3AF35D7F5062A684 /* UITextField+Rx.swift */; }; - 6A37ED23A4C262C8FFE7D6F4D2FBA4A9 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77BBA6073E58C9168975FB180E3331EC /* Zip.swift */; }; - 6A73395FCF548B859C849DB359563B02 /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B113B4194E7BA4E6A0BC8785C93064 /* DispatchQueue+Extensions.swift */; }; - 6B81D4FC3252EE13E3B4A619B4E9D22D /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DCE44F75A96600C8B474D9F159D745 /* Queue.swift */; }; - 6D89DFE34F972E59F89C9C14234BCC70 /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A3AD50DFFFECE8B61274269F68766AD /* Repeat.swift */; }; - 6D8C983C889E12263ED15991FBA5DE0A /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 270BE29C4EAB305B008CA0DCE0A4512E /* NopDisposable.swift */; }; - 6E5FD487F5200FFE41A8590F1C80D6A3 /* UISwitch+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E0689D9A311E9720BE7C70760E1795 /* UISwitch+Rx.swift */; }; - 6FFC834B3ABF3B9E83B812B33BFAEEBB /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BCF3EA68311835C0BD05ADC42BFEFF2 /* PriorityQueue.swift */; }; - 716FD05A624B0B9ECB0A8B8019BE000E /* RxTableViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2006D9E3BE92EFA8F0BC5BB5DCAE9F2E /* RxTableViewDataSourceType.swift */; }; - 71F9E7C80EB5DC3D8BABB4350B0465A9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 7223B0C44F333286E0DAA862662C57A2 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73D4277FE68534C0781645FD7E224A09 /* Disposables.swift */; }; - 72521FC1A240438582D88313DA2F71B3 /* Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4821A3514BD4C5BC6853EB5A79BB288 /* Signal.swift */; }; - 73787921025310FADF6EC42D60EF45B7 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E72977F6C509287602523CE31A31AECD /* Filter.swift */; }; - 73D4B8DBAA4775FA576C6E99DA74E9F5 /* ControlProperty+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B81A32278B219F44E7FADFB3B757FA83 /* ControlProperty+Driver.swift */; }; - 747BFC432635738E49B29E86EF568F32 /* UIActivityIndicatorView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5221C596A14A5F4D76684A2836EBF1E4 /* UIActivityIndicatorView+Rx.swift */; }; - 74872B2FC64CC6125CCEF48562B0671E /* ControlTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76A5767868EEC85D18A54572FBCD81A /* ControlTarget.swift */; }; - 74969DCBAFCC54CA860A6ACCE4A89EBE /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF93C101A10F05DD891B341CE8772CA2 /* Queue.swift */; }; - 74B09E17259334D41B64EE1DC7E64743 /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F924BD66C536AFCE3DC9F9164E2E9C0B /* Cancelable.swift */; }; - 750F53C06AD83AE44E565E99A95BB98D /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F36F006737B6061F5654E714C6546A1 /* PriorityQueue.swift */; }; - 756CBE2332DE2C616261010E9892D546 /* DelaySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F067D39E1B6B85C3377ACB8B664960C /* DelaySubscription.swift */; }; - 760178B71CDA56FA10A78568F286086C /* ObservableConvertibleType+SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = B523BEA6A1E0C0AA62A4EE54B9691165 /* ObservableConvertibleType+SharedSequence.swift */; }; - 77EA69EA20A9D176F698D8B204F6A89C /* XCTest+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66C34338099F88821AA4C25FF25C001C /* XCTest+Rx.swift */; }; - 796616B2692253493BC8674B1FB367FE /* RxTableViewDataSourceProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73BCCC1B87080B021E438BDB1235C9A2 /* RxTableViewDataSourceProxy.swift */; }; - 798E6B391776C92AC52204980E8E0021 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3CCAF883F07E82917B4B37ECA4ED78 /* Deprecated.swift */; }; - 7A00AC4F9139FB78619C8F298F8283B4 /* UIBarButtonItem+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF67DE364D34102B8A5D429A3D07D434 /* UIBarButtonItem+Rx.swift */; }; - 7A671C0210CDA3F4E776DAE550C90B47 /* BehaviorSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 773C7FC7C6936A0DA3CAC55E343E7A60 /* BehaviorSubject.swift */; }; - 7A93A22BD86309270AC44C644B7501FE /* _RX.h in Headers */ = {isa = PBXBuildFile; fileRef = 73189D64ED7807DC22D1C248267A0C5E /* _RX.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7AD5F0A50C181EC21DE6F325AAFAC330 /* MainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2359342B12D3713C27DBFE59C1FC13F /* MainScheduler.swift */; }; - 7AED0B487EE1C935AE22F4056CDD6808 /* RxSwift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F123C81A393F42BC7E907E690D3E3CD8 /* RxSwift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7B89A3FFC01803E264A95FEC8BC0605C /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */; }; - 7C4475AE5484DDFD81D384B0B5C2C0C6 /* TakeWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F36537A401A2CC98DC9744125F59A037 /* TakeWhile.swift */; }; - 7CA7EB74A82CD79231AA28A3156CA430 /* Pods-PcVolumeControl-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 22214056065CF1225B13DFBC526343DA /* Pods-PcVolumeControl-dummy.m */; }; - 7D02C99B5374B45B9863C9475774A024 /* ObservableConvertibleType+Blocking.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA8DBB7F6CBB38DC3C5E2342D499E7AB /* ObservableConvertibleType+Blocking.swift */; }; - 7D54E58E435DD28C7AF8C3FD4E1A5EEA /* UIView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6168A6FF91D446E5FDE3EE8CE21DD858 /* UIView+Rx.swift */; }; - 7D97206F904DAC441809978FB7619D25 /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155AF188C0BD3BE1A496B5E279B012F9 /* Bag+Rx.swift */; }; - 7EDB7CAB96B1830B01F0B80E7FC13AB6 /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DBBCCC05467DB43BAA3EFA593D61103 /* ObservableType+Extensions.swift */; }; - 7F1C00A044692BB016277C00E1F2C773 /* Completable+AndThen.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECC3381D41B7951075FD7027BDEF28AB /* Completable+AndThen.swift */; }; - 805EEDF5A59400ABD8379567AACA849E /* _RXKVOObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = D6F3B680E9B355EB0985F10CBF97EE81 /* _RXKVOObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 808B3B00A91EAFEF3186F32DFE5AFAB5 /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C5FBE194C05050EB13FDE015F2B6071 /* ObservableConvertibleType.swift */; }; - 80A6F9640F4B80A9E09FCEC21478A77A /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A68042F9094FFEE5B7AAD953D90710E /* Debug.swift */; }; - 80AA5AEFA71FA484B90D7B0EF7F9198D /* UITabBarController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = D320FA86507DC04F4238F91E5B31960A /* UITabBarController+Rx.swift */; }; - 80B053295EB40C663E8875C9EBFD245C /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91E77B1F8808E0563BCC027CDA2465C6 /* Bag.swift */; }; - 8117470A6E1CF87DF2049262E34119F3 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA8401AC17F31379D98EF59446BAF032 /* InfiniteSequence.swift */; }; - 8355F3167A08EEC3EB54BAA37097E487 /* Pods-PcVolumeControl-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F3EFDD9B2D0603F737B583D0A44A3788 /* Pods-PcVolumeControl-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 84CE316990A5A4F215424C0029A04A11 /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60934104679A77E69B1C54A2CD3619E6 /* DispatchQueue+Extensions.swift */; }; - 854CD06FA85487611AC11388EC97740A /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81D710E6D1E7795507B8080DB8596F88 /* Map.swift */; }; - 85557BB8ADEDB23D463325DE651CF458 /* UIPickerView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2722E8EAFCF9270ACBA219F7B1B27 /* UIPickerView+Rx.swift */; }; - 8563E9A1C388D6432571C4B889CDC81B /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = E49AF36AA609DBE37A99ACC2804E2F7F /* Event.swift */; }; - 86FB0771E04ED3CCAF7DB95BA8B3D910 /* SectionedViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB3643236C1676D203E0523FF1303A4 /* SectionedViewDataSourceType.swift */; }; - 878947CAF52F3F3DD60CD1BEFD580900 /* CurrentThreadScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80ADF2C64A4359E91C47EE7F5196A743 /* CurrentThreadScheduler.swift */; }; - 87DA86D77902ACF17437E16E77A0D6E0 /* _RXObjCRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 76B9E369650A4B316F7C5DDBD0744153 /* _RXObjCRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 886006CB2A33AC6A623DE1C7B5BC47E7 /* VirtualTimeConverterType.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFEDE2546041B88AB7FCD97EE4D4BFEE /* VirtualTimeConverterType.swift */; }; - 8C1EAC997C4FCDF29630D9B6B4A8542A /* RxNavigationControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99E8C87C656FD344BEA874626C5A487E /* RxNavigationControllerDelegateProxy.swift */; }; - 8C45F2007807507184439AC9619D3AC1 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BAF562BCB361D79C2A47F5715155704 /* Bag.swift */; }; - 8C59DBF8BD1589F58183850B7FE67858 /* UIControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29A1611929CFCD41D560394B729CC00C /* UIControl+Rx.swift */; }; - 8D347BF3B80C9984DB0930C3F6683A18 /* NSControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DCEE586A7E52CC3FB5639949171ECD1 /* NSControl+Rx.swift */; }; - 8E0AD674CAE8833DD02790ED47CF266D /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD42FAEB71A0973109D56FE0A8527F98 /* Just.swift */; }; - 8EFE85C5F1EB7D1C1173AFCEF47DAC45 /* KVORepresentable+Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09967C09CC722CE7DA86AF15AC8CD80E /* KVORepresentable+Swift.swift */; }; - 903230A70B77C4891D1AB14C0D5CFB7C /* WKWebView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 952870A91D76D2FA56A0C2DCD45CF810 /* WKWebView+Rx.swift */; }; - 90347FFE967F9F20BE4960708ACBB4EC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - 9210C710EBF1CB237EA930A8A3C09556 /* RxCocoaObjCRuntimeError+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 719E178033EA58EACE9F8716092FA39F /* RxCocoaObjCRuntimeError+Extensions.swift */; }; - 9234FE61252CAADB60F853B859E2AAEF /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBCB54C19D7402E81E25B0D60449CC74 /* RecursiveLock.swift */; }; - 928B411847B168B7ECF6444BB40680B3 /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4DF6F93775A4FDAAEA82D1650C6BCE /* SubscribeOn.swift */; }; - 92A8C17D76CCEC966A1F3BBC9ED21BB8 /* RxPickerViewDataSourceProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9793F52F5D100FDD4DC9CCD52169560F /* RxPickerViewDataSourceProxy.swift */; }; - 93A7E131348CD4B544C4B701B76D86F4 /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F32CB5C5EFC5E65E11B19A8D8E27CF9F /* CombineLatest.swift */; }; - 93E4DD7B2E1C5A6E5A67D3E79F24E1D3 /* Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD8CF0F7F1817703817008DB3971509 /* Create.swift */; }; - 949EAFFA96CE981E5A3D07331F146390 /* AnonymousDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EC026A6D56A0FC9220E92D40B5FF2D4 /* AnonymousDisposable.swift */; }; - 94F00BBF7C98FF9F7C8A50D09013D5F9 /* RxCollectionViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D54A48EDA1399DC12FD94900CA7E6858 /* RxCollectionViewReactiveArrayDataSource.swift */; }; - 9592A59DA2AB14603C0A164DE99AE989 /* NSTextStorage+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A1CF44A31E7DDBF64E5E753D35F8D4 /* NSTextStorage+Rx.swift */; }; - 95A903FF7AB1A1BA9D09D37DF81A8AB0 /* _RXDelegateProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 96AA39AF96C15A6B93ACD4D58A0B47CA /* _RXDelegateProxy.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 96348CE01FA528DA5A6A17ECF3ABAA9F /* Pods-PcVolumeControlTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D1403DD174C1FF1C9AE643F9464069E /* Pods-PcVolumeControlTests-dummy.m */; }; - 9977BCD36E2CBD9E5B125CD299BD7F41 /* Multicast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EC6246354D2FAD02975AA3CECE9C780 /* Multicast.swift */; }; - 99F8613A48942A008E1685F8137B4D68 /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C8697C71D8D2CACB1A92BB76F332497 /* ElementAt.swift */; }; - 9A2492FB5AAD077758AA999340BFF32C /* UIPageControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8761CD40CB2EE84EBC556B774F24A254 /* UIPageControl+Rx.swift */; }; - 9B36BB2683F3628ECD5960E9619EB19B /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 344E1512ADE7E2518F55A574B1FB21DE /* Queue.swift */; }; - 9B43C07DB4FFAB0CD80DD8C29A792F0F /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2D2B1036836675AA80D49D407484AA9 /* Lock.swift */; }; - 9B8DB79149D502AC26F69A98A4666BFF /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = F31FFBF8C01753EA17359B324A16CDA2 /* Platform.Darwin.swift */; }; - 9BE9B1A29DA997E762CFD07F25605A04 /* UISearchController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FF63E1E4A7336468B43DE5A4D35CAE /* UISearchController+Rx.swift */; }; - 9C6D19CA62E67E73FF98774FCEA080A1 /* KVORepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 962A2D7DC2DC1F6F4D82212001386836 /* KVORepresentable.swift */; }; - 9CD116FF1AB3D45FC37518C4C6997379 /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A8C7F75D8B69949FFF84811D6F8283 /* SerialDisposable.swift */; }; - 9D83CCF8474F4053B033BBF3765F7660 /* _RXDelegateProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 600BC116481E2AFD6A7E33C892CCD5A9 /* _RXDelegateProxy.m */; }; - 9D9106710EAC7C6C7FE9E7EC1BC00C35 /* ObservableConvertibleType+Signal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93CEEE20931225ADE8D703A70149C14A /* ObservableConvertibleType+Signal.swift */; }; - 9E0488FF4304E9EDD472F2CDCF49495C /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF2B50B0AC5AE903980CB790F3924943 /* GroupBy.swift */; }; - 9E0714991EEC5A29143CE9579F3530C3 /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A8ADD3B595FE2B93BA67794EDB3B677 /* Scan.swift */; }; - 9E5EF47186E967E782EAA5219CAB1A8B /* RxSwift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B5B737B0F247BA2DACB0104574F661CF /* RxSwift-dummy.m */; }; - 9F0A40DAEE9EDE8388833CAF9AD84E13 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 734014B530EE72A237D06A031BC7177F /* Range.swift */; }; - A0809FDD5CEA166A37684E7AA3F19829 /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CE5A79746F84C51945277878751D671 /* Catch.swift */; }; - A12B54B052C4ABAFC58080F87B6BAD8C /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A370703B64DEF04F3A91C3ED9AAE34 /* ConcurrentDispatchQueueScheduler.swift */; }; - A25F6B7BE0481113031DF749FE9D40C4 /* RxWKNavigationDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57E69753E98BA31D36AE83678887BE5 /* RxWKNavigationDelegateProxy.swift */; }; - A2BFC7E3B03B8932E87E5037CE34772E /* BlockingObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7C2CB39E3790B67A9CBD8D9F50ECDAC /* BlockingObservable.swift */; }; - A3E229AED66E7A8210E734746ECB02E2 /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20A02F08D8E100FC57061EF062715E59 /* ScheduledDisposable.swift */; }; - A645856411CD83CC21C7D801272669F5 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891A6D75976555954426B79D492C4971 /* Platform.Darwin.swift */; }; - A67985916B86672EE8A09E5961E5E1F9 /* Date+Dispatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E8E497C9F8030D6876FA267A97AA7D2 /* Date+Dispatch.swift */; }; - A90B5B55A543ED3DD9DCB721AE934542 /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85FE5F61F86D1EABDFF892254666CEC6 /* TakeLast.swift */; }; - AA4D5507629CC6A827E7868F74CBBC72 /* HistoricalScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0513FD2340BCCF43D3F413CEF6F38EC2 /* HistoricalScheduler.swift */; }; - AAE570F0DD0A8CEE6B6EACDE0924DFC5 /* Zip+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B5EDA780D21719DFE5B947D72B67BF0 /* Zip+Collection.swift */; }; - AAF2A4BD293FB7F3C6A0FF38C28F0FEE /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F90C4E3FD040BEEBAD3C01BAF976F9A /* Error.swift */; }; - ABE067055E3F6FB1CC45747197D3BC53 /* RunLoopLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21FB119D0847595073A4D88EC548560 /* RunLoopLock.swift */; }; - B0528F277050656E75ADE1D065FC37B8 /* KVORepresentable+CoreGraphics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EBEF8564A6A80DD98F8693318C8AA46 /* KVORepresentable+CoreGraphics.swift */; }; - B278C15C71EE87B01FD8842331A2DD84 /* PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E00A494E3B133E1B785EDF506D7B806 /* PrimitiveSequence.swift */; }; - B27A654EED61328A617C246F39C7EFD2 /* RxTabBarDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F66F8FA9D9F10664C9F489F1269F98DF /* RxTabBarDelegateProxy.swift */; }; - B3B6023B03BE4386650F17AC13A65671 /* SwitchIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 311F6F60BA232FA7E07FA55B9A03487E /* SwitchIfEmpty.swift */; }; - B42D0D71048334E8BF62129F6E528847 /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA15CFA9182243F43CFBF4FD89F2A93B /* Rx.swift */; }; - B4A337004B59DD3D71EA08745DC8D798 /* RxCollectionViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 610AF6A47A8112D10FEF0C3E9A84A0D8 /* RxCollectionViewDelegateProxy.swift */; }; - B50761B46B6B0DFA58E3A45431FAFD8E /* UISlider+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B4FD13E2BFC8D28087418FD13576E11 /* UISlider+Rx.swift */; }; - B606120F6D64F423657236A2970B2857 /* RxTableViewReactiveArrayDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA92CACE943A6A3DE1F08A99F7743432 /* RxTableViewReactiveArrayDataSource.swift */; }; - B67BF7850FA69628C0DDEEDC130035F7 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4CC2E6D04E25FB4FCF3595214A9B2B /* Platform.Darwin.swift */; }; - B763C21339C457FF6C9F23FCD847C294 /* RxScrollViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FC743E3B269BFDA2AC3E94BC2766D17 /* RxScrollViewDelegateProxy.swift */; }; - B805454BD4733A2BD5D1E9927781C61C /* NSTextField+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = D46FE6C3D6717733751AE0053881B9CE /* NSTextField+Rx.swift */; }; - B80CE9FC4E7057117E9858A69097BD54 /* AsyncSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D19A24E094EFF08BED2B50C2008664 /* AsyncSubject.swift */; }; - B9C4C2D9D439A0EDA8C80F495601E34B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - BBDC7FEC58A227C155000D912EB44B39 /* ObserverBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B22C9F294C0BDF459CC5A59702876E4 /* ObserverBase.swift */; }; - BD5C5A780FF4B2C74F0BCD69BD831A3D /* Reduce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6704212EBA8F24926AA1939A3E6D7E46 /* Reduce.swift */; }; - BFCD671D8D213BF0109317A461305377 /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB73D5684CA035AB3885E38B34D0E449 /* ObservableType.swift */; }; - C0CEC195E25C30DB4BB1091CDADD9AFF /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD0B332DB80C92F2C36B077F72970CC /* Empty.swift */; }; - C2D5D09CEC440A4621B5CAFB67B3A5B5 /* ItemEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC1CA51690127BADD8268871BA10257 /* ItemEvents.swift */; }; - C3517B06C7C577E46EAB2724C1D53E7E /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED259FCB363C34FA2263A4F6835C2B64 /* RxMutableBox.swift */; }; - C50FD92788C1136C9B1563359F638E90 /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2178322EBEBABAAA5B6D95D8318B549E /* Optional.swift */; }; - C5A5AEEF77FA6E9297696D7130306BCF /* RxCollectionViewDataSourcePrefetchingProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0270717B67AB64958F33B751E399B1FE /* RxCollectionViewDataSourcePrefetchingProxy.swift */; }; - C5EE17C8E09E0D7042D0340B96131279 /* PublishRelay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BE6FE61853CB720E75D2C37BC30FC01 /* PublishRelay.swift */; }; - C6CFA4D8E44B2ECB867560F11166D847 /* RxTabBarControllerDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23651465CADFA0D4FB3DA2B796748A59 /* RxTabBarControllerDelegateProxy.swift */; }; - C77BBB1150A4EEBF948F2E32133719F0 /* RxTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE63DDA1F4EC3D2464B690D040746B2B /* RxTarget.swift */; }; - C918D068CC13B407BF638F1C57DF3DFF /* ScheduledItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD48D455962D9964B44E0533B1BD3A82 /* ScheduledItemType.swift */; }; - C92EE1C8771E4BA17872F7B9BF534787 /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA1060132DFD2AB326576E130DED3E4F /* RecursiveLock.swift */; }; - C9FED92878541212DCD20841DBFA48AF /* RxSearchBarDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131264B7D064AEFC96A35EC99FE843FA /* RxSearchBarDelegateProxy.swift */; }; - CAEA4361DA6030D11415FBC4FD4C4DF4 /* RxTableViewDataSourcePrefetchingProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F0105057D55ACD1C48F21477455B113 /* RxTableViewDataSourcePrefetchingProxy.swift */; }; - CB952FD2F737FE25DC95579065296BB6 /* Driver+Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B710B273342A5AB32AB22D11A686359 /* Driver+Subscription.swift */; }; - CBB4DFA117262C88F3B767C6BBDAC839 /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F626F932F2ABCD61B59E02C346F7C9F /* AsyncLock.swift */; }; - CC2B22E1F48A7A0EFDBE282DBADCBDDE /* CombineLatest+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEF0C7E650AE014FD61861E58F7816CE /* CombineLatest+Collection.swift */; }; - CDCA48093852C8B844059A9684826F30 /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7D3727B31153C2C246C1892457042AE /* PriorityQueue.swift */; }; - CDED438FA5C4771AAAA8E89F7CC5AC58 /* NSTextView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9EB0869DAC0F9EE44D40CEA279645F /* NSTextView+Rx.swift */; }; - CE7177AD3750FB4F3D0A532D9669CB83 /* SingleAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 471366590AF76D70B2C27B730C5E2E72 /* SingleAsync.swift */; }; - CE90037BF8D1EF3DCBFBC97E56D2701E /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC86DC70093E8081E593935F717561B /* Platform.Linux.swift */; }; - CEFEA7D4312ABEDDC36F2087184FB610 /* Concat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83341CE56A1CFAB8F2E630E520C8F129 /* Concat.swift */; }; - CFDF49EAD80E28466EE0B15A2DD5FBF5 /* ObserveOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68D5CCB1042F162F35079AD68B57A83C /* ObserveOn.swift */; }; - D03DF75AFE3BE4990305DBC1DDB869F6 /* UICollectionView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387CB3BEDC3D95B2B91E15FF3737FCC2 /* UICollectionView+Rx.swift */; }; - D0965DE6C6B69B74A083611F8DC4AD60 /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 391A4527BA7FB320E579457466D28438 /* ConnectableObservableType.swift */; }; - D15DC3BE7C68691D743B1908ABB91E07 /* NSLayoutConstraint+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96E6BA75A50964BB1BB4EFAF203B0A /* NSLayoutConstraint+Rx.swift */; }; - D16947CBD028EF7E04729CD3670B876D /* RxRelay-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 60C0B50FE6E10775D3F7B9083CAD7666 /* RxRelay-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D2BEC4E285D55EBB3B869DF675B4B076 /* RxRelay-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AFB62EEF626C81D502E306B9A1C7CD3D /* RxRelay-dummy.m */; }; - D337BCE2FB7C1D595669844BDD9E53BE /* UISegmentedControl+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4DFF39D517BAEAAAA9BD1E90B52826 /* UISegmentedControl+Rx.swift */; }; - D3B1166513A247F6FD36C0883A6BC6CF /* GroupedObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73B5C4BE43AA97963F1EF5714386B8CF /* GroupedObservable.swift */; }; - D437A93503211D776CC61B0A8A8A71F8 /* DelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4D9AA4765EA172240BDC16A827522DE /* DelegateProxy.swift */; }; - D48713481C30846F118781250401B6EA /* Single.swift in Sources */ = {isa = PBXBuildFile; fileRef = F91E4CF84F2D4A6186BA9942925F0A98 /* Single.swift */; }; - D59636146733244915607A7E177A8712 /* PrimitiveSequence+Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = B49E9E4DE7C006960F429A7AF3DE0C04 /* PrimitiveSequence+Zip+arity.swift */; }; - D64EA6E18B6AC4114BE0CB29B70B7739 /* ControlEvent+Driver.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD651BEC17628FA7D363C052776D4816 /* ControlEvent+Driver.swift */; }; - D74FBDD093E10610392CEE8DB004E78C /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94ACA206557A2026FC70584A9BAAFEBA /* DistinctUntilChanged.swift */; }; - D8318F04E086B061C28D961CC8F86E6A /* SubjectType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FAEB945F5EDA7B6B5E1A3843DBB9A85 /* SubjectType.swift */; }; - D83C68850F8A3C76DE97A0551A818F31 /* TextInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E29D109F52747AA1D58208FBC2EB284 /* TextInput.swift */; }; - D843124BDB94AAE32303A503BFA60127 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */; }; - D9BA5B238765E5E2D796D47246F748F3 /* UITabBarItem+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07E6CC74BF9A1A72BD8D5B4A71C2D567 /* UITabBarItem+Rx.swift */; }; - DB2D57AF81BF92D637AC95F3582CC085 /* RxPickerViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB9374FC7A3970B7B3F4A990FCC1E45 /* RxPickerViewDataSourceType.swift */; }; - DC2C51E58894D6065E999B05B527CC11 /* Maybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3238BB2EEBCCF23A48791BEA5AD66BCD /* Maybe.swift */; }; - DC73E079F3C3FF5F84BD81CFAECEAEB1 /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 790CF14267C1CC1F6B2670D1DF7722DF /* Amb.swift */; }; - DDEF041FB4E7B09E63D90711025A8588 /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88B03981F7F864198033B38703CA0EDD /* Timer.swift */; }; - DE1E9D4BF994BAB37664D3A3B25C296A /* Materialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3FEE371711FCB432564D16F9EE528F9 /* Materialize.swift */; }; - E0913C7ACDEE2FF3F5726843D87F0FB0 /* UIApplication+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 611AB914C1F029F3A8663D33234B66AD /* UIApplication+Rx.swift */; }; - E0A2B9A524EC4D34A3DDFBBE1D1D25B0 /* AsMaybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E722E2E006E65505A86B6D9EFD1777A /* AsMaybe.swift */; }; - E2960331F72C889C85D4875B200AF289 /* UITableView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89027CF30FA8BFF667023C99C1701A7E /* UITableView+Rx.swift */; }; - E3B8690153448DB7BB199D4FB8F1E90F /* SchedulerType+SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 154CE2131A84EF752F8F6704E6DFDE02 /* SchedulerType+SharedSequence.swift */; }; - E4EC22E47F93A0B49658C837EDAC1376 /* RxTextStorageDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D5EF8E7D07BF7EF05109A755FF18B5 /* RxTextStorageDelegateProxy.swift */; }; - E4F1492DE2CFC1190E52A24752007331 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEEE92138CCE9BBBF9C700C7CB938F4 /* Deprecated.swift */; }; - E654F0639E4FC3DEE1BEA8BB63F55745 /* BlueSocket-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9714BB49556E4B7636C3C11879FE650B /* BlueSocket-dummy.m */; }; - E71C2CBDF0E79625EF1058383A2CA403 /* RxCollectionViewDataSourceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50BCE5EA60BD541EE36EDC4A9728848C /* RxCollectionViewDataSourceType.swift */; }; - E81B33B6604600090DFB32512C69E7F8 /* Do.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34C400E4271318E54E4398B8AD23E46E /* Do.swift */; }; - E86B0E0D913346ACDF5F2D69A0A98833 /* DelegateProxyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42227B25516DCEEC26D53B46B6CA74F3 /* DelegateProxyType.swift */; }; - E930FB414E56DB4E95FB2C230F8AC1F3 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */; }; - E94D94EF789DCBC511115EBC4F6B85C2 /* SharedSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A1980CAF8CEAD004C5AFB67D2879CE /* SharedSequence.swift */; }; - EA85F2E900C7B38E67F4BE711B88A924 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95772CCF646929B74805B0A3730517C7 /* Platform.Linux.swift */; }; - EB188E609BEFB8A628A4747E9B5803F8 /* RxTextViewDelegateProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62451FAAD81CFCF6E46CC62D6D6E2B83 /* RxTextViewDelegateProxy.swift */; }; - EB2CACC6628B9D0ADEB629FAA73A9F29 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D51860C5B63891FC7487FB7D8368E65 /* Platform.Linux.swift */; }; - EBB271DDE9112620D373C5A5A6683487 /* Enumerated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57868C25F97BE3D81C1DDAADE8952117 /* Enumerated.swift */; }; - ECAE23D66E9EDF283A168176231FEDBD /* Observable+Bind.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA26EA5F2E7FB5AB3AE2FD9A8930AE8C /* Observable+Bind.swift */; }; - ED505F0A05738E7E6FF9FCD818382387 /* Resources.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA5515C6C427AD47A97F70DF2CD05778 /* Resources.swift */; }; - ED906ACD2E9F3C6DEA3A0B373A7A59F7 /* UIProgressView+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE5E678A806C0231CD469C9BC25CAB7F /* UIProgressView+Rx.swift */; }; - EDB338DD059F5447DBCF1289E353B2CB /* UIViewController+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = E62AE29692EC793033A8F16F4BD5D2A8 /* UIViewController+Rx.swift */; }; - EEC43FF3240A2B6EDC075378D21A0799 /* CompactMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A0C33DE68099F3D0834B48D7E61F3C /* CompactMap.swift */; }; - EFB73B383EE0B9D00BCD7CA7D84B3395 /* UIGestureRecognizer+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59F8771D85BD85428B691FC825409630 /* UIGestureRecognizer+Rx.swift */; }; - F0F7F7EB66C233DD559474AFEA7C10DF /* SharedSequence+Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AC3DADABBB1384AB2DFF5D262484D6B /* SharedSequence+Operators.swift */; }; - F1135C3274284C27AABB699497998C12 /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = D59E1336AE8D35E4E50774DA5E085618 /* PriorityQueue.swift */; }; - F4541139B83E4CE559A87E1FD2484323 /* _RXKVOObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEAE85DA1633BD7D8460C255894228B /* _RXKVOObserver.m */; }; - F46C2BA0BB5DECB53C2C5963E601A792 /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = F66C272989799EF13F81360E1C017FA8 /* ReplaySubject.swift */; }; - F4BC2D1A81ACF9E401CA354EEF9796DB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 165257FF5CC4855BFF00503538487274 /* Foundation.framework */; }; - F57830087820D069FA2A61079DC62BC9 /* LockOwnerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1667ED6BDEC874DE054C507D8F92586 /* LockOwnerType.swift */; }; - F7285BCC377181D97295B6197A7176A1 /* Buffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7795CF42E93B2BFEC658EFBE3DC77DE6 /* Buffer.swift */; }; - F7F102BA36B71A6B46C3732ED3944845 /* SchedulerServices+Emulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5879542193EA1E2A64EDE67D19C197B8 /* SchedulerServices+Emulation.swift */; }; - F88602DEA5D139BDFF12CEDD838BE081 /* UILabel+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B37C57B0507E31DDF703F723F426757 /* UILabel+Rx.swift */; }; - FA484ABE03B4D5BC86A28D154BBDE278 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF1875F1FDB6E9DB873613B08E4345B8 /* Switch.swift */; }; - FAF68A0C9CC23EC9773F7FB9BB72A6C4 /* AtomicInt.swift in Sources */ = {isa = PBXBuildFile; fileRef = D89625B3CCCFF38EA492AF1CED0289B2 /* AtomicInt.swift */; }; - FB1F62B2A744B23A349CF8877CF2A09B /* RxPickerViewAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4598BE4E8CFFD32CF8AC2E80B9A65A6 /* RxPickerViewAdapter.swift */; }; - FC0D1A435D5EBAE9B4910F3BA0EF5EE4 /* VirtualTimeScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3DB97C92CF101387BBEE919C3E562C /* VirtualTimeScheduler.swift */; }; - FCB07678FF31509D157300B7DC1240D6 /* KeyPathBinder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048FB3F4149F0B24806E1C8193517A44 /* KeyPathBinder.swift */; }; - FCFE4498BBE67496C9605F239A7D06CE /* SingleAssignmentDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2BDBD7740FCC4514E2EC9B8DA306DC3 /* SingleAssignmentDisposable.swift */; }; - FD121E214251E5B388161FA787E9399C /* NSObject+Rx+KVORepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC20F83E3E7FB7D4EB564F808C1B327B /* NSObject+Rx+KVORepresentable.swift */; }; - FD9C05FA7BB24EE0802AA9625E4E136A /* RefCountDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1338756395646BAA5F040AF5F8FF6679 /* RefCountDisposable.swift */; }; - FEA8F7B52BA4A7B201FE0D05BDA2EF2A /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B204EADFE4C49400DF283B0402CDC4B /* Never.swift */; }; - FF46DBEE595A7B768C99B569FAA2C2EC /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42D6E2211762AD71977418257026DD5 /* Observable.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 0768EE1088EA330FB10AE76C285FAABB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C8D93C508E21FFD4EE60D335DD6C22E3; - remoteInfo = RxTest; - }; - 28F84B97B6DB0053834E94975C1E6CF9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9717BE7FCECEF299173A5D71C18B19F5; - remoteInfo = BlueSocket; - }; - 2DE8EFD99D12E8C92311A490A9A0D4CD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - 2F1CB9E4B77261ECA5BAA9503B8787AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2ED98DC5EF20C5C8530881763EE47291; - remoteInfo = "Pods-PcVolumeControl"; - }; - 4BE1AB63A58B94CC6612B992D9DE4E9B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = F243B36381C0CE83CCFF789AC38F0D36; - remoteInfo = RxBlocking; - }; - 5A7F3702920320AA45BE775840150190 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4622BFEF3DC16E8BD15EEFC30D4D0084; - remoteInfo = RxRelay; - }; - 62374FF4E30852C81EE1D2F361DAFCF4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - 62B181EB6293B57601B29D7D140BA313 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9717BE7FCECEF299173A5D71C18B19F5; - remoteInfo = BlueSocket; - }; - 68E30A01A4F924C5AB74C81BC5A9192A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - 706DB1EADC340E7032F32A1E6E369DD6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2ED98DC5EF20C5C8530881763EE47291; - remoteInfo = "Pods-PcVolumeControl"; - }; - 7E0BD3D83560FEE0CC21B2C5D139CC3B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - 8A5EBC977D84C1FC6C60805B38161C21 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = C8D93C508E21FFD4EE60D335DD6C22E3; - remoteInfo = RxTest; - }; - 9CA1D36FB66527CB327DCA80528B57D4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - A70E412735A12F0276A4233D00A75D04 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; - AFD379C6632E5CEB4BFBB72FE293F1BE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = F243B36381C0CE83CCFF789AC38F0D36; - remoteInfo = RxBlocking; - }; - B431A2D3027304A5C50B47A2DCA354EB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7AD0C6DCDC9CEC8A3C7C10C7FEE07BE6; - remoteInfo = RxCocoa; - }; - D11614D31D2E51FC10374CEC9EF0C308 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4622BFEF3DC16E8BD15EEFC30D4D0084; - remoteInfo = RxRelay; - }; - D6E12C4A432C48207D91A931ED809B22 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9717BE7FCECEF299173A5D71C18B19F5; - remoteInfo = BlueSocket; - }; - F542978250521176A8327569CEAEEE88 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EA9EA43B3B503823EE36C60D9C8A865F; - remoteInfo = RxSwift; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 01127B024228016233228910D7B1C476 /* BlueSocket-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "BlueSocket-Info.plist"; sourceTree = ""; }; - 0270717B67AB64958F33B751E399B1FE /* RxCollectionViewDataSourcePrefetchingProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewDataSourcePrefetchingProxy.swift; path = RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift; sourceTree = ""; }; - 031893FD3D882E436EC541DF783B1276 /* RxTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxTest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 03CA2A7946DB7F1C458886EFE6C22714 /* RetryWhen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RetryWhen.swift; path = RxSwift/Observables/RetryWhen.swift; sourceTree = ""; }; - 048FB3F4149F0B24806E1C8193517A44 /* KeyPathBinder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KeyPathBinder.swift; path = RxCocoa/Common/KeyPathBinder.swift; sourceTree = ""; }; - 04A0C33DE68099F3D0834B48D7E61F3C /* CompactMap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompactMap.swift; path = RxSwift/Observables/CompactMap.swift; sourceTree = ""; }; - 0513FD2340BCCF43D3F413CEF6F38EC2 /* HistoricalScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalScheduler.swift; path = RxSwift/Schedulers/HistoricalScheduler.swift; sourceTree = ""; }; - 06069700E139C9B86AEB96E92C06824D /* Pods_PcVolumeControlUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControlUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 06136030C196C955ECA4176CAA1ADB1A /* RxRelay.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxRelay.release.xcconfig; sourceTree = ""; }; - 07E6CC74BF9A1A72BD8D5B4A71C2D567 /* UITabBarItem+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITabBarItem+Rx.swift"; path = "RxCocoa/iOS/UITabBarItem+Rx.swift"; sourceTree = ""; }; - 07EA5134AF7CD060DC3BB4B3E7AE9A50 /* BehaviorRelay+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "BehaviorRelay+Driver.swift"; path = "RxCocoa/Traits/Driver/BehaviorRelay+Driver.swift"; sourceTree = ""; }; - 09467A1E2AFCB6BADD58E02F55F6A4F9 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - 098EA338ED568B0259919E2EED409E28 /* Recorded.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Recorded.swift; path = RxTest/Recorded.swift; sourceTree = ""; }; - 09967C09CC722CE7DA86AF15AC8CD80E /* KVORepresentable+Swift.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "KVORepresentable+Swift.swift"; path = "RxCocoa/Foundation/KVORepresentable+Swift.swift"; sourceTree = ""; }; - 099E8B440B222A6AE621B3C654902672 /* Event+Equatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Event+Equatable.swift"; path = "RxTest/Event+Equatable.swift"; sourceTree = ""; }; - 0B4D7A0304C2AA8BBA54D3CC90D45FC9 /* Utils.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Utils.swift; path = RxRelay/Utils.swift; sourceTree = ""; }; - 0B8B4B83352419701DB8C6372C64CDDA /* TestScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TestScheduler.swift; path = RxTest/Schedulers/TestScheduler.swift; sourceTree = ""; }; - 0C526544037BFD565471F127F408ADBE /* Pods-PcVolumeControlUITests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PcVolumeControlUITests-acknowledgements.markdown"; sourceTree = ""; }; - 0D1684EA39AF315405DADFC3B55312F8 /* TakeUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeUntil.swift; path = RxSwift/Observables/TakeUntil.swift; sourceTree = ""; }; - 0D4DF6F93775A4FDAAEA82D1650C6BCE /* SubscribeOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscribeOn.swift; path = RxSwift/Observables/SubscribeOn.swift; sourceTree = ""; }; - 0E6BF0D3D58FA551004F59312E656C48 /* UINavigationController+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UINavigationController+Rx.swift"; path = "RxCocoa/iOS/UINavigationController+Rx.swift"; sourceTree = ""; }; - 0F626F932F2ABCD61B59E02C346F7C9F /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; - 10C4EF4AF0CBFFEA88F3BBF0E684121D /* UIImageView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIImageView+Rx.swift"; path = "RxCocoa/iOS/UIImageView+Rx.swift"; sourceTree = ""; }; - 11F4A789AD047E72F89A5401D5D6AEB3 /* RxCocoa-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxCocoa-prefix.pch"; sourceTree = ""; }; - 131264B7D064AEFC96A35EC99FE843FA /* RxSearchBarDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxSearchBarDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift; sourceTree = ""; }; - 1338756395646BAA5F040AF5F8FF6679 /* RefCountDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCountDisposable.swift; path = RxSwift/Disposables/RefCountDisposable.swift; sourceTree = ""; }; - 15469A2777B60A2C46DB0212EDFB2224 /* UITabBar+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITabBar+Rx.swift"; path = "RxCocoa/iOS/UITabBar+Rx.swift"; sourceTree = ""; }; - 154CE2131A84EF752F8F6704E6DFDE02 /* SchedulerType+SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerType+SharedSequence.swift"; path = "RxCocoa/Traits/SharedSequence/SchedulerType+SharedSequence.swift"; sourceTree = ""; }; - 155AF188C0BD3BE1A496B5E279B012F9 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; - 15A370703B64DEF04F3A91C3ED9AAE34 /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentDispatchQueueScheduler.swift; path = RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift; sourceTree = ""; }; - 165257FF5CC4855BFF00503538487274 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 166A0CC13503947F6D46C3AA0196792C /* NSView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSView+Rx.swift"; path = "RxCocoa/macOS/NSView+Rx.swift"; sourceTree = ""; }; - 17D598A83DEC75328A2A44744B3E7B41 /* RxPickerViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift; sourceTree = ""; }; - 181CBB1C009684C3977A6C15AE440B9B /* Logging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Logging.swift; path = RxCocoa/Foundation/Logging.swift; sourceTree = ""; }; - 18925B68ED164CA96235E423631E2273 /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; - 18BE500FB78D87EBA22326C167F21292 /* Pods-PcVolumeControlUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControlUITests.debug.xcconfig"; sourceTree = ""; }; - 1B710B273342A5AB32AB22D11A686359 /* Driver+Subscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Driver+Subscription.swift"; path = "RxCocoa/Traits/Driver/Driver+Subscription.swift"; sourceTree = ""; }; - 1CE5A79746F84C51945277878751D671 /* Catch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Catch.swift; path = RxSwift/Observables/Catch.swift; sourceTree = ""; }; - 1DEAE85DA1633BD7D8460C255894228B /* _RXKVOObserver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXKVOObserver.m; path = RxCocoa/Runtime/_RXKVOObserver.m; sourceTree = ""; }; - 1DF60C44D5D9B4C6AB2D284F6BF01126 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; - 1E01A9A5EE0038D5E75A4B4414F26F09 /* NSImageView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSImageView+Rx.swift"; path = "RxCocoa/macOS/NSImageView+Rx.swift"; sourceTree = ""; }; - 1EC6246354D2FAD02975AA3CECE9C780 /* Multicast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Multicast.swift; path = RxSwift/Observables/Multicast.swift; sourceTree = ""; }; - 1F79FA00A6A46A94D6D1AFF1F7BFFA8D /* ControlEvent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlEvent.swift; path = RxCocoa/Traits/ControlEvent.swift; sourceTree = ""; }; - 2006D9E3BE92EFA8F0BC5BB5DCAE9F2E /* RxTableViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDataSourceType.swift; path = RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift; sourceTree = ""; }; - 208033768002D1169CE4B6182DF60A3C /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; - 20A02F08D8E100FC57061EF062715E59 /* ScheduledDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledDisposable.swift; path = RxSwift/Disposables/ScheduledDisposable.swift; sourceTree = ""; }; - 20C3F40C837D8C31C01C9F2096CFB1D9 /* UIRefreshControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIRefreshControl+Rx.swift"; path = "RxCocoa/iOS/UIRefreshControl+Rx.swift"; sourceTree = ""; }; - 2178322EBEBABAAA5B6D95D8318B549E /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Optional.swift; sourceTree = ""; }; - 220456D17AD0859A62ACEBDB033E10BC /* ControlProperty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlProperty.swift; path = RxCocoa/Traits/ControlProperty.swift; sourceTree = ""; }; - 22214056065CF1225B13DFBC526343DA /* Pods-PcVolumeControl-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PcVolumeControl-dummy.m"; sourceTree = ""; }; - 2323B58D158A6DD1B70E0C01A82D0250 /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Zip+arity.swift"; sourceTree = ""; }; - 23651465CADFA0D4FB3DA2B796748A59 /* RxTabBarControllerDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTabBarControllerDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift; sourceTree = ""; }; - 23D265A0A6313B6753EE030B326EFADD /* RxCocoa.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RxCocoa.h; path = RxCocoa/RxCocoa.h; sourceTree = ""; }; - 23EE333EDD0DADA041038F3A19F4DA66 /* Any+Equatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Any+Equatable.swift"; path = "RxTest/Any+Equatable.swift"; sourceTree = ""; }; - 24663DE5E1499CECC9AC55C674033FA6 /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; - 253D4B467DD3B5309124C5C3DBB60930 /* Pods-PcVolumeControlTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-PcVolumeControlTests.modulemap"; sourceTree = ""; }; - 25F63A531105CD4E1E4CCF5B918C5494 /* RxBlocking.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxBlocking.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 261D40C90F887E85F9BB1EFCCE9373D2 /* RxSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.release.xcconfig; sourceTree = ""; }; - 26E73CE14BAF3E57647F98CD373FE1F3 /* HotObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HotObservable.swift; path = RxTest/HotObservable.swift; sourceTree = ""; }; - 270BE29C4EAB305B008CA0DCE0A4512E /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; - 278FE9405CC67AE3D1D42C1FCAEDE75D /* RxSwift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-prefix.pch"; sourceTree = ""; }; - 27C6E01E5D9F9110F1AC1B679469F07B /* Pods-PcVolumeControlTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControlTests.debug.xcconfig"; sourceTree = ""; }; - 27EDE187E0CD19195FC41A6F350FD7A8 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxCocoa/Deprecated.swift; sourceTree = ""; }; - 2979BE4542E6E400D8A0D94774A4CDEB /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxSwift.modulemap; sourceTree = ""; }; - 29A1611929CFCD41D560394B729CC00C /* UIControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIControl+Rx.swift"; path = "RxCocoa/iOS/UIControl+Rx.swift"; sourceTree = ""; }; - 2BE6FE61853CB720E75D2C37BC30FC01 /* PublishRelay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishRelay.swift; path = RxRelay/PublishRelay.swift; sourceTree = ""; }; - 2C4CC2E6D04E25FB4FCF3595214A9B2B /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - 2CD87A13A8B9C153A3C6B9F4AEC4EA12 /* Recorded+Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Recorded+Event.swift"; path = "RxTest/Recorded+Event.swift"; sourceTree = ""; }; - 2D51860C5B63891FC7487FB7D8368E65 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; - 2E00A494E3B133E1B785EDF506D7B806 /* PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PrimitiveSequence.swift; path = RxSwift/Traits/PrimitiveSequence.swift; sourceTree = ""; }; - 2E29D109F52747AA1D58208FBC2EB284 /* TextInput.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TextInput.swift; path = RxCocoa/Common/TextInput.swift; sourceTree = ""; }; - 2E8E497C9F8030D6876FA267A97AA7D2 /* Date+Dispatch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Date+Dispatch.swift"; path = "RxSwift/Date+Dispatch.swift"; sourceTree = ""; }; - 2EAA4A7F572E0FFFDA0F24140040D388 /* Socket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Socket.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2EB8E3160B0DB0E173919538EA7ECFF2 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - 2FC743E3B269BFDA2AC3E94BC2766D17 /* RxScrollViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxScrollViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift; sourceTree = ""; }; - 30226535CC498A43D268D346D0376E31 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - 30830F72C5EF27D43304F584471C4218 /* PublishSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishSubject.swift; path = RxSwift/Subjects/PublishSubject.swift; sourceTree = ""; }; - 30FE4976007E1812618427E7D50156AB /* _RXObjCRuntime.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXObjCRuntime.m; path = RxCocoa/Runtime/_RXObjCRuntime.m; sourceTree = ""; }; - 311F6F60BA232FA7E07FA55B9A03487E /* SwitchIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwitchIfEmpty.swift; path = RxSwift/Observables/SwitchIfEmpty.swift; sourceTree = ""; }; - 31A0849E113149648B5B7EDE73C8C442 /* NSObject+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx.swift"; path = "RxCocoa/Foundation/NSObject+Rx.swift"; sourceTree = ""; }; - 3238BB2EEBCCF23A48791BEA5AD66BCD /* Maybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Maybe.swift; path = RxSwift/Traits/Maybe.swift; sourceTree = ""; }; - 32A239A894AD4158D32DEA5544B11697 /* RxTest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxTest.release.xcconfig; sourceTree = ""; }; - 32E2E12FF808966D980F8B8F064F3394 /* CompositeDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompositeDisposable.swift; path = RxSwift/Disposables/CompositeDisposable.swift; sourceTree = ""; }; - 33A46EB293988E6E6C72D55C1CF058B4 /* Pods-PcVolumeControlUITests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControlUITests-acknowledgements.plist"; sourceTree = ""; }; - 340B4B8A27B28EDC76E34C0E1C7A509A /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DispatchQueueConfiguration.swift; path = RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift; sourceTree = ""; }; - 344E1512ADE7E2518F55A574B1FB21DE /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; - 34B1B702F762FF15B8EBFDD40A1C3F26 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; - 34C400E4271318E54E4398B8AD23E46E /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Do.swift; sourceTree = ""; }; - 34FF63E1E4A7336468B43DE5A4D35CAE /* UISearchController+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISearchController+Rx.swift"; path = "RxCocoa/iOS/UISearchController+Rx.swift"; sourceTree = ""; }; - 353624585E9506600A21FF8127232A63 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; - 35944A73E70B0BD8E6B7EF336209BA80 /* Signal+Subscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Signal+Subscription.swift"; path = "RxCocoa/Traits/Signal/Signal+Subscription.swift"; sourceTree = ""; }; - 35CC61964335426092725FAFF66EAD20 /* RxTableViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift; sourceTree = ""; }; - 383841701BC1ECFE19EE9D75CBA3D7B7 /* RxTest-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxTest-prefix.pch"; sourceTree = ""; }; - 387CB3BEDC3D95B2B91E15FF3737FCC2 /* UICollectionView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UICollectionView+Rx.swift"; path = "RxCocoa/iOS/UICollectionView+Rx.swift"; sourceTree = ""; }; - 391A4527BA7FB320E579457466D28438 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; - 39A2E5CC10432212E8094E7AE8FE3147 /* ObservableType+PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+PrimitiveSequence.swift"; path = "RxSwift/Traits/ObservableType+PrimitiveSequence.swift"; sourceTree = ""; }; - 3A080CF82E6070DDEAD577DFB62B774C /* RxCocoa.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxCocoa.release.xcconfig; sourceTree = ""; }; - 3A3CCAF883F07E82917B4B37ECA4ED78 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxSwift/Deprecated.swift; sourceTree = ""; }; - 3B22C9F294C0BDF459CC5A59702876E4 /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; - 3B37C57B0507E31DDF703F723F426757 /* UILabel+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILabel+Rx.swift"; path = "RxCocoa/iOS/UILabel+Rx.swift"; sourceTree = ""; }; - 3B4FD13E2BFC8D28087418FD13576E11 /* UISlider+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISlider+Rx.swift"; path = "RxCocoa/iOS/UISlider+Rx.swift"; sourceTree = ""; }; - 3BA85C8508DA2B3707CBD714AD735261 /* UITextView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITextView+Rx.swift"; path = "RxCocoa/iOS/UITextView+Rx.swift"; sourceTree = ""; }; - 3DA709800162BB778D5A1A85F39A1D69 /* RxCocoa.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxCocoa.debug.xcconfig; sourceTree = ""; }; - 3DDC66BB8BCE36CECDE5BA6A342376EC /* Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Driver.swift; path = RxCocoa/Traits/Driver/Driver.swift; sourceTree = ""; }; - 3EBDBA8FC1B6B915D20FB7BCF39F86FA /* RxCollectionViewDataSourceProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewDataSourceProxy.swift; path = RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift; sourceTree = ""; }; - 42227B25516DCEEC26D53B46B6CA74F3 /* DelegateProxyType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelegateProxyType.swift; path = RxCocoa/Common/DelegateProxyType.swift; sourceTree = ""; }; - 423F60E8A2B399193EA0698C7B8FE4DB /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; - 471366590AF76D70B2C27B730C5E2E72 /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/SingleAsync.swift; sourceTree = ""; }; - 4789720F73E206BE3AF35D7F5062A684 /* UITextField+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITextField+Rx.swift"; path = "RxCocoa/iOS/UITextField+Rx.swift"; sourceTree = ""; }; - 480912712FCA3DA3AFAC55800DA606E2 /* ObserverType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverType.swift; path = RxSwift/ObserverType.swift; sourceTree = ""; }; - 4AC3DADABBB1384AB2DFF5D262484D6B /* SharedSequence+Operators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SharedSequence+Operators.swift"; path = "RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift"; sourceTree = ""; }; - 4B204EADFE4C49400DF283B0402CDC4B /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; - 4B994EE5E07D1BF43652D100A871F0AB /* RxRelay-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxRelay-prefix.pch"; sourceTree = ""; }; - 4BCD7808A9ABABD4C8211067531A0651 /* UIStepper+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIStepper+Rx.swift"; path = "RxCocoa/iOS/UIStepper+Rx.swift"; sourceTree = ""; }; - 4C8697C71D8D2CACB1A92BB76F332497 /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/ElementAt.swift; sourceTree = ""; }; - 4CACDCB7F01783F715B521DE6EF06C67 /* Socket.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Socket.swift; path = Sources/Socket/Socket.swift; sourceTree = ""; }; - 4DBBCCC05467DB43BAA3EFA593D61103 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; - 4E46A70998C88D63FB8CA21D091725BF /* Pods-PcVolumeControlTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControlTests-Info.plist"; sourceTree = ""; }; - 4E7835E25BE79F606718DCBF49942D46 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; - 4F067D39E1B6B85C3377ACB8B664960C /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/DelaySubscription.swift; sourceTree = ""; }; - 50482F5A113D6275248A9AC03F9CDA5A /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/SkipWhile.swift; sourceTree = ""; }; - 50BCE5EA60BD541EE36EDC4A9728848C /* RxCollectionViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewDataSourceType.swift; path = RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift; sourceTree = ""; }; - 50D4892E72CC2833C85ABC0C4C6456F8 /* RxRelay.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxRelay.debug.xcconfig; sourceTree = ""; }; - 5207F4CB7D3CE803A751067C05FADCB4 /* Pods-PcVolumeControlTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PcVolumeControlTests-umbrella.h"; sourceTree = ""; }; - 5221C596A14A5F4D76684A2836EBF1E4 /* UIActivityIndicatorView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIActivityIndicatorView+Rx.swift"; path = "RxCocoa/iOS/UIActivityIndicatorView+Rx.swift"; sourceTree = ""; }; - 5291EFE39BF2A9B4E10217FE9236D7E8 /* SwiftSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = RxSwift/SwiftSupport/SwiftSupport.swift; sourceTree = ""; }; - 573737E40443ECB361FAE27B3F4FD968 /* RxTest-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxTest-dummy.m"; sourceTree = ""; }; - 57868C25F97BE3D81C1DDAADE8952117 /* Enumerated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Enumerated.swift; path = RxSwift/Observables/Enumerated.swift; sourceTree = ""; }; - 5879542193EA1E2A64EDE67D19C197B8 /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; - 58AA9774E4130E068C4143DCE47E77B8 /* Subscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Subscription.swift; path = RxTest/Subscription.swift; sourceTree = ""; }; - 59A8C7F75D8B69949FFF84811D6F8283 /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; - 59EFC2D4069C6A578BF3DB7EE60F1616 /* BlueSocket-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "BlueSocket-umbrella.h"; sourceTree = ""; }; - 59F8771D85BD85428B691FC825409630 /* UIGestureRecognizer+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIGestureRecognizer+Rx.swift"; path = "RxCocoa/iOS/UIGestureRecognizer+Rx.swift"; sourceTree = ""; }; - 5A66EF4E8F4BC1F13BD182D490981DEA /* RxBlocking.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxBlocking.modulemap; sourceTree = ""; }; - 5A7E8B9B962928D03BA5ABC87C3D3822 /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; - 5B879DD34FC39A4CC9F6EAEB7445BBAB /* UISearchBar+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISearchBar+Rx.swift"; path = "RxCocoa/iOS/UISearchBar+Rx.swift"; sourceTree = ""; }; - 5BAF562BCB361D79C2A47F5715155704 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - 5CF3841C7C72D588D674AA3D6A1AD8F7 /* RxTest-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxTest-Info.plist"; sourceTree = ""; }; - 5D18B10095561AC312E3007488114FAA /* RxCocoa.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxCocoa.modulemap; sourceTree = ""; }; - 5E465F9148B7D453DD7FD0EC630D10C6 /* Pods-PcVolumeControl-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControl-acknowledgements.plist"; sourceTree = ""; }; - 5F0105057D55ACD1C48F21477455B113 /* RxTableViewDataSourcePrefetchingProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDataSourcePrefetchingProxy.swift; path = RxCocoa/iOS/Proxies/RxTableViewDataSourcePrefetchingProxy.swift; sourceTree = ""; }; - 5F36F006737B6061F5654E714C6546A1 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; - 5F3DB97C92CF101387BBEE919C3E562C /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; - 5FAEB945F5EDA7B6B5E1A3843DBB9A85 /* SubjectType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubjectType.swift; path = RxSwift/Subjects/SubjectType.swift; sourceTree = ""; }; - 600BC116481E2AFD6A7E33C892CCD5A9 /* _RXDelegateProxy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RXDelegateProxy.m; path = RxCocoa/Runtime/_RXDelegateProxy.m; sourceTree = ""; }; - 60934104679A77E69B1C54A2CD3619E6 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; - 60C0B50FE6E10775D3F7B9083CAD7666 /* RxRelay-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxRelay-umbrella.h"; sourceTree = ""; }; - 610AF6A47A8112D10FEF0C3E9A84A0D8 /* RxCollectionViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift; sourceTree = ""; }; - 611AB914C1F029F3A8663D33234B66AD /* UIApplication+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIApplication+Rx.swift"; path = "RxCocoa/iOS/UIApplication+Rx.swift"; sourceTree = ""; }; - 6168A6FF91D446E5FDE3EE8CE21DD858 /* UIView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Rx.swift"; path = "RxCocoa/iOS/UIView+Rx.swift"; sourceTree = ""; }; - 616DF0F168F14FB83D813C1D969335ED /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Timeout.swift; sourceTree = ""; }; - 61A438B0595BA529862F9743A470E070 /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; - 62451FAAD81CFCF6E46CC62D6D6E2B83 /* RxTextViewDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTextViewDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift; sourceTree = ""; }; - 64120DF1F430BD51B8A88CFF60FFEAF0 /* Pods-PcVolumeControlTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PcVolumeControlTests-acknowledgements.markdown"; sourceTree = ""; }; - 66C34338099F88821AA4C25FF25C001C /* XCTest+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "XCTest+Rx.swift"; path = "RxTest/XCTest+Rx.swift"; sourceTree = ""; }; - 6704212EBA8F24926AA1939A3E6D7E46 /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Reduce.swift; sourceTree = ""; }; - 672A6F808AEDDBD39617973AD123A7E2 /* Pods_PcVolumeControlTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControlTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6740716AB5E480DD1B9618635A89B2C1 /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; - 6778845A74EB8B74A40C7BC912847643 /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; - 687BE6D9BFA94187D5CAB410C60F381A /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; - 68D5CCB1042F162F35079AD68B57A83C /* ObserveOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOn.swift; path = RxSwift/Observables/ObserveOn.swift; sourceTree = ""; }; - 699DD66CDE89DD28213C55E98B69FB22 /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/CombineLatest+arity.swift"; sourceTree = ""; }; - 6BB6CEFFA20D51021E46594082017FF8 /* RxBlocking-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxBlocking-dummy.m"; sourceTree = ""; }; - 6C40FA4CAC354571D924B4EFABB7B856 /* BlueSocket.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = BlueSocket.debug.xcconfig; sourceTree = ""; }; - 6D2F87CD2648E2E337CC65D7542690E8 /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; - 6F1A45F65531AD9BC5F0C07C459A30B9 /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableScheduledItem.swift; path = RxSwift/Schedulers/Internal/InvocableScheduledItem.swift; sourceTree = ""; }; - 6F7D3B69E3AF3022081770EBECFC6401 /* DisposeBag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBag.swift; path = RxSwift/Disposables/DisposeBag.swift; sourceTree = ""; }; - 719E178033EA58EACE9F8716092FA39F /* RxCocoaObjCRuntimeError+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "RxCocoaObjCRuntimeError+Extensions.swift"; path = "RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift"; sourceTree = ""; }; - 72AC498A230F32F79390FA120F1A9F12 /* Sink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sink.swift; path = RxSwift/Observables/Sink.swift; sourceTree = ""; }; - 73189D64ED7807DC22D1C248267A0C5E /* _RX.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RX.h; path = RxCocoa/Runtime/include/_RX.h; sourceTree = ""; }; - 734014B530EE72A237D06A031BC7177F /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = RxSwift/Observables/Range.swift; sourceTree = ""; }; - 739B6586072863C18F6C1FA627125930 /* ControlEvent+Signal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ControlEvent+Signal.swift"; path = "RxCocoa/Traits/Signal/ControlEvent+Signal.swift"; sourceTree = ""; }; - 73B5C4BE43AA97963F1EF5714386B8CF /* GroupedObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupedObservable.swift; path = RxSwift/GroupedObservable.swift; sourceTree = ""; }; - 73BBE312C3870BCDE55D9B078EE17E23 /* RxCocoa-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxCocoa-dummy.m"; sourceTree = ""; }; - 73BCCC1B87080B021E438BDB1235C9A2 /* RxTableViewDataSourceProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewDataSourceProxy.swift; path = RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift; sourceTree = ""; }; - 73D4277FE68534C0781645FD7E224A09 /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; - 7620351B28E8A341F448FBB95F32B7B0 /* RxCocoaRuntime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = RxCocoaRuntime.h; path = RxCocoa/Runtime/include/RxCocoaRuntime.h; sourceTree = ""; }; - 767F3C9AA8A5A5484ABC95488FC303F5 /* NotificationCenter+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NotificationCenter+Rx.swift"; path = "RxCocoa/Foundation/NotificationCenter+Rx.swift"; sourceTree = ""; }; - 76B9E369650A4B316F7C5DDBD0744153 /* _RXObjCRuntime.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXObjCRuntime.h; path = RxCocoa/Runtime/include/_RXObjCRuntime.h; sourceTree = ""; }; - 773C7FC7C6936A0DA3CAC55E343E7A60 /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; - 7795CF42E93B2BFEC658EFBE3DC77DE6 /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Buffer.swift; sourceTree = ""; }; - 77BBA6073E58C9168975FB180E3331EC /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Zip.swift; sourceTree = ""; }; - 790CF14267C1CC1F6B2670D1DF7722DF /* Amb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Amb.swift; path = RxSwift/Observables/Amb.swift; sourceTree = ""; }; - 79441A1750CE19E6B380E697D0D7B829 /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Delay.swift; sourceTree = ""; }; - 7A68042F9094FFEE5B7AAD953D90710E /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Debug.swift; sourceTree = ""; }; - 7A96E02AF26A80E8347C627DC307547C /* Pods-PcVolumeControlTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControlTests-acknowledgements.plist"; sourceTree = ""; }; - 7AB3643236C1676D203E0523FF1303A4 /* SectionedViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SectionedViewDataSourceType.swift; path = RxCocoa/Common/SectionedViewDataSourceType.swift; sourceTree = ""; }; - 7B97E75224814A71A8A8AFCD3536D66F /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/SkipUntil.swift; sourceTree = ""; }; - 7BC86DC70093E8081E593935F717561B /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; - 7BCF3EA68311835C0BD05ADC42BFEFF2 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; - 7DCEE586A7E52CC3FB5639949171ECD1 /* NSControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSControl+Rx.swift"; path = "RxCocoa/macOS/NSControl+Rx.swift"; sourceTree = ""; }; - 7DD2722E8EAFCF9270ACBA219F7B1B27 /* UIPickerView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIPickerView+Rx.swift"; path = "RxCocoa/iOS/UIPickerView+Rx.swift"; sourceTree = ""; }; - 7EC026A6D56A0FC9220E92D40B5FF2D4 /* AnonymousDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousDisposable.swift; path = RxSwift/Disposables/AnonymousDisposable.swift; sourceTree = ""; }; - 7ED55174B34321A98809FD3DC84761D9 /* ObservableConvertibleType+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+Driver.swift"; path = "RxCocoa/Traits/Driver/ObservableConvertibleType+Driver.swift"; sourceTree = ""; }; - 7F60DF601C49DB01E68C4A52045CB662 /* Pods-PcVolumeControl-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControl-Info.plist"; sourceTree = ""; }; - 80351B824222A0C15393481E7AD8F68B /* NSButton+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSButton+Rx.swift"; path = "RxCocoa/macOS/NSButton+Rx.swift"; sourceTree = ""; }; - 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 80ADF2C64A4359E91C47EE7F5196A743 /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; - 81D710E6D1E7795507B8080DB8596F88 /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Map.swift; sourceTree = ""; }; - 823EE588F8140D8595B221C32C02FE6E /* Pods-PcVolumeControl-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PcVolumeControl-frameworks.sh"; sourceTree = ""; }; - 82E5DDD7234E6B2CD65D86DC6FFA4C69 /* RxTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTest.swift; path = RxTest/RxTest.swift; sourceTree = ""; }; - 82EA063964EBEA27D1BAE1B55D874A13 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = RxSwift/Disposable.swift; sourceTree = ""; }; - 83015354BA695D4F72C7E6876DAA73AD /* BlueSocket-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "BlueSocket-prefix.pch"; sourceTree = ""; }; - 83119221C3E965D4FE30DCF7A54071E4 /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OperationQueueScheduler.swift; path = RxSwift/Schedulers/OperationQueueScheduler.swift; sourceTree = ""; }; - 8313ECB065F3D9A7B7DA7EA38F1AED80 /* Pods_PcVolumeControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PcVolumeControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 83341CE56A1CFAB8F2E630E520C8F129 /* Concat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Concat.swift; path = RxSwift/Observables/Concat.swift; sourceTree = ""; }; - 83D73284DCEE4FE8C76234DE2ACCD393 /* RxRelay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxRelay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 851C579244CB1DB947EE2DA501458D89 /* NSObject+Rx+RawRepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx+RawRepresentable.swift"; path = "RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift"; sourceTree = ""; }; - 85A46CC7427FED3A98520AA43B9CC6A7 /* RxBlocking.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxBlocking.debug.xcconfig; sourceTree = ""; }; - 85FE5F61F86D1EABDFF892254666CEC6 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/TakeLast.swift; sourceTree = ""; }; - 86CA65FAFADFF769BF2C013D4482126C /* UIScrollView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIScrollView+Rx.swift"; path = "RxCocoa/iOS/UIScrollView+Rx.swift"; sourceTree = ""; }; - 86F8264F204FF9728CE76CC2CA04937A /* DefaultIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultIfEmpty.swift; path = RxSwift/Observables/DefaultIfEmpty.swift; sourceTree = ""; }; - 8761CD40CB2EE84EBC556B774F24A254 /* UIPageControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIPageControl+Rx.swift"; path = "RxCocoa/iOS/UIPageControl+Rx.swift"; sourceTree = ""; }; - 88B03981F7F864198033B38703CA0EDD /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Timer.swift; sourceTree = ""; }; - 89027CF30FA8BFF667023C99C1701A7E /* UITableView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITableView+Rx.swift"; path = "RxCocoa/iOS/UITableView+Rx.swift"; sourceTree = ""; }; - 891A6D75976555954426B79D492C4971 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - 8A3AD50DFFFECE8B61274269F68766AD /* Repeat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Repeat.swift; path = RxSwift/Observables/Repeat.swift; sourceTree = ""; }; - 8A8ADD3B595FE2B93BA67794EDB3B677 /* Scan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scan.swift; path = RxSwift/Observables/Scan.swift; sourceTree = ""; }; - 8AC453398D54811E2D26DED8AE7F989F /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = RxSwift/Errors.swift; sourceTree = ""; }; - 8B5CFBC3EB91E3A8009F3A6E5473CF14 /* First.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = First.swift; path = RxSwift/Observables/First.swift; sourceTree = ""; }; - 8B5EDA780D21719DFE5B947D72B67BF0 /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Zip+Collection.swift"; sourceTree = ""; }; - 8B7729AFF77A9173CE034081A3F05178 /* Pods-PcVolumeControlTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControlTests.release.xcconfig"; sourceTree = ""; }; - 8BC2DBD42567365F39445A2168D560C3 /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentMainScheduler.swift; path = RxSwift/Schedulers/ConcurrentMainScheduler.swift; sourceTree = ""; }; - 8BD746CF61BACCCCF3104079FFF7981A /* Pods-PcVolumeControlUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControlUITests.release.xcconfig"; sourceTree = ""; }; - 8C5FBE194C05050EB13FDE015F2B6071 /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; - 8D1403DD174C1FF1C9AE643F9464069E /* Pods-PcVolumeControlTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PcVolumeControlTests-dummy.m"; sourceTree = ""; }; - 8D5625A644D7F35DC3122A8C34AE8C44 /* Throttle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Throttle.swift; path = RxSwift/Observables/Throttle.swift; sourceTree = ""; }; - 8EBEF8564A6A80DD98F8693318C8AA46 /* KVORepresentable+CoreGraphics.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "KVORepresentable+CoreGraphics.swift"; path = "RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift"; sourceTree = ""; }; - 8F72A5AC6D55C67DC2497D003392DF72 /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; - 8FD62E6E5963C1B4B935EBF6292B5FD9 /* RxBlocking.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxBlocking.release.xcconfig; sourceTree = ""; }; - 8FD8CF0F7F1817703817008DB3971509 /* Create.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Create.swift; path = RxSwift/Observables/Create.swift; sourceTree = ""; }; - 90CEBF5062A57446C96C58A956CC92FB /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; - 914EE1F1ADA0DE328328CCBC5DC5CFAA /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - 91E77B1F8808E0563BCC027CDA2465C6 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - 920EC7400A2B7EB2C40A30B5A7DD462B /* Binder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Binder.swift; path = RxCocoa/Common/Binder.swift; sourceTree = ""; }; - 927825C3D1C54F29A91BC57C5D2EF38D /* RxTest-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxTest-umbrella.h"; sourceTree = ""; }; - 931EB10A575FB0180AB3B8D270F9BF62 /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionDisposable.swift; path = RxSwift/Disposables/SubscriptionDisposable.swift; sourceTree = ""; }; - 93CEEE20931225ADE8D703A70149C14A /* ObservableConvertibleType+Signal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+Signal.swift"; path = "RxCocoa/Traits/Signal/ObservableConvertibleType+Signal.swift"; sourceTree = ""; }; - 93D19A24E094EFF08BED2B50C2008664 /* AsyncSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncSubject.swift; path = RxSwift/Subjects/AsyncSubject.swift; sourceTree = ""; }; - 94ACA206557A2026FC70584A9BAAFEBA /* DistinctUntilChanged.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DistinctUntilChanged.swift; path = RxSwift/Observables/DistinctUntilChanged.swift; sourceTree = ""; }; - 952870A91D76D2FA56A0C2DCD45CF810 /* WKWebView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "WKWebView+Rx.swift"; path = "RxCocoa/iOS/WKWebView+Rx.swift"; sourceTree = ""; }; - 95772CCF646929B74805B0A3730517C7 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; - 962A2D7DC2DC1F6F4D82212001386836 /* KVORepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KVORepresentable.swift; path = RxCocoa/Foundation/KVORepresentable.swift; sourceTree = ""; }; - 96AA39AF96C15A6B93ACD4D58A0B47CA /* _RXDelegateProxy.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXDelegateProxy.h; path = RxCocoa/Runtime/include/_RXDelegateProxy.h; sourceTree = ""; }; - 9714BB49556E4B7636C3C11879FE650B /* BlueSocket-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "BlueSocket-dummy.m"; sourceTree = ""; }; - 9793F52F5D100FDD4DC9CCD52169560F /* RxPickerViewDataSourceProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewDataSourceProxy.swift; path = RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift; sourceTree = ""; }; - 97A1CF44A31E7DDBF64E5E753D35F8D4 /* NSTextStorage+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSTextStorage+Rx.swift"; path = "RxCocoa/iOS/NSTextStorage+Rx.swift"; sourceTree = ""; }; - 99E8C87C656FD344BEA874626C5A487E /* RxNavigationControllerDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxNavigationControllerDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift; sourceTree = ""; }; - 9A63C7D75B1C447583AB0AED13ABA5B8 /* _RX.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = _RX.m; path = RxCocoa/Runtime/_RX.m; sourceTree = ""; }; - 9AB01AC1EE3267F3A6ED2EE30B7EE993 /* TestableObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TestableObservable.swift; path = RxTest/TestableObservable.swift; sourceTree = ""; }; - 9B10EAF3427C31A47AEF4576CF4D0D39 /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Merge.swift; sourceTree = ""; }; - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 9E722E2E006E65505A86B6D9EFD1777A /* AsMaybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsMaybe.swift; path = RxSwift/Observables/AsMaybe.swift; sourceTree = ""; }; - 9EEEE92138CCE9BBBF9C700C7CB938F4 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxTest/Deprecated.swift; sourceTree = ""; }; - 9F7900D2A6A8123D690CE28680FC2EF3 /* RxSwift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxSwift-Info.plist"; sourceTree = ""; }; - 9F90C4E3FD040BEEBAD3C01BAF976F9A /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Error.swift; sourceTree = ""; }; - 9F9EB0869DAC0F9EE44D40CEA279645F /* NSTextView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSTextView+Rx.swift"; path = "RxCocoa/macOS/NSTextView+Rx.swift"; sourceTree = ""; }; - 9FC2DC1AC4ADCF68A27B6F7202E10327 /* RxCocoa-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxCocoa-umbrella.h"; sourceTree = ""; }; - A04DCFCD5917489D0B84218953AB52CA /* BehaviorRelay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorRelay.swift; path = RxRelay/BehaviorRelay.swift; sourceTree = ""; }; - A04FA66F88B68B16D138105418EAE28C /* BlueSocket.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = BlueSocket.modulemap; sourceTree = ""; }; - A13DC759F93839015BEB2246FCDFA805 /* Deferred.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deferred.swift; path = RxSwift/Observables/Deferred.swift; sourceTree = ""; }; - A2D2B1036836675AA80D49D407484AA9 /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; - A42D6E2211762AD71977418257026DD5 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; - A46436DD08BCF9F5A18AB7C70F83FB38 /* UINavigationItem+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UINavigationItem+Rx.swift"; path = "RxCocoa/iOS/UINavigationItem+Rx.swift"; sourceTree = ""; }; - A4BD8970D67E3DD90F7934E8313595AE /* Pods-PcVolumeControlUITests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PcVolumeControlUITests-umbrella.h"; sourceTree = ""; }; - A741A5A53A37DB703EF34E996811C2BC /* Pods-PcVolumeControlUITests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PcVolumeControlUITests-frameworks.sh"; sourceTree = ""; }; - A7B113B4194E7BA4E6A0BC8785C93064 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; - A7C2CB39E3790B67A9CBD8D9F50ECDAC /* BlockingObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BlockingObservable.swift; path = RxBlocking/BlockingObservable.swift; sourceTree = ""; }; - A90DF1967AC48650BB379D32C9D030D2 /* Pods-PcVolumeControl.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-PcVolumeControl.modulemap"; sourceTree = ""; }; - AA15CFA9182243F43CFBF4FD89F2A93B /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; - AA26EA5F2E7FB5AB3AE2FD9A8930AE8C /* Observable+Bind.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Bind.swift"; path = "RxCocoa/Common/Observable+Bind.swift"; sourceTree = ""; }; - AB73D5684CA035AB3885E38B34D0E449 /* ObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableType.swift; path = RxSwift/ObservableType.swift; sourceTree = ""; }; - AD48D455962D9964B44E0533B1BD3A82 /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; - AF2B50B0AC5AE903980CB790F3924943 /* GroupBy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupBy.swift; path = RxSwift/Observables/GroupBy.swift; sourceTree = ""; }; - AFB4FABD07CD59D4F94AA56C2F166D64 /* PublishRelay+Signal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PublishRelay+Signal.swift"; path = "RxCocoa/Traits/Signal/PublishRelay+Signal.swift"; sourceTree = ""; }; - AFB62EEF626C81D502E306B9A1C7CD3D /* RxRelay-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxRelay-dummy.m"; sourceTree = ""; }; - B1CE6B0E749417F2A2E2DFE94B2446FA /* Pods-PcVolumeControl.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControl.release.xcconfig"; sourceTree = ""; }; - B20EB781D77AEFC0011D94F24DA28F3B /* Producer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Producer.swift; path = RxSwift/Observables/Producer.swift; sourceTree = ""; }; - B3FEE371711FCB432564D16F9EE528F9 /* Materialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Materialize.swift; path = RxSwift/Observables/Materialize.swift; sourceTree = ""; }; - B49E9E4DE7C006960F429A7AF3DE0C04 /* PrimitiveSequence+Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PrimitiveSequence+Zip+arity.swift"; path = "RxSwift/Traits/PrimitiveSequence+Zip+arity.swift"; sourceTree = ""; }; - B4D9AA4765EA172240BDC16A827522DE /* DelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelegateProxy.swift; path = RxCocoa/Common/DelegateProxy.swift; sourceTree = ""; }; - B523BEA6A1E0C0AA62A4EE54B9691165 /* ObservableConvertibleType+SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+SharedSequence.swift"; path = "RxCocoa/Traits/SharedSequence/ObservableConvertibleType+SharedSequence.swift"; sourceTree = ""; }; - B57E69753E98BA31D36AE83678887BE5 /* RxWKNavigationDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxWKNavigationDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxWKNavigationDelegateProxy.swift; sourceTree = ""; }; - B5B737B0F247BA2DACB0104574F661CF /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; - B5C4DF39F9FAD8934D7D17B07A523428 /* RxSearchControllerDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxSearchControllerDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift; sourceTree = ""; }; - B5D5EF8E7D07BF7EF05109A755FF18B5 /* RxTextStorageDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTextStorageDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift; sourceTree = ""; }; - B5D9E991EE31AB6821D24FBA085FF567 /* URLSession+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "URLSession+Rx.swift"; path = "RxCocoa/Foundation/URLSession+Rx.swift"; sourceTree = ""; }; - B5DCE44F75A96600C8B474D9F159D745 /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; - B6D2204E1F5D39D9E464AC69BD6FEF6B /* AddRef.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AddRef.swift; path = RxSwift/Observables/AddRef.swift; sourceTree = ""; }; - B76C9C95A08C0C020CBCF459A1CFC06B /* RxTest.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxTest.modulemap; sourceTree = ""; }; - B7D3727B31153C2C246C1892457042AE /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; - B81A32278B219F44E7FADFB3B757FA83 /* ControlProperty+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ControlProperty+Driver.swift"; path = "RxCocoa/Traits/Driver/ControlProperty+Driver.swift"; sourceTree = ""; }; - B84337E7D25E148FB59E6DCA4E1B1795 /* Pods-PcVolumeControl.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-PcVolumeControl.debug.xcconfig"; sourceTree = ""; }; - B84E6AD26A488E4FC3B1A381B968AC10 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; - B9DE8684B1E32151B349AC4C3BD0FB39 /* ColdObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ColdObservable.swift; path = RxTest/ColdObservable.swift; sourceTree = ""; }; - BA2F982B0A4AB47A4BBD7E1C87B1B77D /* Completable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Completable.swift; path = RxSwift/Traits/Completable.swift; sourceTree = ""; }; - BA81CB87E410F5AF2D41B869CD499A90 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - BA8DBB7F6CBB38DC3C5E2342D499E7AB /* ObservableConvertibleType+Blocking.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableConvertibleType+Blocking.swift"; path = "RxBlocking/ObservableConvertibleType+Blocking.swift"; sourceTree = ""; }; - BABEC7961D3917FA96B4EDDB1811FABC /* RxSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.debug.xcconfig; sourceTree = ""; }; - BBF810D29148F1F5301466D67B33FEAE /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; - BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - BDED50D08B2D5C26ED0EF50C6008EC4C /* Dematerialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Dematerialize.swift; path = RxSwift/Observables/Dematerialize.swift; sourceTree = ""; }; - BE80D5D46A21936442FD346C31626856 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - BF1875F1FDB6E9DB873613B08E4345B8 /* Switch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Switch.swift; path = RxSwift/Observables/Switch.swift; sourceTree = ""; }; - BF93C101A10F05DD891B341CE8772CA2 /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; - C53D921AEFACB183CF6653D4DBDE8619 /* AtomicInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AtomicInt.swift; path = Platform/AtomicInt.swift; sourceTree = ""; }; - C782B445229E3ECDA116760525E46D4B /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; - C79617BF9FCBFF1731059AC8EA88CDBD /* SharedSequence+Operators+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SharedSequence+Operators+arity.swift"; path = "RxCocoa/Traits/SharedSequence/SharedSequence+Operators+arity.swift"; sourceTree = ""; }; - CB30B1587B70AC8F44EA652EE682E88C /* AtomicInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AtomicInt.swift; path = Platform/AtomicInt.swift; sourceTree = ""; }; - CBCB54C19D7402E81E25B0D60449CC74 /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; - CCE4663CDED2BA3A827DE9BA659AA19C /* BlockingObservable+Operators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "BlockingObservable+Operators.swift"; path = "RxBlocking/BlockingObservable+Operators.swift"; sourceTree = ""; }; - CD4DFF39D517BAEAAAA9BD1E90B52826 /* UISegmentedControl+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISegmentedControl+Rx.swift"; path = "RxCocoa/iOS/UISegmentedControl+Rx.swift"; sourceTree = ""; }; - CD6C733ABC5A0826C4EE51C10ACED04C /* Sample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sample.swift; path = RxSwift/Observables/Sample.swift; sourceTree = ""; }; - CE63DDA1F4EC3D2464B690D040746B2B /* RxTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTarget.swift; path = RxCocoa/Common/RxTarget.swift; sourceTree = ""; }; - CEA0DB824165FFF3867A11A35E647426 /* NSSlider+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSSlider+Rx.swift"; path = "RxCocoa/macOS/NSSlider+Rx.swift"; sourceTree = ""; }; - D0A1980CAF8CEAD004C5AFB67D2879CE /* SharedSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SharedSequence.swift; path = RxCocoa/Traits/SharedSequence/SharedSequence.swift; sourceTree = ""; }; - D0B560C68169CF08892FA2FB0562B80C /* TestableObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TestableObserver.swift; path = RxTest/TestableObserver.swift; sourceTree = ""; }; - D13EEC60488930A2BE8EA5A35BB19225 /* Pods-PcVolumeControlUITests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PcVolumeControlUITests-dummy.m"; sourceTree = ""; }; - D1563E317B323E3F76370769B9109D2D /* UIAlertAction+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIAlertAction+Rx.swift"; path = "RxCocoa/iOS/UIAlertAction+Rx.swift"; sourceTree = ""; }; - D21484AB05526AEB5AAC8FDCC446BF75 /* SocketUtils.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SocketUtils.swift; path = Sources/Socket/SocketUtils.swift; sourceTree = ""; }; - D2F2327DF7984B242385B151CE81BFDB /* RxRelay.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxRelay.modulemap; sourceTree = ""; }; - D320FA86507DC04F4238F91E5B31960A /* UITabBarController+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UITabBarController+Rx.swift"; path = "RxCocoa/iOS/UITabBarController+Rx.swift"; sourceTree = ""; }; - D3691C2A7C228DB1FED8C5676B7C75EA /* BlueSocket.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = BlueSocket.release.xcconfig; sourceTree = ""; }; - D4598BE4E8CFFD32CF8AC2E80B9A65A6 /* RxPickerViewAdapter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewAdapter.swift; path = RxCocoa/iOS/DataSources/RxPickerViewAdapter.swift; sourceTree = ""; }; - D46FE6C3D6717733751AE0053881B9CE /* NSTextField+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSTextField+Rx.swift"; path = "RxCocoa/macOS/NSTextField+Rx.swift"; sourceTree = ""; }; - D4821A3514BD4C5BC6853EB5A79BB288 /* Signal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Signal.swift; path = RxCocoa/Traits/Signal/Signal.swift; sourceTree = ""; }; - D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D54A48EDA1399DC12FD94900CA7E6858 /* RxCollectionViewReactiveArrayDataSource.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCollectionViewReactiveArrayDataSource.swift; path = RxCocoa/iOS/DataSources/RxCollectionViewReactiveArrayDataSource.swift; sourceTree = ""; }; - D5751433DD3FB187CC2F6DCB15619BFE /* RxCocoa-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxCocoa-Info.plist"; sourceTree = ""; }; - D59E1336AE8D35E4E50774DA5E085618 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; - D6F3B680E9B355EB0985F10CBF97EE81 /* _RXKVOObserver.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = _RXKVOObserver.h; path = RxCocoa/Runtime/include/_RXKVOObserver.h; sourceTree = ""; }; - D843788095528E29F1214B5BCFD6CFE0 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; - D89625B3CCCFF38EA492AF1CED0289B2 /* AtomicInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AtomicInt.swift; path = Platform/AtomicInt.swift; sourceTree = ""; }; - D9C04B5DDE964165FBBBA04A9377CF17 /* RxRelay-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxRelay-Info.plist"; sourceTree = ""; }; - DA8401AC17F31379D98EF59446BAF032 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - DAC1CA51690127BADD8268871BA10257 /* ItemEvents.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ItemEvents.swift; path = RxCocoa/iOS/Events/ItemEvents.swift; sourceTree = ""; }; - DBD0B332DB80C92F2C36B077F72970CC /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Empty.swift; sourceTree = ""; }; - DBF3724FA6EA3A343B5A587B0E20B7BB /* ToArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToArray.swift; path = RxSwift/Observables/ToArray.swift; sourceTree = ""; }; - DBF38FBA72F5B4A09A1C364C99BE93EF /* TestSchedulerVirtualTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TestSchedulerVirtualTimeConverter.swift; path = RxTest/Schedulers/TestSchedulerVirtualTimeConverter.swift; sourceTree = ""; }; - DC137B9D2C5A7F4B81587418A25F6D9C /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; - DD106A8A5EC48162E34C74F0F8D068E8 /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; - DD42FAEB71A0973109D56FE0A8527F98 /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Just.swift; sourceTree = ""; }; - DDB9374FC7A3970B7B3F4A990FCC1E45 /* RxPickerViewDataSourceType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxPickerViewDataSourceType.swift; path = RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift; sourceTree = ""; }; - DFCD7CC945B63AFA2DBFA9FB9E12AA67 /* RxBlocking-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxBlocking-umbrella.h"; sourceTree = ""; }; - E2359342B12D3713C27DBFE59C1FC13F /* MainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MainScheduler.swift; path = RxSwift/Schedulers/MainScheduler.swift; sourceTree = ""; }; - E2BDBD7740FCC4514E2EC9B8DA306DC3 /* SingleAssignmentDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAssignmentDisposable.swift; path = RxSwift/Disposables/SingleAssignmentDisposable.swift; sourceTree = ""; }; - E30D86B22BBC03C62DC23EB6F660153A /* UIButton+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIButton+Rx.swift"; path = "RxCocoa/iOS/UIButton+Rx.swift"; sourceTree = ""; }; - E49AF36AA609DBE37A99ACC2804E2F7F /* Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Event.swift; path = RxSwift/Event.swift; sourceTree = ""; }; - E59351142D883FD61600EE08A069754F /* Pods-PcVolumeControl-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PcVolumeControl-acknowledgements.markdown"; sourceTree = ""; }; - E61B3FFA9AC88211931C4D889F4EE43D /* Pods-PcVolumeControlTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PcVolumeControlTests-frameworks.sh"; sourceTree = ""; }; - E62AE29692EC793033A8F16F4BD5D2A8 /* UIViewController+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Rx.swift"; path = "RxCocoa/iOS/UIViewController+Rx.swift"; sourceTree = ""; }; - E72977F6C509287602523CE31A31AECD /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Filter.swift; sourceTree = ""; }; - E757922DB463B4F6C4139D799D8188F2 /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Skip.swift; sourceTree = ""; }; - E9DEB3037153FAAF05EFF55933992778 /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Take.swift; sourceTree = ""; }; - E9E5999EF88C3D899FE8BFE72E0E8951 /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/WithLatestFrom.swift; sourceTree = ""; }; - EB96E6BA75A50964BB1BB4EFAF203B0A /* NSLayoutConstraint+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSLayoutConstraint+Rx.swift"; path = "RxCocoa/Common/NSLayoutConstraint+Rx.swift"; sourceTree = ""; }; - EC5F8EB40237D39081796D6D290878A5 /* StartWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StartWith.swift; path = RxSwift/Observables/StartWith.swift; sourceTree = ""; }; - ECC3381D41B7951075FD7027BDEF28AB /* Completable+AndThen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Completable+AndThen.swift"; path = "RxSwift/Traits/Completable+AndThen.swift"; sourceTree = ""; }; - ED259FCB363C34FA2263A4F6835C2B64 /* RxMutableBox.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxMutableBox.swift; path = RxSwift/RxMutableBox.swift; sourceTree = ""; }; - ED74F69B493E00BE9F052FD62F560FA4 /* RxBlocking-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxBlocking-Info.plist"; sourceTree = ""; }; - EE1463ACD5544288C4EDD8BBF4AA42BC /* Pods-PcVolumeControlUITests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-PcVolumeControlUITests.modulemap"; sourceTree = ""; }; - EEF0C7E650AE014FD61861E58F7816CE /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; - EF67DE364D34102B8A5D429A3D07D434 /* UIBarButtonItem+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIBarButtonItem+Rx.swift"; path = "RxCocoa/iOS/UIBarButtonItem+Rx.swift"; sourceTree = ""; }; - F0D44B25231A947F6CB92AE86FF8003D /* Observable+Bind.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Observable+Bind.swift"; path = "RxRelay/Observable+Bind.swift"; sourceTree = ""; }; - F0E0689D9A311E9720BE7C70760E1795 /* UISwitch+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UISwitch+Rx.swift"; path = "RxCocoa/iOS/UISwitch+Rx.swift"; sourceTree = ""; }; - F0E8206C4187405C4B549752F59EA214 /* Pods-PcVolumeControlUITests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-PcVolumeControlUITests-Info.plist"; sourceTree = ""; }; - F123C81A393F42BC7E907E690D3E3CD8 /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; - F1667ED6BDEC874DE054C507D8F92586 /* LockOwnerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LockOwnerType.swift; path = RxSwift/Concurrency/LockOwnerType.swift; sourceTree = ""; }; - F21FB119D0847595073A4D88EC548560 /* RunLoopLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RunLoopLock.swift; path = RxBlocking/RunLoopLock.swift; sourceTree = ""; }; - F25AB16788DDFB81F872343984C07315 /* SerialDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDispatchQueueScheduler.swift; path = RxSwift/Schedulers/SerialDispatchQueueScheduler.swift; sourceTree = ""; }; - F31FFBF8C01753EA17359B324A16CDA2 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - F329E40A0D94C2B155B3314D2966204B /* RxTest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxTest.debug.xcconfig; sourceTree = ""; }; - F32CB5C5EFC5E65E11B19A8D8E27CF9F /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/CombineLatest.swift; sourceTree = ""; }; - F36537A401A2CC98DC9744125F59A037 /* TakeWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeWhile.swift; path = RxSwift/Observables/TakeWhile.swift; sourceTree = ""; }; - F3EFDD9B2D0603F737B583D0A44A3788 /* Pods-PcVolumeControl-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-PcVolumeControl-umbrella.h"; sourceTree = ""; }; - F46DA9B774F2F6FA34DA8D996961ED06 /* SocketProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SocketProtocols.swift; path = Sources/Socket/SocketProtocols.swift; sourceTree = ""; }; - F5601C5B089E7DA00B58370D0FC120D7 /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; - F58343C5240B54FF834ADB6B6022F244 /* RxBlocking-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxBlocking-prefix.pch"; sourceTree = ""; }; - F64080C1DC981269258F636EBF6F8B63 /* ShareReplayScope.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplayScope.swift; path = RxSwift/Observables/ShareReplayScope.swift; sourceTree = ""; }; - F6662F9FD685EDEFF18128FBF12A5853 /* TailRecursiveSink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TailRecursiveSink.swift; path = RxSwift/Observers/TailRecursiveSink.swift; sourceTree = ""; }; - F66C272989799EF13F81360E1C017FA8 /* ReplaySubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ReplaySubject.swift; path = RxSwift/Subjects/ReplaySubject.swift; sourceTree = ""; }; - F66F8FA9D9F10664C9F489F1269F98DF /* RxTabBarDelegateProxy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTabBarDelegateProxy.swift; path = RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift; sourceTree = ""; }; - F76A5767868EEC85D18A54572FBCD81A /* ControlTarget.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ControlTarget.swift; path = RxCocoa/Common/ControlTarget.swift; sourceTree = ""; }; - F7EC4A07F640498E3C09CF04CA41F8AD /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - F8034985B3EC17A7E2342F189A8E9CB5 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; - F91E4CF84F2D4A6186BA9942925F0A98 /* Single.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Single.swift; path = RxSwift/Traits/Single.swift; sourceTree = ""; }; - F924BD66C536AFCE3DC9F9164E2E9C0B /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; - FA1060132DFD2AB326576E130DED3E4F /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; - FA5515C6C427AD47A97F70DF2CD05778 /* Resources.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Resources.swift; path = RxBlocking/Resources.swift; sourceTree = ""; }; - FA92CACE943A6A3DE1F08A99F7743432 /* RxTableViewReactiveArrayDataSource.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxTableViewReactiveArrayDataSource.swift; path = RxCocoa/iOS/DataSources/RxTableViewReactiveArrayDataSource.swift; sourceTree = ""; }; - FC20F83E3E7FB7D4EB564F808C1B327B /* NSObject+Rx+KVORepresentable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Rx+KVORepresentable.swift"; path = "RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift"; sourceTree = ""; }; - FD651BEC17628FA7D363C052776D4816 /* ControlEvent+Driver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ControlEvent+Driver.swift"; path = "RxCocoa/Traits/Driver/ControlEvent+Driver.swift"; sourceTree = ""; }; - FD6C7230757C77AB256FE566C0829575 /* Debounce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debounce.swift; path = RxSwift/Observables/Debounce.swift; sourceTree = ""; }; - FDAF51E36E2E49A2CE5C7C225DFBE9FD /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; - FDDDCEEBC8E402CB7B1E298204F6AEAA /* UIDatePicker+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIDatePicker+Rx.swift"; path = "RxCocoa/iOS/UIDatePicker+Rx.swift"; sourceTree = ""; }; - FE5E678A806C0231CD469C9BC25CAB7F /* UIProgressView+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIProgressView+Rx.swift"; path = "RxCocoa/iOS/UIProgressView+Rx.swift"; sourceTree = ""; }; - FEC069B8B2E2182CF94B26FAC7D5103A /* Sequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sequence.swift; path = RxSwift/Observables/Sequence.swift; sourceTree = ""; }; - FEC42B384C176F3FBB8E14A1BC104281 /* RxCocoa.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxCocoa.swift; path = RxCocoa/RxCocoa.swift; sourceTree = ""; }; - FF8B264DFE802855D5D67E7CDDABFC3C /* RxRelay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxRelay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FFEDE2546041B88AB7FCD97EE4D4BFEE /* VirtualTimeConverterType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeConverterType.swift; path = RxSwift/Schedulers/VirtualTimeConverterType.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3BDB6584AE9F1E728DDA1470BE90BE47 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 16318138193380BB984F425ED3ECCB95 /* Foundation.framework in Frameworks */, - 4B552609516064140427EEB49FA25216 /* RxSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 43E6D56F7F3748001C1B26B671EDC448 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 078528915ABA677900726FAE8A8D0D05 /* Foundation.framework in Frameworks */, - 598FFFD4D64B8A54CD141F10274D8F4F /* RxRelay.framework in Frameworks */, - 7B89A3FFC01803E264A95FEC8BC0605C /* RxSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 610ED85E10506698ACD5FF8D1CD80EFE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B57B0ECB4E176EFDD3882590110DE45 /* Foundation.framework in Frameworks */, - D843124BDB94AAE32303A503BFA60127 /* RxSwift.framework in Frameworks */, - 3730C3B3838E32ABC80351B3D0B8921F /* XCTest.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7EBE11992074C990A98C297AF971E356 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F4BC2D1A81ACF9E401CA354EEF9796DB /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97660778CA88990C0CB17550A325085D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5D02648BB692F6257886933D02A4A7EA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B088800CDC7FD13C6A8D81A3A9787AB9 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 71F9E7C80EB5DC3D8BABB4350B0465A9 /* Foundation.framework in Frameworks */, - E930FB414E56DB4E95FB2C230F8AC1F3 /* RxSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F52ED7086F71FFC17988CAAB2853D6FD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 10826D29F709FA504C1C2833C71F21B9 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F53B9470659BF11B94730CFF73C7309F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B9C4C2D9D439A0EDA8C80F495601E34B /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FC3DA349BB4845429B354BB85122E19E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 90347FFE967F9F20BE4960708ACBB4EC /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0AB01E2329EBCE3B298D260BA920EF6C /* Pods-PcVolumeControlTests */ = { - isa = PBXGroup; - children = ( - 253D4B467DD3B5309124C5C3DBB60930 /* Pods-PcVolumeControlTests.modulemap */, - 64120DF1F430BD51B8A88CFF60FFEAF0 /* Pods-PcVolumeControlTests-acknowledgements.markdown */, - 7A96E02AF26A80E8347C627DC307547C /* Pods-PcVolumeControlTests-acknowledgements.plist */, - 8D1403DD174C1FF1C9AE643F9464069E /* Pods-PcVolumeControlTests-dummy.m */, - E61B3FFA9AC88211931C4D889F4EE43D /* Pods-PcVolumeControlTests-frameworks.sh */, - 4E46A70998C88D63FB8CA21D091725BF /* Pods-PcVolumeControlTests-Info.plist */, - 5207F4CB7D3CE803A751067C05FADCB4 /* Pods-PcVolumeControlTests-umbrella.h */, - 27C6E01E5D9F9110F1AC1B679469F07B /* Pods-PcVolumeControlTests.debug.xcconfig */, - 8B7729AFF77A9173CE034081A3F05178 /* Pods-PcVolumeControlTests.release.xcconfig */, - ); - name = "Pods-PcVolumeControlTests"; - path = "Target Support Files/Pods-PcVolumeControlTests"; - sourceTree = ""; - }; - 0CEC9262508E857356E36730781F6DFF /* BlueSocket */ = { - isa = PBXGroup; - children = ( - 4CACDCB7F01783F715B521DE6EF06C67 /* Socket.swift */, - F46DA9B774F2F6FA34DA8D996961ED06 /* SocketProtocols.swift */, - D21484AB05526AEB5AAC8FDCC446BF75 /* SocketUtils.swift */, - E5D8DE53B6E7F6C841F30093797B8F33 /* Support Files */, - ); - path = BlueSocket; - sourceTree = ""; - }; - 2BB727F2D54B1EEA5EF74A033D0F4367 /* RxTest */ = { - isa = PBXGroup; - children = ( - 23EE333EDD0DADA041038F3A19F4DA66 /* Any+Equatable.swift */, - D89625B3CCCFF38EA492AF1CED0289B2 /* AtomicInt.swift */, - 5BAF562BCB361D79C2A47F5715155704 /* Bag.swift */, - B9DE8684B1E32151B349AC4C3BD0FB39 /* ColdObservable.swift */, - 9EEEE92138CCE9BBBF9C700C7CB938F4 /* Deprecated.swift */, - B84E6AD26A488E4FC3B1A381B968AC10 /* DispatchQueue+Extensions.swift */, - 099E8B440B222A6AE621B3C654902672 /* Event+Equatable.swift */, - 26E73CE14BAF3E57647F98CD373FE1F3 /* HotObservable.swift */, - 30226535CC498A43D268D346D0376E31 /* InfiniteSequence.swift */, - F31FFBF8C01753EA17359B324A16CDA2 /* Platform.Darwin.swift */, - 4E7835E25BE79F606718DCBF49942D46 /* Platform.Linux.swift */, - 7BCF3EA68311835C0BD05ADC42BFEFF2 /* PriorityQueue.swift */, - B5DCE44F75A96600C8B474D9F159D745 /* Queue.swift */, - 098EA338ED568B0259919E2EED409E28 /* Recorded.swift */, - 2CD87A13A8B9C153A3C6B9F4AEC4EA12 /* Recorded+Event.swift */, - CBCB54C19D7402E81E25B0D60449CC74 /* RecursiveLock.swift */, - 82E5DDD7234E6B2CD65D86DC6FFA4C69 /* RxTest.swift */, - 58AA9774E4130E068C4143DCE47E77B8 /* Subscription.swift */, - 9AB01AC1EE3267F3A6ED2EE30B7EE993 /* TestableObservable.swift */, - D0B560C68169CF08892FA2FB0562B80C /* TestableObserver.swift */, - 0B8B4B83352419701DB8C6372C64CDDA /* TestScheduler.swift */, - DBF38FBA72F5B4A09A1C364C99BE93EF /* TestSchedulerVirtualTimeConverter.swift */, - 66C34338099F88821AA4C25FF25C001C /* XCTest+Rx.swift */, - BAE30FB378868FE6A4766EB7E62B4356 /* Support Files */, - ); - path = RxTest; - sourceTree = ""; - }; - 2C6706428CF02EDDD35FD12DBBCFDF4E /* RxBlocking */ = { - isa = PBXGroup; - children = ( - C53D921AEFACB183CF6653D4DBDE8619 /* AtomicInt.swift */, - 2EB8E3160B0DB0E173919538EA7ECFF2 /* Bag.swift */, - A7C2CB39E3790B67A9CBD8D9F50ECDAC /* BlockingObservable.swift */, - CCE4663CDED2BA3A827DE9BA659AA19C /* BlockingObservable+Operators.swift */, - A7B113B4194E7BA4E6A0BC8785C93064 /* DispatchQueue+Extensions.swift */, - F7EC4A07F640498E3C09CF04CA41F8AD /* InfiniteSequence.swift */, - BA8DBB7F6CBB38DC3C5E2342D499E7AB /* ObservableConvertibleType+Blocking.swift */, - 09467A1E2AFCB6BADD58E02F55F6A4F9 /* Platform.Darwin.swift */, - 2D51860C5B63891FC7487FB7D8368E65 /* Platform.Linux.swift */, - D59E1336AE8D35E4E50774DA5E085618 /* PriorityQueue.swift */, - BBF810D29148F1F5301466D67B33FEAE /* Queue.swift */, - 5A7E8B9B962928D03BA5ABC87C3D3822 /* RecursiveLock.swift */, - FA5515C6C427AD47A97F70DF2CD05778 /* Resources.swift */, - F21FB119D0847595073A4D88EC548560 /* RunLoopLock.swift */, - F5D915E8871060A0EFDE874B8CC08F5D /* Support Files */, - ); - path = RxBlocking; - sourceTree = ""; - }; - 3C346CBBE959E8CF6E5F91C3A259E66A /* Pods-PcVolumeControlUITests */ = { - isa = PBXGroup; - children = ( - EE1463ACD5544288C4EDD8BBF4AA42BC /* Pods-PcVolumeControlUITests.modulemap */, - 0C526544037BFD565471F127F408ADBE /* Pods-PcVolumeControlUITests-acknowledgements.markdown */, - 33A46EB293988E6E6C72D55C1CF058B4 /* Pods-PcVolumeControlUITests-acknowledgements.plist */, - D13EEC60488930A2BE8EA5A35BB19225 /* Pods-PcVolumeControlUITests-dummy.m */, - A741A5A53A37DB703EF34E996811C2BC /* Pods-PcVolumeControlUITests-frameworks.sh */, - F0E8206C4187405C4B549752F59EA214 /* Pods-PcVolumeControlUITests-Info.plist */, - A4BD8970D67E3DD90F7934E8313595AE /* Pods-PcVolumeControlUITests-umbrella.h */, - 18BE500FB78D87EBA22326C167F21292 /* Pods-PcVolumeControlUITests.debug.xcconfig */, - 8BD746CF61BACCCCF3104079FFF7981A /* Pods-PcVolumeControlUITests.release.xcconfig */, - ); - name = "Pods-PcVolumeControlUITests"; - path = "Target Support Files/Pods-PcVolumeControlUITests"; - sourceTree = ""; - }; - 48AF887A5D0C65BB74C186B9F8A61714 /* RxCocoa */ = { - isa = PBXGroup; - children = ( - 73189D64ED7807DC22D1C248267A0C5E /* _RX.h */, - 9A63C7D75B1C447583AB0AED13ABA5B8 /* _RX.m */, - 96AA39AF96C15A6B93ACD4D58A0B47CA /* _RXDelegateProxy.h */, - 600BC116481E2AFD6A7E33C892CCD5A9 /* _RXDelegateProxy.m */, - D6F3B680E9B355EB0985F10CBF97EE81 /* _RXKVOObserver.h */, - 1DEAE85DA1633BD7D8460C255894228B /* _RXKVOObserver.m */, - 76B9E369650A4B316F7C5DDBD0744153 /* _RXObjCRuntime.h */, - 30FE4976007E1812618427E7D50156AB /* _RXObjCRuntime.m */, - 914EE1F1ADA0DE328328CCBC5DC5CFAA /* Bag.swift */, - 07EA5134AF7CD060DC3BB4B3E7AE9A50 /* BehaviorRelay+Driver.swift */, - 920EC7400A2B7EB2C40A30B5A7DD462B /* Binder.swift */, - 1F79FA00A6A46A94D6D1AFF1F7BFFA8D /* ControlEvent.swift */, - FD651BEC17628FA7D363C052776D4816 /* ControlEvent+Driver.swift */, - 739B6586072863C18F6C1FA627125930 /* ControlEvent+Signal.swift */, - 220456D17AD0859A62ACEBDB033E10BC /* ControlProperty.swift */, - B81A32278B219F44E7FADFB3B757FA83 /* ControlProperty+Driver.swift */, - F76A5767868EEC85D18A54572FBCD81A /* ControlTarget.swift */, - B4D9AA4765EA172240BDC16A827522DE /* DelegateProxy.swift */, - 42227B25516DCEEC26D53B46B6CA74F3 /* DelegateProxyType.swift */, - 27EDE187E0CD19195FC41A6F350FD7A8 /* Deprecated.swift */, - 1DF60C44D5D9B4C6AB2D284F6BF01126 /* DispatchQueue+Extensions.swift */, - 3DDC66BB8BCE36CECDE5BA6A342376EC /* Driver.swift */, - 1B710B273342A5AB32AB22D11A686359 /* Driver+Subscription.swift */, - DA8401AC17F31379D98EF59446BAF032 /* InfiniteSequence.swift */, - DAC1CA51690127BADD8268871BA10257 /* ItemEvents.swift */, - 048FB3F4149F0B24806E1C8193517A44 /* KeyPathBinder.swift */, - 962A2D7DC2DC1F6F4D82212001386836 /* KVORepresentable.swift */, - 8EBEF8564A6A80DD98F8693318C8AA46 /* KVORepresentable+CoreGraphics.swift */, - 09967C09CC722CE7DA86AF15AC8CD80E /* KVORepresentable+Swift.swift */, - 181CBB1C009684C3977A6C15AE440B9B /* Logging.swift */, - 767F3C9AA8A5A5484ABC95488FC303F5 /* NotificationCenter+Rx.swift */, - 80351B824222A0C15393481E7AD8F68B /* NSButton+Rx.swift */, - 7DCEE586A7E52CC3FB5639949171ECD1 /* NSControl+Rx.swift */, - 1E01A9A5EE0038D5E75A4B4414F26F09 /* NSImageView+Rx.swift */, - EB96E6BA75A50964BB1BB4EFAF203B0A /* NSLayoutConstraint+Rx.swift */, - 31A0849E113149648B5B7EDE73C8C442 /* NSObject+Rx.swift */, - FC20F83E3E7FB7D4EB564F808C1B327B /* NSObject+Rx+KVORepresentable.swift */, - 851C579244CB1DB947EE2DA501458D89 /* NSObject+Rx+RawRepresentable.swift */, - CEA0DB824165FFF3867A11A35E647426 /* NSSlider+Rx.swift */, - D46FE6C3D6717733751AE0053881B9CE /* NSTextField+Rx.swift */, - 97A1CF44A31E7DDBF64E5E753D35F8D4 /* NSTextStorage+Rx.swift */, - 9F9EB0869DAC0F9EE44D40CEA279645F /* NSTextView+Rx.swift */, - 166A0CC13503947F6D46C3AA0196792C /* NSView+Rx.swift */, - AA26EA5F2E7FB5AB3AE2FD9A8930AE8C /* Observable+Bind.swift */, - 7ED55174B34321A98809FD3DC84761D9 /* ObservableConvertibleType+Driver.swift */, - B523BEA6A1E0C0AA62A4EE54B9691165 /* ObservableConvertibleType+SharedSequence.swift */, - 93CEEE20931225ADE8D703A70149C14A /* ObservableConvertibleType+Signal.swift */, - 891A6D75976555954426B79D492C4971 /* Platform.Darwin.swift */, - 7BC86DC70093E8081E593935F717561B /* Platform.Linux.swift */, - B7D3727B31153C2C246C1892457042AE /* PriorityQueue.swift */, - AFB4FABD07CD59D4F94AA56C2F166D64 /* PublishRelay+Signal.swift */, - 344E1512ADE7E2518F55A574B1FB21DE /* Queue.swift */, - FA1060132DFD2AB326576E130DED3E4F /* RecursiveLock.swift */, - 23D265A0A6313B6753EE030B326EFADD /* RxCocoa.h */, - FEC42B384C176F3FBB8E14A1BC104281 /* RxCocoa.swift */, - 719E178033EA58EACE9F8716092FA39F /* RxCocoaObjCRuntimeError+Extensions.swift */, - 7620351B28E8A341F448FBB95F32B7B0 /* RxCocoaRuntime.h */, - 0270717B67AB64958F33B751E399B1FE /* RxCollectionViewDataSourcePrefetchingProxy.swift */, - 3EBDBA8FC1B6B915D20FB7BCF39F86FA /* RxCollectionViewDataSourceProxy.swift */, - 50BCE5EA60BD541EE36EDC4A9728848C /* RxCollectionViewDataSourceType.swift */, - 610AF6A47A8112D10FEF0C3E9A84A0D8 /* RxCollectionViewDelegateProxy.swift */, - D54A48EDA1399DC12FD94900CA7E6858 /* RxCollectionViewReactiveArrayDataSource.swift */, - 99E8C87C656FD344BEA874626C5A487E /* RxNavigationControllerDelegateProxy.swift */, - D4598BE4E8CFFD32CF8AC2E80B9A65A6 /* RxPickerViewAdapter.swift */, - 9793F52F5D100FDD4DC9CCD52169560F /* RxPickerViewDataSourceProxy.swift */, - DDB9374FC7A3970B7B3F4A990FCC1E45 /* RxPickerViewDataSourceType.swift */, - 17D598A83DEC75328A2A44744B3E7B41 /* RxPickerViewDelegateProxy.swift */, - 2FC743E3B269BFDA2AC3E94BC2766D17 /* RxScrollViewDelegateProxy.swift */, - 131264B7D064AEFC96A35EC99FE843FA /* RxSearchBarDelegateProxy.swift */, - B5C4DF39F9FAD8934D7D17B07A523428 /* RxSearchControllerDelegateProxy.swift */, - 23651465CADFA0D4FB3DA2B796748A59 /* RxTabBarControllerDelegateProxy.swift */, - F66F8FA9D9F10664C9F489F1269F98DF /* RxTabBarDelegateProxy.swift */, - 5F0105057D55ACD1C48F21477455B113 /* RxTableViewDataSourcePrefetchingProxy.swift */, - 73BCCC1B87080B021E438BDB1235C9A2 /* RxTableViewDataSourceProxy.swift */, - 2006D9E3BE92EFA8F0BC5BB5DCAE9F2E /* RxTableViewDataSourceType.swift */, - 35CC61964335426092725FAFF66EAD20 /* RxTableViewDelegateProxy.swift */, - FA92CACE943A6A3DE1F08A99F7743432 /* RxTableViewReactiveArrayDataSource.swift */, - CE63DDA1F4EC3D2464B690D040746B2B /* RxTarget.swift */, - B5D5EF8E7D07BF7EF05109A755FF18B5 /* RxTextStorageDelegateProxy.swift */, - 62451FAAD81CFCF6E46CC62D6D6E2B83 /* RxTextViewDelegateProxy.swift */, - B57E69753E98BA31D36AE83678887BE5 /* RxWKNavigationDelegateProxy.swift */, - 154CE2131A84EF752F8F6704E6DFDE02 /* SchedulerType+SharedSequence.swift */, - 7AB3643236C1676D203E0523FF1303A4 /* SectionedViewDataSourceType.swift */, - D0A1980CAF8CEAD004C5AFB67D2879CE /* SharedSequence.swift */, - 4AC3DADABBB1384AB2DFF5D262484D6B /* SharedSequence+Operators.swift */, - C79617BF9FCBFF1731059AC8EA88CDBD /* SharedSequence+Operators+arity.swift */, - D4821A3514BD4C5BC6853EB5A79BB288 /* Signal.swift */, - 35944A73E70B0BD8E6B7EF336209BA80 /* Signal+Subscription.swift */, - 2E29D109F52747AA1D58208FBC2EB284 /* TextInput.swift */, - 5221C596A14A5F4D76684A2836EBF1E4 /* UIActivityIndicatorView+Rx.swift */, - D1563E317B323E3F76370769B9109D2D /* UIAlertAction+Rx.swift */, - 611AB914C1F029F3A8663D33234B66AD /* UIApplication+Rx.swift */, - EF67DE364D34102B8A5D429A3D07D434 /* UIBarButtonItem+Rx.swift */, - E30D86B22BBC03C62DC23EB6F660153A /* UIButton+Rx.swift */, - 387CB3BEDC3D95B2B91E15FF3737FCC2 /* UICollectionView+Rx.swift */, - 29A1611929CFCD41D560394B729CC00C /* UIControl+Rx.swift */, - FDDDCEEBC8E402CB7B1E298204F6AEAA /* UIDatePicker+Rx.swift */, - 59F8771D85BD85428B691FC825409630 /* UIGestureRecognizer+Rx.swift */, - 10C4EF4AF0CBFFEA88F3BBF0E684121D /* UIImageView+Rx.swift */, - 3B37C57B0507E31DDF703F723F426757 /* UILabel+Rx.swift */, - 0E6BF0D3D58FA551004F59312E656C48 /* UINavigationController+Rx.swift */, - A46436DD08BCF9F5A18AB7C70F83FB38 /* UINavigationItem+Rx.swift */, - 8761CD40CB2EE84EBC556B774F24A254 /* UIPageControl+Rx.swift */, - 7DD2722E8EAFCF9270ACBA219F7B1B27 /* UIPickerView+Rx.swift */, - FE5E678A806C0231CD469C9BC25CAB7F /* UIProgressView+Rx.swift */, - 20C3F40C837D8C31C01C9F2096CFB1D9 /* UIRefreshControl+Rx.swift */, - 86CA65FAFADFF769BF2C013D4482126C /* UIScrollView+Rx.swift */, - 5B879DD34FC39A4CC9F6EAEB7445BBAB /* UISearchBar+Rx.swift */, - 34FF63E1E4A7336468B43DE5A4D35CAE /* UISearchController+Rx.swift */, - CD4DFF39D517BAEAAAA9BD1E90B52826 /* UISegmentedControl+Rx.swift */, - 3B4FD13E2BFC8D28087418FD13576E11 /* UISlider+Rx.swift */, - 4BCD7808A9ABABD4C8211067531A0651 /* UIStepper+Rx.swift */, - F0E0689D9A311E9720BE7C70760E1795 /* UISwitch+Rx.swift */, - 15469A2777B60A2C46DB0212EDFB2224 /* UITabBar+Rx.swift */, - D320FA86507DC04F4238F91E5B31960A /* UITabBarController+Rx.swift */, - 07E6CC74BF9A1A72BD8D5B4A71C2D567 /* UITabBarItem+Rx.swift */, - 89027CF30FA8BFF667023C99C1701A7E /* UITableView+Rx.swift */, - 4789720F73E206BE3AF35D7F5062A684 /* UITextField+Rx.swift */, - 3BA85C8508DA2B3707CBD714AD735261 /* UITextView+Rx.swift */, - 6168A6FF91D446E5FDE3EE8CE21DD858 /* UIView+Rx.swift */, - E62AE29692EC793033A8F16F4BD5D2A8 /* UIViewController+Rx.swift */, - B5D9E991EE31AB6821D24FBA085FF567 /* URLSession+Rx.swift */, - 952870A91D76D2FA56A0C2DCD45CF810 /* WKWebView+Rx.swift */, - E4F0913B647E7B70C19DC40D9FF7DC11 /* Support Files */, - ); - path = RxCocoa; - sourceTree = ""; - }; - 65CF9112EB8B18D7A1E9FD5B901A9558 /* RxRelay */ = { - isa = PBXGroup; - children = ( - A04DCFCD5917489D0B84218953AB52CA /* BehaviorRelay.swift */, - F0D44B25231A947F6CB92AE86FF8003D /* Observable+Bind.swift */, - 2BE6FE61853CB720E75D2C37BC30FC01 /* PublishRelay.swift */, - 0B4D7A0304C2AA8BBA54D3CC90D45FC9 /* Utils.swift */, - DB470183D514D074CC61AD34168D1431 /* Support Files */, - ); - path = RxRelay; - sourceTree = ""; - }; - 6DC6A37C370349D726EE7E85B18EB907 /* iOS */ = { - isa = PBXGroup; - children = ( - 165257FF5CC4855BFF00503538487274 /* Foundation.framework */, - BE80D5D46A21936442FD346C31626856 /* XCTest.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 8E7B64E067D246B209D95430C961FC70 /* Pods-PcVolumeControl */ = { - isa = PBXGroup; - children = ( - A90DF1967AC48650BB379D32C9D030D2 /* Pods-PcVolumeControl.modulemap */, - E59351142D883FD61600EE08A069754F /* Pods-PcVolumeControl-acknowledgements.markdown */, - 5E465F9148B7D453DD7FD0EC630D10C6 /* Pods-PcVolumeControl-acknowledgements.plist */, - 22214056065CF1225B13DFBC526343DA /* Pods-PcVolumeControl-dummy.m */, - 823EE588F8140D8595B221C32C02FE6E /* Pods-PcVolumeControl-frameworks.sh */, - 7F60DF601C49DB01E68C4A52045CB662 /* Pods-PcVolumeControl-Info.plist */, - F3EFDD9B2D0603F737B583D0A44A3788 /* Pods-PcVolumeControl-umbrella.h */, - B84337E7D25E148FB59E6DCA4E1B1795 /* Pods-PcVolumeControl.debug.xcconfig */, - B1CE6B0E749417F2A2E2DFE94B2446FA /* Pods-PcVolumeControl.release.xcconfig */, - ); - name = "Pods-PcVolumeControl"; - path = "Target Support Files/Pods-PcVolumeControl"; - sourceTree = ""; - }; - A6EEDDCEDADF3C175A8BCD2F569758F4 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 83D73284DCEE4FE8C76234DE2ACCD393 /* RxRelay.framework */, - D4F5CAC3DFDC297B2C56D647BF7C7813 /* RxSwift.framework */, - 6DC6A37C370349D726EE7E85B18EB907 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - BAE30FB378868FE6A4766EB7E62B4356 /* Support Files */ = { - isa = PBXGroup; - children = ( - B76C9C95A08C0C020CBCF459A1CFC06B /* RxTest.modulemap */, - 573737E40443ECB361FAE27B3F4FD968 /* RxTest-dummy.m */, - 5CF3841C7C72D588D674AA3D6A1AD8F7 /* RxTest-Info.plist */, - 383841701BC1ECFE19EE9D75CBA3D7B7 /* RxTest-prefix.pch */, - 927825C3D1C54F29A91BC57C5D2EF38D /* RxTest-umbrella.h */, - F329E40A0D94C2B155B3314D2966204B /* RxTest.debug.xcconfig */, - 32A239A894AD4158D32DEA5544B11697 /* RxTest.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/RxTest"; - sourceTree = ""; - }; - BBF88229E9AC014F8F0E9331443CE302 /* Products */ = { - isa = PBXGroup; - children = ( - 8313ECB065F3D9A7B7DA7EA38F1AED80 /* Pods_PcVolumeControl.framework */, - 672A6F808AEDDBD39617973AD123A7E2 /* Pods_PcVolumeControlTests.framework */, - 06069700E139C9B86AEB96E92C06824D /* Pods_PcVolumeControlUITests.framework */, - 25F63A531105CD4E1E4CCF5B918C5494 /* RxBlocking.framework */, - BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */, - FF8B264DFE802855D5D67E7CDDABFC3C /* RxRelay.framework */, - 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */, - 031893FD3D882E436EC541DF783B1276 /* RxTest.framework */, - 2EAA4A7F572E0FFFDA0F24140040D388 /* Socket.framework */, - ); - name = Products; - sourceTree = ""; - }; - BF11797B03CEF4155222D4E1527A46A2 /* Pods */ = { - isa = PBXGroup; - children = ( - 0CEC9262508E857356E36730781F6DFF /* BlueSocket */, - 2C6706428CF02EDDD35FD12DBBCFDF4E /* RxBlocking */, - 48AF887A5D0C65BB74C186B9F8A61714 /* RxCocoa */, - 65CF9112EB8B18D7A1E9FD5B901A9558 /* RxRelay */, - E749CDB2A6828FB71F76C135FA71DF40 /* RxSwift */, - 2BB727F2D54B1EEA5EF74A033D0F4367 /* RxTest */, - ); - name = Pods; - sourceTree = ""; - }; - CF1408CF629C7361332E53B88F7BD30C = { - isa = PBXGroup; - children = ( - 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, - A6EEDDCEDADF3C175A8BCD2F569758F4 /* Frameworks */, - BF11797B03CEF4155222D4E1527A46A2 /* Pods */, - BBF88229E9AC014F8F0E9331443CE302 /* Products */, - EC310C63A7FB7BBB2B7C3FFE7BF6C3E1 /* Targets Support Files */, - ); - sourceTree = ""; - }; - DB470183D514D074CC61AD34168D1431 /* Support Files */ = { - isa = PBXGroup; - children = ( - D2F2327DF7984B242385B151CE81BFDB /* RxRelay.modulemap */, - AFB62EEF626C81D502E306B9A1C7CD3D /* RxRelay-dummy.m */, - D9C04B5DDE964165FBBBA04A9377CF17 /* RxRelay-Info.plist */, - 4B994EE5E07D1BF43652D100A871F0AB /* RxRelay-prefix.pch */, - 60C0B50FE6E10775D3F7B9083CAD7666 /* RxRelay-umbrella.h */, - 50D4892E72CC2833C85ABC0C4C6456F8 /* RxRelay.debug.xcconfig */, - 06136030C196C955ECA4176CAA1ADB1A /* RxRelay.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/RxRelay"; - sourceTree = ""; - }; - E4F0913B647E7B70C19DC40D9FF7DC11 /* Support Files */ = { - isa = PBXGroup; - children = ( - 5D18B10095561AC312E3007488114FAA /* RxCocoa.modulemap */, - 73BBE312C3870BCDE55D9B078EE17E23 /* RxCocoa-dummy.m */, - D5751433DD3FB187CC2F6DCB15619BFE /* RxCocoa-Info.plist */, - 11F4A789AD047E72F89A5401D5D6AEB3 /* RxCocoa-prefix.pch */, - 9FC2DC1AC4ADCF68A27B6F7202E10327 /* RxCocoa-umbrella.h */, - 3DA709800162BB778D5A1A85F39A1D69 /* RxCocoa.debug.xcconfig */, - 3A080CF82E6070DDEAD577DFB62B774C /* RxCocoa.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/RxCocoa"; - sourceTree = ""; - }; - E5D8DE53B6E7F6C841F30093797B8F33 /* Support Files */ = { - isa = PBXGroup; - children = ( - A04FA66F88B68B16D138105418EAE28C /* BlueSocket.modulemap */, - 9714BB49556E4B7636C3C11879FE650B /* BlueSocket-dummy.m */, - 01127B024228016233228910D7B1C476 /* BlueSocket-Info.plist */, - 83015354BA695D4F72C7E6876DAA73AD /* BlueSocket-prefix.pch */, - 59EFC2D4069C6A578BF3DB7EE60F1616 /* BlueSocket-umbrella.h */, - 6C40FA4CAC354571D924B4EFABB7B856 /* BlueSocket.debug.xcconfig */, - D3691C2A7C228DB1FED8C5676B7C75EA /* BlueSocket.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/BlueSocket"; - sourceTree = ""; - }; - E749CDB2A6828FB71F76C135FA71DF40 /* RxSwift */ = { - isa = PBXGroup; - children = ( - B6D2204E1F5D39D9E464AC69BD6FEF6B /* AddRef.swift */, - 790CF14267C1CC1F6B2670D1DF7722DF /* Amb.swift */, - 7EC026A6D56A0FC9220E92D40B5FF2D4 /* AnonymousDisposable.swift */, - 18925B68ED164CA96235E423631E2273 /* AnonymousObserver.swift */, - 208033768002D1169CE4B6182DF60A3C /* AnyObserver.swift */, - 9E722E2E006E65505A86B6D9EFD1777A /* AsMaybe.swift */, - 6778845A74EB8B74A40C7BC912847643 /* AsSingle.swift */, - 0F626F932F2ABCD61B59E02C346F7C9F /* AsyncLock.swift */, - 93D19A24E094EFF08BED2B50C2008664 /* AsyncSubject.swift */, - CB30B1587B70AC8F44EA652EE682E88C /* AtomicInt.swift */, - 91E77B1F8808E0563BCC027CDA2465C6 /* Bag.swift */, - 155AF188C0BD3BE1A496B5E279B012F9 /* Bag+Rx.swift */, - 773C7FC7C6936A0DA3CAC55E343E7A60 /* BehaviorSubject.swift */, - 90CEBF5062A57446C96C58A956CC92FB /* BinaryDisposable.swift */, - 687BE6D9BFA94187D5CAB410C60F381A /* BooleanDisposable.swift */, - 7795CF42E93B2BFEC658EFBE3DC77DE6 /* Buffer.swift */, - F924BD66C536AFCE3DC9F9164E2E9C0B /* Cancelable.swift */, - 1CE5A79746F84C51945277878751D671 /* Catch.swift */, - F32CB5C5EFC5E65E11B19A8D8E27CF9F /* CombineLatest.swift */, - 699DD66CDE89DD28213C55E98B69FB22 /* CombineLatest+arity.swift */, - EEF0C7E650AE014FD61861E58F7816CE /* CombineLatest+Collection.swift */, - 04A0C33DE68099F3D0834B48D7E61F3C /* CompactMap.swift */, - BA2F982B0A4AB47A4BBD7E1C87B1B77D /* Completable.swift */, - ECC3381D41B7951075FD7027BDEF28AB /* Completable+AndThen.swift */, - 32E2E12FF808966D980F8B8F064F3394 /* CompositeDisposable.swift */, - 83341CE56A1CFAB8F2E630E520C8F129 /* Concat.swift */, - 15A370703B64DEF04F3A91C3ED9AAE34 /* ConcurrentDispatchQueueScheduler.swift */, - 8BC2DBD42567365F39445A2168D560C3 /* ConcurrentMainScheduler.swift */, - 391A4527BA7FB320E579457466D28438 /* ConnectableObservableType.swift */, - 8FD8CF0F7F1817703817008DB3971509 /* Create.swift */, - 80ADF2C64A4359E91C47EE7F5196A743 /* CurrentThreadScheduler.swift */, - 2E8E497C9F8030D6876FA267A97AA7D2 /* Date+Dispatch.swift */, - FD6C7230757C77AB256FE566C0829575 /* Debounce.swift */, - 7A68042F9094FFEE5B7AAD953D90710E /* Debug.swift */, - 86F8264F204FF9728CE76CC2CA04937A /* DefaultIfEmpty.swift */, - A13DC759F93839015BEB2246FCDFA805 /* Deferred.swift */, - 79441A1750CE19E6B380E697D0D7B829 /* Delay.swift */, - 4F067D39E1B6B85C3377ACB8B664960C /* DelaySubscription.swift */, - BDED50D08B2D5C26ED0EF50C6008EC4C /* Dematerialize.swift */, - 3A3CCAF883F07E82917B4B37ECA4ED78 /* Deprecated.swift */, - 60934104679A77E69B1C54A2CD3619E6 /* DispatchQueue+Extensions.swift */, - 340B4B8A27B28EDC76E34C0E1C7A509A /* DispatchQueueConfiguration.swift */, - 82EA063964EBEA27D1BAE1B55D874A13 /* Disposable.swift */, - 73D4277FE68534C0781645FD7E224A09 /* Disposables.swift */, - 6F7D3B69E3AF3022081770EBECFC6401 /* DisposeBag.swift */, - 61A438B0595BA529862F9743A470E070 /* DisposeBase.swift */, - 94ACA206557A2026FC70584A9BAAFEBA /* DistinctUntilChanged.swift */, - 34C400E4271318E54E4398B8AD23E46E /* Do.swift */, - 4C8697C71D8D2CACB1A92BB76F332497 /* ElementAt.swift */, - DBD0B332DB80C92F2C36B077F72970CC /* Empty.swift */, - 57868C25F97BE3D81C1DDAADE8952117 /* Enumerated.swift */, - 9F90C4E3FD040BEEBAD3C01BAF976F9A /* Error.swift */, - 8AC453398D54811E2D26DED8AE7F989F /* Errors.swift */, - E49AF36AA609DBE37A99ACC2804E2F7F /* Event.swift */, - E72977F6C509287602523CE31A31AECD /* Filter.swift */, - 8B5CFBC3EB91E3A8009F3A6E5473CF14 /* First.swift */, - FDAF51E36E2E49A2CE5C7C225DFBE9FD /* Generate.swift */, - AF2B50B0AC5AE903980CB790F3924943 /* GroupBy.swift */, - 73B5C4BE43AA97963F1EF5714386B8CF /* GroupedObservable.swift */, - 0513FD2340BCCF43D3F413CEF6F38EC2 /* HistoricalScheduler.swift */, - F8034985B3EC17A7E2342F189A8E9CB5 /* HistoricalSchedulerTimeConverter.swift */, - 6D2F87CD2648E2E337CC65D7542690E8 /* ImmediateSchedulerType.swift */, - BA81CB87E410F5AF2D41B869CD499A90 /* InfiniteSequence.swift */, - 6F1A45F65531AD9BC5F0C07C459A30B9 /* InvocableScheduledItem.swift */, - 24663DE5E1499CECC9AC55C674033FA6 /* InvocableType.swift */, - DD42FAEB71A0973109D56FE0A8527F98 /* Just.swift */, - A2D2B1036836675AA80D49D407484AA9 /* Lock.swift */, - F1667ED6BDEC874DE054C507D8F92586 /* LockOwnerType.swift */, - E2359342B12D3713C27DBFE59C1FC13F /* MainScheduler.swift */, - 81D710E6D1E7795507B8080DB8596F88 /* Map.swift */, - B3FEE371711FCB432564D16F9EE528F9 /* Materialize.swift */, - 3238BB2EEBCCF23A48791BEA5AD66BCD /* Maybe.swift */, - 9B10EAF3427C31A47AEF4576CF4D0D39 /* Merge.swift */, - 1EC6246354D2FAD02975AA3CECE9C780 /* Multicast.swift */, - 4B204EADFE4C49400DF283B0402CDC4B /* Never.swift */, - 270BE29C4EAB305B008CA0DCE0A4512E /* NopDisposable.swift */, - A42D6E2211762AD71977418257026DD5 /* Observable.swift */, - 8C5FBE194C05050EB13FDE015F2B6071 /* ObservableConvertibleType.swift */, - AB73D5684CA035AB3885E38B34D0E449 /* ObservableType.swift */, - 4DBBCCC05467DB43BAA3EFA593D61103 /* ObservableType+Extensions.swift */, - 39A2E5CC10432212E8094E7AE8FE3147 /* ObservableType+PrimitiveSequence.swift */, - 68D5CCB1042F162F35079AD68B57A83C /* ObserveOn.swift */, - 3B22C9F294C0BDF459CC5A59702876E4 /* ObserverBase.swift */, - 480912712FCA3DA3AFAC55800DA606E2 /* ObserverType.swift */, - 83119221C3E965D4FE30DCF7A54071E4 /* OperationQueueScheduler.swift */, - 2178322EBEBABAAA5B6D95D8318B549E /* Optional.swift */, - 2C4CC2E6D04E25FB4FCF3595214A9B2B /* Platform.Darwin.swift */, - 95772CCF646929B74805B0A3730517C7 /* Platform.Linux.swift */, - 2E00A494E3B133E1B785EDF506D7B806 /* PrimitiveSequence.swift */, - B49E9E4DE7C006960F429A7AF3DE0C04 /* PrimitiveSequence+Zip+arity.swift */, - 5F36F006737B6061F5654E714C6546A1 /* PriorityQueue.swift */, - B20EB781D77AEFC0011D94F24DA28F3B /* Producer.swift */, - 30830F72C5EF27D43304F584471C4218 /* PublishSubject.swift */, - BF93C101A10F05DD891B341CE8772CA2 /* Queue.swift */, - 734014B530EE72A237D06A031BC7177F /* Range.swift */, - DC137B9D2C5A7F4B81587418A25F6D9C /* Reactive.swift */, - C782B445229E3ECDA116760525E46D4B /* RecursiveLock.swift */, - DD106A8A5EC48162E34C74F0F8D068E8 /* RecursiveScheduler.swift */, - 6704212EBA8F24926AA1939A3E6D7E46 /* Reduce.swift */, - 1338756395646BAA5F040AF5F8FF6679 /* RefCountDisposable.swift */, - 8A3AD50DFFFECE8B61274269F68766AD /* Repeat.swift */, - F66C272989799EF13F81360E1C017FA8 /* ReplaySubject.swift */, - 03CA2A7946DB7F1C458886EFE6C22714 /* RetryWhen.swift */, - AA15CFA9182243F43CFBF4FD89F2A93B /* Rx.swift */, - ED259FCB363C34FA2263A4F6835C2B64 /* RxMutableBox.swift */, - CD6C733ABC5A0826C4EE51C10ACED04C /* Sample.swift */, - 8A8ADD3B595FE2B93BA67794EDB3B677 /* Scan.swift */, - 20A02F08D8E100FC57061EF062715E59 /* ScheduledDisposable.swift */, - 423F60E8A2B399193EA0698C7B8FE4DB /* ScheduledItem.swift */, - AD48D455962D9964B44E0533B1BD3A82 /* ScheduledItemType.swift */, - 5879542193EA1E2A64EDE67D19C197B8 /* SchedulerServices+Emulation.swift */, - 6740716AB5E480DD1B9618635A89B2C1 /* SchedulerType.swift */, - FEC069B8B2E2182CF94B26FAC7D5103A /* Sequence.swift */, - F25AB16788DDFB81F872343984C07315 /* SerialDispatchQueueScheduler.swift */, - 59A8C7F75D8B69949FFF84811D6F8283 /* SerialDisposable.swift */, - F64080C1DC981269258F636EBF6F8B63 /* ShareReplayScope.swift */, - F91E4CF84F2D4A6186BA9942925F0A98 /* Single.swift */, - E2BDBD7740FCC4514E2EC9B8DA306DC3 /* SingleAssignmentDisposable.swift */, - 471366590AF76D70B2C27B730C5E2E72 /* SingleAsync.swift */, - 72AC498A230F32F79390FA120F1A9F12 /* Sink.swift */, - E757922DB463B4F6C4139D799D8188F2 /* Skip.swift */, - 7B97E75224814A71A8A8AFCD3536D66F /* SkipUntil.swift */, - 50482F5A113D6275248A9AC03F9CDA5A /* SkipWhile.swift */, - EC5F8EB40237D39081796D6D290878A5 /* StartWith.swift */, - 5FAEB945F5EDA7B6B5E1A3843DBB9A85 /* SubjectType.swift */, - 0D4DF6F93775A4FDAAEA82D1650C6BCE /* SubscribeOn.swift */, - 931EB10A575FB0180AB3B8D270F9BF62 /* SubscriptionDisposable.swift */, - 5291EFE39BF2A9B4E10217FE9236D7E8 /* SwiftSupport.swift */, - BF1875F1FDB6E9DB873613B08E4345B8 /* Switch.swift */, - 311F6F60BA232FA7E07FA55B9A03487E /* SwitchIfEmpty.swift */, - 353624585E9506600A21FF8127232A63 /* SynchronizedDisposeType.swift */, - 8F72A5AC6D55C67DC2497D003392DF72 /* SynchronizedOnType.swift */, - D843788095528E29F1214B5BCFD6CFE0 /* SynchronizedUnsubscribeType.swift */, - F6662F9FD685EDEFF18128FBF12A5853 /* TailRecursiveSink.swift */, - E9DEB3037153FAAF05EFF55933992778 /* Take.swift */, - 85FE5F61F86D1EABDFF892254666CEC6 /* TakeLast.swift */, - 0D1684EA39AF315405DADFC3B55312F8 /* TakeUntil.swift */, - F36537A401A2CC98DC9744125F59A037 /* TakeWhile.swift */, - 8D5625A644D7F35DC3122A8C34AE8C44 /* Throttle.swift */, - 616DF0F168F14FB83D813C1D969335ED /* Timeout.swift */, - 88B03981F7F864198033B38703CA0EDD /* Timer.swift */, - DBF3724FA6EA3A343B5A587B0E20B7BB /* ToArray.swift */, - 34B1B702F762FF15B8EBFDD40A1C3F26 /* Using.swift */, - FFEDE2546041B88AB7FCD97EE4D4BFEE /* VirtualTimeConverterType.swift */, - 5F3DB97C92CF101387BBEE919C3E562C /* VirtualTimeScheduler.swift */, - F5601C5B089E7DA00B58370D0FC120D7 /* Window.swift */, - E9E5999EF88C3D899FE8BFE72E0E8951 /* WithLatestFrom.swift */, - 77BBA6073E58C9168975FB180E3331EC /* Zip.swift */, - 2323B58D158A6DD1B70E0C01A82D0250 /* Zip+arity.swift */, - 8B5EDA780D21719DFE5B947D72B67BF0 /* Zip+Collection.swift */, - F80095A139635D55E88998A5B5BC0150 /* Support Files */, - ); - path = RxSwift; - sourceTree = ""; - }; - EC310C63A7FB7BBB2B7C3FFE7BF6C3E1 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 8E7B64E067D246B209D95430C961FC70 /* Pods-PcVolumeControl */, - 0AB01E2329EBCE3B298D260BA920EF6C /* Pods-PcVolumeControlTests */, - 3C346CBBE959E8CF6E5F91C3A259E66A /* Pods-PcVolumeControlUITests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - F5D915E8871060A0EFDE874B8CC08F5D /* Support Files */ = { - isa = PBXGroup; - children = ( - 5A66EF4E8F4BC1F13BD182D490981DEA /* RxBlocking.modulemap */, - 6BB6CEFFA20D51021E46594082017FF8 /* RxBlocking-dummy.m */, - ED74F69B493E00BE9F052FD62F560FA4 /* RxBlocking-Info.plist */, - F58343C5240B54FF834ADB6B6022F244 /* RxBlocking-prefix.pch */, - DFCD7CC945B63AFA2DBFA9FB9E12AA67 /* RxBlocking-umbrella.h */, - 85A46CC7427FED3A98520AA43B9CC6A7 /* RxBlocking.debug.xcconfig */, - 8FD62E6E5963C1B4B935EBF6292B5FD9 /* RxBlocking.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/RxBlocking"; - sourceTree = ""; - }; - F80095A139635D55E88998A5B5BC0150 /* Support Files */ = { - isa = PBXGroup; - children = ( - 2979BE4542E6E400D8A0D94774A4CDEB /* RxSwift.modulemap */, - B5B737B0F247BA2DACB0104574F661CF /* RxSwift-dummy.m */, - 9F7900D2A6A8123D690CE28680FC2EF3 /* RxSwift-Info.plist */, - 278FE9405CC67AE3D1D42C1FCAEDE75D /* RxSwift-prefix.pch */, - F123C81A393F42BC7E907E690D3E3CD8 /* RxSwift-umbrella.h */, - BABEC7961D3917FA96B4EDDB1811FABC /* RxSwift.debug.xcconfig */, - 261D40C90F887E85F9BB1EFCCE9373D2 /* RxSwift.release.xcconfig */, - ); - name = "Support Files"; - path = "../Target Support Files/RxSwift"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 0DC616625A02AD3FC3C986C8AFD07F42 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7AED0B487EE1C935AE22F4056CDD6808 /* RxSwift-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3CD506064B8709D5FF2E01EA35C0C576 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - D16947CBD028EF7E04729CD3670B876D /* RxRelay-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 883F3AE1A20B6D1FDDA9A2FC99D88321 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 8355F3167A08EEC3EB54BAA37097E487 /* Pods-PcVolumeControl-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8AF67066C6C225B01CEF8EAF71D14AE9 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D88573155490741E0F535B6436A1193 /* Pods-PcVolumeControlTests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 986537600D14761579460449DE03C288 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 7A93A22BD86309270AC44C644B7501FE /* _RX.h in Headers */, - 95A903FF7AB1A1BA9D09D37DF81A8AB0 /* _RXDelegateProxy.h in Headers */, - 805EEDF5A59400ABD8379567AACA849E /* _RXKVOObserver.h in Headers */, - 87DA86D77902ACF17437E16E77A0D6E0 /* _RXObjCRuntime.h in Headers */, - 23A4EF746AB64504DEB5EFDBA5450492 /* RxCocoa-umbrella.h in Headers */, - 2A8FD3A693CCE3F0B20522C1DD4F82B3 /* RxCocoa.h in Headers */, - 45AFB5D51C5929C8AB5858D694572F91 /* RxCocoaRuntime.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9FDA3B15B299CEA34F9C3E8C6B93F33F /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C3B5A8DA08F18DFE9C10D2BDA7D11A1 /* RxBlocking-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CB5B16F79B8DD1D9F55E276FEEC7F44A /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 3B9E0F782DAA798342A01764B5423D5C /* RxTest-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EEDCED618AC4CF562ECA334E62995813 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1760AF3E2CF96191F7758264E33AD9E6 /* BlueSocket-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F001E1100D7C0CE7C4BF1CD42861091D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 108ED31E46AAAF5BB99993C62673B275 /* Pods-PcVolumeControlUITests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 2ED98DC5EF20C5C8530881763EE47291 /* Pods-PcVolumeControl */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1FED4B2A31501473757F61E57D1821F2 /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControl" */; - buildPhases = ( - 883F3AE1A20B6D1FDDA9A2FC99D88321 /* Headers */, - 22AD01E7D3366318530120EEFD3C0705 /* Sources */, - F52ED7086F71FFC17988CAAB2853D6FD /* Frameworks */, - 9C56BD35949454EB1CAB3BD90353CBC5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 840F11D7C2140AF4E81965A973D8A250 /* PBXTargetDependency */, - 7AA6EBCE467AE3D3ADC2949BCCFB9FD7 /* PBXTargetDependency */, - 0A1DF1516A336BD48945120588BCE8E0 /* PBXTargetDependency */, - 213011EB81079CC4B1AA86FFE465D135 /* PBXTargetDependency */, - ); - name = "Pods-PcVolumeControl"; - productName = "Pods-PcVolumeControl"; - productReference = 8313ECB065F3D9A7B7DA7EA38F1AED80 /* Pods_PcVolumeControl.framework */; - productType = "com.apple.product-type.framework"; - }; - 4622BFEF3DC16E8BD15EEFC30D4D0084 /* RxRelay */ = { - isa = PBXNativeTarget; - buildConfigurationList = E1C6A94030A057AEEC1E09BD2FCE0934 /* Build configuration list for PBXNativeTarget "RxRelay" */; - buildPhases = ( - 3CD506064B8709D5FF2E01EA35C0C576 /* Headers */, - 948263EB52B4ABDF393ED2DB8385D4FD /* Sources */, - B088800CDC7FD13C6A8D81A3A9787AB9 /* Frameworks */, - 603E922978B59B06F36FB787CCA8546C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 1D58138708E5141FD31AFC0FBF330893 /* PBXTargetDependency */, - ); - name = RxRelay; - productName = RxRelay; - productReference = FF8B264DFE802855D5D67E7CDDABFC3C /* RxRelay.framework */; - productType = "com.apple.product-type.framework"; - }; - 77D7DF2154685534D9E1B0DB487E232D /* Pods-PcVolumeControlTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = D7EC190EE1BCC83099CFD8688CAED34A /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControlTests" */; - buildPhases = ( - 8AF67066C6C225B01CEF8EAF71D14AE9 /* Headers */, - 61F3FE9FC301C1B7ACA900664174F512 /* Sources */, - F53B9470659BF11B94730CFF73C7309F /* Frameworks */, - 04216E5C36BF16A100E293CC63A4BB84 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - EADCBCB9D9BC63088B09AF949158B7F0 /* PBXTargetDependency */, - 5E9EFE4D33B207AE7FEB7D0C811B548E /* PBXTargetDependency */, - 83314574BDEB5B992C92E3B0B4F5C138 /* PBXTargetDependency */, - 78DA4423EEA48AA74EFEBF56B0A5FC44 /* PBXTargetDependency */, - 94BAA9C736D9D222E7FCFDECD9344F6E /* PBXTargetDependency */, - ); - name = "Pods-PcVolumeControlTests"; - productName = "Pods-PcVolumeControlTests"; - productReference = 672A6F808AEDDBD39617973AD123A7E2 /* Pods_PcVolumeControlTests.framework */; - productType = "com.apple.product-type.framework"; - }; - 7AD0C6DCDC9CEC8A3C7C10C7FEE07BE6 /* RxCocoa */ = { - isa = PBXNativeTarget; - buildConfigurationList = F7028E084333DB57BEE3106A0E5C0DFB /* Build configuration list for PBXNativeTarget "RxCocoa" */; - buildPhases = ( - 986537600D14761579460449DE03C288 /* Headers */, - AF1306D295C23EEAA4762B61C848E112 /* Sources */, - 43E6D56F7F3748001C1B26B671EDC448 /* Frameworks */, - 7FBB271CB0198701052AF4F5606A1405 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 2AA1EB6E8CD13BF042079A28EC22BD91 /* PBXTargetDependency */, - B239DECAF190C9D41E8536D3D9700723 /* PBXTargetDependency */, - ); - name = RxCocoa; - productName = RxCocoa; - productReference = BC432FD48A5932251F1CAFBC4BF74894 /* RxCocoa.framework */; - productType = "com.apple.product-type.framework"; - }; - 9717BE7FCECEF299173A5D71C18B19F5 /* BlueSocket */ = { - isa = PBXNativeTarget; - buildConfigurationList = 87A03B7CDC3F58F8F7D420134806E925 /* Build configuration list for PBXNativeTarget "BlueSocket" */; - buildPhases = ( - EEDCED618AC4CF562ECA334E62995813 /* Headers */, - BA99ED16FD44DA8B3FD690B27CBA2194 /* Sources */, - FC3DA349BB4845429B354BB85122E19E /* Frameworks */, - C8370E91C272F1B31D13EFAFEA45DDF0 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = BlueSocket; - productName = BlueSocket; - productReference = 2EAA4A7F572E0FFFDA0F24140040D388 /* Socket.framework */; - productType = "com.apple.product-type.framework"; - }; - 9D3248D16DEE24E538B93059F123DE63 /* Pods-PcVolumeControlUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4774411CB02BD6E49DA88AE212D9CEBB /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControlUITests" */; - buildPhases = ( - F001E1100D7C0CE7C4BF1CD42861091D /* Headers */, - 73170BFAD9E8C9031D4A783B25D6AD4B /* Sources */, - 97660778CA88990C0CB17550A325085D /* Frameworks */, - 8DCCFE93AA833BDD3FA15C310C45620C /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 0B42EE72A466AA270AB3E4C965F3B510 /* PBXTargetDependency */, - E8563181D5B5D9560C260CE1DB1CF874 /* PBXTargetDependency */, - 3C275D9D6359DDEFD7852D23D6C3E247 /* PBXTargetDependency */, - CCA41407EBBDBF16F0EB2C2164B3925B /* PBXTargetDependency */, - 0A5176E945DE48D0806749A4C3E379D9 /* PBXTargetDependency */, - ); - name = "Pods-PcVolumeControlUITests"; - productName = "Pods-PcVolumeControlUITests"; - productReference = 06069700E139C9B86AEB96E92C06824D /* Pods_PcVolumeControlUITests.framework */; - productType = "com.apple.product-type.framework"; - }; - C8D93C508E21FFD4EE60D335DD6C22E3 /* RxTest */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1AAF7B0DCE271F8B892FD4F52EE190DE /* Build configuration list for PBXNativeTarget "RxTest" */; - buildPhases = ( - CB5B16F79B8DD1D9F55E276FEEC7F44A /* Headers */, - 68F8102CD2B395F16D4D7FB2B2207C0C /* Sources */, - 610ED85E10506698ACD5FF8D1CD80EFE /* Frameworks */, - A6D32A9576DCA6DDD757821BB7BA1343 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 4E0D383709609CE9C25AAE1F217E0F6F /* PBXTargetDependency */, - ); - name = RxTest; - productName = RxTest; - productReference = 031893FD3D882E436EC541DF783B1276 /* RxTest.framework */; - productType = "com.apple.product-type.framework"; - }; - EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */ = { - isa = PBXNativeTarget; - buildConfigurationList = C0F7AE7659B118605E2BFC3ECF1E302E /* Build configuration list for PBXNativeTarget "RxSwift" */; - buildPhases = ( - 0DC616625A02AD3FC3C986C8AFD07F42 /* Headers */, - ABF87B779C06936C1E302B50BB9291E2 /* Sources */, - 7EBE11992074C990A98C297AF971E356 /* Frameworks */, - DE40495975A372571F35CF33C4997B5A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RxSwift; - productName = RxSwift; - productReference = 809C5FAB588354C9BA37DC3EAB8CB45C /* RxSwift.framework */; - productType = "com.apple.product-type.framework"; - }; - F243B36381C0CE83CCFF789AC38F0D36 /* RxBlocking */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BC98F628BCA88FDA88CDA91AD4BEBE2 /* Build configuration list for PBXNativeTarget "RxBlocking" */; - buildPhases = ( - 9FDA3B15B299CEA34F9C3E8C6B93F33F /* Headers */, - 67A2A123D763751201FAB07595AA8BF9 /* Sources */, - 3BDB6584AE9F1E728DDA1470BE90BE47 /* Frameworks */, - 58F0C8E66BEA5ECB2CB13B12D4C1FA31 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 71CB14FB7749575B7FD4C7C0125858B0 /* PBXTargetDependency */, - ); - name = RxBlocking; - productName = RxBlocking; - productReference = 25F63A531105CD4E1E4CCF5B918C5494 /* RxBlocking.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - BFDFE7DC352907FC980B868725387E98 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1200; - }; - buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = CF1408CF629C7361332E53B88F7BD30C; - productRefGroup = BBF88229E9AC014F8F0E9331443CE302 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 9717BE7FCECEF299173A5D71C18B19F5 /* BlueSocket */, - 2ED98DC5EF20C5C8530881763EE47291 /* Pods-PcVolumeControl */, - 77D7DF2154685534D9E1B0DB487E232D /* Pods-PcVolumeControlTests */, - 9D3248D16DEE24E538B93059F123DE63 /* Pods-PcVolumeControlUITests */, - F243B36381C0CE83CCFF789AC38F0D36 /* RxBlocking */, - 7AD0C6DCDC9CEC8A3C7C10C7FEE07BE6 /* RxCocoa */, - 4622BFEF3DC16E8BD15EEFC30D4D0084 /* RxRelay */, - EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */, - C8D93C508E21FFD4EE60D335DD6C22E3 /* RxTest */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 04216E5C36BF16A100E293CC63A4BB84 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 58F0C8E66BEA5ECB2CB13B12D4C1FA31 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 603E922978B59B06F36FB787CCA8546C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7FBB271CB0198701052AF4F5606A1405 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8DCCFE93AA833BDD3FA15C310C45620C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9C56BD35949454EB1CAB3BD90353CBC5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A6D32A9576DCA6DDD757821BB7BA1343 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C8370E91C272F1B31D13EFAFEA45DDF0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DE40495975A372571F35CF33C4997B5A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 22AD01E7D3366318530120EEFD3C0705 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 7CA7EB74A82CD79231AA28A3156CA430 /* Pods-PcVolumeControl-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 61F3FE9FC301C1B7ACA900664174F512 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 96348CE01FA528DA5A6A17ECF3ABAA9F /* Pods-PcVolumeControlTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 67A2A123D763751201FAB07595AA8BF9 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3131E34C496127AB54417A72CCF9FFA7 /* AtomicInt.swift in Sources */, - 0CF395D1004E69F1179C3858208194C9 /* Bag.swift in Sources */, - 3F5E886891D384105BE4158FE42DB549 /* BlockingObservable+Operators.swift in Sources */, - A2BFC7E3B03B8932E87E5037CE34772E /* BlockingObservable.swift in Sources */, - 6A73395FCF548B859C849DB359563B02 /* DispatchQueue+Extensions.swift in Sources */, - 5A2DD71DADD5BB1FA33948BFFF084DC3 /* InfiniteSequence.swift in Sources */, - 7D02C99B5374B45B9863C9475774A024 /* ObservableConvertibleType+Blocking.swift in Sources */, - 224162E63E07A1A93470F3C3D90C90E6 /* Platform.Darwin.swift in Sources */, - EB2CACC6628B9D0ADEB629FAA73A9F29 /* Platform.Linux.swift in Sources */, - F1135C3274284C27AABB699497998C12 /* PriorityQueue.swift in Sources */, - 406947EA19A5E88DD007C8244BF05AA8 /* Queue.swift in Sources */, - 26DF8FD18ABF605B9A0ED6C8CCB15AD0 /* RecursiveLock.swift in Sources */, - ED505F0A05738E7E6FF9FCD818382387 /* Resources.swift in Sources */, - ABE067055E3F6FB1CC45747197D3BC53 /* RunLoopLock.swift in Sources */, - 02B4224CE547E617A81BF34EF8CED6F4 /* RxBlocking-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 68F8102CD2B395F16D4D7FB2B2207C0C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2199F90999D502109900C03B92C3E539 /* Any+Equatable.swift in Sources */, - FAF68A0C9CC23EC9773F7FB9BB72A6C4 /* AtomicInt.swift in Sources */, - 8C45F2007807507184439AC9619D3AC1 /* Bag.swift in Sources */, - 0024CE6A1DE87F16D33D1A18348EB51F /* ColdObservable.swift in Sources */, - E4F1492DE2CFC1190E52A24752007331 /* Deprecated.swift in Sources */, - 26D9B0739B8130FCDFA581139D0E1EFC /* DispatchQueue+Extensions.swift in Sources */, - 108AD9AFB43B2E04CFA2A139925EF894 /* Event+Equatable.swift in Sources */, - 551187685E606B1CA5478AACEC9882DF /* HotObservable.swift in Sources */, - 2F4CD6F91A8A857FF4B3B9999ED49F7E /* InfiniteSequence.swift in Sources */, - 9B8DB79149D502AC26F69A98A4666BFF /* Platform.Darwin.swift in Sources */, - 3307BDF0CD783175D8B8E5D13E65B3C9 /* Platform.Linux.swift in Sources */, - 6FFC834B3ABF3B9E83B812B33BFAEEBB /* PriorityQueue.swift in Sources */, - 6B81D4FC3252EE13E3B4A619B4E9D22D /* Queue.swift in Sources */, - 5615E75DEA2A72EC6D595861F179C410 /* Recorded+Event.swift in Sources */, - 4C2E9FA8385F1C2C48555B0A65E5BEA2 /* Recorded.swift in Sources */, - 9234FE61252CAADB60F853B859E2AAEF /* RecursiveLock.swift in Sources */, - 56608A2F1F1C86C132AC359E57E98FC4 /* RxTest-dummy.m in Sources */, - 55C3BBF7346BD4FEC05801FFEE0C7A53 /* RxTest.swift in Sources */, - 3252EA0FD38EC25CC88D9716480FEE67 /* Subscription.swift in Sources */, - 4245BD4B8D48ABC33532FF8A51C847F3 /* TestableObservable.swift in Sources */, - 00355718395C59ED8C381977C1FC8302 /* TestableObserver.swift in Sources */, - 1A8588D1B419DE1A3DB2D8A6A975E868 /* TestScheduler.swift in Sources */, - 0DFDC400BF846697AA6EBE11578E8938 /* TestSchedulerVirtualTimeConverter.swift in Sources */, - 77EA69EA20A9D176F698D8B204F6A89C /* XCTest+Rx.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 73170BFAD9E8C9031D4A783B25D6AD4B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 051508D26F56417C3C0A1CB690D2A80E /* Pods-PcVolumeControlUITests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 948263EB52B4ABDF393ED2DB8385D4FD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 37159E819194F6FA9C48BFCD38F132B1 /* BehaviorRelay.swift in Sources */, - 5106BA525271A18C663077010DE6B5A9 /* Observable+Bind.swift in Sources */, - C5EE17C8E09E0D7042D0340B96131279 /* PublishRelay.swift in Sources */, - D2BEC4E285D55EBB3B869DF675B4B076 /* RxRelay-dummy.m in Sources */, - 1DC827268B89EB2E8EEB6E80EA9CCD9E /* Utils.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - ABF87B779C06936C1E302B50BB9291E2 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 0AB3E0C7F041293384E513C0F7659943 /* AddRef.swift in Sources */, - DC73E079F3C3FF5F84BD81CFAECEAEB1 /* Amb.swift in Sources */, - 949EAFFA96CE981E5A3D07331F146390 /* AnonymousDisposable.swift in Sources */, - 5A44C9CCB46537B7CB435E7531B114AB /* AnonymousObserver.swift in Sources */, - 576714F3065A0965AECDFA02E202F951 /* AnyObserver.swift in Sources */, - E0A2B9A524EC4D34A3DDFBBE1D1D25B0 /* AsMaybe.swift in Sources */, - 001010C53E1DC6BBCF012485920497B0 /* AsSingle.swift in Sources */, - CBB4DFA117262C88F3B767C6BBDAC839 /* AsyncLock.swift in Sources */, - B80CE9FC4E7057117E9858A69097BD54 /* AsyncSubject.swift in Sources */, - 149F7625653E428DD27D2C6C6657BF8F /* AtomicInt.swift in Sources */, - 7D97206F904DAC441809978FB7619D25 /* Bag+Rx.swift in Sources */, - 80B053295EB40C663E8875C9EBFD245C /* Bag.swift in Sources */, - 7A671C0210CDA3F4E776DAE550C90B47 /* BehaviorSubject.swift in Sources */, - 18518C2595D036BBA6E40CEAD26C90EF /* BinaryDisposable.swift in Sources */, - 070C93E7A528B165EE15AD7E82EAC5DC /* BooleanDisposable.swift in Sources */, - F7285BCC377181D97295B6197A7176A1 /* Buffer.swift in Sources */, - 74B09E17259334D41B64EE1DC7E64743 /* Cancelable.swift in Sources */, - A0809FDD5CEA166A37684E7AA3F19829 /* Catch.swift in Sources */, - 401722C5C02E357B2FA0D25DEA091F99 /* CombineLatest+arity.swift in Sources */, - CC2B22E1F48A7A0EFDBE282DBADCBDDE /* CombineLatest+Collection.swift in Sources */, - 93A7E131348CD4B544C4B701B76D86F4 /* CombineLatest.swift in Sources */, - EEC43FF3240A2B6EDC075378D21A0799 /* CompactMap.swift in Sources */, - 7F1C00A044692BB016277C00E1F2C773 /* Completable+AndThen.swift in Sources */, - 5712FD6B8B944D951DA8A013B68E80E1 /* Completable.swift in Sources */, - 12717CB375BB0264D40E4BF432018AC0 /* CompositeDisposable.swift in Sources */, - CEFEA7D4312ABEDDC36F2087184FB610 /* Concat.swift in Sources */, - A12B54B052C4ABAFC58080F87B6BAD8C /* ConcurrentDispatchQueueScheduler.swift in Sources */, - 5C76266AF24E20D1B75D898BA58921D8 /* ConcurrentMainScheduler.swift in Sources */, - D0965DE6C6B69B74A083611F8DC4AD60 /* ConnectableObservableType.swift in Sources */, - 93E4DD7B2E1C5A6E5A67D3E79F24E1D3 /* Create.swift in Sources */, - 878947CAF52F3F3DD60CD1BEFD580900 /* CurrentThreadScheduler.swift in Sources */, - A67985916B86672EE8A09E5961E5E1F9 /* Date+Dispatch.swift in Sources */, - 016A4DDDA7932393216E3228AB332FFE /* Debounce.swift in Sources */, - 80A6F9640F4B80A9E09FCEC21478A77A /* Debug.swift in Sources */, - 24E2C0559433A57E7F0C0803B5244493 /* DefaultIfEmpty.swift in Sources */, - 0B6AAAE5D99A9B21991A0557A561DC22 /* Deferred.swift in Sources */, - 26140F377DA8ADCD09DEFB2967C2F527 /* Delay.swift in Sources */, - 756CBE2332DE2C616261010E9892D546 /* DelaySubscription.swift in Sources */, - 5865CDE318C87CAEA2C689C15BA40053 /* Dematerialize.swift in Sources */, - 798E6B391776C92AC52204980E8E0021 /* Deprecated.swift in Sources */, - 84CE316990A5A4F215424C0029A04A11 /* DispatchQueue+Extensions.swift in Sources */, - 164902FDBE0DFA02B59EBB10D8414AA6 /* DispatchQueueConfiguration.swift in Sources */, - 08512CDDFB37C15AEE6C5B1D463E0026 /* Disposable.swift in Sources */, - 7223B0C44F333286E0DAA862662C57A2 /* Disposables.swift in Sources */, - 4AE58568D7FB26CB4BFEFFCD877CE69F /* DisposeBag.swift in Sources */, - 1065DC3E40BF6AB6265BBAF023890283 /* DisposeBase.swift in Sources */, - D74FBDD093E10610392CEE8DB004E78C /* DistinctUntilChanged.swift in Sources */, - E81B33B6604600090DFB32512C69E7F8 /* Do.swift in Sources */, - 99F8613A48942A008E1685F8137B4D68 /* ElementAt.swift in Sources */, - C0CEC195E25C30DB4BB1091CDADD9AFF /* Empty.swift in Sources */, - EBB271DDE9112620D373C5A5A6683487 /* Enumerated.swift in Sources */, - AAF2A4BD293FB7F3C6A0FF38C28F0FEE /* Error.swift in Sources */, - 2691B5846201756629563EF3702BA217 /* Errors.swift in Sources */, - 8563E9A1C388D6432571C4B889CDC81B /* Event.swift in Sources */, - 73787921025310FADF6EC42D60EF45B7 /* Filter.swift in Sources */, - 08A6DDF8C8858ECE6E1EA0912E1A6D37 /* First.swift in Sources */, - 2FFABBE0D06F04E3AC19CA59B108BED0 /* Generate.swift in Sources */, - 9E0488FF4304E9EDD472F2CDCF49495C /* GroupBy.swift in Sources */, - D3B1166513A247F6FD36C0883A6BC6CF /* GroupedObservable.swift in Sources */, - AA4D5507629CC6A827E7868F74CBBC72 /* HistoricalScheduler.swift in Sources */, - 51A4848D5778A42A3B6ED4F89BF6591E /* HistoricalSchedulerTimeConverter.swift in Sources */, - 608126C71A7EF239FF580F12591EA453 /* ImmediateSchedulerType.swift in Sources */, - 16AB6246CF9F91EE1CB451A741537300 /* InfiniteSequence.swift in Sources */, - 5A8DE93ADDC0893F7BEBC2270CDB215D /* InvocableScheduledItem.swift in Sources */, - 32A9EDB5115AA69527FC18D43842B3E5 /* InvocableType.swift in Sources */, - 8E0AD674CAE8833DD02790ED47CF266D /* Just.swift in Sources */, - 9B43C07DB4FFAB0CD80DD8C29A792F0F /* Lock.swift in Sources */, - F57830087820D069FA2A61079DC62BC9 /* LockOwnerType.swift in Sources */, - 7AD5F0A50C181EC21DE6F325AAFAC330 /* MainScheduler.swift in Sources */, - 854CD06FA85487611AC11388EC97740A /* Map.swift in Sources */, - DE1E9D4BF994BAB37664D3A3B25C296A /* Materialize.swift in Sources */, - DC2C51E58894D6065E999B05B527CC11 /* Maybe.swift in Sources */, - 46DFBBF0E8909A488BF4D4CE03EE96C5 /* Merge.swift in Sources */, - 9977BCD36E2CBD9E5B125CD299BD7F41 /* Multicast.swift in Sources */, - FEA8F7B52BA4A7B201FE0D05BDA2EF2A /* Never.swift in Sources */, - 6D8C983C889E12263ED15991FBA5DE0A /* NopDisposable.swift in Sources */, - FF46DBEE595A7B768C99B569FAA2C2EC /* Observable.swift in Sources */, - 808B3B00A91EAFEF3186F32DFE5AFAB5 /* ObservableConvertibleType.swift in Sources */, - 7EDB7CAB96B1830B01F0B80E7FC13AB6 /* ObservableType+Extensions.swift in Sources */, - 0852333CE0B68F66F30D70F71C3C3EDF /* ObservableType+PrimitiveSequence.swift in Sources */, - BFCD671D8D213BF0109317A461305377 /* ObservableType.swift in Sources */, - CFDF49EAD80E28466EE0B15A2DD5FBF5 /* ObserveOn.swift in Sources */, - BBDC7FEC58A227C155000D912EB44B39 /* ObserverBase.swift in Sources */, - 166128A64D180DD5E733D5FB2E319352 /* ObserverType.swift in Sources */, - 259ED997BBB03A0EB730545570FCD12B /* OperationQueueScheduler.swift in Sources */, - C50FD92788C1136C9B1563359F638E90 /* Optional.swift in Sources */, - B67BF7850FA69628C0DDEEDC130035F7 /* Platform.Darwin.swift in Sources */, - EA85F2E900C7B38E67F4BE711B88A924 /* Platform.Linux.swift in Sources */, - D59636146733244915607A7E177A8712 /* PrimitiveSequence+Zip+arity.swift in Sources */, - B278C15C71EE87B01FD8842331A2DD84 /* PrimitiveSequence.swift in Sources */, - 750F53C06AD83AE44E565E99A95BB98D /* PriorityQueue.swift in Sources */, - 3DB187D7166EE7E362D9DB8CD1642BE2 /* Producer.swift in Sources */, - 5385392A0813FB6EF0B2F0872AC03159 /* PublishSubject.swift in Sources */, - 74969DCBAFCC54CA860A6ACCE4A89EBE /* Queue.swift in Sources */, - 9F0A40DAEE9EDE8388833CAF9AD84E13 /* Range.swift in Sources */, - 1B4D16DBC67DE093B1C676B478A840D0 /* Reactive.swift in Sources */, - 4CDDE8B6539CCBEDC770B9E33D839F3C /* RecursiveLock.swift in Sources */, - 131B3320C9FEAC3E2D4E9D6FCEAB1669 /* RecursiveScheduler.swift in Sources */, - BD5C5A780FF4B2C74F0BCD69BD831A3D /* Reduce.swift in Sources */, - FD9C05FA7BB24EE0802AA9625E4E136A /* RefCountDisposable.swift in Sources */, - 6D89DFE34F972E59F89C9C14234BCC70 /* Repeat.swift in Sources */, - F46C2BA0BB5DECB53C2C5963E601A792 /* ReplaySubject.swift in Sources */, - 052DD31A0DBCE60088D189DE2D2B16E3 /* RetryWhen.swift in Sources */, - B42D0D71048334E8BF62129F6E528847 /* Rx.swift in Sources */, - C3517B06C7C577E46EAB2724C1D53E7E /* RxMutableBox.swift in Sources */, - 9E5EF47186E967E782EAA5219CAB1A8B /* RxSwift-dummy.m in Sources */, - 58A215B8234F1616FEFBF883A7094D57 /* Sample.swift in Sources */, - 9E0714991EEC5A29143CE9579F3530C3 /* Scan.swift in Sources */, - A3E229AED66E7A8210E734746ECB02E2 /* ScheduledDisposable.swift in Sources */, - 52F4D44D7648170015E46320CE9CE425 /* ScheduledItem.swift in Sources */, - C918D068CC13B407BF638F1C57DF3DFF /* ScheduledItemType.swift in Sources */, - F7F102BA36B71A6B46C3732ED3944845 /* SchedulerServices+Emulation.swift in Sources */, - 1374413A4D7303DB7E1098FA230900AF /* SchedulerType.swift in Sources */, - 028727FF536BF0B14F5A34D106857902 /* Sequence.swift in Sources */, - 50CA09012F4275296D278C498C72F906 /* SerialDispatchQueueScheduler.swift in Sources */, - 9CD116FF1AB3D45FC37518C4C6997379 /* SerialDisposable.swift in Sources */, - 5C1A0B9A6BDEC6800DE6E9CB15C17549 /* ShareReplayScope.swift in Sources */, - D48713481C30846F118781250401B6EA /* Single.swift in Sources */, - FCFE4498BBE67496C9605F239A7D06CE /* SingleAssignmentDisposable.swift in Sources */, - CE7177AD3750FB4F3D0A532D9669CB83 /* SingleAsync.swift in Sources */, - 6139EF22C6DB4872E39E5DF81528C7F4 /* Sink.swift in Sources */, - 31A03EE96F96218D0C4B01A5601D83EC /* Skip.swift in Sources */, - 395E7D6BF89E52E0B44E1129A1A93B3B /* SkipUntil.swift in Sources */, - 0AD3E58CC964DFC9F2A57A40ADDDB041 /* SkipWhile.swift in Sources */, - 17FC91B142D50F14591274E65E0B9846 /* StartWith.swift in Sources */, - D8318F04E086B061C28D961CC8F86E6A /* SubjectType.swift in Sources */, - 928B411847B168B7ECF6444BB40680B3 /* SubscribeOn.swift in Sources */, - 07AC0BB16FDD5E1F07581177EA2B968A /* SubscriptionDisposable.swift in Sources */, - 3543B45E5D92606752905CCE1737CE70 /* SwiftSupport.swift in Sources */, - FA484ABE03B4D5BC86A28D154BBDE278 /* Switch.swift in Sources */, - B3B6023B03BE4386650F17AC13A65671 /* SwitchIfEmpty.swift in Sources */, - 41AFD30D5602865B660BFD4B81D66F7B /* SynchronizedDisposeType.swift in Sources */, - 54E3E7435B196D90946D6DB81E386250 /* SynchronizedOnType.swift in Sources */, - 33A0F4241786901D9FCFB1EE4F721D77 /* SynchronizedUnsubscribeType.swift in Sources */, - 309554F1225D176EDAACA87A89168F4A /* TailRecursiveSink.swift in Sources */, - 2C9DB6618E88BBFC33409F127A179632 /* Take.swift in Sources */, - A90B5B55A543ED3DD9DCB721AE934542 /* TakeLast.swift in Sources */, - 539A6B088FB388FE966FE0219B7B1619 /* TakeUntil.swift in Sources */, - 7C4475AE5484DDFD81D384B0B5C2C0C6 /* TakeWhile.swift in Sources */, - 2E6BA7044FA76C5E185BC767E4D23FB3 /* Throttle.swift in Sources */, - 18C782DE869CEA3E18E4D866BE29892E /* Timeout.swift in Sources */, - DDEF041FB4E7B09E63D90711025A8588 /* Timer.swift in Sources */, - 290DB11F0FBE959448BD652816D8C5D8 /* ToArray.swift in Sources */, - 2885F5A85EB54DEEC9307749B0657E6D /* Using.swift in Sources */, - 886006CB2A33AC6A623DE1C7B5BC47E7 /* VirtualTimeConverterType.swift in Sources */, - FC0D1A435D5EBAE9B4910F3BA0EF5EE4 /* VirtualTimeScheduler.swift in Sources */, - 29BC2CF35BA9356827A8ED717EBB186A /* Window.swift in Sources */, - 24ADAC3DBBF3422EEF81E3E1F009A639 /* WithLatestFrom.swift in Sources */, - 00F0817D74B5B5D3EBD04B2FDF815497 /* Zip+arity.swift in Sources */, - AAE570F0DD0A8CEE6B6EACDE0924DFC5 /* Zip+Collection.swift in Sources */, - 6A37ED23A4C262C8FFE7D6F4D2FBA4A9 /* Zip.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AF1306D295C23EEAA4762B61C848E112 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5E3605A3BC245596B6DD17BBFCD55765 /* _RX.m in Sources */, - 9D83CCF8474F4053B033BBF3765F7660 /* _RXDelegateProxy.m in Sources */, - F4541139B83E4CE559A87E1FD2484323 /* _RXKVOObserver.m in Sources */, - 519CF3AAEC307B5130BA02E8460DF541 /* _RXObjCRuntime.m in Sources */, - 52C0835254BE9A54C26C05E8B7AC7448 /* Bag.swift in Sources */, - 439197DD2AAEE0595B8DA4474C4595CA /* BehaviorRelay+Driver.swift in Sources */, - 59A6B0D9EEDC697D0013B02572F0FD7F /* Binder.swift in Sources */, - D64EA6E18B6AC4114BE0CB29B70B7739 /* ControlEvent+Driver.swift in Sources */, - 06504FFE7AB5C57B2E1626C35E42023A /* ControlEvent+Signal.swift in Sources */, - 0C2AEEA5C30032AF2F9EC02C0128ED13 /* ControlEvent.swift in Sources */, - 73D4B8DBAA4775FA576C6E99DA74E9F5 /* ControlProperty+Driver.swift in Sources */, - 2550B408EF306E05ED36C6AAB6837BF1 /* ControlProperty.swift in Sources */, - 74872B2FC64CC6125CCEF48562B0671E /* ControlTarget.swift in Sources */, - D437A93503211D776CC61B0A8A8A71F8 /* DelegateProxy.swift in Sources */, - E86B0E0D913346ACDF5F2D69A0A98833 /* DelegateProxyType.swift in Sources */, - 6467FE4BA8A61320C4A98A4478485ECB /* Deprecated.swift in Sources */, - 5B26550079AB783C657ECDBF80F3713F /* DispatchQueue+Extensions.swift in Sources */, - CB952FD2F737FE25DC95579065296BB6 /* Driver+Subscription.swift in Sources */, - 27E37AE40D404DFA7A4B0FE122789204 /* Driver.swift in Sources */, - 8117470A6E1CF87DF2049262E34119F3 /* InfiniteSequence.swift in Sources */, - C2D5D09CEC440A4621B5CAFB67B3A5B5 /* ItemEvents.swift in Sources */, - FCB07678FF31509D157300B7DC1240D6 /* KeyPathBinder.swift in Sources */, - B0528F277050656E75ADE1D065FC37B8 /* KVORepresentable+CoreGraphics.swift in Sources */, - 8EFE85C5F1EB7D1C1173AFCEF47DAC45 /* KVORepresentable+Swift.swift in Sources */, - 9C6D19CA62E67E73FF98774FCEA080A1 /* KVORepresentable.swift in Sources */, - 0A15F6D793421163A92E18ED9E911F87 /* Logging.swift in Sources */, - 5823BCC5E382DE702FBE07784AF8FC08 /* NotificationCenter+Rx.swift in Sources */, - 44B0BF2665B93BA05D05FBE47BEF7B1B /* NSButton+Rx.swift in Sources */, - 8D347BF3B80C9984DB0930C3F6683A18 /* NSControl+Rx.swift in Sources */, - 6464287695ECCBB4CA2CB81462BF1178 /* NSImageView+Rx.swift in Sources */, - D15DC3BE7C68691D743B1908ABB91E07 /* NSLayoutConstraint+Rx.swift in Sources */, - FD121E214251E5B388161FA787E9399C /* NSObject+Rx+KVORepresentable.swift in Sources */, - 15D0D8EE39393B4628502414BD95C248 /* NSObject+Rx+RawRepresentable.swift in Sources */, - 5441B6F9D99E964B9DEF28E22DA186C3 /* NSObject+Rx.swift in Sources */, - 3E7E4A485F70C759DBC3CF975C4FEA27 /* NSSlider+Rx.swift in Sources */, - B805454BD4733A2BD5D1E9927781C61C /* NSTextField+Rx.swift in Sources */, - 9592A59DA2AB14603C0A164DE99AE989 /* NSTextStorage+Rx.swift in Sources */, - CDED438FA5C4771AAAA8E89F7CC5AC58 /* NSTextView+Rx.swift in Sources */, - 144B84C01342DD588EE98169B133057B /* NSView+Rx.swift in Sources */, - ECAE23D66E9EDF283A168176231FEDBD /* Observable+Bind.swift in Sources */, - 28FEE3F61E1275C9E2E82FE7A97915D5 /* ObservableConvertibleType+Driver.swift in Sources */, - 760178B71CDA56FA10A78568F286086C /* ObservableConvertibleType+SharedSequence.swift in Sources */, - 9D9106710EAC7C6C7FE9E7EC1BC00C35 /* ObservableConvertibleType+Signal.swift in Sources */, - A645856411CD83CC21C7D801272669F5 /* Platform.Darwin.swift in Sources */, - CE90037BF8D1EF3DCBFBC97E56D2701E /* Platform.Linux.swift in Sources */, - CDCA48093852C8B844059A9684826F30 /* PriorityQueue.swift in Sources */, - 00FA1801533D853DDBCE33A57D28D648 /* PublishRelay+Signal.swift in Sources */, - 9B36BB2683F3628ECD5960E9619EB19B /* Queue.swift in Sources */, - C92EE1C8771E4BA17872F7B9BF534787 /* RecursiveLock.swift in Sources */, - 17B9CEBBD5764D362F71128009E4469A /* RxCocoa-dummy.m in Sources */, - 3492924BB6DC68CCAED4C1142E7739A3 /* RxCocoa.swift in Sources */, - 9210C710EBF1CB237EA930A8A3C09556 /* RxCocoaObjCRuntimeError+Extensions.swift in Sources */, - C5A5AEEF77FA6E9297696D7130306BCF /* RxCollectionViewDataSourcePrefetchingProxy.swift in Sources */, - 303E0C92168D1B45A96EB56FA114AAB4 /* RxCollectionViewDataSourceProxy.swift in Sources */, - E71C2CBDF0E79625EF1058383A2CA403 /* RxCollectionViewDataSourceType.swift in Sources */, - B4A337004B59DD3D71EA08745DC8D798 /* RxCollectionViewDelegateProxy.swift in Sources */, - 94F00BBF7C98FF9F7C8A50D09013D5F9 /* RxCollectionViewReactiveArrayDataSource.swift in Sources */, - 8C1EAC997C4FCDF29630D9B6B4A8542A /* RxNavigationControllerDelegateProxy.swift in Sources */, - FB1F62B2A744B23A349CF8877CF2A09B /* RxPickerViewAdapter.swift in Sources */, - 92A8C17D76CCEC966A1F3BBC9ED21BB8 /* RxPickerViewDataSourceProxy.swift in Sources */, - DB2D57AF81BF92D637AC95F3582CC085 /* RxPickerViewDataSourceType.swift in Sources */, - 352FC9B2FA639258CB77E7C0FB5F6840 /* RxPickerViewDelegateProxy.swift in Sources */, - B763C21339C457FF6C9F23FCD847C294 /* RxScrollViewDelegateProxy.swift in Sources */, - C9FED92878541212DCD20841DBFA48AF /* RxSearchBarDelegateProxy.swift in Sources */, - 3DF06796726197AEE928AEE9C4B0510A /* RxSearchControllerDelegateProxy.swift in Sources */, - C6CFA4D8E44B2ECB867560F11166D847 /* RxTabBarControllerDelegateProxy.swift in Sources */, - B27A654EED61328A617C246F39C7EFD2 /* RxTabBarDelegateProxy.swift in Sources */, - CAEA4361DA6030D11415FBC4FD4C4DF4 /* RxTableViewDataSourcePrefetchingProxy.swift in Sources */, - 796616B2692253493BC8674B1FB367FE /* RxTableViewDataSourceProxy.swift in Sources */, - 716FD05A624B0B9ECB0A8B8019BE000E /* RxTableViewDataSourceType.swift in Sources */, - 4DAEB64861955FE51DC5DFD39B2A1C1D /* RxTableViewDelegateProxy.swift in Sources */, - B606120F6D64F423657236A2970B2857 /* RxTableViewReactiveArrayDataSource.swift in Sources */, - C77BBB1150A4EEBF948F2E32133719F0 /* RxTarget.swift in Sources */, - E4EC22E47F93A0B49658C837EDAC1376 /* RxTextStorageDelegateProxy.swift in Sources */, - EB188E609BEFB8A628A4747E9B5803F8 /* RxTextViewDelegateProxy.swift in Sources */, - A25F6B7BE0481113031DF749FE9D40C4 /* RxWKNavigationDelegateProxy.swift in Sources */, - E3B8690153448DB7BB199D4FB8F1E90F /* SchedulerType+SharedSequence.swift in Sources */, - 86FB0771E04ED3CCAF7DB95BA8B3D910 /* SectionedViewDataSourceType.swift in Sources */, - 1F6B55D049CA4A0F17091F158365273E /* SharedSequence+Operators+arity.swift in Sources */, - F0F7F7EB66C233DD559474AFEA7C10DF /* SharedSequence+Operators.swift in Sources */, - E94D94EF789DCBC511115EBC4F6B85C2 /* SharedSequence.swift in Sources */, - 5CDE9F4B6E5C2CA57B28D5040F03F8CF /* Signal+Subscription.swift in Sources */, - 72521FC1A240438582D88313DA2F71B3 /* Signal.swift in Sources */, - D83C68850F8A3C76DE97A0551A818F31 /* TextInput.swift in Sources */, - 747BFC432635738E49B29E86EF568F32 /* UIActivityIndicatorView+Rx.swift in Sources */, - 37F572B1D4C35D5DE1AE90659641C34F /* UIAlertAction+Rx.swift in Sources */, - E0913C7ACDEE2FF3F5726843D87F0FB0 /* UIApplication+Rx.swift in Sources */, - 7A00AC4F9139FB78619C8F298F8283B4 /* UIBarButtonItem+Rx.swift in Sources */, - 6797FA90BF2145F3575358E2BF49B4F5 /* UIButton+Rx.swift in Sources */, - D03DF75AFE3BE4990305DBC1DDB869F6 /* UICollectionView+Rx.swift in Sources */, - 8C59DBF8BD1589F58183850B7FE67858 /* UIControl+Rx.swift in Sources */, - 3EABFE825C3FFAF030663555D2C8080F /* UIDatePicker+Rx.swift in Sources */, - EFB73B383EE0B9D00BCD7CA7D84B3395 /* UIGestureRecognizer+Rx.swift in Sources */, - 635E24A31EE03543A8FAFE0EC67A85DC /* UIImageView+Rx.swift in Sources */, - F88602DEA5D139BDFF12CEDD838BE081 /* UILabel+Rx.swift in Sources */, - 637E7100E21DDC1CE80B56DB518EAEBA /* UINavigationController+Rx.swift in Sources */, - 0A42BD548A8D5A0800D7CDD82B41EFF0 /* UINavigationItem+Rx.swift in Sources */, - 9A2492FB5AAD077758AA999340BFF32C /* UIPageControl+Rx.swift in Sources */, - 85557BB8ADEDB23D463325DE651CF458 /* UIPickerView+Rx.swift in Sources */, - ED906ACD2E9F3C6DEA3A0B373A7A59F7 /* UIProgressView+Rx.swift in Sources */, - 38970A50544688DDD6557737769CE86C /* UIRefreshControl+Rx.swift in Sources */, - 02C64A705AFBB72766D93EC1EF5CD60C /* UIScrollView+Rx.swift in Sources */, - 2533166320ACEE9728B4F16958FC90F8 /* UISearchBar+Rx.swift in Sources */, - 9BE9B1A29DA997E762CFD07F25605A04 /* UISearchController+Rx.swift in Sources */, - D337BCE2FB7C1D595669844BDD9E53BE /* UISegmentedControl+Rx.swift in Sources */, - B50761B46B6B0DFA58E3A45431FAFD8E /* UISlider+Rx.swift in Sources */, - 330DB3CAEB0F54399D764FC809B6C5ED /* UIStepper+Rx.swift in Sources */, - 6E5FD487F5200FFE41A8590F1C80D6A3 /* UISwitch+Rx.swift in Sources */, - 59ADA960FD6E41FEC7C3ADEAF7620D4C /* UITabBar+Rx.swift in Sources */, - 80AA5AEFA71FA484B90D7B0EF7F9198D /* UITabBarController+Rx.swift in Sources */, - D9BA5B238765E5E2D796D47246F748F3 /* UITabBarItem+Rx.swift in Sources */, - E2960331F72C889C85D4875B200AF289 /* UITableView+Rx.swift in Sources */, - 68A9C5850AF89F7E3B8AFEEAE2A97BB2 /* UITextField+Rx.swift in Sources */, - 581460068D8BD0691BD67D4A95FF9A8B /* UITextView+Rx.swift in Sources */, - 7D54E58E435DD28C7AF8C3FD4E1A5EEA /* UIView+Rx.swift in Sources */, - EDB338DD059F5447DBCF1289E353B2CB /* UIViewController+Rx.swift in Sources */, - 593D382A4A7EEE47FDCAA668E5E3189D /* URLSession+Rx.swift in Sources */, - 903230A70B77C4891D1AB14C0D5CFB7C /* WKWebView+Rx.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BA99ED16FD44DA8B3FD690B27CBA2194 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E654F0639E4FC3DEE1BEA8BB63F55745 /* BlueSocket-dummy.m in Sources */, - 088322E81AC101AC449C5BBCEBE462DA /* Socket.swift in Sources */, - 20ABA3F900EAFCE434322581110ADEF2 /* SocketProtocols.swift in Sources */, - 2059D8B5FFE163E510E12C5A6A2E61F0 /* SocketUtils.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 0A1DF1516A336BD48945120588BCE8E0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxRelay; - target = 4622BFEF3DC16E8BD15EEFC30D4D0084 /* RxRelay */; - targetProxy = D11614D31D2E51FC10374CEC9EF0C308 /* PBXContainerItemProxy */; - }; - 0A5176E945DE48D0806749A4C3E379D9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxTest; - target = C8D93C508E21FFD4EE60D335DD6C22E3 /* RxTest */; - targetProxy = 8A5EBC977D84C1FC6C60805B38161C21 /* PBXContainerItemProxy */; - }; - 0B42EE72A466AA270AB3E4C965F3B510 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = BlueSocket; - target = 9717BE7FCECEF299173A5D71C18B19F5 /* BlueSocket */; - targetProxy = D6E12C4A432C48207D91A931ED809B22 /* PBXContainerItemProxy */; - }; - 1D58138708E5141FD31AFC0FBF330893 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = A70E412735A12F0276A4233D00A75D04 /* PBXContainerItemProxy */; - }; - 213011EB81079CC4B1AA86FFE465D135 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = 68E30A01A4F924C5AB74C81BC5A9192A /* PBXContainerItemProxy */; - }; - 2AA1EB6E8CD13BF042079A28EC22BD91 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxRelay; - target = 4622BFEF3DC16E8BD15EEFC30D4D0084 /* RxRelay */; - targetProxy = 5A7F3702920320AA45BE775840150190 /* PBXContainerItemProxy */; - }; - 3C275D9D6359DDEFD7852D23D6C3E247 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxBlocking; - target = F243B36381C0CE83CCFF789AC38F0D36 /* RxBlocking */; - targetProxy = 4BE1AB63A58B94CC6612B992D9DE4E9B /* PBXContainerItemProxy */; - }; - 4E0D383709609CE9C25AAE1F217E0F6F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = 7E0BD3D83560FEE0CC21B2C5D139CC3B /* PBXContainerItemProxy */; - }; - 5E9EFE4D33B207AE7FEB7D0C811B548E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-PcVolumeControl"; - target = 2ED98DC5EF20C5C8530881763EE47291 /* Pods-PcVolumeControl */; - targetProxy = 2F1CB9E4B77261ECA5BAA9503B8787AD /* PBXContainerItemProxy */; - }; - 71CB14FB7749575B7FD4C7C0125858B0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = 62374FF4E30852C81EE1D2F361DAFCF4 /* PBXContainerItemProxy */; - }; - 78DA4423EEA48AA74EFEBF56B0A5FC44 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = 2DE8EFD99D12E8C92311A490A9A0D4CD /* PBXContainerItemProxy */; - }; - 7AA6EBCE467AE3D3ADC2949BCCFB9FD7 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxCocoa; - target = 7AD0C6DCDC9CEC8A3C7C10C7FEE07BE6 /* RxCocoa */; - targetProxy = B431A2D3027304A5C50B47A2DCA354EB /* PBXContainerItemProxy */; - }; - 83314574BDEB5B992C92E3B0B4F5C138 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxBlocking; - target = F243B36381C0CE83CCFF789AC38F0D36 /* RxBlocking */; - targetProxy = AFD379C6632E5CEB4BFBB72FE293F1BE /* PBXContainerItemProxy */; - }; - 840F11D7C2140AF4E81965A973D8A250 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = BlueSocket; - target = 9717BE7FCECEF299173A5D71C18B19F5 /* BlueSocket */; - targetProxy = 28F84B97B6DB0053834E94975C1E6CF9 /* PBXContainerItemProxy */; - }; - 94BAA9C736D9D222E7FCFDECD9344F6E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxTest; - target = C8D93C508E21FFD4EE60D335DD6C22E3 /* RxTest */; - targetProxy = 0768EE1088EA330FB10AE76C285FAABB /* PBXContainerItemProxy */; - }; - B239DECAF190C9D41E8536D3D9700723 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = 9CA1D36FB66527CB327DCA80528B57D4 /* PBXContainerItemProxy */; - }; - CCA41407EBBDBF16F0EB2C2164B3925B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = EA9EA43B3B503823EE36C60D9C8A865F /* RxSwift */; - targetProxy = F542978250521176A8327569CEAEEE88 /* PBXContainerItemProxy */; - }; - E8563181D5B5D9560C260CE1DB1CF874 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-PcVolumeControl"; - target = 2ED98DC5EF20C5C8530881763EE47291 /* Pods-PcVolumeControl */; - targetProxy = 706DB1EADC340E7032F32A1E6E369DD6 /* PBXContainerItemProxy */; - }; - EADCBCB9D9BC63088B09AF949158B7F0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = BlueSocket; - target = 9717BE7FCECEF299173A5D71C18B19F5 /* BlueSocket */; - targetProxy = 62B181EB6293B57601B29D7D140BA313 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 11DB2A5008120A2BBED5C686B7E2C05D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3A080CF82E6070DDEAD577DFB62B774C /* RxCocoa.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxCocoa/RxCocoa-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxCocoa/RxCocoa-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxCocoa/RxCocoa.modulemap"; - PRODUCT_MODULE_NAME = RxCocoa; - PRODUCT_NAME = RxCocoa; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 2EDE49D2ACB2DDF26978F132203C8E88 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D3691C2A7C228DB1FED8C5676B7C75EA /* BlueSocket.release.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/BlueSocket/BlueSocket-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BlueSocket/BlueSocket-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BlueSocket/BlueSocket.modulemap"; - PRODUCT_MODULE_NAME = Socket; - PRODUCT_NAME = Socket; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 3268D53E6823F51ED83ED52EA0A92FB3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 06136030C196C955ECA4176CAA1ADB1A /* RxRelay.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxRelay/RxRelay-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxRelay/RxRelay-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxRelay/RxRelay.modulemap"; - PRODUCT_MODULE_NAME = RxRelay; - PRODUCT_NAME = RxRelay; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 41225FF239F990196CE5F71D7B8FBCF4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F329E40A0D94C2B155B3314D2966204B /* RxTest.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxTest/RxTest-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxTest/RxTest-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxTest/RxTest.modulemap"; - PRODUCT_MODULE_NAME = RxTest; - PRODUCT_NAME = RxTest; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 41B2656960CBBC201F6FD604053369D7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B84337E7D25E148FB59E6DCA4E1B1795 /* Pods-PcVolumeControl.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 4C20CA07B909C2B2C54782D965F95B2F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8FD62E6E5963C1B4B935EBF6292B5FD9 /* RxBlocking.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxBlocking/RxBlocking-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxBlocking/RxBlocking-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxBlocking/RxBlocking.modulemap"; - PRODUCT_MODULE_NAME = RxBlocking; - PRODUCT_NAME = RxBlocking; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 4D8F2B809C71CB585E94C2185622B7D9 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 27C6E01E5D9F9110F1AC1B679469F07B /* Pods-PcVolumeControlTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 5FE16C3DC1563897F52AE7CF5DE0D22F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B1CE6B0E749417F2A2E2DFE94B2446FA /* Pods-PcVolumeControl.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControl/Pods-PcVolumeControl.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 6ACE01E101CD05C2D9274B28BE586706 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - 923BFB18D3DA120A50FBFD5995E4B08B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BABEC7961D3917FA96B4EDDB1811FABC /* RxSwift.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/RxSwift-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - PRODUCT_MODULE_NAME = RxSwift; - PRODUCT_NAME = RxSwift; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - AE381207710BBDDD479EB51BC483BAC6 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 85A46CC7427FED3A98520AA43B9CC6A7 /* RxBlocking.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxBlocking/RxBlocking-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxBlocking/RxBlocking-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxBlocking/RxBlocking.modulemap"; - PRODUCT_MODULE_NAME = RxBlocking; - PRODUCT_NAME = RxBlocking; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - B1B259C5FB7465EF9C71163827046E70 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - B64351C6776FED6FB52EFD41E4D1E214 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8B7729AFF77A9173CE034081A3F05178 /* Pods-PcVolumeControlTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControlTests/Pods-PcVolumeControlTests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - BCFE7317570D3D539312827B50F56B1D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 32A239A894AD4158D32DEA5544B11697 /* RxTest.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxTest/RxTest-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxTest/RxTest-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxTest/RxTest.modulemap"; - PRODUCT_MODULE_NAME = RxTest; - PRODUCT_NAME = RxTest; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - D15A4F3B540E0D9BAAEE9F846763B26F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8BD746CF61BACCCCF3104079FFF7981A /* Pods-PcVolumeControlUITests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - E0AE744CF1E31E8872556A64E59F116C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 6C40FA4CAC354571D924B4EFABB7B856 /* BlueSocket.debug.xcconfig */; - buildSettings = { - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/BlueSocket/BlueSocket-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BlueSocket/BlueSocket-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BlueSocket/BlueSocket.modulemap"; - PRODUCT_MODULE_NAME = Socket; - PRODUCT_NAME = Socket; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - E7444D0109EEADF8C6934C5198B54F07 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 261D40C90F887E85F9BB1EFCCE9373D2 /* RxSwift.release.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/RxSwift-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - PRODUCT_MODULE_NAME = RxSwift; - PRODUCT_NAME = RxSwift; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - EC4C580659E08318BD7F02F5159C2BC2 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3DA709800162BB778D5A1A85F39A1D69 /* RxCocoa.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxCocoa/RxCocoa-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxCocoa/RxCocoa-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxCocoa/RxCocoa.modulemap"; - PRODUCT_MODULE_NAME = RxCocoa; - PRODUCT_NAME = RxCocoa; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - F1FB319551075D4DA950B7E60772CD79 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 18BE500FB78D87EBA22326C167F21292 /* Pods-PcVolumeControlUITests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-PcVolumeControlUITests/Pods-PcVolumeControlUITests.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - FD0BED5F257D4EAF00D3A9789F1A3B08 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 50D4892E72CC2833C85ABC0C4C6456F8 /* RxRelay.debug.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxRelay/RxRelay-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxRelay/RxRelay-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxRelay/RxRelay.modulemap"; - PRODUCT_MODULE_NAME = RxRelay; - PRODUCT_NAME = RxRelay; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1AAF7B0DCE271F8B892FD4F52EE190DE /* Build configuration list for PBXNativeTarget "RxTest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41225FF239F990196CE5F71D7B8FBCF4 /* Debug */, - BCFE7317570D3D539312827B50F56B1D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1FED4B2A31501473757F61E57D1821F2 /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 41B2656960CBBC201F6FD604053369D7 /* Debug */, - 5FE16C3DC1563897F52AE7CF5DE0D22F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4774411CB02BD6E49DA88AE212D9CEBB /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControlUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F1FB319551075D4DA950B7E60772CD79 /* Debug */, - D15A4F3B540E0D9BAAEE9F846763B26F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B1B259C5FB7465EF9C71163827046E70 /* Debug */, - 6ACE01E101CD05C2D9274B28BE586706 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BC98F628BCA88FDA88CDA91AD4BEBE2 /* Build configuration list for PBXNativeTarget "RxBlocking" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AE381207710BBDDD479EB51BC483BAC6 /* Debug */, - 4C20CA07B909C2B2C54782D965F95B2F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 87A03B7CDC3F58F8F7D420134806E925 /* Build configuration list for PBXNativeTarget "BlueSocket" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E0AE744CF1E31E8872556A64E59F116C /* Debug */, - 2EDE49D2ACB2DDF26978F132203C8E88 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C0F7AE7659B118605E2BFC3ECF1E302E /* Build configuration list for PBXNativeTarget "RxSwift" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 923BFB18D3DA120A50FBFD5995E4B08B /* Debug */, - E7444D0109EEADF8C6934C5198B54F07 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D7EC190EE1BCC83099CFD8688CAED34A /* Build configuration list for PBXNativeTarget "Pods-PcVolumeControlTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4D8F2B809C71CB585E94C2185622B7D9 /* Debug */, - B64351C6776FED6FB52EFD41E4D1E214 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E1C6A94030A057AEEC1E09BD2FCE0934 /* Build configuration list for PBXNativeTarget "RxRelay" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD0BED5F257D4EAF00D3A9789F1A3B08 /* Debug */, - 3268D53E6823F51ED83ED52EA0A92FB3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F7028E084333DB57BEE3106A0E5C0DFB /* Build configuration list for PBXNativeTarget "RxCocoa" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EC4C580659E08318BD7F02F5159C2BC2 /* Debug */, - 11DB2A5008120A2BBED5C686B7E2C05D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; -} diff --git a/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-PcVolumeControl.xcscheme b/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-PcVolumeControl.xcscheme deleted file mode 100644 index 85ab7fe..0000000 --- a/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-PcVolumeControl.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControl.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControl.xcscheme deleted file mode 100644 index f0d514d..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControl.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlTests.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlTests.xcscheme deleted file mode 100644 index 8198f67..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlTests.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlUITests.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlUITests.xcscheme deleted file mode 100644 index 87c337a..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/Pods-PcVolumeControlUITests.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxBlocking.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxBlocking.xcscheme deleted file mode 100644 index f7e6019..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxBlocking.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxCocoa.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxCocoa.xcscheme deleted file mode 100644 index 7222134..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxCocoa.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxSwift.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxSwift.xcscheme deleted file mode 100644 index 29bdf08..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxSwift.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxTest.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxTest.xcscheme deleted file mode 100644 index 6412ec6..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/RxTest.xcscheme +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index e72f59a..0000000 --- a/Pods/Pods.xcodeproj/xcuserdata/bill.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - SchemeUserState - - BlueSocket.xcscheme - - isShown - - - Pods-PcVolumeControl.xcscheme - - isShown - - - Pods-PcVolumeControlTests.xcscheme - - isShown - - - Pods-PcVolumeControlUITests.xcscheme - - isShown - - - RxBlocking.xcscheme - - isShown - - - RxCocoa.xcscheme - - isShown - - - RxRelay.xcscheme - - isShown - - - RxSwift.xcscheme - - isShown - - - RxTest.xcscheme - - isShown - - - - SuppressBuildableAutocreation - - - diff --git a/Pods/RxBlocking/LICENSE.md b/Pods/RxBlocking/LICENSE.md deleted file mode 100644 index d6765d9..0000000 --- a/Pods/RxBlocking/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -**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/RxBlocking/Platform/AtomicInt.swift b/Pods/RxBlocking/Platform/AtomicInt.swift deleted file mode 100644 index d8d9580..0000000 --- a/Pods/RxBlocking/Platform/AtomicInt.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// AtomicInt.swift -// Platform -// -// Created by Krunoslav Zaher on 10/28/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSLock - -final class AtomicInt: NSLock { - fileprivate var value: Int32 - public init(_ value: Int32 = 0) { - self.value = value - } -} - -@discardableResult -@inline(__always) -func add(_ this: AtomicInt, _ value: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value += value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func sub(_ this: AtomicInt, _ value: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value -= value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func fetchOr(_ this: AtomicInt, _ mask: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value |= mask - this.unlock() - return oldValue -} - -@inline(__always) -func load(_ this: AtomicInt) -> Int32 { - this.lock() - let oldValue = this.value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func increment(_ this: AtomicInt) -> Int32 { - return add(this, 1) -} - -@discardableResult -@inline(__always) -func decrement(_ this: AtomicInt) -> Int32 { - return sub(this, 1) -} - -@inline(__always) -func isFlagSet(_ this: AtomicInt, _ mask: Int32) -> Bool { - return (load(this) & mask) != 0 -} diff --git a/Pods/RxBlocking/Platform/DataStructures/Bag.swift b/Pods/RxBlocking/Platform/DataStructures/Bag.swift deleted file mode 100644 index 71e1e91..0000000 --- a/Pods/RxBlocking/Platform/DataStructures/Bag.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// Bag.swift -// Platform -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 and 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) - - private var _nextKey: BagKey = BagKey(rawValue: 0) - - // data - - // first fill inline variables - var _key0: BagKey? - var _value0: T? - - // then fill "array dictionary" - var _pairs = ContiguousArray() - - // last is sparse dictionary - var _dictionary: [BagKey: T]? - - 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 _pairs.count < arrayDictionaryMaxSize { - _pairs.append((key: key, value: element)) - return key - } - - _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) + _pairs.count + dictionaryCount - } - - /// Removes all elements from bag and clears capacity. - mutating func removeAll() { - _key0 = nil - _value0 = nil - - _pairs.removeAll(keepingCapacity: false) - _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 - } - - for i in 0 ..< _pairs.count where _pairs[i].key == key { - let value = _pairs[i].value - _pairs.remove(at: i) - return value - } - - 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) - } - - for i in 0 ..< _pairs.count { - action(_pairs[i].value) - } - - if dictionary?.count ?? 0 > 0 { - for element in dictionary!.values { - action(element) - } - } - } -} - -extension BagKey: Hashable { - func hash(into hasher: inout Hasher) { - hasher.combine(rawValue) - } -} - -func ==(lhs: BagKey, rhs: BagKey) -> Bool { - return lhs.rawValue == rhs.rawValue -} diff --git a/Pods/RxBlocking/Platform/DataStructures/InfiniteSequence.swift b/Pods/RxBlocking/Platform/DataStructures/InfiniteSequence.swift deleted file mode 100644 index b6404a7..0000000 --- a/Pods/RxBlocking/Platform/DataStructures/InfiniteSequence.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// InfiniteSequence.swift -// Platform -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Sequence that repeats `repeatedValue` infinite number of times. -struct InfiniteSequence : Sequence { - typealias Iterator = AnyIterator - - private let _repeatedValue: Element - - init(repeatedValue: Element) { - _repeatedValue = repeatedValue - } - - func makeIterator() -> Iterator { - let repeatedValue = _repeatedValue - return AnyIterator { - return repeatedValue - } - } -} diff --git a/Pods/RxBlocking/Platform/DataStructures/PriorityQueue.swift b/Pods/RxBlocking/Platform/DataStructures/PriorityQueue.swift deleted file mode 100644 index fac525f..0000000 --- a/Pods/RxBlocking/Platform/DataStructures/PriorityQueue.swift +++ /dev/null @@ -1,111 +0,0 @@ -// -// PriorityQueue.swift -// Platform -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct PriorityQueue { - private let _hasHigherPriority: (Element, Element) -> Bool - private let _isEqual: (Element, Element) -> Bool - - private 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 { - _elements.swapAt(index, _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 } - _elements.swapAt(unbalancedIndex, 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 } - _elements.swapAt(highestPriorityIndex, unbalancedIndex) - - unbalancedIndex = highestPriorityIndex - } - } -} - -extension PriorityQueue : CustomDebugStringConvertible { - var debugDescription: String { - return _elements.debugDescription - } -} diff --git a/Pods/RxBlocking/Platform/DataStructures/Queue.swift b/Pods/RxBlocking/Platform/DataStructures/Queue.swift deleted file mode 100644 index d05726c..0000000 --- a/Pods/RxBlocking/Platform/DataStructures/Queue.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// Queue.swift -// Platform -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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/RxBlocking/Platform/DispatchQueue+Extensions.swift b/Pods/RxBlocking/Platform/DispatchQueue+Extensions.swift deleted file mode 100644 index 552314a..0000000 --- a/Pods/RxBlocking/Platform/DispatchQueue+Extensions.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// DispatchQueue+Extensions.swift -// Platform -// -// Created by Krunoslav Zaher on 10/22/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -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/RxBlocking/Platform/Platform.Darwin.swift b/Pods/RxBlocking/Platform/Platform.Darwin.swift deleted file mode 100644 index 6dc36ad..0000000 --- a/Pods/RxBlocking/Platform/Platform.Darwin.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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 class Foundation.Thread - import protocol Foundation.NSCopying - - extension Thread { - static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying) { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - if let newValue = value { - threadDictionary[key] = newValue - } - else { - threadDictionary[key] = nil - } - } - - static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - -#endif diff --git a/Pods/RxBlocking/Platform/Platform.Linux.swift b/Pods/RxBlocking/Platform/Platform.Linux.swift deleted file mode 100644 index a950e1c..0000000 --- a/Pods/RxBlocking/Platform/Platform.Linux.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Platform.Linux.swift -// Platform -// -// Created by Krunoslav Zaher on 12/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(Linux) - - import class Foundation.Thread - - extension Thread { - - static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { - if let newValue = value { - Thread.current.threadDictionary[key] = newValue - } - else { - Thread.current.threadDictionary[key] = nil - } - } - - static func getThreadLocalStorageValueForKey(_ key: String) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - -#endif diff --git a/Pods/RxBlocking/Platform/RecursiveLock.swift b/Pods/RxBlocking/Platform/RecursiveLock.swift deleted file mode 100644 index c03471d..0000000 --- a/Pods/RxBlocking/Platform/RecursiveLock.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// RecursiveLock.swift -// Platform -// -// Created by Krunoslav Zaher on 12/18/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSRecursiveLock - -#if TRACE_RESOURCES - class RecursiveLock: NSRecursiveLock { - override init() { - _ = Resources.incrementTotal() - super.init() - } - - override func lock() { - super.lock() - _ = Resources.incrementTotal() - } - - override func unlock() { - super.unlock() - _ = Resources.decrementTotal() - } - - deinit { - _ = Resources.decrementTotal() - } - } -#else - typealias RecursiveLock = NSRecursiveLock -#endif diff --git a/Pods/RxBlocking/README.md b/Pods/RxBlocking/README.md deleted file mode 100644 index c666142..0000000 --- a/Pods/RxBlocking/README.md +++ /dev/null @@ -1,244 +0,0 @@ -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)](https://cocoapods.org/pods/RxSwift) [![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) - -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) -* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, and `ControlProperty` ... 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.
[Join Slack Channel](http://slack.rxswift.org) -* 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) -* Help out [Check out contribution guide](CONTRIBUTING.md) - -###### ... compare - -* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). - -###### ... understand the structure - -RxSwift comprises five separate components depending on eachother in the following way: - -```none -┌──────────────┐ ┌──────────────┐ -│ RxCocoa ├────▶ RxRelay │ -└───────┬──────┘ └──────┬───────┘ - │ │ -┌───────▼──────────────────▼───────┐ -│ RxSwift │ -└───────▲──────────────────▲───────┘ - │ │ -┌───────┴──────┐ ┌──────┴───────┐ -│ RxTest │ │ RxBlocking │ -└──────────────┘ └──────────────┘ -``` - -* **RxSwift**: The core of RxSwift, providing the Rx standard as (mostly) defined by [ReactiveX](https://reactivex.io). It has no other dependencies. -* **RxCocoa**: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Binders, Traits, and much more. It depends on both `RxSwift` and `RxRelay`. -* **RxRelay**: Provides `PublishRelay` and `BehaviorRelay`, two [simple wrappers around Subjects](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Subjects.md#relays). It depends on `RxSwift`. -* **RxTest** and **RxBlocking**: Provides testing capabilities for Rx-based systems. It depends on `RxSwift`. - -###### ... 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(.milliseconds(300), 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
-    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
-        (index, repository: Repository, cell) in
-        cell.textLabel?.text = repository.name
-        cell.detailTextLabel?.text = repository.url
-    }
-    .disposed(by: disposeBag)
- - -## Requirements - -* Xcode 10.2 -* Swift 5.0 - -For Xcode 10.1 and below, [use RxSwift 4.5](https://github.com/ReactiveX/RxSwift/releases/tag/4.5.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) - -```ruby -# Podfile -use_frameworks! - -target 'YOUR_TARGET_NAME' do - pod 'RxSwift', '~> 5' - pod 'RxCocoa', '~> 5' -end - -# RxTest and RxBlocking make the most sense in the context of unit/integration tests -target 'YOUR_TESTING_TARGET' do - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```bash -$ pod install -``` - -### [Carthage](https://github.com/Carthage/Carthage) - -Officially supported: Carthage 0.33 and up. - -Add this to `Cartfile` - -``` -github "ReactiveX/RxSwift" ~> 5.0 -``` - -```bash -$ carthage update -``` - -#### Carthage as a Static Library - -Carthage defaults to building RxSwift as a Dynamic Library. - -If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: - -```bash -carthage update RxSwift --platform iOS --no-build -sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj -carthage build RxSwift --platform iOS -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -Create a `Package.swift` file. - -```swift -// swift-tools-version:5.0 - -import PackageDescription - -let package = Package( - name: "RxTestProject", - dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") - ], - targets: [ - .target(name: "RxTestProject", dependencies: ["RxSwift", "RxCocoa"]) - ] -) -``` - -```bash -$ swift build -``` - -To build or test a module with RxTest dependency, set `TEST=1`. - -```bash -$ TEST=1 swift test -``` - -### Manually using git submodules - -* Add RxSwift as a submodule - -```bash -$ 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) -* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift-reactive-programming-with-swift) -* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) -* [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/RxBlocking/RxBlocking/BlockingObservable+Operators.swift b/Pods/RxBlocking/RxBlocking/BlockingObservable+Operators.swift deleted file mode 100644 index 3aba99c..0000000 --- a/Pods/RxBlocking/RxBlocking/BlockingObservable+Operators.swift +++ /dev/null @@ -1,170 +0,0 @@ -// -// BlockingObservable+Operators.swift -// RxBlocking -// -// Created by Krunoslav Zaher on 10/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/// The `MaterializedSequenceResult` enum represents the materialized -/// output of a BlockingObservable. -/// -/// If the sequence terminates successfully, the result is represented -/// by `.completed` with the array of elements. -/// -/// If the sequence terminates with error, the result is represented -/// by `.failed` with both the array of elements and the terminating error. -public enum MaterializedSequenceResult { - case completed(elements: [T]) - case failed(elements: [T], error: Error) -} - -extension BlockingObservable { - /// Blocks current thread until sequence terminates. - /// - /// If sequence terminates with error, terminating error will be thrown. - /// - /// - returns: All elements of sequence. - public func toArray() throws -> [Element] { - let results = self.materializeResult() - return try self.elementsOrThrow(results) - } -} - -extension BlockingObservable { - /// Blocks current thread until sequence produces first element. - /// - /// If sequence terminates with error before producing first element, terminating error will be thrown. - /// - /// - returns: First element of sequence. If sequence is empty `nil` is returned. - public func first() throws -> Element? { - let results = self.materializeResult(max: 1) - return try self.elementsOrThrow(results).first - } -} - -extension BlockingObservable { - /// Blocks current thread until sequence terminates. - /// - /// If sequence terminates with error, terminating error will be thrown. - /// - /// - returns: Last element in the sequence. If sequence is empty `nil` is returned. - public func last() throws -> Element? { - let results = self.materializeResult() - return try self.elementsOrThrow(results).last - } -} - -extension BlockingObservable { - /// Blocks current thread until sequence terminates. - /// - /// If sequence terminates with error before producing first element, terminating error will be thrown. - /// - /// - returns: Returns the only element of an sequence, and reports an error if there is not exactly one element in the observable sequence. - public func single() throws -> Element { - return try self.single { _ in true } - } - - /// Blocks current thread until sequence terminates. - /// - /// If sequence terminates with error before producing first element, terminating error will be thrown. - /// - /// - parameter predicate: A function to test each source element for a condition. - /// - returns: Returns the only element of an sequence that satisfies the condition in the predicate, and reports an error if there is not exactly one element in the sequence. - public func single(_ predicate: @escaping (Element) throws -> Bool) throws -> Element { - let results = self.materializeResult(max: 2, predicate: predicate) - let elements = try self.elementsOrThrow(results) - - if elements.count > 1 { - throw RxError.moreThanOneElement - } - - guard let first = elements.first else { - throw RxError.noElements - } - - return first - } -} - -extension BlockingObservable { - /// Blocks current thread until sequence terminates. - /// - /// The sequence is materialized as a result type capturing how the sequence terminated (completed or error), along with any elements up to that point. - /// - /// - returns: On completion, returns the list of elements in the sequence. On error, returns the list of elements up to that point, along with the error itself. - public func materialize() -> MaterializedSequenceResult { - return self.materializeResult() - } -} - -extension BlockingObservable { - private func materializeResult(max: Int? = nil, predicate: @escaping (Element) throws -> Bool = { _ in true }) -> MaterializedSequenceResult { - var elements = [Element]() - var error: Swift.Error? - - let lock = RunLoopLock(timeout: self.timeout) - - let d = SingleAssignmentDisposable() - - defer { - d.dispose() - } - - lock.dispatch { - let subscription = self.source.subscribe { event in - if d.isDisposed { - return - } - switch event { - case .next(let element): - do { - if try predicate(element) { - elements.append(element) - } - if let max = max, elements.count >= max { - d.dispose() - lock.stop() - } - } catch let err { - error = err - d.dispose() - lock.stop() - } - case .error(let err): - error = err - d.dispose() - lock.stop() - case .completed: - d.dispose() - lock.stop() - } - } - - d.setDisposable(subscription) - } - - do { - try lock.run() - } catch let err { - error = err - } - - if let error = error { - return MaterializedSequenceResult.failed(elements: elements, error: error) - } - - return MaterializedSequenceResult.completed(elements: elements) - } - - private func elementsOrThrow(_ results: MaterializedSequenceResult) throws -> [Element] { - switch results { - case .failed(_, let error): - throw error - case .completed(let elements): - return elements - } - } -} diff --git a/Pods/RxBlocking/RxBlocking/BlockingObservable.swift b/Pods/RxBlocking/RxBlocking/BlockingObservable.swift deleted file mode 100644 index 12aa9fd..0000000 --- a/Pods/RxBlocking/RxBlocking/BlockingObservable.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// BlockingObservable.swift -// RxBlocking -// -// Created by Krunoslav Zaher on 10/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import Foundation -import RxSwift - -/** -`BlockingObservable` is a variety of `Observable` that provides blocking operators. - -It can be useful for testing and demo purposes, but is generally inappropriate for production applications. - -If you think you need to use a `BlockingObservable` this is usually a sign that you should rethink your -design. -*/ -public struct BlockingObservable { - let timeout: TimeInterval? - let source: Observable -} diff --git a/Pods/RxBlocking/RxBlocking/ObservableConvertibleType+Blocking.swift b/Pods/RxBlocking/RxBlocking/ObservableConvertibleType+Blocking.swift deleted file mode 100644 index 31306c4..0000000 --- a/Pods/RxBlocking/RxBlocking/ObservableConvertibleType+Blocking.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ObservableConvertibleType+Blocking.swift -// RxBlocking -// -// Created by Krunoslav Zaher on 7/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import Foundation - -extension ObservableConvertibleType { - /// Converts an Observable into a `BlockingObservable` (an Observable with blocking operators). - /// - /// - parameter timeout: Maximal time interval BlockingObservable can block without throwing `RxError.timeout`. - /// - returns: `BlockingObservable` version of `self` - public func toBlocking(timeout: TimeInterval? = nil) -> BlockingObservable { - return BlockingObservable(timeout: timeout, source: self.asObservable()) - } -} diff --git a/Pods/RxBlocking/RxBlocking/Resources.swift b/Pods/RxBlocking/RxBlocking/Resources.swift deleted file mode 100644 index b22246b..0000000 --- a/Pods/RxBlocking/RxBlocking/Resources.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Resources.swift -// RxBlocking -// -// Created by Krunoslav Zaher on 1/21/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -#if TRACE_RESOURCES - struct Resources { - static func incrementTotal() -> Int32 { - return RxSwift.Resources.incrementTotal() - } - - static func decrementTotal() -> Int32 { - return RxSwift.Resources.decrementTotal() - } - - static var numberOfSerialDispatchQueueObservables: Int32 { - return RxSwift.Resources.numberOfSerialDispatchQueueObservables - } - - static var total: Int32 { - return RxSwift.Resources.total - } - } -#endif diff --git a/Pods/RxBlocking/RxBlocking/RunLoopLock.swift b/Pods/RxBlocking/RxBlocking/RunLoopLock.swift deleted file mode 100644 index f86668e..0000000 --- a/Pods/RxBlocking/RxBlocking/RunLoopLock.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// RunLoopLock.swift -// RxBlocking -// -// Created by Krunoslav Zaher on 11/5/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import CoreFoundation -import Foundation -import RxSwift - -#if os(Linux) - import Foundation - #if compiler(>=5.0) - let runLoopMode: RunLoop.Mode = .default - #else - let runLoopMode: RunLoopMode = .defaultRunLoopMode - #endif - - let runLoopModeRaw: CFString = unsafeBitCast(runLoopMode.rawValue._bridgeToObjectiveC(), to: CFString.self) -#else - let runLoopMode: CFRunLoopMode = CFRunLoopMode.defaultMode - let runLoopModeRaw = runLoopMode.rawValue -#endif - -final class RunLoopLock { - let _currentRunLoop: CFRunLoop - - let _calledRun = AtomicInt(0) - let _calledStop = AtomicInt(0) - var _timeout: TimeInterval? - - init(timeout: TimeInterval?) { - self._timeout = timeout - self._currentRunLoop = CFRunLoopGetCurrent() - } - - func dispatch(_ action: @escaping () -> Void) { - CFRunLoopPerformBlock(self._currentRunLoop, runLoopModeRaw) { - if CurrentThreadScheduler.isScheduleRequired { - _ = CurrentThreadScheduler.instance.schedule(()) { _ in - action() - return Disposables.create() - } - } - else { - action() - } - } - CFRunLoopWakeUp(self._currentRunLoop) - } - - func stop() { - if decrement(self._calledStop) > 1 { - return - } - CFRunLoopPerformBlock(self._currentRunLoop, runLoopModeRaw) { - CFRunLoopStop(self._currentRunLoop) - } - CFRunLoopWakeUp(self._currentRunLoop) - } - - func run() throws { - if increment(self._calledRun) != 0 { - fatalError("Run can be only called once") - } - if let timeout = self._timeout { - #if os(Linux) - switch Int(CFRunLoopRunInMode(runLoopModeRaw, timeout, false)) { - case kCFRunLoopRunFinished: - return - case kCFRunLoopRunHandledSource: - return - case kCFRunLoopRunStopped: - return - case kCFRunLoopRunTimedOut: - throw RxError.timeout - default: - fatalError("This failed because `CFRunLoopRunResult` wasn't bridged to Swift.") - } - #else - switch CFRunLoopRunInMode(runLoopMode, timeout, false) { - case .finished: - return - case .handledSource: - return - case .stopped: - return - case .timedOut: - throw RxError.timeout - default: - return - } - #endif - } - else { - CFRunLoopRun() - } - } -} diff --git a/Pods/RxCocoa/LICENSE.md b/Pods/RxCocoa/LICENSE.md deleted file mode 100644 index d6765d9..0000000 --- a/Pods/RxCocoa/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -**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 deleted file mode 100644 index 71e1e91..0000000 --- a/Pods/RxCocoa/Platform/DataStructures/Bag.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// Bag.swift -// Platform -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 and 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) - - private var _nextKey: BagKey = BagKey(rawValue: 0) - - // data - - // first fill inline variables - var _key0: BagKey? - var _value0: T? - - // then fill "array dictionary" - var _pairs = ContiguousArray() - - // last is sparse dictionary - var _dictionary: [BagKey: T]? - - 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 _pairs.count < arrayDictionaryMaxSize { - _pairs.append((key: key, value: element)) - return key - } - - _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) + _pairs.count + dictionaryCount - } - - /// Removes all elements from bag and clears capacity. - mutating func removeAll() { - _key0 = nil - _value0 = nil - - _pairs.removeAll(keepingCapacity: false) - _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 - } - - for i in 0 ..< _pairs.count where _pairs[i].key == key { - let value = _pairs[i].value - _pairs.remove(at: i) - return value - } - - 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) - } - - for i in 0 ..< _pairs.count { - action(_pairs[i].value) - } - - if dictionary?.count ?? 0 > 0 { - for element in dictionary!.values { - action(element) - } - } - } -} - -extension BagKey: Hashable { - func hash(into hasher: inout Hasher) { - hasher.combine(rawValue) - } -} - -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 deleted file mode 100644 index b6404a7..0000000 --- a/Pods/RxCocoa/Platform/DataStructures/InfiniteSequence.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// InfiniteSequence.swift -// Platform -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Sequence that repeats `repeatedValue` infinite number of times. -struct InfiniteSequence : Sequence { - typealias Iterator = AnyIterator - - private let _repeatedValue: Element - - init(repeatedValue: Element) { - _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 deleted file mode 100644 index fac525f..0000000 --- a/Pods/RxCocoa/Platform/DataStructures/PriorityQueue.swift +++ /dev/null @@ -1,111 +0,0 @@ -// -// PriorityQueue.swift -// Platform -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct PriorityQueue { - private let _hasHigherPriority: (Element, Element) -> Bool - private let _isEqual: (Element, Element) -> Bool - - private 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 { - _elements.swapAt(index, _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 } - _elements.swapAt(unbalancedIndex, 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 } - _elements.swapAt(highestPriorityIndex, 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 deleted file mode 100644 index d05726c..0000000 --- a/Pods/RxCocoa/Platform/DataStructures/Queue.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// Queue.swift -// Platform -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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 deleted file mode 100644 index 552314a..0000000 --- a/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// DispatchQueue+Extensions.swift -// Platform -// -// Created by Krunoslav Zaher on 10/22/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -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 deleted file mode 100644 index 6dc36ad..0000000 --- a/Pods/RxCocoa/Platform/Platform.Darwin.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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 class Foundation.Thread - import protocol Foundation.NSCopying - - extension Thread { - static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying) { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - if let newValue = value { - threadDictionary[key] = newValue - } - else { - threadDictionary[key] = nil - } - } - - static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - -#endif diff --git a/Pods/RxCocoa/Platform/Platform.Linux.swift b/Pods/RxCocoa/Platform/Platform.Linux.swift deleted file mode 100644 index a950e1c..0000000 --- a/Pods/RxCocoa/Platform/Platform.Linux.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Platform.Linux.swift -// Platform -// -// Created by Krunoslav Zaher on 12/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(Linux) - - import class Foundation.Thread - - extension Thread { - - static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { - if let newValue = value { - Thread.current.threadDictionary[key] = newValue - } - else { - Thread.current.threadDictionary[key] = nil - } - } - - 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/Platform/RecursiveLock.swift b/Pods/RxCocoa/Platform/RecursiveLock.swift deleted file mode 100644 index c03471d..0000000 --- a/Pods/RxCocoa/Platform/RecursiveLock.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// RecursiveLock.swift -// Platform -// -// Created by Krunoslav Zaher on 12/18/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSRecursiveLock - -#if TRACE_RESOURCES - class RecursiveLock: NSRecursiveLock { - override init() { - _ = Resources.incrementTotal() - super.init() - } - - override func lock() { - super.lock() - _ = Resources.incrementTotal() - } - - override func unlock() { - super.unlock() - _ = Resources.decrementTotal() - } - - deinit { - _ = Resources.decrementTotal() - } - } -#else - typealias RecursiveLock = NSRecursiveLock -#endif diff --git a/Pods/RxCocoa/README.md b/Pods/RxCocoa/README.md deleted file mode 100644 index c666142..0000000 --- a/Pods/RxCocoa/README.md +++ /dev/null @@ -1,244 +0,0 @@ -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)](https://cocoapods.org/pods/RxSwift) [![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) - -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) -* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, and `ControlProperty` ... 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.
[Join Slack Channel](http://slack.rxswift.org) -* 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) -* Help out [Check out contribution guide](CONTRIBUTING.md) - -###### ... compare - -* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). - -###### ... understand the structure - -RxSwift comprises five separate components depending on eachother in the following way: - -```none -┌──────────────┐ ┌──────────────┐ -│ RxCocoa ├────▶ RxRelay │ -└───────┬──────┘ └──────┬───────┘ - │ │ -┌───────▼──────────────────▼───────┐ -│ RxSwift │ -└───────▲──────────────────▲───────┘ - │ │ -┌───────┴──────┐ ┌──────┴───────┐ -│ RxTest │ │ RxBlocking │ -└──────────────┘ └──────────────┘ -``` - -* **RxSwift**: The core of RxSwift, providing the Rx standard as (mostly) defined by [ReactiveX](https://reactivex.io). It has no other dependencies. -* **RxCocoa**: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Binders, Traits, and much more. It depends on both `RxSwift` and `RxRelay`. -* **RxRelay**: Provides `PublishRelay` and `BehaviorRelay`, two [simple wrappers around Subjects](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Subjects.md#relays). It depends on `RxSwift`. -* **RxTest** and **RxBlocking**: Provides testing capabilities for Rx-based systems. It depends on `RxSwift`. - -###### ... 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(.milliseconds(300), 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
-    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
-        (index, repository: Repository, cell) in
-        cell.textLabel?.text = repository.name
-        cell.detailTextLabel?.text = repository.url
-    }
-    .disposed(by: disposeBag)
- - -## Requirements - -* Xcode 10.2 -* Swift 5.0 - -For Xcode 10.1 and below, [use RxSwift 4.5](https://github.com/ReactiveX/RxSwift/releases/tag/4.5.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) - -```ruby -# Podfile -use_frameworks! - -target 'YOUR_TARGET_NAME' do - pod 'RxSwift', '~> 5' - pod 'RxCocoa', '~> 5' -end - -# RxTest and RxBlocking make the most sense in the context of unit/integration tests -target 'YOUR_TESTING_TARGET' do - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```bash -$ pod install -``` - -### [Carthage](https://github.com/Carthage/Carthage) - -Officially supported: Carthage 0.33 and up. - -Add this to `Cartfile` - -``` -github "ReactiveX/RxSwift" ~> 5.0 -``` - -```bash -$ carthage update -``` - -#### Carthage as a Static Library - -Carthage defaults to building RxSwift as a Dynamic Library. - -If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: - -```bash -carthage update RxSwift --platform iOS --no-build -sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj -carthage build RxSwift --platform iOS -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -Create a `Package.swift` file. - -```swift -// swift-tools-version:5.0 - -import PackageDescription - -let package = Package( - name: "RxTestProject", - dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") - ], - targets: [ - .target(name: "RxTestProject", dependencies: ["RxSwift", "RxCocoa"]) - ] -) -``` - -```bash -$ swift build -``` - -To build or test a module with RxTest dependency, set `TEST=1`. - -```bash -$ TEST=1 swift test -``` - -### Manually using git submodules - -* Add RxSwift as a submodule - -```bash -$ 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) -* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift-reactive-programming-with-swift) -* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) -* [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/Common/Binder.swift b/Pods/RxCocoa/RxCocoa/Common/Binder.swift deleted file mode 100644 index 15dd0cc..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/Binder.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// Binder.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/17/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/** - 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 a specific scheduler - - `Binder` doesn't retain target and in case target is released, element isn't bound. - - By default it binds elements on main scheduler. - */ -public struct Binder: ObserverType { - public typealias Element = Value - - private let _binding: (Event) -> Void - - /// Initializes `Binder` - /// - /// - parameter target: Target object. - /// - parameter scheduler: Scheduler used to bind the events. - /// - parameter binding: Binding logic. - public init(_ target: Target, scheduler: ImmediateSchedulerType = MainScheduler(), binding: @escaping (Target, Value) -> Void) { - weak var weakTarget = target - - self._binding = { event in - switch event { - case .next(let element): - _ = scheduler.schedule(element) { element in - if let target = weakTarget { - binding(target, element) - } - return Disposables.create() - } - case .error(let error): - bindingError(error) - case .completed: - break - } - } - } - - /// Binds next element to owner view as described in `binding`. - public func on(_ event: Event) { - self._binding(event) - } - - /// Erases type of observer. - /// - /// - returns: type erased observer. - public func asObserver() -> AnyObserver { - return AnyObserver(eventHandler: self.on) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift b/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift deleted file mode 100644 index 231c3fe..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/ControlTarget.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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 RxSwift - -#if os(iOS) || os(tvOS) - import UIKit - - typealias Control = UIKit.UIControl -#elseif os(macOS) - import Cocoa - - typealias Control = Cocoa.NSControl -#endif - -// This should be only used from `MainScheduler` -final class ControlTarget: RxTarget { - typealias Callback = (Control) -> Void - - let selector: Selector = #selector(ControlTarget.eventHandler(_:)) - - weak var control: Control? -#if os(iOS) || os(tvOS) - let controlEvents: UIControl.Event -#endif - var callback: Callback? - #if os(iOS) || os(tvOS) - init(control: Control, controlEvents: UIControl.Event, callback: @escaping Callback) { - MainScheduler.ensureRunningOnMainThread() - - 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.ensureRunningOnMainThread() - - self.control = control - self.callback = callback - - super.init() - - control.target = self - control.action = self.selector - - let method = self.method(for: self.selector) - if method == nil { - rxFatalError("Can't find method") - } - } -#endif - - @objc 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 deleted file mode 100644 index 37b02c5..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/DelegateProxy.swift +++ /dev/null @@ -1,293 +0,0 @@ -// -// DelegateProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - - import RxSwift - #if SWIFT_PACKAGE && !os(Linux) - import RxCocoaRuntime - #endif - - /// 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 { - public typealias ParentObject = P - public typealias Delegate = D - - private var _sentMessageForSelector = [Selector: MessageDispatcher]() - private var _methodInvokedForSelector = [Selector: MessageDispatcher]() - - /// Parent object associated with delegate proxy. - private weak var _parentObject: ParentObject? - - private let _currentDelegateFor: (ParentObject) -> AnyObject? - private let _setCurrentDelegateTo: (AnyObject?, ParentObject) -> Void - - /// Initializes new instance. - /// - /// - parameter parentObject: Optional parent object that owns `DelegateProxy` as associated object. - public init(parentObject: ParentObject, delegateProxy: Proxy.Type) - where Proxy: DelegateProxy, Proxy.ParentObject == ParentObject, Proxy.Delegate == Delegate { - self._parentObject = parentObject - self._currentDelegateFor = delegateProxy._currentDelegate - self._setCurrentDelegateTo = delegateProxy._setCurrentDelegate - - MainScheduler.ensureRunningOnMainThread() - #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.proxy(for: 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]> { - MainScheduler.ensureRunningOnMainThread() - - let subject = self._sentMessageForSelector[selector] - - if let subject = subject { - return subject.asObservable() - } - else { - let subject = MessageDispatcher(selector: selector, delegateProxy: self) - self._sentMessageForSelector[selector] = subject - return subject.asObservable() - } - } - - /** - 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.proxy(for: 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]> { - MainScheduler.ensureRunningOnMainThread() - - let subject = self._methodInvokedForSelector[selector] - - if let subject = subject { - return subject.asObservable() - } - else { - let subject = MessageDispatcher(selector: selector, delegateProxy: self) - self._methodInvokedForSelector[selector] = subject - return subject.asObservable() - } - } - - fileprivate func checkSelectorIsObservable(_ selector: Selector) { - MainScheduler.ensureRunningOnMainThread() - - if self.hasWiredImplementation(for: selector) { - print("⚠️ Delegate proxy is already implementing `\(selector)`, a more performant way of registering might exist.") - return - } - - if self.voidDelegateMethodsContain(selector) { - return - } - - // In case `_forwardToDelegate` is `nil`, it is assumed the check is being done prematurely. - if !(self._forwardToDelegate?.responds(to: selector) ?? true) { - print("⚠️ Using delegate proxy dynamic interception method but the target delegate object doesn't respond to the requested selector. " + - "In case pure Swift delegate proxy is being used please use manual observing method by using`PublishSubject`s. " + - " (selector: `\(selector)`, forwardToDelegate: `\(self._forwardToDelegate ?? self)`)") - } - } - - // proxy - - open override func _sentMessage(_ selector: Selector, withArguments arguments: [Any]) { - self._sentMessageForSelector[selector]?.on(.next(arguments)) - } - - open override func _methodInvoked(_ selector: Selector, withArguments arguments: [Any]) { - self._methodInvokedForSelector[selector]?.on(.next(arguments)) - } - - /// Returns reference of normal delegate that receives all forwarded messages - /// through `self`. - /// - /// - returns: Value of reference if set or nil. - open func forwardToDelegate() -> Delegate? { - return castOptionalOrFatalError(self._forwardToDelegate) - } - - /// 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: Delegate?, retainDelegate: Bool) { - #if DEBUG // 4.0 all configurations - MainScheduler.ensureRunningOnMainThread() - #endif - self._setForwardToDelegate(delegate, retainDelegate: retainDelegate) - - let sentSelectors: [Selector] = self._sentMessageForSelector.values.filter { $0.hasObservers }.map { $0.selector } - let invokedSelectors: [Selector] = self._methodInvokedForSelector.values.filter { $0.hasObservers }.map { $0.selector } - let allUsedSelectors = sentSelectors + invokedSelectors - - for selector in Set(allUsedSelectors) { - self.checkSelectorIsObservable(selector) - } - - self.reset() - } - - private func hasObservers(selector: Selector) -> Bool { - return (self._sentMessageForSelector[selector]?.hasObservers ?? false) - || (self._methodInvokedForSelector[selector]?.hasObservers ?? false) - } - - override open func responds(to aSelector: Selector!) -> Bool { - return super.responds(to: aSelector) - || (self._forwardToDelegate?.responds(to: aSelector) ?? false) - || (self.voidDelegateMethodsContain(aSelector) && self.hasObservers(selector: aSelector)) - } - - fileprivate func reset() { - guard let parentObject = self._parentObject else { return } - - let maybeCurrentDelegate = self._currentDelegateFor(parentObject) - - if maybeCurrentDelegate === self { - self._setCurrentDelegateTo(nil, parentObject) - self._setCurrentDelegateTo(castOrFatalError(self), parentObject) - } - } - - deinit { - for v in self._sentMessageForSelector.values { - v.on(.completed) - } - for v in self._methodInvokedForSelector.values { - v.on(.completed) - } - #if TRACE_RESOURCES - _ = Resources.decrementTotal() - #endif - } - - - } - - private let mainScheduler = MainScheduler() - - private final class MessageDispatcher { - private let dispatcher: PublishSubject<[Any]> - private let result: Observable<[Any]> - - fileprivate let selector: Selector - - init(selector: Selector, delegateProxy _delegateProxy: DelegateProxy) { - weak var weakDelegateProxy = _delegateProxy - - let dispatcher = PublishSubject<[Any]>() - self.dispatcher = dispatcher - self.selector = selector - - self.result = dispatcher - .do(onSubscribed: { weakDelegateProxy?.checkSelectorIsObservable(selector); weakDelegateProxy?.reset() }, onDispose: { weakDelegateProxy?.reset() }) - .share() - .subscribeOn(mainScheduler) - } - - var on: (Event<[Any]>) -> Void { - return self.dispatcher.on - } - - var hasObservers: Bool { - return self.dispatcher.hasObservers - } - - func asObservable() -> Observable<[Any]> { - return self.result - } - } - -#endif diff --git a/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift b/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift deleted file mode 100644 index bfccc12..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/DelegateProxyType.swift +++ /dev/null @@ -1,429 +0,0 @@ -// -// DelegateProxyType.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - - import func Foundation.objc_getAssociatedObject - import func Foundation.objc_setAssociatedObject - - import RxSwift - -/** -`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`, `proxy` 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 - -... this mechanism can be extended by using the following snippet in `registerKnownImplementations` or in some other - part of your app that executes before using `rx.*` (e.g. appDidFinishLaunching). - - RxScrollViewDelegateProxy.register { RxTableViewDelegateProxy(parentObject: $0) } - -*/ -public protocol DelegateProxyType: class { - associatedtype ParentObject: AnyObject - associatedtype Delegate - - /// It is require that enumerate call `register` of the extended DelegateProxy subclasses here. - static func registerKnownImplementations() - - /// Unique identifier for delegate - static var identifier: UnsafeRawPointer { get } - - /// Returns designated delegate property for object. - /// - /// Objects can have multiple delegate properties. - /// - /// Each delegate property needs to have it's own type implementing `DelegateProxyType`. - /// - /// It's abstract method. - /// - /// - parameter object: Object that has delegate property. - /// - returns: Value of delegate property. - static func currentDelegate(for object: ParentObject) -> Delegate? - - /// Sets designated delegate property for object. - /// - /// Objects can have multiple delegate properties. - /// - /// Each delegate property needs to have it's own type implementing `DelegateProxyType`. - /// - /// It's abstract method. - /// - /// - parameter toObject: Object that has delegate property. - /// - parameter delegate: Delegate value. - static func setCurrentDelegate(_ delegate: Delegate?, to object: ParentObject) - - /// Returns reference of normal delegate that receives all forwarded messages - /// through `self`. - /// - /// - returns: Value of reference if set or nil. - func forwardToDelegate() -> Delegate? - - /// 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: Delegate?, retainDelegate: Bool) -} - -// default implementations -extension DelegateProxyType { - /// Unique identifier for delegate - public static var identifier: UnsafeRawPointer { - let delegateIdentifier = ObjectIdentifier(Delegate.self) - let integerIdentifier = Int(bitPattern: delegateIdentifier) - return UnsafeRawPointer(bitPattern: integerIdentifier)! - } -} - -// workaround of Delegate: class -extension DelegateProxyType { - static func _currentDelegate(for object: ParentObject) -> AnyObject? { - return currentDelegate(for: object).map { $0 as AnyObject } - } - - static func _setCurrentDelegate(_ delegate: AnyObject?, to object: ParentObject) { - return setCurrentDelegate(castOptionalOrFatalError(delegate), to: object) - } - - func _forwardToDelegate() -> AnyObject? { - return self.forwardToDelegate().map { $0 as AnyObject } - } - - func _setForwardToDelegate(_ forwardToDelegate: AnyObject?, retainDelegate: Bool) { - return self.setForwardToDelegate(castOptionalOrFatalError(forwardToDelegate), retainDelegate: retainDelegate) - } -} - -extension DelegateProxyType { - - /// Store DelegateProxy subclass to factory. - /// When make 'Rx*DelegateProxy' subclass, call 'Rx*DelegateProxySubclass.register(for:_)' 1 time, or use it in DelegateProxyFactory - /// 'Rx*DelegateProxy' can have one subclass implementation per concrete ParentObject type. - /// Should call it from concrete DelegateProxy type, not generic. - public static func register(make: @escaping (Parent) -> Self) { - self.factory.extend(make: make) - } - - /// Creates new proxy for target object. - /// Should not call this function directory, use 'DelegateProxy.proxy(for:)' - public static func createProxy(for object: AnyObject) -> Self { - return castOrFatalError(factory.createProxy(for: object)) - } - - /// 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.proxy(for: base) - /// } - /// - /// public var text: ControlProperty { - /// let source: Observable = self.delegate.observe(#selector(UISearchBarDelegate.searchBar(_:textDidChange:))) - /// ... - /// } - /// } - public static func proxy(for object: ParentObject) -> Self { - MainScheduler.ensureRunningOnMainThread() - - let maybeProxy = self.assignedProxy(for: object) - - let proxy: AnyObject - if let existingProxy = maybeProxy { - proxy = existingProxy - } - else { - proxy = castOrFatalError(self.createProxy(for: object)) - self.assignProxy(proxy, toObject: object) - assert(self.assignedProxy(for: object) === proxy) - } - let currentDelegate = self._currentDelegate(for: object) - let delegateProxy: Self = castOrFatalError(proxy) - - if currentDelegate !== delegateProxy { - delegateProxy._setForwardToDelegate(currentDelegate, retainDelegate: false) - assert(delegateProxy._forwardToDelegate() === currentDelegate) - self._setCurrentDelegate(proxy, to: object) - assert(self._currentDelegate(for: object) === proxy) - assert(delegateProxy._forwardToDelegate() === currentDelegate) - } - - return delegateProxy - } - - /// 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: Delegate, retainDelegate: Bool, onProxyForObject object: ParentObject) -> Disposable { - weak var weakForwardDelegate: AnyObject? = forwardDelegate as AnyObject - let proxy = self.proxy(for: 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 is 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) - - return Disposables.create { - MainScheduler.ensureRunningOnMainThread() - - let delegate: AnyObject? = weakForwardDelegate - - assert(delegate == nil || proxy._forwardToDelegate() === delegate, "Delegate was changed from time it was first set. Current \(String(describing: proxy.forwardToDelegate())), and it should have been \(proxy)") - - proxy.setForwardToDelegate(nil, retainDelegate: retainDelegate) - } - } -} - - -// private extensions -extension DelegateProxyType { - private static var factory: DelegateProxyFactory { - return DelegateProxyFactory.sharedFactory(for: self) - } - - private static func assignedProxy(for object: ParentObject) -> AnyObject? { - let maybeDelegate = objc_getAssociatedObject(object, self.identifier) - return castOptionalOrFatalError(maybeDelegate) - } - - private static func assignProxy(_ proxy: AnyObject, toObject object: ParentObject) { - objc_setAssociatedObject(object, self.identifier, proxy, .OBJC_ASSOCIATION_RETAIN) - } -} - -/// Describes an object that has a delegate. -public protocol HasDelegate: AnyObject { - /// Delegate type - associatedtype Delegate - - /// Delegate - var delegate: Delegate? { get set } -} - -extension DelegateProxyType where ParentObject: HasDelegate, Self.Delegate == ParentObject.Delegate { - public static func currentDelegate(for object: ParentObject) -> Delegate? { - return object.delegate - } - - public static func setCurrentDelegate(_ delegate: Delegate?, to object: ParentObject) { - object.delegate = delegate - } -} - -/// Describes an object that has a data source. -public protocol HasDataSource: AnyObject { - /// Data source type - associatedtype DataSource - - /// Data source - var dataSource: DataSource? { get set } -} - -extension DelegateProxyType where ParentObject: HasDataSource, Self.Delegate == ParentObject.DataSource { - public static func currentDelegate(for object: ParentObject) -> Delegate? { - return object.dataSource - } - - public static func setCurrentDelegate(_ delegate: Delegate?, to object: ParentObject) { - object.dataSource = delegate - } -} - -/// Describes an object that has a prefetch data source. -@available(iOS 10.0, tvOS 10.0, *) -public protocol HasPrefetchDataSource: AnyObject { - /// Prefetch data source type - associatedtype PrefetchDataSource - - /// Prefetch data source - var prefetchDataSource: PrefetchDataSource? { get set } -} - -@available(iOS 10.0, tvOS 10.0, *) -extension DelegateProxyType where ParentObject: HasPrefetchDataSource, Self.Delegate == ParentObject.PrefetchDataSource { - public static func currentDelegate(for object: ParentObject) -> Delegate? { - return object.prefetchDataSource - } - - public static func setCurrentDelegate(_ delegate: Delegate?, to object: ParentObject) { - object.prefetchDataSource = delegate - } -} - - #if os(iOS) || os(tvOS) - import UIKit - - extension ObservableType { - func subscribeProxyDataSource(ofObject object: DelegateProxy.ParentObject, dataSource: DelegateProxy.Delegate, retainDataSource: Bool, binding: @escaping (DelegateProxy, Event) -> Void) - -> Disposable - where DelegateProxy.ParentObject: UIView - , DelegateProxy.Delegate: AnyObject { - let proxy = DelegateProxy.proxy(for: object) - let unregisterDelegate = DelegateProxy.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 - bindingError(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 === DelegateProxy.currentDelegate(for: object), "Proxy changed from the time it was first set.\nOriginal: \(proxy)\nExisting: \(String(describing: DelegateProxy.currentDelegate(for: object)))") - } - - binding(proxy, event) - - switch event { - case .error(let error): - bindingError(error) - unregisterDelegate.dispose() - case .completed: - unregisterDelegate.dispose() - default: - break - } - } - - return Disposables.create { [weak object] in - subscription.dispose() - object?.layoutIfNeeded() - unregisterDelegate.dispose() - } - } - } - - #endif - - /** - - To add delegate proxy subclasses call `DelegateProxySubclass.register()` in `registerKnownImplementations` or in some other - part of your app that executes before using `rx.*` (e.g. appDidFinishLaunching). - - class RxScrollViewDelegateProxy: DelegateProxy { - public static func registerKnownImplementations() { - self.register { RxTableViewDelegateProxy(parentObject: $0) } - } - ... - - - */ - private class DelegateProxyFactory { - private static var _sharedFactories: [UnsafeRawPointer: DelegateProxyFactory] = [:] - - fileprivate static func sharedFactory(for proxyType: DelegateProxy.Type) -> DelegateProxyFactory { - MainScheduler.ensureRunningOnMainThread() - let identifier = DelegateProxy.identifier - if let factory = _sharedFactories[identifier] { - return factory - } - let factory = DelegateProxyFactory(for: proxyType) - _sharedFactories[identifier] = factory - DelegateProxy.registerKnownImplementations() - return factory - } - - private var _factories: [ObjectIdentifier: ((AnyObject) -> AnyObject)] - private var _delegateProxyType: Any.Type - private var _identifier: UnsafeRawPointer - - private init(for proxyType: DelegateProxy.Type) { - self._factories = [:] - self._delegateProxyType = proxyType - self._identifier = proxyType.identifier - } - - fileprivate func extend(make: @escaping (ParentObject) -> DelegateProxy) { - MainScheduler.ensureRunningOnMainThread() - precondition(self._identifier == DelegateProxy.identifier, "Delegate proxy has inconsistent identifier") - guard self._factories[ObjectIdentifier(ParentObject.self)] == nil else { - rxFatalError("The factory of \(ParentObject.self) is duplicated. DelegateProxy is not allowed of duplicated base object type.") - } - self._factories[ObjectIdentifier(ParentObject.self)] = { make(castOrFatalError($0)) } - } - - fileprivate func createProxy(for object: AnyObject) -> AnyObject { - MainScheduler.ensureRunningOnMainThread() - var maybeMirror: Mirror? = Mirror(reflecting: object) - while let mirror = maybeMirror { - if let factory = self._factories[ObjectIdentifier(mirror.subjectType)] { - return factory(object) - } - maybeMirror = mirror.superclassMirror - } - rxFatalError("DelegateProxy has no factory of \(object). Implement DelegateProxy subclass for \(object) first.") - } - } - -#endif diff --git a/Pods/RxCocoa/RxCocoa/Common/KeyPathBinder.swift b/Pods/RxCocoa/RxCocoa/Common/KeyPathBinder.swift deleted file mode 100644 index 7f81561..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/KeyPathBinder.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// KeyPathBinder.swift -// RxCocoa -// -// Created by Ryo Aoyama on 2/7/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension Reactive where Base: AnyObject { - - /// Bindable sink for arbitrary property using the given key path. - /// Binding runs on the MainScheduler. - /// - /// - parameter keyPath: Key path to write to the property. - public subscript(keyPath: ReferenceWritableKeyPath) -> Binder { - return Binder(self.base) { base, value in - base[keyPath: keyPath] = value - } - } - - /// Bindable sink for arbitrary property using the given key path. - /// Binding runs on the specified scheduler. - /// - /// - parameter keyPath: Key path to write to the property. - /// - parameter scheduler: Scheduler to run bindings on. - public subscript(keyPath: ReferenceWritableKeyPath, on scheduler: ImmediateSchedulerType) -> Binder { - return Binder(self.base, scheduler: scheduler) { base, value in - base[keyPath: keyPath] = value - } - } - -} diff --git a/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift b/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift deleted file mode 100644 index 5810fe5..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// NSLayoutConstraint+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 12/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - -#if os(macOS) - import Cocoa -#else - import UIKit -#endif - -import RxSwift - -#if os(iOS) || os(macOS) || os(tvOS) -extension Reactive where Base: NSLayoutConstraint { - /// Bindable sink for `constant` property. - public var constant: Binder { - return Binder(self.base) { constraint, constant in - constraint.constant = constant - } - } - - /// Bindable sink for `active` property. - @available(iOS 8, OSX 10.10, *) - public var active: Binder { - return Binder(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 deleted file mode 100644 index 7be1474..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/Observable+Bind.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// Observable+Bind.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 8/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ObservableType { - /** - Creates new subscription and sends elements to observer(s). - In this form, it's equivalent to the `subscribe` method, but it better conveys intent, and enables - writing more consistent binding code. - - parameter to: Observers to receives events. - - returns: Disposable object that can be used to unsubscribe the observers. - */ - public func bind(to observers: Observer...) -> Disposable where Observer.Element == Element { - return self.bind(to: observers) - } - - /** - Creates new subscription and sends elements to observer(s). - In this form, it's equivalent to the `subscribe` method, but it better conveys intent, and enables - writing more consistent binding code. - - parameter to: Observers to receives events. - - returns: Disposable object that can be used to unsubscribe the observers. - */ - public func bind(to observers: Observer...) -> Disposable where Observer.Element == Element? { - return self.map { $0 as Element? }.bind(to: observers) - } - - /** - Creates new subscription and sends elements to observer(s). - In this form, it's equivalent to the `subscribe` method, but it better conveys intent, and enables - writing more consistent binding code. - - parameter to: Observers to receives events. - - returns: Disposable object that can be used to unsubscribe the observers. - */ - private func bind(to observers: [Observer]) -> Disposable where Observer.Element == Element { - return self.subscribe { event in - observers.forEach { $0.on(event) } - } - } - - /** - Subscribes to observable sequence using custom binder function. - - - parameter to: Function used to bind elements from `self`. - - returns: Object representing subscription. - */ - public func bind(to binder: (Self) -> Result) -> Result { - return binder(self) - } - - /** - Subscribes to observable sequence using custom binder function and final parameter passed to binder function - after `self` is passed. - - public func bind(to binder: Self -> R1 -> R2, curriedArgument: R1) -> R2 { - return binder(self)(curriedArgument) - } - - - parameter to: Function used to bind elements from `self`. - - parameter curriedArgument: Final argument passed to `binder` to finish binding process. - - returns: Object representing subscription. - */ - public func bind(to 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 bind(onNext: @escaping (Element) -> Void) -> Disposable { - return self.subscribe(onNext: onNext, onError: { error in - rxFatalErrorInDebug("Binding error: \(error)") - }) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift b/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift deleted file mode 100644 index 4abf880..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/RxCocoaObjCRuntimeError+Extensions.swift +++ /dev/null @@ -1,161 +0,0 @@ -// -// RxCocoaObjCRuntimeError+Extensions.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 10/9/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if SWIFT_PACKAGE && !DISABLE_SWIZZLING && !os(Linux) - import RxCocoaRuntime -#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) - @unknown default: - fatalError("Unhandled Objective C Runtime Error") - } - } - - return RxCocoaObjCRuntimeError.unknown(target: target) - } - } - -#endif - diff --git a/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift b/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift deleted file mode 100644 index c3356dd..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// RxTarget.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 7/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSObject - -import RxSwift - -class RxTarget : NSObject - , Disposable { - - private var retainSelf: RxTarget? - - override init() { - super.init() - self.retainSelf = self - -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - -#if DEBUG - MainScheduler.ensureRunningOnMainThread() -#endif - } - - func dispose() { -#if DEBUG - MainScheduler.ensureRunningOnMainThread() -#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 deleted file mode 100644 index 1532baa..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/SectionedViewDataSourceType.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// SectionedViewDataSourceType.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 1/10/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.IndexPath - -/// 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 deleted file mode 100644 index 2268882..0000000 --- a/Pods/RxCocoa/RxCocoa/Common/TextInput.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// TextInput.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/12/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -#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: self.base, text: self.text) - } - } - -#endif - - diff --git a/Pods/RxCocoa/RxCocoa/Deprecated.swift b/Pods/RxCocoa/RxCocoa/Deprecated.swift deleted file mode 100644 index 97c1132..0000000 --- a/Pods/RxCocoa/RxCocoa/Deprecated.swift +++ /dev/null @@ -1,580 +0,0 @@ -// -// Deprecated.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 3/19/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import Dispatch -import Foundation - -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. - */ - @available(*, deprecated, renamed: "bind(to:)") - public func bindTo(_ observer: Observer) -> Disposable where Observer.Element == Element { - 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. - */ - @available(*, deprecated, renamed: "bind(to:)") - public func bindTo(_ observer: Observer) -> Disposable where Observer.Element == Element? { - 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. - */ - @available(*, deprecated, renamed: "bind(to:)") - public func bindTo(_ variable: Variable) -> Disposable { - return self.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. - */ - @available(*, deprecated, renamed: "bind(to:)") - public func bindTo(_ variable: Variable) -> Disposable { - return self.map { $0 as Element? }.bindTo(variable) - } - - /** - Subscribes to observable sequence using custom binder function. - - - parameter binder: Function used to bind elements from `self`. - - returns: Object representing subscription. - */ - @available(*, deprecated, renamed: "bind(to:)") - public func bindTo(_ binder: (Self) -> Result) -> Result { - 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. - */ - @available(*, deprecated, renamed: "bind(to:)") - 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. - */ - @available(*, deprecated, renamed: "bind(onNext:)") - public func bindNext(_ onNext: @escaping (Element) -> Void) -> Disposable { - return self.subscribe(onNext: onNext, onError: { error in - let error = "Binding error: \(error)" - #if DEBUG - rxFatalError(error) - #else - print(error) - #endif - }) - } -} - -#if os(iOS) || os(tvOS) - import UIKit - - extension NSTextStorage { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxTextStorageDelegateProxy { - fatalError() - } - } - - extension UIScrollView { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxScrollViewDelegateProxy { - fatalError() - } - } - - extension UICollectionView { - @available(*, unavailable, message: "createRxDataSourceProxy is now unavailable, check DelegateProxyFactory") - public func createRxDataSourceProxy() -> RxCollectionViewDataSourceProxy { - fatalError() - } - } - - extension UITableView { - @available(*, unavailable, message: "createRxDataSourceProxy is now unavailable, check DelegateProxyFactory") - public func createRxDataSourceProxy() -> RxTableViewDataSourceProxy { - fatalError() - } - } - - extension UINavigationBar { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxNavigationControllerDelegateProxy { - fatalError() - } - } - - extension UINavigationController { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxNavigationControllerDelegateProxy { - fatalError() - } - } - - extension UITabBar { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxTabBarDelegateProxy { - fatalError() - } - } - - extension UITabBarController { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxTabBarControllerDelegateProxy { - fatalError() - } - } - - extension UISearchBar { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxSearchBarDelegateProxy { - fatalError() - } - } - -#endif - -#if os(iOS) - extension UISearchController { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxSearchControllerDelegateProxy { - fatalError() - } - } - - extension UIPickerView { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxPickerViewDelegateProxy { - fatalError() - } - - @available(*, unavailable, message: "createRxDataSourceProxy is now unavailable, check DelegateProxyFactory") - public func createRxDataSourceProxy() -> RxPickerViewDataSourceProxy { - fatalError() - } - } -#endif - -#if os(macOS) - import Cocoa - - extension NSTextField { - @available(*, unavailable, message: "createRxDelegateProxy is now unavailable, check DelegateProxyFactory") - public func createRxDelegateProxy() -> RxTextFieldDelegateProxy { - fatalError() - } - } -#endif - -/** - 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.** - */ -@available(*, deprecated, renamed: "SharingScheduler.mock(scheduler:action:)") -public func driveOnScheduler(_ scheduler: SchedulerType, action: () -> Void) { - SharingScheduler.mock(scheduler: scheduler, action: action) -} - -@available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") -extension Variable { - /// Converts `Variable` to `SharedSequence` unit. - /// - /// - returns: Observable sequence. - @available(*, deprecated, renamed: "asDriver()") - public func asSharedSequence(strategy: SharingStrategy.Type = SharingStrategy.self) -> SharedSequence { - let source = self.asObservable() - .observeOn(SharingStrategy.scheduler) - return SharedSequence(source) - } -} - -#if !os(Linux) - -extension DelegateProxy { - @available(*, unavailable, renamed: "assignedProxy(for:)") - public static func assignedProxyFor(_ object: ParentObject) -> Delegate? { - fatalError() - } - - @available(*, unavailable, renamed: "currentDelegate(for:)") - public static func currentDelegateFor(_ object: ParentObject) -> Delegate? { - fatalError() - } -} - -#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. -*/ -@available(*, deprecated, renamed: "Binder") -public final class UIBindingObserver : ObserverType where UIElement: AnyObject { - public typealias Element = Value - - weak var UIElement: UIElement? - - let binding: (UIElement, Value) -> Void - - /// Initializes `ViewBindingObserver` using - @available(*, deprecated, renamed: "UIBinder.init(_:scheduler:binding:)") - public init(UIElement: UIElement, binding: @escaping (UIElement, 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 { - self.binding(view, element) - } - case .error(let error): - bindingError(error) - case .completed: - break - } - } - - /// Erases type of observer. - /// - /// - returns: type erased observer. - public func asObserver() -> AnyObserver { - return AnyObserver(eventHandler: self.on) - } -} - - -#if os(iOS) - extension Reactive where Base: UIRefreshControl { - - /// Bindable sink for `beginRefreshing()`, `endRefreshing()` methods. - @available(*, deprecated, renamed: "isRefreshing") - public var refreshing: Binder { - return self.isRefreshing - } - } -#endif - -#if os(iOS) || os(tvOS) -extension Reactive where Base: UIImageView { - - /// Bindable sink for `image` property. - /// - parameter transitionType: Optional transition type while setting the image (kCATransitionFade, kCATransitionMoveIn, ...) - @available(*, deprecated, renamed: "image") - public func image(transitionType: String? = nil) -> Binder { - return Binder(base) { imageView, image in - if let transitionType = transitionType { - if image != nil { - let transition = CATransition() - transition.duration = 0.25 - transition.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut) - transition.type = CATransitionType(rawValue: transitionType) - - imageView.layer.add(transition, forKey: kCATransition) - } - } - else { - imageView.layer.removeAllAnimations() - } - imageView.image = image - } - } -} - -extension Reactive where Base: UISegmentedControl { - @available(*, deprecated, renamed: "enabledForSegment(at:)") - public func enabled(forSegmentAt segmentAt: Int) -> Binder { - return enabledForSegment(at: segmentAt) - } -} -#endif - -#if os(macOS) - - extension Reactive where Base: NSImageView { - - /// Bindable sink for `image` property. - /// - /// - parameter transitionType: Optional transition type while setting the image (kCATransitionFade, kCATransitionMoveIn, ...) - @available(*, deprecated, renamed: "image") - public func image(transitionType: String? = nil) -> Binder { - return Binder(self.base) { control, value in - if let transitionType = transitionType { - if value != nil { - let transition = CATransition() - transition.duration = 0.25 - transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) - transition.type = CATransitionType(rawValue: transitionType) - control.layer?.add(transition, forKey: kCATransition) - } - } - else { - control.layer?.removeAllAnimations() - } - control.image = value - } - } - } -#endif - -@available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") -extension Variable { - /// Converts `Variable` to `Driver` trait. - /// - /// - returns: Driving observable sequence. - public func asDriver() -> Driver { - let source = self.asObservable() - .observeOn(DriverSharingStrategy.scheduler) - return Driver(source) - } -} - - -private let errorMessage = "`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" - -extension SharedSequenceConvertibleType where SharingStrategy == DriverSharingStrategy { - /** - 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. - */ - @available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") - public func drive(_ variable: Variable) -> Disposable { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.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. - */ - @available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") - public func drive(_ variable: Variable) -> Disposable { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.drive(onNext: { e in - variable.value = e - }) - } -} - -@available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") -extension ObservableType { - /** - 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 to: Target variable for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to variable: Variable) -> Disposable { - return self.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 to: Target variable for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to variable: Variable) -> Disposable { - return self.map { $0 as Element? }.bind(to: variable) - } -} - -// 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timeout(_:latest:)") - public func throttle(_ dueTime: Foundation.TimeInterval, latest: Bool = true) - -> SharedSequence { - return throttle(.milliseconds(Int(dueTime * 1000.0)), latest: latest) - } - - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "debounce(_:)") - public func debounce(_ dueTime: Foundation.TimeInterval) - -> SharedSequence { - return debounce(.milliseconds(Int(dueTime * 1000.0))) - } -} - -// MARK: delay -extension SharedSequenceConvertibleType { - - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "delay(_:)") - public func delay(_ dueTime: Foundation.TimeInterval) - -> SharedSequence { - return delay(.milliseconds(Int(dueTime * 1000.0))) - } -} - -extension SharedSequence where Element : RxAbstractInteger { - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "interval(_:)") - public static func interval(_ period: Foundation.TimeInterval) - -> SharedSequence { - return interval(.milliseconds(Int(period * 1000.0))) - } -} - -// MARK: timer - -extension SharedSequence where Element: RxAbstractInteger { - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timer(_:)") - public static func timer(_ dueTime: Foundation.TimeInterval, period: Foundation.TimeInterval) - -> SharedSequence { - return timer(.milliseconds(Int(dueTime * 1000.0)), period: .milliseconds(Int(period * 1000.0))) - } -} - diff --git a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift b/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift deleted file mode 100644 index 0013434..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+CoreGraphics.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// KVORepresentable+CoreGraphics.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - -import RxSwift -import CoreGraphics - -import class Foundation.NSValue - -#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) || arch(arm64_32) - 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 deleted file mode 100644 index f65a93e..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable+Swift.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// KVORepresentable+Swift.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSNumber - -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 deleted file mode 100644 index be12b33..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// KVORepresentable.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 deleted file mode 100644 index 256a17a..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/Logging.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Logging.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/3/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if canImport(FoundationNetworking) -import struct FoundationNetworking.URLRequest -#else -import struct Foundation.URLRequest -#endif - -/// 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/NSObject+Rx+KVORepresentable.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift deleted file mode 100644 index 8c8c274..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+KVORepresentable.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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.NSObject -import RxSwift - -/// Key value observing options -public struct KeyValueObservingOptions: OptionSet { - /// Raw value - public let rawValue: UInt - - public init(rawValue: UInt) { - self.rawValue = rawValue - } - - /// Whether a sequence element should be sent to the observer immediately, before the subscribe method even returns. - public static let initial = KeyValueObservingOptions(rawValue: 1 << 0) - /// Whether to send updated values. - public static let new = KeyValueObservingOptions(rawValue: 1 << 1) -} - -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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable { - return self.observe(Element.KVOType.self, keyPath, options: options, retainSelf: retainSelf) - .map(Element.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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial]) -> Observable { - return self.observeWeakly(Element.KVOType.self, keyPath, options: options) - .map(Element.init) - } - } -#endif - -#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift deleted file mode 100644 index 205ab6c..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx+RawRepresentable.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// NSObject+Rx+RawRepresentable.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/9/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - -import RxSwift - -import Foundation.NSObject - -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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable where Element.RawValue: KVORepresentable { - return self.observe(Element.RawValue.KVOType.self, keyPath, options: options, retainSelf: retainSelf) - .map(Element.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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial]) -> Observable where Element.RawValue: KVORepresentable { - return self.observeWeakly(Element.RawValue.KVOType.self, keyPath, options: options) - .map(Element.init) - } - } -#endif - -#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift deleted file mode 100644 index 95bf25d..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/NSObject+Rx.swift +++ /dev/null @@ -1,544 +0,0 @@ -// -// NSObject+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if !os(Linux) - -import Foundation.NSObject -import RxSwift -#if SWIFT_PACKAGE && !DISABLE_SWIZZLING && !os(Linux) - import RxCocoaRuntime -#endif - -#if !DISABLE_SWIZZLING && !os(Linux) -private var deallocatingSubjectTriggerContext: UInt8 = 0 -private var deallocatingSubjectContext: UInt8 = 0 -#endif -private var deallocatedSubjectTriggerContext: UInt8 = 0 -private 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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial], retainSelf: Bool = true) -> Observable { - return KVOObservable(object: self.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: Element.Type, _ keyPath: String, options: KeyValueObservingOptions = [.new, .initial]) -> Observable { - return observeWeaklyKeyPathFor(self.base, keyPath: keyPath, options: options) - .map { n in - return n as? Element - } - } -} -#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 self.synchronized { - if let deallocObservable = objc_getAssociatedObject(self.base, &deallocatedSubjectContext) as? DeallocObservable { - return deallocObservable._subject - } - - let deallocObservable = DeallocObservable() - - objc_setAssociatedObject(self.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 arguments passed to `selector` method. - */ - public func sentMessage(_ selector: Selector) -> Observable<[Any]> { - return self.synchronized { - // in case of dealloc selector replay subject behavior needs to be used - if selector == deallocSelector { - return self.deallocating.map { _ in [] } - } - - do { - let proxy: MessageSentProxy = try self.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 arguments passed to `selector` method. - */ - public func methodInvoked(_ selector: Selector) -> Observable<[Any]> { - return self.synchronized { - // in case of dealloc selector replay subject behavior needs to be used - if selector == deallocSelector { - return self.deallocated.map { _ in [] } - } - - - do { - let proxy: MessageSentProxy = try self.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 self.synchronized { - do { - let proxy: DeallocatingProxy = try self.registerMessageInterceptor(deallocSelector) - return proxy.messageSent.asObservable() - } - catch let e { - return Observable.error(e) - } - } - } - - private 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(self.base, selectorReference) as? T { - subject = existingSubject - } - else { - subject = T() - objc_setAssociatedObject( - self.base, - selectorReference, - subject, - .OBJC_ASSOCIATION_RETAIN_NONATOMIC - ) - } - - if subject.isActive { - return subject - } - - var error: NSError? - let targetImplementation = RX_ensure_observing(self.base, selector, &error) - if targetImplementation == nil { - throw error?.rxCocoaErrorForTarget(self.base) ?? RxCocoaError.unknown - } - - subject.targetImplementation = targetImplementation! - - return subject - } -#endif -} - -// MARK: Message interceptors - -#if !DISABLE_SWIZZLING && !os(Linux) - - private protocol MessageInterceptorSubject: class { - init() - - var isActive: Bool { - get - } - - var targetImplementation: IMP { get set } - } - - private final class DeallocatingProxy - : MessageInterceptorSubject - , RXDeallocatingObserver { - typealias Element = () - - let messageSent = ReplaySubject<()>.create(bufferSize: 1) - - @objc var targetImplementation: IMP = RX_default_target_implementation() - - var isActive: Bool { - return self.targetImplementation != RX_default_target_implementation() - } - - init() { - } - - @objc func deallocating() { - self.messageSent.on(.next(())) - } - - deinit { - self.messageSent.on(.completed) - } - } - - private final class MessageSentProxy - : MessageInterceptorSubject - , RXMessageSentObserver { - typealias Element = [AnyObject] - - let messageSent = PublishSubject<[Any]>() - let methodInvoked = PublishSubject<[Any]>() - - @objc var targetImplementation: IMP = RX_default_target_implementation() - - var isActive: Bool { - return self.targetImplementation != RX_default_target_implementation() - } - - init() { - } - - @objc func messageSent(withArguments arguments: [Any]) { - self.messageSent.on(.next(arguments)) - } - - @objc func methodInvoked(withArguments arguments: [Any]) { - self.methodInvoked.on(.next(arguments)) - } - - deinit { - self.messageSent.on(.completed) - self.methodInvoked.on(.completed) - } - } - -#endif - - -private final class DeallocObservable { - let _subject = ReplaySubject.create(bufferSize:1) - - init() { - } - - deinit { - self._subject.on(.next(())) - self._subject.on(.completed) - } -} - -// MARK: KVO - -#if !os(Linux) - -private protocol KVOObservableProtocol { - var target: AnyObject { get } - var keyPath: String { get } - var retainTarget: Bool { get } - var options: KeyValueObservingOptions { get } -} - -private final class KVOObserver - : _RXKVOObserver - , Disposable { - typealias Callback = (Any?) -> Void - - var retainSelf: KVOObserver? - - 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.nsOptions, callback: callback) - self.retainSelf = self - } - - override func dispose() { - super.dispose() - self.retainSelf = nil - } - - deinit { - #if TRACE_RESOURCES - _ = Resources.decrementTotal() - #endif - } -} - -private final class KVOObservable - : ObservableType - , KVOObservableProtocol { - typealias Element = Element? - - unowned var target: AnyObject - var strongTarget: AnyObject? - - var keyPath: String - var options: KeyValueObservingOptions - var retainTarget: Bool - - init(object: AnyObject, keyPath: String, options: KeyValueObservingOptions, retainTarget: Bool) { - self.target = object - self.keyPath = keyPath - self.options = options - self.retainTarget = retainTarget - if retainTarget { - self.strongTarget = object - } - } - - func subscribe(_ observer: Observer) -> Disposable where Observer.Element == 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) - } - -} - -private extension KeyValueObservingOptions { - var nsOptions: NSKeyValueObservingOptions { - var result: UInt = 0 - if self.contains(.new) { - result |= NSKeyValueObservingOptions.new.rawValue - } - if self.contains(.initial) { - result |= NSKeyValueObservingOptions.initial.rawValue - } - - return NSKeyValueObservingOptions(rawValue: result) - } -} - -#endif - -#if !DISABLE_SWIZZLING && !os(Linux) - - private func observeWeaklyKeyPathFor(_ target: NSObject, keyPath: String, options: KeyValueObservingOptions) -> Observable { - let components = keyPath.components(separatedBy: ".").filter { $0 != "self" } - - let observable = observeWeaklyKeyPathFor(target, keyPathSections: components, options: options) - .finishWithNilWhenDealloc(target) - - if !options.isDisjoint(with: .initial) { - 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. - private func isWeakProperty(_ properyRuntimeInfo: String) -> Bool { - return properyRuntimeInfo.range(of: ",W,") != nil - } - - private extension ObservableType where Element == AnyObject? { - func finishWithNilWhenDealloc(_ target: NSObject) - -> Observable { - let deallocating = target.rx.deallocating - - return deallocating - .map { _ in - return Observable.just(nil) - } - .startWith(self.asObservable()) - .switchLatest() - } - } - - private func observeWeaklyKeyPathFor( - _ target: NSObject, - keyPathSections: [String], - options: KeyValueObservingOptions - ) -> 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 - -private 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(self.base, key) { - return value as! T - } - - let observable = createCachedObservable() - - objc_setAssociatedObject(self.base, key, observable, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - - return observable - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/Foundation/NotificationCenter+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/NotificationCenter+Rx.swift deleted file mode 100644 index f15e718..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/NotificationCenter+Rx.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// NotificationCenter+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NotificationCenter -import struct Foundation.Notification - -import RxSwift - -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/URLSession+Rx.swift b/Pods/RxCocoa/RxCocoa/Foundation/URLSession+Rx.swift deleted file mode 100644 index b5d84ad..0000000 --- a/Pods/RxCocoa/RxCocoa/Foundation/URLSession+Rx.swift +++ /dev/null @@ -1,251 +0,0 @@ -// -// URLSession+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 3/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.URL -import struct Foundation.Data -import struct Foundation.Date -import struct Foundation.TimeInterval -import class Foundation.JSONSerialization -import class Foundation.NSError -import var Foundation.NSURLErrorCancelled -import var Foundation.NSURLErrorDomain - -#if canImport(FoundationNetworking) -import struct FoundationNetworking.URLRequest -import class FoundationNetworking.HTTPURLResponse -import class FoundationNetworking.URLSession -import class FoundationNetworking.URLResponse -#else -import struct Foundation.URLRequest -import class Foundation.HTTPURLResponse -import class Foundation.URLSession -import class Foundation.URLResponse -#endif - -#if os(Linux) - // don't know why - import Foundation -#endif - -import RxSwift - -/// 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)" - } - } -} - -private func escapeTerminalString(_ value: String) -> String { - return value.replacingOccurrences(of: "\"", with: "\\\"", options:[], range: nil) -} - -private func convertURLRequestToCurlCommand(_ request: URLRequest) -> String { - let method = request.httpMethod ?? "GET" - var returnValue = "curl -X \(method) " - - if let httpBody = request.httpBody, request.httpMethod == "POST" || request.httpMethod == "PUT" { - 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 -} - -private func convertResponseToString(_ 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 "Canceled (\(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<(response: HTTPURLResponse, data: 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)) - #if os(Linux) - print(convertResponseToString(response, error.flatMap { $0 as NSError }, interval)) - #else - print(convertResponseToString(response, error.map { $0 as NSError }, interval)) - #endif - } - - 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) - } - - task.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 self.response(request: request).map { pair -> Data in - if 200 ..< 300 ~= pair.0.statusCode { - return pair.1 - } - else { - throw RxCocoaURLError.httpRequestFailed(response: pair.0, data: pair.1) - } - } - } - - /** - 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 self.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 self.json(request: URLRequest(url: url)) - } -} - diff --git a/Pods/RxCocoa/RxCocoa/Runtime/_RX.m b/Pods/RxCocoa/RxCocoa/Runtime/_RX.m deleted file mode 100644 index cffbfbc..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/_RX.m +++ /dev/null @@ -1,10 +0,0 @@ -// -// _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 deleted file mode 100644 index 36338a5..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/_RXDelegateProxy.m +++ /dev/null @@ -1,147 +0,0 @@ -// -// _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 *voidSelectorsPerClass = nil; - -@implementation _RXDelegateProxy - -+(NSSet*)collectVoidSelectorsForProtocol:(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 collectVoidSelectorsForProtocol:pSubprotocols[i]]]; - } - - free(pSubprotocols); - - return selectors; -} - -+(void)initialize { - @synchronized (_RXDelegateProxy.class) { - if (voidSelectorsPerClass == nil) { - voidSelectorsPerClass = [[NSMutableDictionary alloc] init]; - } - - NSMutableSet *voidSelectors = [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 collectVoidSelectorsForProtocol:pProtocols[i]]; - [voidSelectors 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 - } - - voidSelectorsPerClass[CLASS_VALUE(self)] = voidSelectors; - } -} - --(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)voidDelegateMethodsContain:(SEL)selector { - @synchronized(_RXDelegateProxy.class) { - NSSet *voidSelectors = voidSelectorsPerClass[CLASS_VALUE(self.class)]; - NSAssert(voidSelectors != nil, @"Set of allowed methods not initialized"); - return [voidSelectors containsObject:SEL_VALUE(selector)]; - } -} - --(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 deleted file mode 100644 index fc8fb75..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/_RXKVOObserver.m +++ /dev/null @@ -1,54 +0,0 @@ -// -// _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 deleted file mode 100644 index 1aa9071..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/_RXObjCRuntime.m +++ /dev/null @@ -1,1027 +0,0 @@ -// -// _RXObjCRuntime.m -// RxCocoa -// -// Created by Krunoslav Zaher on 7/11/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#import -#import -#import -#import -#import -#import - -#import "include/_RX.h" -#import "include/_RXObjCRuntime.h" - -// self + cmd -#define HIDDEN_ARGUMENT_COUNT 2 - -#if !DISABLE_SWIZZLING - -#define NSErrorParam NSError *__autoreleasing __nullable * __nullable - -@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, NSErrorParam error); - -static CFTypeID defaultTypeID; -static SEL deallocSelector; - -static int RxSwizzlingTargetClassKey = 0; - -#if TRACE_RESOURCES -_Atomic static int32_t numberOInterceptedMethods = 0; -_Atomic 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 (^)(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]); -} - -#endif - -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; -} - -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 (^)(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; -} - -IMP __nonnull RX_default_target_implementation(void) { - return _objc_msgForward; -} - -#if !DISABLE_SWIZZLING - -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; -} - -@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:(NSErrorParam)error; --(BOOL)ensureSwizzledSelector:(SEL __nonnull)selector - ofClass:(Class __nonnull)class - newImplementationGenerator:(IMP(^)(void))newImplementationGenerator -replacementImplementationGenerator:(IMP (^)(IMP originalImplementation))replacementImplementationGenerator - error:(NSErrorParam)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, NSErrorParam 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; -} - -// 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_FOREACH(_, SEPARATE_BY_COMMA, NOT_NULL_ARGUMENT_CAT, ## __VA_ARGS__) -#define ARGUMENTS(...) RX_FOREACH_COMMA(_, NAME_CAT, ## __VA_ARGS__) -#define DECLARE_ARGUMENTS(...) RX_FOREACH_COMMA(_, TYPE_AND_NAME_CAT, ## __VA_ARGS__) - -// optimized observe methods - -#define GENERATE_METHOD_IDENTIFIER(...) RX_CAT2(swizzle, RX_FOREACH(_, CAT, UNDERSCORE_TYPE_CAT, ## __VA_ARGS__)) - -#define GENERATE_OBSERVE_METHOD_DECLARATION(...) \ - -(BOOL)GENERATE_METHOD_IDENTIFIER(__VA_ARGS__):(Class __nonnull)class \ - selector:(SEL)selector \ - error:(NSErrorParam)error { \ - - -#define BUILD_EXAMPLE_METHOD(return_value, ...) \ - +(return_value)RX_CAT2(RX_CAT2(example_, return_value), RX_FOREACH(_, SEPARATE_BY_SPACE, EXAMPLE_PARAMETER, ## __VA_ARGS__)) {} - -#define BUILD_EXAMPLE_METHOD_SELECTOR(return_value, ...) \ - RX_CAT2(RX_CAT2(example_, return_value), RX_FOREACH(_, 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, NSErrorParam 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:(NSErrorParam)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)(void) = ^() { \ - __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:(NSErrorParam)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:(NSErrorParam)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:(NSErrorParam)error { - if (![self ensureForwardingMethodsAreSwizzled:swizzlingImplementorClass error:error]) { - return NO; - } - - ALWAYS(![self forwardingSelector:selector forClass:swizzlingImplementorClass], @"Already observing selector for class"); - -#if TRACE_RESOURCES - atomic_fetch_add(&numberOfForwardedMethods, 1); -#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:(NSErrorParam)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:(NSErrorParam)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(^)(void))newImplementationGenerator -replacementImplementationGenerator:(IMP (^)(IMP originalImplementation))replacementImplementationGenerator - error:(NSErrorParam)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 - atomic_fetch_add(&numberOInterceptedMethods, 1); -#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 deleted file mode 100644 index 8cf762e..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/include/RxCocoaRuntime.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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 deleted file mode 100644 index b868ac9..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/include/_RX.h +++ /dev/null @@ -1,93 +0,0 @@ -// -// _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 explicitly 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); - -#define RX_CAT2(_1, _2) _RX_CAT2(_1, _2) -#define _RX_CAT2(_1, _2) _1 ## _2 - -#define RX_ELEMENT_AT(n, ...) RX_CAT2(_RX_ELEMENT_AT_, n)(__VA_ARGS__) -#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 - -#define RX_COUNT(...) RX_ELEMENT_AT(6, ## __VA_ARGS__, 6, 5, 4, 3, 2, 1, 0) -#define RX_EMPTY(...) RX_ELEMENT_AT(6, ## __VA_ARGS__, 0, 0, 0, 0, 0, 0, 1) - -/** - #define SUM(context, index, head, tail) head + tail - #define MAP(context, index, element) (context)[index] * (element) - - RX_FOR(numbers, SUM, MAP, b0, b1, b2); - - (numbers)[0] * (b0) + (numbers)[1] * (b1) + (numbers[2]) * (b2) - */ - -#define RX_FOREACH(context, concat, map, ...) RX_FOR_MAX(RX_COUNT(__VA_ARGS__), _RX_FOREACH_CONCAT, _RX_FOREACH_MAP, context, concat, map, __VA_ARGS__) -#define _RX_FOREACH_CONCAT(index, head, tail, context, concat, map, ...) concat(context, index, head, tail) -#define _RX_FOREACH_MAP(index, context, concat, map, ...) map(context, index, RX_ELEMENT_AT(index, __VA_ARGS__)) - -/** - #define MAP(context, index, item) (context)[index] * (item) - - RX_FOR_COMMA(numbers, MAP, b0, b1); - - ,(numbers)[0] * b0, (numbers)[1] * b1 - */ -#define RX_FOREACH_COMMA(context, map, ...) RX_CAT2(_RX_FOREACH_COMMA_EMPTY_, RX_EMPTY(__VA_ARGS__))(context, map, ## __VA_ARGS__) -#define _RX_FOREACH_COMMA_EMPTY_1(context, map, ...) -#define _RX_FOREACH_COMMA_EMPTY_0(context, map, ...) , RX_FOR_MAX(RX_COUNT(__VA_ARGS__), _RX_FOREACH_COMMA_CONCAT, _RX_FOREACH_COMMA_MAP, context, map, __VA_ARGS__) -#define _RX_FOREACH_COMMA_CONCAT(index, head, tail, context, map, ...) head, tail -#define _RX_FOREACH_COMMA_MAP(index, context, map, ...) map(context, index, RX_ELEMENT_AT(index, __VA_ARGS__)) - -// rx for - -#define RX_FOR_MAX(max, concat, map, ...) RX_CAT2(RX_FOR_, max)(concat, map, ## __VA_ARGS__) - -#define RX_FOR_0(concat, map, ...) -#define RX_FOR_1(concat, map, ...) map(0, __VA_ARGS__) -#define RX_FOR_2(concat, map, ...) concat(1, RX_FOR_1(concat, map, ## __VA_ARGS__), map(1, __VA_ARGS__), __VA_ARGS__) -#define RX_FOR_3(concat, map, ...) concat(2, RX_FOR_2(concat, map, ## __VA_ARGS__), map(2, __VA_ARGS__), __VA_ARGS__) -#define RX_FOR_4(concat, map, ...) concat(3, RX_FOR_3(concat, map, ## __VA_ARGS__), map(3, __VA_ARGS__), __VA_ARGS__) -#define RX_FOR_5(concat, map, ...) concat(4, RX_FOR_4(concat, map, ## __VA_ARGS__), map(4, __VA_ARGS__), __VA_ARGS__) -#define RX_FOR_6(concat, map, ...) concat(5, RX_FOR_5(concat, map, ## __VA_ARGS__), map(5, __VA_ARGS__), __VA_ARGS__) - diff --git a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h b/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h deleted file mode 100644 index e1cc207..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// _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 NS_SWIFT_NAME(_setForwardToDelegate(_:retainDelegate:)) ; - --(BOOL)hasWiredImplementationForSelector:(SEL)selector; --(BOOL)voidDelegateMethodsContain:(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 deleted file mode 100644 index adcfd0a..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXKVOObserver.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// _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 deleted file mode 100644 index bc6a76a..0000000 --- a/Pods/RxCocoa/RxCocoa/Runtime/include/_RXObjCRuntime.h +++ /dev/null @@ -1,102 +0,0 @@ -// -// _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 *__autoreleasing __nullable * __nullable error); - -#endif - -/// 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(void); diff --git a/Pods/RxCocoa/RxCocoa/RxCocoa.h b/Pods/RxCocoa/RxCocoa/RxCocoa.h deleted file mode 100644 index 7436904..0000000 --- a/Pods/RxCocoa/RxCocoa/RxCocoa.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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 deleted file mode 100644 index a446f55..0000000 --- a/Pods/RxCocoa/RxCocoa/RxCocoa.swift +++ /dev/null @@ -1,155 +0,0 @@ -// -// RxCocoa.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSNull - -// Importing RxCocoa also imports RxRelay -@_exported import RxRelay - -import RxSwift -#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)` doesn'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 let .castingError(object, targetType): - return "Error casting `\(object)` to `\(targetType)`" - } - } -} - - - -// MARK: Error binding policies - -func bindingError(_ error: Swift.Error) { - let error = "Binding error: \(error)" -#if DEBUG - rxFatalError(error) -#else - print(error) -#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 rxAbstractMethod(message: String = "Abstract method", file: StaticString = #file, line: UInt = #line) -> Swift.Never { - rxFatalError(message, file: file, line: line) -} - -func rxFatalError(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) -> 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(), file: file, line: line) -} - -func rxFatalErrorInDebug(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) { - #if DEBUG - fatalError(lastMessage(), file: file, line: line) - #else - print("\(file):\(line): \(lastMessage())") - #endif -} - -// 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 \(String(describing: value)) to \(T.self)") - } - - return result -} - -// MARK: Error messages - -let dataSourceNotSet = "DataSource not set" -let delegateNotSet = "Delegate not set" - -// MARK: Shared with RxSwift - -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) -} - diff --git a/Pods/RxCocoa/RxCocoa/Traits/ControlEvent.swift b/Pods/RxCocoa/RxCocoa/Traits/ControlEvent.swift deleted file mode 100644 index 4be2ed2..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/ControlEvent.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// ControlEvent.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 8/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/// A protocol that extends `ControlEvent`. -public protocol ControlEventType : ObservableType { - - /// - returns: `ControlEvent` interface - func asControlEvent() -> ControlEvent -} - -/** - A trait for `Observable`/`ObservableType` that represents an event on a UI element. - - Properties: - - - it doesn’t send any initial value on subscription, - - it `Complete`s the sequence when the control deallocates, - - 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 the implementor’s responsibility to make sure that all other properties enumerated above are satisfied.** - - **If they aren’t, using this trait will communicate wrong properties, and could potentially break someone’s code.** - - **If the `events` observable sequence passed into the initializer doesn’t satisfy all enumerated - properties, don’t use this trait.** -*/ -public struct ControlEvent : ControlEventType { - public typealias Element = 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.Element == Element { - self._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: Observer) -> Disposable where Observer.Element == Element { - return self._events.subscribe(observer) - } - - /// - returns: `Observable` interface. - public func asObservable() -> Observable { - return self._events - } - - /// - returns: `ControlEvent` interface. - public func asControlEvent() -> ControlEvent { - return self - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/ControlProperty.swift b/Pods/RxCocoa/RxCocoa/Traits/ControlProperty.swift deleted file mode 100644 index 60ac016..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/ControlProperty.swift +++ /dev/null @@ -1,118 +0,0 @@ -// -// ControlProperty.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 8/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/// Protocol that enables extension of `ControlProperty`. -public protocol ControlPropertyType : ObservableType, ObserverType { - - /// - returns: `ControlProperty` interface - func asControlProperty() -> ControlProperty -} - -/** - Trait for `Observable`/`ObservableType` that represents property of UI element. - - Sequence of values only represents initial control value and user initiated value changes. - Programmatic value changes won't be reported. - - It's properties are: - - - `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 trait 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 trait.** -*/ -public struct ControlProperty : ControlPropertyType { - public typealias Element = 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: Values, valueSink: Sink) where Element == Values.Element, Element == Sink.Element { - self._values = values.subscribeOn(ConcurrentMainScheduler.instance) - self._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: Observer) -> Disposable where Observer.Element == Element { - return self._values.subscribe(observer) - } - - /// `ControlEvent` of user initiated value changes. Every time user updates control value change event - /// will be emitted from `changed` event. - /// - /// Programmatic 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 programmatic and user updates, - /// or for any other reason). - public var changed: ControlEvent { - return ControlEvent(events: self._values.skip(1)) - } - - /// - returns: `Observable` interface. - public func asObservable() -> Observable { - return self._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): - bindingError(error) - case .next: - self._valueSink.on(event) - case .completed: - self._valueSink.on(event) - } - } -} - -extension ControlPropertyType where Element == 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/Traits/Driver/BehaviorRelay+Driver.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/BehaviorRelay+Driver.swift deleted file mode 100644 index a248d15..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/BehaviorRelay+Driver.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// BehaviorRelay+Driver.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 10/7/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import RxRelay - -extension BehaviorRelay { - /// Converts `BehaviorRelay` to `Driver`. - /// - /// - returns: Observable sequence. - public func asDriver() -> Driver { - let source = self.asObservable() - .observeOn(DriverSharingStrategy.scheduler) - return SharedSequence(source) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlEvent+Driver.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlEvent+Driver.swift deleted file mode 100644 index b59c753..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlEvent+Driver.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ControlEvent+Driver.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ControlEvent { - /// Converts `ControlEvent` to `Driver` trait. - /// - /// `ControlEvent` already can't fail, so no special case needs to be handled. - public func asDriver() -> Driver { - return self.asDriver { _ -> 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/Traits/Driver/ControlProperty+Driver.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlProperty+Driver.swift deleted file mode 100644 index 7904529..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlProperty+Driver.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ControlProperty+Driver.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ControlProperty { - /// Converts `ControlProperty` to `Driver` trait. - /// - /// `ControlProperty` already can't fail, so no special case needs to be handled. - public func asDriver() -> Driver { - return self.asDriver { _ -> 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/Traits/Driver/Driver+Subscription.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/Driver+Subscription.swift deleted file mode 100644 index 9026747..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/Driver+Subscription.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// Driver+Subscription.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import RxRelay - -private let errorMessage = "`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" - -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: Observer) -> Disposable where Observer.Element == Element { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - 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: Observer) -> Disposable where Observer.Element == Element? { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.asSharedSequence().asObservable().map { $0 as Element? }.subscribe(observer) - } - - /** - Creates new subscription and sends elements to `BehaviorRelay`. - This method can be only called from `MainThread`. - - - parameter relay: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func drive(_ relay: BehaviorRelay) -> Disposable { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.drive(onNext: { e in - relay.accept(e) - }) - } - - /** - Creates new subscription and sends elements to `BehaviorRelay`. - This method can be only called from `MainThread`. - - - parameter relay: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func drive(_ relay: BehaviorRelay) -> Disposable { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.drive(onNext: { e in - relay.accept(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) -> Result) -> Result { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - 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.ensureRunningOnMainThread(errorMessage: errorMessage) - 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 canceled 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 canceled by disposing subscription) - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func drive(onNext: ((Element) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) -> Disposable { - MainScheduler.ensureRunningOnMainThread(errorMessage: errorMessage) - return self.asObservable().subscribe(onNext: onNext, onCompleted: onCompleted, onDisposed: onDisposed) - } -} - - diff --git a/Pods/RxCocoa/RxCocoa/Traits/Driver/Driver.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/Driver.swift deleted file mode 100644 index 07d2c86..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/Driver.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// Driver.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/26/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/** - Trait that represents observable sequence with following properties: - - - it never fails - - it delivers events on `MainScheduler.instance` - - `share(replay: 1, scope: .whileConnected)` sharing strategy - - Additional explanation: - - all observers share sequence computation resources - - it's stateful, upon subscription (calling subscribe) last element is immediately 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 - - In case trait that models event bus is required, please check `Signal`. - - `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 traits and how to use them, please visit `Documentation/Traits.md`. - */ -public typealias Driver = SharedSequence - -public struct DriverSharingStrategy: SharingStrategyProtocol { - public static var scheduler: SchedulerType { return SharingScheduler.make() } - public static func share(_ source: Observable) -> Observable { - return source.share(replay: 1, scope: .whileConnected) - } -} - -extension SharedSequenceConvertibleType where SharingStrategy == DriverSharingStrategy { - /// Adds `asDriver` to `SharingSequence` with `DriverSharingStrategy`. - public func asDriver() -> Driver { - return self.asSharedSequence() - } -} - diff --git a/Pods/RxCocoa/RxCocoa/Traits/Driver/ObservableConvertibleType+Driver.swift b/Pods/RxCocoa/RxCocoa/Traits/Driver/ObservableConvertibleType+Driver.swift deleted file mode 100644 index 96a5363..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Driver/ObservableConvertibleType+Driver.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// ObservableConvertibleType+Driver.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ObservableConvertibleType { - /** - Converts observable sequence to `Driver` trait. - - - parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence. - - returns: Driver trait. - */ - public func asDriver(onErrorJustReturn: Element) -> Driver { - let source = self - .asObservable() - .observeOn(DriverSharingStrategy.scheduler) - .catchErrorJustReturn(onErrorJustReturn) - return Driver(source) - } - - /** - Converts observable sequence to `Driver` trait. - - - parameter onErrorDriveWith: Driver that continues to drive the sequence in case of error. - - returns: Driver trait. - */ - public func asDriver(onErrorDriveWith: Driver) -> Driver { - let source = self - .asObservable() - .observeOn(DriverSharingStrategy.scheduler) - .catchError { _ in - onErrorDriveWith.asObservable() - } - return Driver(source) - } - - /** - Converts observable sequence to `Driver` trait. - - - parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error. - - returns: Driver trait. - */ - 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/Traits/SharedSequence/ObservableConvertibleType+SharedSequence.swift b/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/ObservableConvertibleType+SharedSequence.swift deleted file mode 100644 index 57af194..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/ObservableConvertibleType+SharedSequence.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// ObservableConvertibleType+SharedSequence.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/1/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -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: Element) -> 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/Traits/SharedSequence/SchedulerType+SharedSequence.swift b/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SchedulerType+SharedSequence.swift deleted file mode 100644 index 4ab1bb9..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SchedulerType+SharedSequence.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// SchedulerType+SharedSequence.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 8/27/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -public enum SharingScheduler { - /// Default scheduler used in SharedSequence based traits. - public private(set) static var make: () -> SchedulerType = { MainScheduler() } - - /** - This method can be used in unit tests to ensure that built in shared sequences are using mock schedulers instead - of main schedulers. - - **This shouldn't be used in normal release builds.** - */ - static public func mock(scheduler: SchedulerType, action: () -> Void) { - return mock(makeScheduler: { scheduler }, action: action) - } - - /** - This method can be used in unit tests to ensure that built in shared sequences are using mock schedulers instead - of main schedulers. - - **This shouldn't be used in normal release builds.** - */ - static public func mock(makeScheduler: @escaping () -> SchedulerType, action: () -> Void) { - let originalMake = make - make = makeScheduler - - action() - - // If you remove this line , compiler buggy optimizations will change behavior of this code - _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(makeScheduler) - // Scary, I know - - make = originalMake - } -} - -#if os(Linux) - import Glibc -#else - import func Foundation.arc4random -#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()) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators+arity.swift b/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators+arity.swift deleted file mode 100644 index 4cc967c..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators+arity.swift +++ /dev/null @@ -1,656 +0,0 @@ -// 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 RxSwift - - - -// 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.Element, O2.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), - resultSelector: resultSelector - ) - - return SharedSequence(source) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), - resultSelector: resultSelector - ) - - return SharedSequence(source) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), - resultSelector: resultSelector - ) - - return SharedSequence(source) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), - resultSelector: resultSelector - ) - - return SharedSequence(source) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element, O4.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - 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 SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element, O4.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), - resultSelector: resultSelector - ) - - return SharedSequence(source) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - 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 SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy { - let source = Observable.zip( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - 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) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy { - let source = Observable.combineLatest( - source1.asSharedSequence().asObservable(), source2.asSharedSequence().asObservable(), source3.asSharedSequence().asObservable(), source4.asSharedSequence().asObservable(), source5.asSharedSequence().asObservable() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - 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 SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - 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() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - 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) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - 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() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - 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 SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - 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() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - 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) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - 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() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - SharingStrategy == O7.SharingStrategy, - 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 SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - SharingStrategy == O7.SharingStrategy, - 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() - ) - - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element) throws -> Element) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - SharingStrategy == O7.SharingStrategy, - 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) - } -} - -extension SharedSequenceConvertibleType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of element tuples whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> SharedSequence where SharingStrategy == O1.SharingStrategy, - SharingStrategy == O2.SharingStrategy, - SharingStrategy == O3.SharingStrategy, - SharingStrategy == O4.SharingStrategy, - SharingStrategy == O5.SharingStrategy, - SharingStrategy == O6.SharingStrategy, - SharingStrategy == O7.SharingStrategy, - 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() - ) - - return SharedSequence(source) - } -} - - diff --git a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift b/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift deleted file mode 100644 index c489365..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence+Operators.swift +++ /dev/null @@ -1,541 +0,0 @@ -// -// SharedSequence+Operators.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -// 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 (Element) -> Result) -> SharedSequence { - let source = self - .asObservable() - .map(selector) - return SharedSequence(source) - } -} - -// MARK: compactMap -extension SharedSequenceConvertibleType { - - /** - Projects each element of an observable sequence into an optional form and filters all optional results. - - Equivalent to: - - func compactMap(_ transform: @escaping (Self.E) -> Result?) -> SharedSequence { - return self.map(transform).filter { $0 != nil }.map { $0! } - } - - - parameter transform: A transform function to apply to each source element and which returns an element or nil. - - returns: An observable sequence whose elements are the result of filtering the transform function for each element of the source. - - */ - public func compactMap(_ selector: @escaping (Element) -> Result?) -> SharedSequence { - let source = self - .asObservable() - .compactMap(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 (Element) -> Bool) -> SharedSequence { - let source = self - .asObservable() - .filter(predicate) - return SharedSequence(source) - } -} - -// MARK: switchLatest -extension SharedSequenceConvertibleType where Element : SharedSequenceConvertibleType { - - /** - 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 (Element) -> 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 (Element) -> 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 afterNext: Action to invoke for each element after the observable has passed an onNext event along to its downstream. - - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - - parameter afterCompleted: Action to invoke after graceful termination of the observable sequence. - - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. - - parameter onSubscribed: Action to invoke after 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: ((Element) -> Void)? = nil, afterNext: ((Element) -> Void)? = nil, onCompleted: (() -> Void)? = nil, afterCompleted: (() -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) - -> SharedSequence { - let source = self.asObservable() - .do(onNext: onNext, afterNext: afterNext, onCompleted: onCompleted, afterCompleted: afterCompleted, onSubscribe: onSubscribe, onSubscribed: onSubscribed, 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, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function) -> SharedSequence { - let source = self.asObservable() - .debug(identifier, trimOutput: trimOutput, file: file, line: line, function: function) - return SharedSequence(source) - } -} - -// MARK: distinctUntilChanged -extension SharedSequenceConvertibleType where Element: 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 (Element) -> Key) -> 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 (Element, Element) -> 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 (Element) -> 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 (Element) -> SharedSequence) -> SharedSequence { - let source = self.asObservable() - .flatMap(selector) - - return SharedSequence(source) - } -} - -// MARK: merge -extension SharedSequenceConvertibleType { - /** - Merges elements from all observable sequences from collection into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: Collection) -> SharedSequence - where Collection.Element == SharedSequence { - let source = Observable.merge(sources.map { $0.asObservable() }) - return SharedSequence(source) - } - - /** - Merges elements from all observable sequences from array into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Array of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: [SharedSequence]) -> SharedSequence { - let source = Observable.merge(sources.map { $0.asObservable() }) - return SharedSequence(source) - } - - /** - Merges elements from all observable sequences into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: SharedSequence...) -> SharedSequence { - let source = Observable.merge(sources.map { $0.asObservable() }) - return SharedSequence(source) - } - -} - -// MARK: merge -extension SharedSequenceConvertibleType where Element : SharedSequenceConvertibleType { - /** - Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. - - - 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. - - - 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) - -> 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, latest: Bool = true) - -> SharedSequence { - let source = self.asObservable() - .throttle(dueTime, latest: latest, 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, Element) -> 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: Sequence) -> SharedSequence - where Sequence.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: Collection) -> SharedSequence - where Collection.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: Collection, resultSelector: @escaping ([Element]) throws -> Result) -> SharedSequence - where Collection.Element == SharedSequence { - let source = Observable.zip(collection.map { $0.asSharedSequence().asObservable() }, resultSelector: resultSelector) - return SharedSequence(source) - } - - /** - Merges the specified observable sequences into one observable sequence all of the observable sequences have produced an element at a corresponding index. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip(_ collection: Collection) -> SharedSequence - where Collection.Element == SharedSequence { - let source = Observable.zip(collection.map { $0.asSharedSequence().asObservable() }) - 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: Collection, resultSelector: @escaping ([Element]) throws -> Result) -> SharedSequence - where Collection.Element == SharedSequence { - let source = Observable.combineLatest(collection.map { $0.asObservable() }, resultSelector: resultSelector) - return SharedSequence(source) - } - - /** - Merges the specified observable sequences into one observable sequence whenever any of the observable sequences produces an element. - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest(_ collection: Collection) -> SharedSequence - where Collection.Element == SharedSequence { - let source = Observable.combineLatest(collection.map { $0.asObservable() }) - 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 (Element, SecondO.Element) -> ResultType) -> SharedSequence where SecondO.SharingStrategy == 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` emits 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: Element) - -> SharedSequence { - let source = self.asObservable() - .startWith(element) - - return SharedSequence(source) - } -} - -// MARK: delay -extension SharedSequenceConvertibleType { - - /** - 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) - -> SharedSequence { - let source = self.asObservable() - .delay(dueTime, scheduler: SharingStrategy.scheduler) - - return SharedSequence(source) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence.swift b/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence.swift deleted file mode 100644 index 9014d69..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/SharedSequence/SharedSequence.swift +++ /dev/null @@ -1,226 +0,0 @@ -// -// SharedSequence.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 8/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/** - Trait 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/Traits.md`. -*/ -public struct SharedSequence : SharedSequenceConvertibleType { - let _source: Observable - - init(_ source: Observable) { - self._source = SharingStrategy.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 them to ensure shared sequence - properties are preserved after extension. - */ - public static func createUnsafe(source: Source) -> SharedSequence { - return SharedSequence(raw: source.asObservable()) - } - #endif - - /** - - returns: Built observable sequence. - */ - public func asObservable() -> Observable { - return self._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 `share(replay:scope:)` - 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 self.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(raw: Observable.empty().subscribeOn(SharingStrategy.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(raw: 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: Element) -> SharedSequence { - return SharedSequence(raw: Observable.just(element).subscribeOn(SharingStrategy.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: Element ...) -> SharedSequence { - let source = Observable.from(elements, scheduler: SharingStrategy.scheduler) - return SharedSequence(raw: source) - } -} - -extension SharedSequence { - - /** - This method 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: [Element]) -> SharedSequence { - let source = Observable.from(array, scheduler: SharingStrategy.scheduler) - return SharedSequence(raw: source) - } - - /** - This method 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: Sequence) -> SharedSequence where Sequence.Element == Element { - let source = Observable.from(sequence, scheduler: SharingStrategy.scheduler) - return SharedSequence(raw: source) - } - - /** - This method 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: Element?) -> SharedSequence { - let source = Observable.from(optional: optional, scheduler: SharingStrategy.scheduler) - return SharedSequence(raw: source) - } -} - -extension SharedSequence where Element : RxAbstractInteger { - /** - 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: SharingStrategy.scheduler)) - } -} - -// MARK: timer - -extension SharedSequence where Element: RxAbstractInteger { - /** - 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: SharingStrategy.scheduler)) - } -} - diff --git a/Pods/RxCocoa/RxCocoa/Traits/Signal/ControlEvent+Signal.swift b/Pods/RxCocoa/RxCocoa/Traits/Signal/ControlEvent+Signal.swift deleted file mode 100644 index bec4723..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Signal/ControlEvent+Signal.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ControlEvent+Signal.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 11/1/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ControlEvent { - /// Converts `ControlEvent` to `Signal` trait. - /// - /// `ControlEvent` already can't fail, so no special case needs to be handled. - public func asSignal() -> Signal { - return self.asSignal { _ -> Signal in - #if DEBUG - rxFatalError("Somehow signal received error from a source that shouldn't fail.") - #else - return Signal.empty() - #endif - } - } -} - diff --git a/Pods/RxCocoa/RxCocoa/Traits/Signal/ObservableConvertibleType+Signal.swift b/Pods/RxCocoa/RxCocoa/Traits/Signal/ObservableConvertibleType+Signal.swift deleted file mode 100644 index 1ba75ce..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Signal/ObservableConvertibleType+Signal.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// ObservableConvertibleType+Signal.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ObservableConvertibleType { - /** - Converts observable sequence to `Signal` trait. - - - parameter onErrorJustReturn: Element to return in case of error and after that complete the sequence. - - returns: Signal trait. - */ - public func asSignal(onErrorJustReturn: Element) -> Signal { - let source = self - .asObservable() - .observeOn(SignalSharingStrategy.scheduler) - .catchErrorJustReturn(onErrorJustReturn) - return Signal(source) - } - - /** - Converts observable sequence to `Driver` trait. - - - parameter onErrorDriveWith: Driver that continues to drive the sequence in case of error. - - returns: Signal trait. - */ - public func asSignal(onErrorSignalWith: Signal) -> Signal { - let source = self - .asObservable() - .observeOn(SignalSharingStrategy.scheduler) - .catchError { _ in - onErrorSignalWith.asObservable() - } - return Signal(source) - } - - /** - Converts observable sequence to `Driver` trait. - - - parameter onErrorRecover: Calculates driver that continues to drive the sequence in case of error. - - returns: Signal trait. - */ - public func asSignal(onErrorRecover: @escaping (_ error: Swift.Error) -> Signal) -> Signal { - let source = self - .asObservable() - .observeOn(SignalSharingStrategy.scheduler) - .catchError { error in - onErrorRecover(error).asObservable() - } - return Signal(source) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/Signal/PublishRelay+Signal.swift b/Pods/RxCocoa/RxCocoa/Traits/Signal/PublishRelay+Signal.swift deleted file mode 100644 index 16f5cf8..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Signal/PublishRelay+Signal.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// PublishRelay+Signal.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 12/28/15. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import RxRelay - -extension PublishRelay { - /// Converts `PublishRelay` to `Signal`. - /// - /// - returns: Observable sequence. - public func asSignal() -> Signal { - let source = self.asObservable() - .observeOn(SignalSharingStrategy.scheduler) - return SharedSequence(source) - } -} diff --git a/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal+Subscription.swift b/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal+Subscription.swift deleted file mode 100644 index 3c3585a..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal+Subscription.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// Signal+Subscription.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import RxSwift -import RxRelay - -extension SharedSequenceConvertibleType where SharingStrategy == SignalSharingStrategy { - /** - Creates new subscription and sends elements to observer. - - In this form it's equivalent to `subscribe` method, but it communicates intent better. - - - parameter to: Observer that receives events. - - returns: Disposable object that can be used to unsubscribe the observer from the subject. - */ - public func emit(to observer: Observer) -> Disposable where Observer.Element == Element { - return self.asSharedSequence().asObservable().subscribe(observer) - } - - /** - Creates new subscription and sends elements to observer. - - In this form it's equivalent to `subscribe` method, but it communicates intent better. - - - parameter to: Observer that receives events. - - returns: Disposable object that can be used to unsubscribe the observer from the subject. - */ - public func emit(to observer: Observer) -> Disposable where Observer.Element == Element? { - return self.asSharedSequence().asObservable().map { $0 as Element? }.subscribe(observer) - } - - /** - Creates new subscription and sends elements to `BehaviorRelay`. - - parameter relay: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func emit(to relay: BehaviorRelay) -> Disposable { - return self.emit(onNext: { e in - relay.accept(e) - }) - } - - /** - Creates new subscription and sends elements to `BehaviorRelay`. - - parameter relay: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func emit(to relay: BehaviorRelay) -> Disposable { - return self.emit(onNext: { e in - relay.accept(e) - }) - } - - /** - Creates new subscription and sends elements to relay. - - - parameter relay: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func emit(to relay: PublishRelay) -> Disposable { - return self.emit(onNext: { e in - relay.accept(e) - }) - } - - /** - Creates new subscription and sends elements to relay. - - - parameter to: Target relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer from the relay. - */ - public func emit(to relay: PublishRelay) -> Disposable { - return self.emit(onNext: { e in - relay.accept(e) - }) - } - - /** - Subscribes an element handler, a completion handler and disposed handler to an observable sequence. - - Error callback is not exposed because `Signal` 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 canceled 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 canceled by disposing subscription) - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func emit(onNext: ((Element) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) -> Disposable { - return self.asObservable().subscribe(onNext: onNext, onCompleted: onCompleted, onDisposed: onDisposed) - } -} - - - diff --git a/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal.swift b/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal.swift deleted file mode 100644 index 6d7e32f..0000000 --- a/Pods/RxCocoa/RxCocoa/Traits/Signal/Signal.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// Signal.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 9/26/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/** - Trait that represents observable sequence with following properties: - - - it never fails - - it delivers events on `MainScheduler.instance` - - `share(scope: .whileConnected)` sharing strategy - - Additional explanation: - - all observers share sequence computation resources - - there is no replaying of sequence elements on new observer subscription - - computation of elements is reference counted with respect to the number of observers - - if there are no subscribers, it will release sequence computation resources - - In case trait that models state propagation is required, please check `Driver`. - - `Signal` can be considered a builder pattern for observable sequences that model imperative events part of the application. - - To find out more about units and how to use them, please visit `Documentation/Traits.md`. - */ -public typealias Signal = SharedSequence - -public struct SignalSharingStrategy: SharingStrategyProtocol { - public static var scheduler: SchedulerType { return SharingScheduler.make() } - - public static func share(_ source: Observable) -> Observable { - return source.share(scope: .whileConnected) - } -} - -extension SharedSequenceConvertibleType where SharingStrategy == SignalSharingStrategy { - /// Adds `asPublisher` to `SharingSequence` with `PublishSharingStrategy`. - public func asSignal() -> Signal { - return self.asSharedSequence() - } -} diff --git a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxCollectionViewReactiveArrayDataSource.swift b/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxCollectionViewReactiveArrayDataSource.swift deleted file mode 100644 index 8c4eb63..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxCollectionViewReactiveArrayDataSource.swift +++ /dev/null @@ -1,108 +0,0 @@ -// -// RxCollectionViewReactiveArrayDataSource.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -// objc monkey business -class _RxCollectionViewReactiveArrayDataSource - : NSObject - , UICollectionViewDataSource { - - @objc(numberOfSectionsInCollectionView:) - func numberOfSections(in: UICollectionView) -> Int { - return 1 - } - - func _collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 0 - } - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return _collectionView(collectionView, numberOfItemsInSection: section) - } - - fileprivate func _collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - rxAbstractMethod() - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - return _collectionView(collectionView, cellForItemAt: indexPath) - } -} - -class RxCollectionViewReactiveArrayDataSourceSequenceWrapper - : RxCollectionViewReactiveArrayDataSource - , RxCollectionViewDataSourceType { - typealias Element = Sequence - - override init(cellFactory: @escaping CellFactory) { - super.init(cellFactory: cellFactory) - } - - func collectionView(_ collectionView: UICollectionView, observedEvent: Event) { - Binder(self) { collectionViewDataSource, sectionModels in - let sections = Array(sectionModels) - collectionViewDataSource.collectionView(collectionView, observedElements: sections) - }.on(observedEvent) - } -} - - -// Please take a look at `DelegateProxyType.swift` -class RxCollectionViewReactiveArrayDataSource - : _RxCollectionViewReactiveArrayDataSource - , SectionedViewDataSourceType { - - typealias CellFactory = (UICollectionView, Int, Element) -> UICollectionViewCell - - var itemModels: [Element]? - - func modelAtIndex(_ index: Int) -> Element? { - return itemModels?[index] - } - - func model(at indexPath: IndexPath) throws -> Any { - precondition(indexPath.section == 0) - guard let item = itemModels?[indexPath.item] else { - throw RxCocoaError.itemsNotYetBound(object: self) - } - return item - } - - var cellFactory: CellFactory - - init(cellFactory: @escaping CellFactory) { - self.cellFactory = cellFactory - } - - // data source - - override func _collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return itemModels?.count ?? 0 - } - - override func _collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - return cellFactory(collectionView, indexPath.item, itemModels![indexPath.item]) - } - - // reactive - - func collectionView(_ collectionView: UICollectionView, observedElements: [Element]) { - self.itemModels = observedElements - - collectionView.reloadData() - - // workaround for http://stackoverflow.com/questions/39867325/ios-10-bug-uicollectionview-received-layout-attributes-for-a-cell-with-an-index - collectionView.collectionViewLayout.invalidateLayout() - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxPickerViewAdapter.swift b/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxPickerViewAdapter.swift deleted file mode 100644 index f50f226..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxPickerViewAdapter.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// RxPickerViewAdapter.swift -// RxCocoa -// -// Created by Sergey Shulga on 12/07/2017. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -class RxPickerViewArrayDataSource: NSObject, UIPickerViewDataSource, SectionedViewDataSourceType { - fileprivate var items: [T] = [] - - func model(at indexPath: IndexPath) throws -> Any { - guard items.indices ~= indexPath.row else { - throw RxCocoaError.itemsNotYetBound(object: self) - } - return items[indexPath.row] - } - - func numberOfComponents(in pickerView: UIPickerView) -> Int { - return 1 - } - - func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { - return items.count - } -} - -class RxPickerViewSequenceDataSource - : RxPickerViewArrayDataSource - , RxPickerViewDataSourceType { - typealias Element = Sequence - - func pickerView(_ pickerView: UIPickerView, observedEvent: Event) { - Binder(self) { dataSource, items in - dataSource.items = items - pickerView.reloadAllComponents() - } - .on(observedEvent.map(Array.init)) - } -} - -final class RxStringPickerViewAdapter - : RxPickerViewSequenceDataSource - , UIPickerViewDelegate { - - typealias TitleForRow = (Int, Sequence.Element) -> String? - private let titleForRow: TitleForRow - - init(titleForRow: @escaping TitleForRow) { - self.titleForRow = titleForRow - super.init() - } - - func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { - return titleForRow(row, items[row]) - } -} - -final class RxAttributedStringPickerViewAdapter: RxPickerViewSequenceDataSource, UIPickerViewDelegate { - typealias AttributedTitleForRow = (Int, Sequence.Element) -> NSAttributedString? - private let attributedTitleForRow: AttributedTitleForRow - - init(attributedTitleForRow: @escaping AttributedTitleForRow) { - self.attributedTitleForRow = attributedTitleForRow - super.init() - } - - func pickerView(_ pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString? { - return attributedTitleForRow(row, items[row]) - } -} - -final class RxPickerViewAdapter: RxPickerViewSequenceDataSource, UIPickerViewDelegate { - typealias ViewForRow = (Int, Sequence.Element, UIView?) -> UIView - private let viewForRow: ViewForRow - - init(viewForRow: @escaping ViewForRow) { - self.viewForRow = viewForRow - super.init() - } - - func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { - return viewForRow(row, items[row], view) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxTableViewReactiveArrayDataSource.swift b/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxTableViewReactiveArrayDataSource.swift deleted file mode 100644 index 0ac92ab..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/DataSources/RxTableViewReactiveArrayDataSource.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// RxTableViewReactiveArrayDataSource.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/26/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -// objc monkey business -class _RxTableViewReactiveArrayDataSource - : NSObject - , UITableViewDataSource { - - func numberOfSections(in tableView: UITableView) -> Int { - return 1 - } - - func _tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 0 - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return _tableView(tableView, numberOfRowsInSection: section) - } - - fileprivate func _tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - rxAbstractMethod() - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - return _tableView(tableView, cellForRowAt: indexPath) - } -} - - -class RxTableViewReactiveArrayDataSourceSequenceWrapper - : RxTableViewReactiveArrayDataSource - , RxTableViewDataSourceType { - typealias Element = Sequence - - override init(cellFactory: @escaping CellFactory) { - super.init(cellFactory: cellFactory) - } - - func tableView(_ tableView: UITableView, observedEvent: Event) { - Binder(self) { tableViewDataSource, sectionModels in - let sections = Array(sectionModels) - tableViewDataSource.tableView(tableView, observedElements: sections) - }.on(observedEvent) - } -} - -// Please take a look at `DelegateProxyType.swift` -class RxTableViewReactiveArrayDataSource - : _RxTableViewReactiveArrayDataSource - , SectionedViewDataSourceType { - typealias CellFactory = (UITableView, Int, Element) -> UITableViewCell - - var itemModels: [Element]? - - func modelAtIndex(_ index: Int) -> Element? { - return itemModels?[index] - } - - func model(at indexPath: IndexPath) throws -> Any { - precondition(indexPath.section == 0) - guard let item = itemModels?[indexPath.item] else { - throw RxCocoaError.itemsNotYetBound(object: self) - } - return item - } - - let cellFactory: CellFactory - - init(cellFactory: @escaping CellFactory) { - self.cellFactory = cellFactory - } - - override func _tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return itemModels?.count ?? 0 - } - - override func _tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - return cellFactory(tableView, indexPath.item, itemModels![indexPath.row]) - } - - // reactive - - func tableView(_ tableView: UITableView, observedElements: [Element]) { - self.itemModels = observedElements - - tableView.reloadData() - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Events/ItemEvents.swift b/Pods/RxCocoa/RxCocoa/iOS/Events/ItemEvents.swift deleted file mode 100644 index aadf749..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Events/ItemEvents.swift +++ /dev/null @@ -1,15 +0,0 @@ -// -// ItemEvents.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/20/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) -import UIKit - -public typealias ItemMovedEvent = (sourceIndex: IndexPath, destinationIndex: IndexPath) -public typealias WillDisplayCellEvent = (cell: UITableViewCell, indexPath: IndexPath) -public typealias DidEndDisplayingCellEvent = (cell: UITableViewCell, indexPath: IndexPath) -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/NSTextStorage+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/NSTextStorage+Rx.swift deleted file mode 100644 index ba30547..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/NSTextStorage+Rx.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// NSTextStorage+Rx.swift -// RxCocoa -// -// Created by Segii Shulga on 12/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - import RxSwift - import UIKit - - extension Reactive where Base: NSTextStorage { - - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxTextStorageDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `delegate` message. - public var didProcessEditingRangeChangeInLength: Observable<(editedMask: NSTextStorage.EditActions, editedRange: NSRange, delta: Int)> { - return delegate - .methodInvoked(#selector(NSTextStorageDelegate.textStorage(_:didProcessEditing:range:changeInLength:))) - .map { a in - let editedMask = NSTextStorage.EditActions(rawValue: try castOrThrow(UInt.self, a[1]) ) - let editedRange = try castOrThrow(NSValue.self, a[2]).rangeValue - let delta = try castOrThrow(Int.self, a[3]) - - return (editedMask, editedRange, delta) - } - } - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift b/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift deleted file mode 100644 index b098a9e..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// RxCollectionViewDataSourceType.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/// Marks data source as `UICollectionView` reactive data source enabling it to be used with one of the `bindTo` methods. -public protocol RxCollectionViewDataSourceType /*: UICollectionViewDataSource*/ { - - /// Type of elements that can be bound to collection view. - associatedtype Element - - /// New observable sequence event observed. - /// - /// - parameter collectionView: Bound collection view. - /// - parameter observedEvent: Event - func collectionView(_ collectionView: UICollectionView, observedEvent: Event) -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift b/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift deleted file mode 100644 index 1f390bf..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// RxPickerViewDataSourceType.swift -// RxCocoa -// -// Created by Sergey Shulga on 05/07/2017. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -/// Marks data source as `UIPickerView` reactive data source enabling it to be used with one of the `bindTo` methods. -public protocol RxPickerViewDataSourceType { - /// Type of elements that can be bound to picker view. - associatedtype Element - - /// New observable sequence event observed. - /// - /// - parameter pickerView: Bound picker view. - /// - parameter observedEvent: Event - func pickerView(_ pickerView: UIPickerView, observedEvent: Event) -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift b/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift deleted file mode 100644 index d59af9e..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// RxTableViewDataSourceType.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/26/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/// Marks data source as `UITableView` reactive data source enabling it to be used with one of the `bindTo` methods. -public protocol RxTableViewDataSourceType /*: UITableViewDataSource*/ { - - /// Type of elements that can be bound to table view. - associatedtype Element - - /// New observable sequence event observed. - /// - /// - parameter tableView: Bound table view. - /// - parameter observedEvent: Event - func tableView(_ tableView: UITableView, observedEvent: Event) -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift deleted file mode 100644 index efb7554..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourcePrefetchingProxy.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// RxCollectionViewDataSourcePrefetchingProxy.swift -// RxCocoa -// -// Created by Rowan Livingstone on 2/15/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -@available(iOS 10.0, tvOS 10.0, *) -extension UICollectionView: HasPrefetchDataSource { - public typealias PrefetchDataSource = UICollectionViewDataSourcePrefetching -} - -@available(iOS 10.0, tvOS 10.0, *) -private let collectionViewPrefetchDataSourceNotSet = CollectionViewPrefetchDataSourceNotSet() - -@available(iOS 10.0, tvOS 10.0, *) -private final class CollectionViewPrefetchDataSourceNotSet - : NSObject - , UICollectionViewDataSourcePrefetching { - - func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) {} - -} - -@available(iOS 10.0, tvOS 10.0, *) -open class RxCollectionViewDataSourcePrefetchingProxy - : DelegateProxy - , DelegateProxyType - , UICollectionViewDataSourcePrefetching { - - /// Typed parent object. - public weak private(set) var collectionView: UICollectionView? - - /// - parameter collectionView: Parent object for delegate proxy. - public init(collectionView: ParentObject) { - self.collectionView = collectionView - super.init(parentObject: collectionView, delegateProxy: RxCollectionViewDataSourcePrefetchingProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxCollectionViewDataSourcePrefetchingProxy(collectionView: $0) } - } - - private var _prefetchItemsPublishSubject: PublishSubject<[IndexPath]>? - - /// Optimized version used for observing prefetch items callbacks. - internal var prefetchItemsPublishSubject: PublishSubject<[IndexPath]> { - if let subject = _prefetchItemsPublishSubject { - return subject - } - - let subject = PublishSubject<[IndexPath]>() - _prefetchItemsPublishSubject = subject - - return subject - } - - private weak var _requiredMethodsPrefetchDataSource: UICollectionViewDataSourcePrefetching? = collectionViewPrefetchDataSourceNotSet - - // MARK: delegate - - /// Required delegate method implementation. - public func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) { - if let subject = _prefetchItemsPublishSubject { - subject.on(.next(indexPaths)) - } - - (_requiredMethodsPrefetchDataSource ?? collectionViewPrefetchDataSourceNotSet).collectionView(collectionView, prefetchItemsAt: indexPaths) - } - - /// For more information take a look at `DelegateProxyType`. - open override func setForwardToDelegate(_ forwardToDelegate: UICollectionViewDataSourcePrefetching?, retainDelegate: Bool) { - _requiredMethodsPrefetchDataSource = forwardToDelegate ?? collectionViewPrefetchDataSourceNotSet - super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) - } - - deinit { - if let subject = _prefetchItemsPublishSubject { - subject.on(.completed) - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift deleted file mode 100644 index 7cc7003..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDataSourceProxy.swift +++ /dev/null @@ -1,76 +0,0 @@ -// -// RxCollectionViewDataSourceProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension UICollectionView: HasDataSource { - public typealias DataSource = UICollectionViewDataSource -} - -private let collectionViewDataSourceNotSet = CollectionViewDataSourceNotSet() - -private final class CollectionViewDataSourceNotSet - : NSObject - , UICollectionViewDataSource { - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 0 - } - - // The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath: - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - rxAbstractMethod(message: dataSourceNotSet) - } - -} - -/// For more information take a look at `DelegateProxyType`. -open class RxCollectionViewDataSourceProxy - : DelegateProxy - , DelegateProxyType - , UICollectionViewDataSource { - - /// Typed parent object. - public weak private(set) var collectionView: UICollectionView? - - /// - parameter collectionView: Parent object for delegate proxy. - public init(collectionView: ParentObject) { - self.collectionView = collectionView - super.init(parentObject: collectionView, delegateProxy: RxCollectionViewDataSourceProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxCollectionViewDataSourceProxy(collectionView: $0) } - } - - private weak var _requiredMethodsDataSource: UICollectionViewDataSource? = collectionViewDataSourceNotSet - - // MARK: delegate - - /// Required delegate method implementation. - public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, numberOfItemsInSection: section) - } - - /// Required delegate method implementation. - public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - return (_requiredMethodsDataSource ?? collectionViewDataSourceNotSet).collectionView(collectionView, cellForItemAt: indexPath) - } - - /// For more information take a look at `DelegateProxyType`. - open override func setForwardToDelegate(_ forwardToDelegate: UICollectionViewDataSource?, retainDelegate: Bool) { - _requiredMethodsDataSource = forwardToDelegate ?? collectionViewDataSourceNotSet - super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift deleted file mode 100644 index dd8f4b4..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// RxCollectionViewDelegateProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/// For more information take a look at `DelegateProxyType`. -open class RxCollectionViewDelegateProxy - : RxScrollViewDelegateProxy - , UICollectionViewDelegate - , UICollectionViewDelegateFlowLayout { - - /// Typed parent object. - public weak private(set) var collectionView: UICollectionView? - - /// Initializes `RxCollectionViewDelegateProxy` - /// - /// - parameter collectionView: Parent object for delegate proxy. - public init(collectionView: UICollectionView) { - self.collectionView = collectionView - super.init(scrollView: collectionView) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift deleted file mode 100644 index 372bf79..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxNavigationControllerDelegateProxy.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// RxNavigationControllerDelegateProxy.swift -// RxCocoa -// -// Created by Diogo on 13/04/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - - import UIKit - import RxSwift - - extension UINavigationController: HasDelegate { - public typealias Delegate = UINavigationControllerDelegate - } - - /// For more information take a look at `DelegateProxyType`. - open class RxNavigationControllerDelegateProxy - : DelegateProxy - , DelegateProxyType - , UINavigationControllerDelegate { - - /// Typed parent object. - public weak private(set) var navigationController: UINavigationController? - - /// - parameter navigationController: Parent object for delegate proxy. - public init(navigationController: ParentObject) { - self.navigationController = navigationController - super.init(parentObject: navigationController, delegateProxy: RxNavigationControllerDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxNavigationControllerDelegateProxy(navigationController: $0) } - } - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift deleted file mode 100644 index a639ef8..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDataSourceProxy.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// RxPickerViewDataSourceProxy.swift -// RxCocoa -// -// Created by Sergey Shulga on 05/07/2017. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -extension UIPickerView: HasDataSource { - public typealias DataSource = UIPickerViewDataSource -} - -private let pickerViewDataSourceNotSet = PickerViewDataSourceNotSet() - -final private class PickerViewDataSourceNotSet: NSObject, UIPickerViewDataSource { - func numberOfComponents(in pickerView: UIPickerView) -> Int { - return 0 - } - - func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { - return 0 - } -} - -/// For more information take a look at `DelegateProxyType`. -public class RxPickerViewDataSourceProxy - : DelegateProxy - , DelegateProxyType - , UIPickerViewDataSource { - - /// Typed parent object. - public weak private(set) var pickerView: UIPickerView? - - /// - parameter pickerView: Parent object for delegate proxy. - public init(pickerView: ParentObject) { - self.pickerView = pickerView - super.init(parentObject: pickerView, delegateProxy: RxPickerViewDataSourceProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxPickerViewDataSourceProxy(pickerView: $0) } - } - - private weak var _requiredMethodsDataSource: UIPickerViewDataSource? = pickerViewDataSourceNotSet - - // MARK: UIPickerViewDataSource - - /// Required delegate method implementation. - public func numberOfComponents(in pickerView: UIPickerView) -> Int { - return (_requiredMethodsDataSource ?? pickerViewDataSourceNotSet).numberOfComponents(in: pickerView) - } - - /// Required delegate method implementation. - public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { - return (_requiredMethodsDataSource ?? pickerViewDataSourceNotSet).pickerView(pickerView, numberOfRowsInComponent: component) - } - - /// For more information take a look at `DelegateProxyType`. - public override func setForwardToDelegate(_ forwardToDelegate: UIPickerViewDataSource?, retainDelegate: Bool) { - _requiredMethodsDataSource = forwardToDelegate ?? pickerViewDataSourceNotSet - super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift deleted file mode 100644 index 922126f..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// RxPickerViewDelegateProxy.swift -// RxCocoa -// -// Created by Segii Shulga on 5/12/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - - import RxSwift - import UIKit - - extension UIPickerView: HasDelegate { - public typealias Delegate = UIPickerViewDelegate - } - - open class RxPickerViewDelegateProxy - : DelegateProxy - , DelegateProxyType - , UIPickerViewDelegate { - - /// Typed parent object. - public weak private(set) var pickerView: UIPickerView? - - /// - parameter pickerView: Parent object for delegate proxy. - public init(pickerView: ParentObject) { - self.pickerView = pickerView - super.init(parentObject: pickerView, delegateProxy: RxPickerViewDelegateProxy.self) - } - - // Register known implementationss - public static func registerKnownImplementations() { - self.register { RxPickerViewDelegateProxy(pickerView: $0) } - } - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift deleted file mode 100644 index 59608d3..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxScrollViewDelegateProxy.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// RxScrollViewDelegateProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension UIScrollView: HasDelegate { - public typealias Delegate = UIScrollViewDelegate -} - -/// For more information take a look at `DelegateProxyType`. -open class RxScrollViewDelegateProxy - : DelegateProxy - , DelegateProxyType - , UIScrollViewDelegate { - - /// Typed parent object. - public weak private(set) var scrollView: UIScrollView? - - /// - parameter scrollView: Parent object for delegate proxy. - public init(scrollView: ParentObject) { - self.scrollView = scrollView - super.init(parentObject: scrollView, delegateProxy: RxScrollViewDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxScrollViewDelegateProxy(scrollView: $0) } - self.register { RxTableViewDelegateProxy(tableView: $0) } - self.register { RxCollectionViewDelegateProxy(collectionView: $0) } - self.register { RxTextViewDelegateProxy(textView: $0) } - } - - private var _contentOffsetBehaviorSubject: BehaviorSubject? - private var _contentOffsetPublishSubject: PublishSubject<()>? - - /// Optimized version used for observing content offset changes. - internal var contentOffsetBehaviorSubject: BehaviorSubject { - if let subject = _contentOffsetBehaviorSubject { - return subject - } - - let subject = BehaviorSubject(value: self.scrollView?.contentOffset ?? CGPoint.zero) - _contentOffsetBehaviorSubject = subject - - return subject - } - - /// Optimized version used for observing content offset changes. - internal var contentOffsetPublishSubject: PublishSubject<()> { - if let subject = _contentOffsetPublishSubject { - return subject - } - - let subject = PublishSubject<()>() - _contentOffsetPublishSubject = subject - - return subject - } - - // MARK: delegate methods - - /// For more information take a look at `DelegateProxyType`. - public func scrollViewDidScroll(_ scrollView: UIScrollView) { - if let subject = _contentOffsetBehaviorSubject { - subject.on(.next(scrollView.contentOffset)) - } - if let subject = _contentOffsetPublishSubject { - subject.on(.next(())) - } - self._forwardToDelegate?.scrollViewDidScroll?(scrollView) - } - - deinit { - if let subject = _contentOffsetBehaviorSubject { - subject.on(.completed) - } - - if let subject = _contentOffsetPublishSubject { - subject.on(.completed) - } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift deleted file mode 100644 index 532ab68..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// RxSearchBarDelegateProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 7/4/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension UISearchBar: HasDelegate { - public typealias Delegate = UISearchBarDelegate -} - -/// For more information take a look at `DelegateProxyType`. -open class RxSearchBarDelegateProxy - : DelegateProxy - , DelegateProxyType - , UISearchBarDelegate { - - /// Typed parent object. - public weak private(set) var searchBar: UISearchBar? - - /// - parameter searchBar: Parent object for delegate proxy. - public init(searchBar: ParentObject) { - self.searchBar = searchBar - super.init(parentObject: searchBar, delegateProxy: RxSearchBarDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxSearchBarDelegateProxy(searchBar: $0) } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift deleted file mode 100644 index 8341aa3..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// RxSearchControllerDelegateProxy.swift -// RxCocoa -// -// Created by Segii Shulga on 3/17/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import RxSwift -import UIKit - -extension UISearchController: HasDelegate { - public typealias Delegate = UISearchControllerDelegate -} - -/// For more information take a look at `DelegateProxyType`. -@available(iOS 8.0, *) -open class RxSearchControllerDelegateProxy - : DelegateProxy - , DelegateProxyType - , UISearchControllerDelegate { - - /// Typed parent object. - public weak private(set) var searchController: UISearchController? - - /// - parameter searchController: Parent object for delegate proxy. - public init(searchController: UISearchController) { - self.searchController = searchController - super.init(parentObject: searchController, delegateProxy: RxSearchControllerDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxSearchControllerDelegateProxy(searchController: $0) } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift deleted file mode 100644 index 585894c..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// RxTabBarControllerDelegateProxy.swift -// RxCocoa -// -// Created by Yusuke Kita on 2016/12/07. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension UITabBarController: HasDelegate { - public typealias Delegate = UITabBarControllerDelegate -} - -/// For more information take a look at `DelegateProxyType`. -open class RxTabBarControllerDelegateProxy - : DelegateProxy - , DelegateProxyType - , UITabBarControllerDelegate { - - /// Typed parent object. - public weak private(set) var tabBar: UITabBarController? - - /// - parameter tabBar: Parent object for delegate proxy. - public init(tabBar: ParentObject) { - self.tabBar = tabBar - super.init(parentObject: tabBar, delegateProxy: RxTabBarControllerDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxTabBarControllerDelegateProxy(tabBar: $0) } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift deleted file mode 100644 index c4a1704..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarDelegateProxy.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// RxTabBarDelegateProxy.swift -// RxCocoa -// -// Created by Jesse Farless on 5/14/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension UITabBar: HasDelegate { - public typealias Delegate = UITabBarDelegate -} - -/// For more information take a look at `DelegateProxyType`. -open class RxTabBarDelegateProxy - : DelegateProxy - , DelegateProxyType - , UITabBarDelegate { - - /// Typed parent object. - public weak private(set) var tabBar: UITabBar? - - /// - parameter tabBar: Parent object for delegate proxy. - public init(tabBar: ParentObject) { - self.tabBar = tabBar - super.init(parentObject: tabBar, delegateProxy: RxTabBarDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxTabBarDelegateProxy(tabBar: $0) } - } - - /// For more information take a look at `DelegateProxyType`. - open class func currentDelegate(for object: ParentObject) -> UITabBarDelegate? { - return object.delegate - } - - /// For more information take a look at `DelegateProxyType`. - open class func setCurrentDelegate(_ delegate: UITabBarDelegate?, to object: ParentObject) { - object.delegate = delegate - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourcePrefetchingProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourcePrefetchingProxy.swift deleted file mode 100644 index 4345312..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourcePrefetchingProxy.swift +++ /dev/null @@ -1,93 +0,0 @@ -// -// RxTableViewDataSourcePrefetchingProxy.swift -// RxCocoa -// -// Created by Rowan Livingstone on 2/15/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -@available(iOS 10.0, tvOS 10.0, *) -extension UITableView: HasPrefetchDataSource { - public typealias PrefetchDataSource = UITableViewDataSourcePrefetching -} - -@available(iOS 10.0, tvOS 10.0, *) -private let tableViewPrefetchDataSourceNotSet = TableViewPrefetchDataSourceNotSet() - -@available(iOS 10.0, tvOS 10.0, *) -private final class TableViewPrefetchDataSourceNotSet - : NSObject - , UITableViewDataSourcePrefetching { - - func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) {} - -} - -@available(iOS 10.0, tvOS 10.0, *) -open class RxTableViewDataSourcePrefetchingProxy - : DelegateProxy - , DelegateProxyType - , UITableViewDataSourcePrefetching { - - /// Typed parent object. - public weak private(set) var tableView: UITableView? - - /// - parameter tableView: Parent object for delegate proxy. - public init(tableView: ParentObject) { - self.tableView = tableView - super.init(parentObject: tableView, delegateProxy: RxTableViewDataSourcePrefetchingProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxTableViewDataSourcePrefetchingProxy(tableView: $0) } - } - - private var _prefetchRowsPublishSubject: PublishSubject<[IndexPath]>? - - /// Optimized version used for observing prefetch rows callbacks. - internal var prefetchRowsPublishSubject: PublishSubject<[IndexPath]> { - if let subject = _prefetchRowsPublishSubject { - return subject - } - - let subject = PublishSubject<[IndexPath]>() - _prefetchRowsPublishSubject = subject - - return subject - } - - private weak var _requiredMethodsPrefetchDataSource: UITableViewDataSourcePrefetching? = tableViewPrefetchDataSourceNotSet - - // MARK: delegate - - /// Required delegate method implementation. - public func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) { - if let subject = _prefetchRowsPublishSubject { - subject.on(.next(indexPaths)) - } - - (_requiredMethodsPrefetchDataSource ?? tableViewPrefetchDataSourceNotSet).tableView(tableView, prefetchRowsAt: indexPaths) - } - - /// For more information take a look at `DelegateProxyType`. - open override func setForwardToDelegate(_ forwardToDelegate: UITableViewDataSourcePrefetching?, retainDelegate: Bool) { - _requiredMethodsPrefetchDataSource = forwardToDelegate ?? tableViewPrefetchDataSourceNotSet - super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) - } - - deinit { - if let subject = _prefetchRowsPublishSubject { - subject.on(.completed) - } - } - -} - -#endif - diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift deleted file mode 100644 index 019d2c1..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDataSourceProxy.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// RxTableViewDataSourceProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension UITableView: HasDataSource { - public typealias DataSource = UITableViewDataSource -} - -private let tableViewDataSourceNotSet = TableViewDataSourceNotSet() - -private final class TableViewDataSourceNotSet - : NSObject - , UITableViewDataSource { - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 0 - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - rxAbstractMethod(message: dataSourceNotSet) - } -} - -/// For more information take a look at `DelegateProxyType`. -open class RxTableViewDataSourceProxy - : DelegateProxy - , DelegateProxyType - , UITableViewDataSource { - - /// Typed parent object. - public weak private(set) var tableView: UITableView? - - /// - parameter tableView: Parent object for delegate proxy. - public init(tableView: UITableView) { - self.tableView = tableView - super.init(parentObject: tableView, delegateProxy: RxTableViewDataSourceProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxTableViewDataSourceProxy(tableView: $0) } - } - - private weak var _requiredMethodsDataSource: UITableViewDataSource? = tableViewDataSourceNotSet - - // MARK: delegate - - /// Required delegate method implementation. - public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return (_requiredMethodsDataSource ?? tableViewDataSourceNotSet).tableView(tableView, numberOfRowsInSection: section) - } - - /// Required delegate method implementation. - public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - return (_requiredMethodsDataSource ?? tableViewDataSourceNotSet).tableView(tableView, cellForRowAt: indexPath) - } - - /// For more information take a look at `DelegateProxyType`. - open override func setForwardToDelegate(_ forwardToDelegate: UITableViewDataSource?, retainDelegate: Bool) { - _requiredMethodsDataSource = forwardToDelegate ?? tableViewDataSourceNotSet - super.setForwardToDelegate(forwardToDelegate, retainDelegate: retainDelegate) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift deleted file mode 100644 index 86a8758..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// RxTableViewDelegateProxy.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 6/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/// For more information take a look at `DelegateProxyType`. -open class RxTableViewDelegateProxy - : RxScrollViewDelegateProxy - , UITableViewDelegate { - - /// Typed parent object. - public weak private(set) var tableView: UITableView? - - /// - parameter tableView: Parent object for delegate proxy. - public init(tableView: UITableView) { - self.tableView = tableView - super.init(scrollView: tableView) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift deleted file mode 100644 index 12669f9..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// RxTextStorageDelegateProxy.swift -// RxCocoa -// -// Created by Segii Shulga on 12/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - - import RxSwift - import UIKit - - extension NSTextStorage: HasDelegate { - public typealias Delegate = NSTextStorageDelegate - } - - open class RxTextStorageDelegateProxy - : DelegateProxy - , DelegateProxyType - , NSTextStorageDelegate { - - /// Typed parent object. - public weak private(set) var textStorage: NSTextStorage? - - /// - parameter textStorage: Parent object for delegate proxy. - public init(textStorage: NSTextStorage) { - self.textStorage = textStorage - super.init(parentObject: textStorage, delegateProxy: RxTextStorageDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxTextStorageDelegateProxy(textStorage: $0) } - } - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift deleted file mode 100644 index c8a1dfd..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextViewDelegateProxy.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// RxTextViewDelegateProxy.swift -// RxCocoa -// -// Created by Yuta ToKoRo on 7/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/// For more information take a look at `DelegateProxyType`. -open class RxTextViewDelegateProxy - : RxScrollViewDelegateProxy - , UITextViewDelegate { - - /// Typed parent object. - public weak private(set) var textView: UITextView? - - /// - parameter textview: Parent object for delegate proxy. - public init(textView: UITextView) { - self.textView = textView - super.init(scrollView: textView) - } - - // MARK: delegate methods - - /// For more information take a look at `DelegateProxyType`. - @objc open func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { - /** - We've had some issues with observing text changes. This is here just in case we need the same hack in future and that - we wouldn't need to change the public interface. - */ - let forwardToDelegate = self.forwardToDelegate() as? UITextViewDelegate - return forwardToDelegate?.textView?(textView, - shouldChangeTextIn: range, - replacementText: text) ?? true - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxWKNavigationDelegateProxy.swift b/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxWKNavigationDelegateProxy.swift deleted file mode 100644 index c758c02..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxWKNavigationDelegateProxy.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// RxWKNavigationDelegateProxy.swift -// RxCocoa -// -// Created by Giuseppe Lanza on 14/02/2020. -// Copyright © 2020 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(macOS) - -import RxSwift -import WebKit - -@available(iOS 8.0, OSX 10.10, OSXApplicationExtension 10.10, *) -open class RxWKNavigationDelegateProxy - : DelegateProxy - , DelegateProxyType -, WKNavigationDelegate { - - /// Typed parent object. - public weak private(set) var webView: WKWebView? - - /// - parameter webView: Parent object for delegate proxy. - public init(webView: ParentObject) { - self.webView = webView - super.init(parentObject: webView, delegateProxy: RxWKNavigationDelegateProxy.self) - } - - // Register known implementations - public static func registerKnownImplementations() { - self.register { RxWKNavigationDelegateProxy(webView: $0) } - } - - public static func currentDelegate(for object: WKWebView) -> WKNavigationDelegate? { - object.navigationDelegate - } - - public static func setCurrentDelegate(_ delegate: WKNavigationDelegate?, to object: WKWebView) { - object.navigationDelegate = delegate - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIActivityIndicatorView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIActivityIndicatorView+Rx.swift deleted file mode 100644 index bf00996..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIActivityIndicatorView+Rx.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// UIActivityIndicatorView+Rx.swift -// RxCocoa -// -// Created by Ivan Persidskiy on 02/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UIActivityIndicatorView { - - /// Bindable sink for `startAnimating()`, `stopAnimating()` methods. - public var isAnimating: Binder { - return Binder(self.base) { activityIndicator, active in - if active { - activityIndicator.startAnimating() - } else { - activityIndicator.stopAnimating() - } - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIAlertAction+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIAlertAction+Rx.swift deleted file mode 100644 index a992fe1..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIAlertAction+Rx.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// UIAlertAction+Rx.swift -// RxCocoa -// -// Created by Andrew Breckenridge on 5/7/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UIAlertAction { - - /// Bindable sink for `enabled` property. - public var isEnabled: Binder { - return Binder(self.base) { alertAction, value in - alertAction.isEnabled = value - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIApplication+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIApplication+Rx.swift deleted file mode 100644 index c6ed134..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIApplication+Rx.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// UIApplication+Rx.swift -// RxCocoa -// -// Created by Mads Bøgeskov on 18/01/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - - import UIKit - import RxSwift - - extension Reactive where Base: UIApplication { - - /// Bindable sink for `networkActivityIndicatorVisible`. - public var isNetworkActivityIndicatorVisible: Binder { - return Binder(self.base) { application, active in - application.isNetworkActivityIndicatorVisible = active - } - } - } -#endif - diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIBarButtonItem+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIBarButtonItem+Rx.swift deleted file mode 100644 index f470ccf..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIBarButtonItem+Rx.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// UIBarButtonItem+Rx.swift -// RxCocoa -// -// Created by Daniel Tartaglia on 5/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -private var rx_tap_key: UInt8 = 0 - -extension Reactive where Base: UIBarButtonItem { - - /// Bindable sink for `enabled` property. - public var isEnabled: Binder { - return Binder(self.base) { element, value in - element.isEnabled = value - } - } - - /// Bindable sink for `title` property. - public var title: Binder { - return Binder(self.base) { element, value in - element.title = value - } - } - - /// Reactive wrapper for target action pattern on `self`. - public var tap: ControlEvent<()> { - let source = lazyInstanceObservable(&rx_tap_key) { () -> Observable<()> in - Observable.create { [weak control = self.base] observer in - guard let control = control else { - observer.on(.completed) - return Disposables.create() - } - let target = BarButtonItemTarget(barButtonItem: control) { - observer.on(.next(())) - } - return target - } - .takeUntil(self.deallocated) - .share() - } - - return ControlEvent(events: source) - } -} - - -@objc -final class BarButtonItemTarget: RxTarget { - typealias Callback = () -> Void - - weak var barButtonItem: UIBarButtonItem? - var callback: Callback! - - init(barButtonItem: UIBarButtonItem, callback: @escaping () -> Void) { - self.barButtonItem = barButtonItem - self.callback = callback - super.init() - barButtonItem.target = self - barButtonItem.action = #selector(BarButtonItemTarget.action(_:)) - } - - override func dispose() { - super.dispose() -#if DEBUG - MainScheduler.ensureRunningOnMainThread() -#endif - - barButtonItem?.target = nil - barButtonItem?.action = nil - - callback = nil - } - - @objc func action(_ sender: AnyObject) { - callback() - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIButton+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIButton+Rx.swift deleted file mode 100644 index f4977dc..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIButton+Rx.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// UIButton+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIButton { - - /// Reactive wrapper for `TouchUpInside` control event. - public var tap: ControlEvent { - return controlEvent(.touchUpInside) - } -} - -#endif - -#if os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIButton { - - /// Reactive wrapper for `PrimaryActionTriggered` control event. - public var primaryAction: ControlEvent { - return controlEvent(.primaryActionTriggered) - } - -} - -#endif - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIButton { - - /// Reactive wrapper for `setTitle(_:for:)` - public func title(for controlState: UIControl.State = []) -> Binder { - return Binder(self.base) { button, title -> Void in - button.setTitle(title, for: controlState) - } - } - - /// Reactive wrapper for `setImage(_:for:)` - public func image(for controlState: UIControl.State = []) -> Binder { - return Binder(self.base) { button, image -> Void in - button.setImage(image, for: controlState) - } - } - - /// Reactive wrapper for `setBackgroundImage(_:for:)` - public func backgroundImage(for controlState: UIControl.State = []) -> Binder { - return Binder(self.base) { button, image -> Void in - button.setBackgroundImage(image, for: controlState) - } - } - -} -#endif - -#if os(iOS) || os(tvOS) - - import RxSwift - import UIKit - - extension Reactive where Base: UIButton { - - /// Reactive wrapper for `setAttributedTitle(_:controlState:)` - public func attributedTitle(for controlState: UIControl.State = []) -> Binder { - return Binder(self.base) { button, attributedTitle -> Void in - button.setAttributedTitle(attributedTitle, for: controlState) - } - } - - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UICollectionView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UICollectionView+Rx.swift deleted file mode 100644 index 343d567..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UICollectionView+Rx.swift +++ /dev/null @@ -1,380 +0,0 @@ -// -// UICollectionView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -// Items - -extension Reactive where Base: UICollectionView { - - /** - Binds sequences of elements to collection view items. - - - parameter source: Observable sequence of items. - - parameter cellFactory: Transform between sequence elements and view cells. - - returns: Disposable object that can be used to unbind. - - Example - - let items = Observable.just([ - 1, - 2, - 3 - ]) - - items - .bind(to: collectionView.rx.items) { (collectionView, row, element) in - let indexPath = IndexPath(row: row, section: 0) - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! NumberCell - cell.value?.text = "\(element) @ \(row)" - return cell - } - .disposed(by: disposeBag) - */ - public func items - (_ source: Source) - -> (_ cellFactory: @escaping (UICollectionView, Int, Sequence.Element) -> UICollectionViewCell) - -> Disposable where Source.Element == Sequence { - return { cellFactory in - let dataSource = RxCollectionViewReactiveArrayDataSourceSequenceWrapper(cellFactory: cellFactory) - return self.items(dataSource: dataSource)(source) - } - - } - - /** - Binds sequences of elements to collection view items. - - - parameter cellIdentifier: Identifier used to dequeue cells. - - parameter source: Observable sequence of items. - - parameter configureCell: Transform between sequence elements and view cells. - - parameter cellType: Type of collection view cell. - - returns: Disposable object that can be used to unbind. - - Example - - let items = Observable.just([ - 1, - 2, - 3 - ]) - - items - .bind(to: collectionView.rx.items(cellIdentifier: "Cell", cellType: NumberCell.self)) { (row, element, cell) in - cell.value?.text = "\(element) @ \(row)" - } - .disposed(by: disposeBag) - */ - public func items - (cellIdentifier: String, cellType: Cell.Type = Cell.self) - -> (_ source: Source) - -> (_ configureCell: @escaping (Int, Sequence.Element, Cell) -> Void) - -> Disposable where Source.Element == Sequence { - return { source in - return { configureCell in - let dataSource = RxCollectionViewReactiveArrayDataSourceSequenceWrapper { cv, i, item in - let indexPath = IndexPath(item: i, section: 0) - let cell = cv.dequeueReusableCell(withReuseIdentifier: cellIdentifier, for: indexPath) as! Cell - configureCell(i, item, cell) - return cell - } - - return self.items(dataSource: dataSource)(source) - } - } - } - - - /** - Binds sequences of elements to collection view items using a custom reactive data used to perform the transformation. - - - parameter dataSource: Data source used to transform elements to view cells. - - parameter source: Observable sequence of items. - - returns: Disposable object that can be used to unbind. - - Example - - let dataSource = RxCollectionViewSectionedReloadDataSource>() - - let items = Observable.just([ - SectionModel(model: "First section", items: [ - 1.0, - 2.0, - 3.0 - ]), - SectionModel(model: "Second section", items: [ - 1.0, - 2.0, - 3.0 - ]), - SectionModel(model: "Third section", items: [ - 1.0, - 2.0, - 3.0 - ]) - ]) - - dataSource.configureCell = { (dataSource, cv, indexPath, element) in - let cell = cv.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath) as! NumberCell - cell.value?.text = "\(element) @ row \(indexPath.row)" - return cell - } - - items - .bind(to: collectionView.rx.items(dataSource: dataSource)) - .disposed(by: disposeBag) - */ - public func items< - DataSource: RxCollectionViewDataSourceType & UICollectionViewDataSource, - Source: ObservableType> - (dataSource: DataSource) - -> (_ source: Source) - -> Disposable where DataSource.Element == Source.Element - { - return { source in - // This is called for sideeffects only, and to make sure delegate proxy is in place when - // data source is being bound. - // This is needed because theoretically the data source subscription itself might - // call `self.rx.delegate`. If that happens, it might cause weird side effects since - // setting data source will set delegate, and UICollectionView might get into a weird state. - // Therefore it's better to set delegate proxy first, just to be sure. - _ = self.delegate - // Strong reference is needed because data source is in use until result subscription is disposed - return source.subscribeProxyDataSource(ofObject: self.base, dataSource: dataSource, retainDataSource: true) { [weak collectionView = self.base] (_: RxCollectionViewDataSourceProxy, event) -> Void in - guard let collectionView = collectionView else { - return - } - dataSource.collectionView(collectionView, observedEvent: event) - } - } - } -} - -extension Reactive where Base: UICollectionView { - public typealias DisplayCollectionViewCellEvent = (cell: UICollectionViewCell, at: IndexPath) - public typealias DisplayCollectionViewSupplementaryViewEvent = (supplementaryView: UICollectionReusableView, elementKind: String, at: IndexPath) - - /// Reactive wrapper for `dataSource`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var dataSource: DelegateProxy { - return RxCollectionViewDataSourceProxy.proxy(for: base) - } - - /// Installs data source as forwarding delegate on `rx.dataSource`. - /// Data source won't be retained. - /// - /// It enables using normal delegate mechanism with reactive delegate mechanism. - /// - /// - parameter dataSource: Data source object. - /// - returns: Disposable object that can be used to unbind the data source. - public func setDataSource(_ dataSource: UICollectionViewDataSource) - -> Disposable { - return RxCollectionViewDataSourceProxy.installForwardDelegate(dataSource, retainDelegate: false, onProxyForObject: self.base) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didSelectItemAtIndexPath:)`. - public var itemSelected: ControlEvent { - let source = delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didSelectItemAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didDeselectItemAtIndexPath:)`. - public var itemDeselected: ControlEvent { - let source = delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didDeselectItemAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didHighlightItemAt:)`. - public var itemHighlighted: ControlEvent { - let source = delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didHighlightItemAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didUnhighlightItemAt:)`. - public var itemUnhighlighted: ControlEvent { - let source = delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didUnhighlightItemAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView:willDisplay:forItemAt:`. - public var willDisplayCell: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:willDisplay:forItemAt:))) - .map { a in - return (try castOrThrow(UICollectionViewCell.self, a[1]), try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:willDisplaySupplementaryView:forElementKind:at:)`. - public var willDisplaySupplementaryView: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:willDisplaySupplementaryView:forElementKind:at:))) - .map { a in - return (try castOrThrow(UICollectionReusableView.self, a[1]), - try castOrThrow(String.self, a[2]), - try castOrThrow(IndexPath.self, a[3])) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView:didEndDisplaying:forItemAt:`. - public var didEndDisplayingCell: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didEndDisplaying:forItemAt:))) - .map { a in - return (try castOrThrow(UICollectionViewCell.self, a[1]), try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:)`. - public var didEndDisplayingSupplementaryView: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didEndDisplayingSupplementaryView:forElementOfKind:at:))) - .map { a in - return (try castOrThrow(UICollectionReusableView.self, a[1]), - try castOrThrow(String.self, a[2]), - try castOrThrow(IndexPath.self, a[3])) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didSelectItemAtIndexPath:)`. - /// - /// It can be only used when one of the `rx.itemsWith*` methods is used to bind observable sequence, - /// or any other data source conforming to `SectionedViewDataSourceType` protocol. - /// - /// ``` - /// collectionView.rx.modelSelected(MyModel.self) - /// .map { ... - /// ``` - public func modelSelected(_ modelType: T.Type) -> ControlEvent { - let source: Observable = itemSelected.flatMap { [weak view = self.base as UICollectionView] indexPath -> Observable in - guard let view = view else { - return Observable.empty() - } - - return Observable.just(try view.rx.model(at: indexPath)) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `collectionView(_:didSelectItemAtIndexPath:)`. - /// - /// It can be only used when one of the `rx.itemsWith*` methods is used to bind observable sequence, - /// or any other data source conforming to `SectionedViewDataSourceType` protocol. - /// - /// ``` - /// collectionView.rx.modelDeselected(MyModel.self) - /// .map { ... - /// ``` - public func modelDeselected(_ modelType: T.Type) -> ControlEvent { - let source: Observable = itemDeselected.flatMap { [weak view = self.base as UICollectionView] indexPath -> Observable in - guard let view = view else { - return Observable.empty() - } - - return Observable.just(try view.rx.model(at: indexPath)) - } - - return ControlEvent(events: source) - } - - /// Synchronous helper method for retrieving a model at indexPath through a reactive data source - public func model(at indexPath: IndexPath) throws -> T { - let dataSource: SectionedViewDataSourceType = castOrFatalError(self.dataSource.forwardToDelegate(), message: "This method only works in case one of the `rx.itemsWith*` methods was used.") - - let element = try dataSource.model(at: indexPath) - - return try castOrThrow(T.self, element) - } -} - -@available(iOS 10.0, tvOS 10.0, *) -extension Reactive where Base: UICollectionView { - - /// Reactive wrapper for `prefetchDataSource`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var prefetchDataSource: DelegateProxy { - return RxCollectionViewDataSourcePrefetchingProxy.proxy(for: base) - } - - /** - Installs prefetch data source as forwarding delegate on `rx.prefetchDataSource`. - Prefetch data source won't be retained. - - It enables using normal delegate mechanism with reactive delegate mechanism. - - - parameter prefetchDataSource: Prefetch data source object. - - returns: Disposable object that can be used to unbind the data source. - */ - public func setPrefetchDataSource(_ prefetchDataSource: UICollectionViewDataSourcePrefetching) - -> Disposable { - return RxCollectionViewDataSourcePrefetchingProxy.installForwardDelegate(prefetchDataSource, retainDelegate: false, onProxyForObject: self.base) - } - - /// Reactive wrapper for `prefetchDataSource` message `collectionView(_:prefetchItemsAt:)`. - public var prefetchItems: ControlEvent<[IndexPath]> { - let source = RxCollectionViewDataSourcePrefetchingProxy.proxy(for: base).prefetchItemsPublishSubject - return ControlEvent(events: source) - } - - /// Reactive wrapper for `prefetchDataSource` message `collectionView(_:cancelPrefetchingForItemsAt:)`. - public var cancelPrefetchingForItems: ControlEvent<[IndexPath]> { - let source = prefetchDataSource.methodInvoked(#selector(UICollectionViewDataSourcePrefetching.collectionView(_:cancelPrefetchingForItemsAt:))) - .map { a in - return try castOrThrow(Array.self, a[1]) - } - - return ControlEvent(events: source) - } - -} -#endif - -#if os(tvOS) - -extension Reactive where Base: UICollectionView { - - /// Reactive wrapper for `delegate` message `collectionView(_:didUpdateFocusInContext:withAnimationCoordinator:)`. - public var didUpdateFocusInContextWithAnimationCoordinator: ControlEvent<(context: UICollectionViewFocusUpdateContext, animationCoordinator: UIFocusAnimationCoordinator)> { - - let source = delegate.methodInvoked(#selector(UICollectionViewDelegate.collectionView(_:didUpdateFocusIn:with:))) - .map { a -> (context: UICollectionViewFocusUpdateContext, animationCoordinator: UIFocusAnimationCoordinator) in - let context = try castOrThrow(UICollectionViewFocusUpdateContext.self, a[1]) - let animationCoordinator = try castOrThrow(UIFocusAnimationCoordinator.self, a[2]) - return (context: context, animationCoordinator: animationCoordinator) - } - - return ControlEvent(events: source) - } -} -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIControl+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIControl+Rx.swift deleted file mode 100644 index 179978d..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIControl+Rx.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// UIControl+Rx.swift -// RxCocoa -// -// Created by Daniel Tartaglia on 5/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIControl { - - /// Bindable sink for `enabled` property. - public var isEnabled: Binder { - return Binder(self.base) { control, value in - control.isEnabled = value - } - } - - /// Bindable sink for `selected` property. - public var isSelected: Binder { - return Binder(self.base) { control, selected in - control.isSelected = selected - } - } - - /// Reactive wrapper for target action pattern. - /// - /// - parameter controlEvents: Filter for observed event types. - public func controlEvent(_ controlEvents: UIControl.Event) -> ControlEvent<()> { - let source: Observable = Observable.create { [weak control = self.base] observer in - MainScheduler.ensureRunningOnMainThread() - - guard let control = control else { - observer.on(.completed) - return Disposables.create() - } - - let controlTarget = ControlTarget(control: control, controlEvents: controlEvents) { _ in - observer.on(.next(())) - } - - return Disposables.create(with: controlTarget.dispose) - } - .takeUntil(deallocated) - - return ControlEvent(events: source) - } - - /// Creates a `ControlProperty` that is triggered by target/action pattern value updates. - /// - /// - parameter controlEvents: Events that trigger value update sequence elements. - /// - parameter getter: Property value getter. - /// - parameter setter: Property value setter. - public func controlProperty( - editingEvents: UIControl.Event, - getter: @escaping (Base) -> T, - setter: @escaping (Base, T) -> Void - ) -> ControlProperty { - let source: Observable = Observable.create { [weak weakControl = base] observer in - guard let control = weakControl else { - observer.on(.completed) - return Disposables.create() - } - - observer.on(.next(getter(control))) - - let controlTarget = ControlTarget(control: control, controlEvents: editingEvents) { _ in - if let control = weakControl { - observer.on(.next(getter(control))) - } - } - - return Disposables.create(with: controlTarget.dispose) - } - .takeUntil(deallocated) - - let bindingObserver = Binder(base, binding: setter) - - return ControlProperty(values: source, valueSink: bindingObserver) - } - - /// This is a separate method to better communicate to public consumers that - /// an `editingEvent` needs to fire for control property to be updated. - internal func controlPropertyWithDefaultEvents( - editingEvents: UIControl.Event = [.allEditingEvents, .valueChanged], - getter: @escaping (Base) -> T, - setter: @escaping (Base, T) -> Void - ) -> ControlProperty { - return controlProperty( - editingEvents: editingEvents, - getter: getter, - setter: setter - ) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift deleted file mode 100644 index 233be86..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// UIDatePicker+Rx.swift -// RxCocoa -// -// Created by Daniel Tartaglia on 5/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIDatePicker { - /// Reactive wrapper for `date` property. - public var date: ControlProperty { - return value - } - - /// Reactive wrapper for `date` property. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { datePicker in - datePicker.date - }, setter: { datePicker, value in - datePicker.date = value - } - ) - } - - /// Reactive wrapper for `countDownDuration` property. - public var countDownDuration: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { datePicker in - datePicker.countDownDuration - }, setter: { datePicker, value in - datePicker.countDownDuration = value - } - ) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIGestureRecognizer+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIGestureRecognizer+Rx.swift deleted file mode 100644 index 1ad762d..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIGestureRecognizer+Rx.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// UIGestureRecognizer+Rx.swift -// RxCocoa -// -// Created by Carlos García on 10/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -// This should be only used from `MainScheduler` -final class GestureTarget: RxTarget { - typealias Callback = (Recognizer) -> Void - - let selector = #selector(ControlTarget.eventHandler(_:)) - - weak var gestureRecognizer: Recognizer? - var callback: Callback? - - init(_ gestureRecognizer: Recognizer, callback: @escaping Callback) { - self.gestureRecognizer = gestureRecognizer - self.callback = callback - - super.init() - - gestureRecognizer.addTarget(self, action: selector) - - let method = self.method(for: selector) - if method == nil { - fatalError("Can't find method") - } - } - - @objc func eventHandler(_ sender: UIGestureRecognizer) { - if let callback = self.callback, let gestureRecognizer = self.gestureRecognizer { - callback(gestureRecognizer) - } - } - - override func dispose() { - super.dispose() - - self.gestureRecognizer?.removeTarget(self, action: self.selector) - self.callback = nil - } -} - -extension Reactive where Base: UIGestureRecognizer { - - /// Reactive wrapper for gesture recognizer events. - public var event: ControlEvent { - let source: Observable = Observable.create { [weak control = self.base] observer in - MainScheduler.ensureRunningOnMainThread() - - guard let control = control else { - observer.on(.completed) - return Disposables.create() - } - - let observer = GestureTarget(control) { control in - observer.on(.next(control)) - } - - return observer - }.takeUntil(deallocated) - - return ControlEvent(events: source) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIImageView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIImageView+Rx.swift deleted file mode 100644 index b6315c2..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIImageView+Rx.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// UIImageView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIImageView { - - /// Bindable sink for `image` property. - public var image: Binder { - return Binder(base) { imageView, image in - imageView.image = image - } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UILabel+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UILabel+Rx.swift deleted file mode 100644 index f533f56..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UILabel+Rx.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// UILabel+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UILabel { - - /// Bindable sink for `text` property. - public var text: Binder { - return Binder(self.base) { label, text in - label.text = text - } - } - - /// Bindable sink for `attributedText` property. - public var attributedText: Binder { - return Binder(self.base) { label, text in - label.attributedText = text - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UINavigationController+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UINavigationController+Rx.swift deleted file mode 100644 index 2391351..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UINavigationController+Rx.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// UINavigationController+Rx.swift -// RxCocoa -// -// Created by Diogo on 13/04/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UINavigationController { - public typealias ShowEvent = (viewController: UIViewController, animated: Bool) - - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxNavigationControllerDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for delegate method `navigationController(:willShow:animated:)`. - public var willShow: ControlEvent { - let source: Observable = delegate - .methodInvoked(#selector(UINavigationControllerDelegate.navigationController(_:willShow:animated:))) - .map { arg in - let viewController = try castOrThrow(UIViewController.self, arg[1]) - let animated = try castOrThrow(Bool.self, arg[2]) - return (viewController, animated) - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `navigationController(:didShow:animated:)`. - public var didShow: ControlEvent { - let source: Observable = delegate - .methodInvoked(#selector(UINavigationControllerDelegate.navigationController(_:didShow:animated:))) - .map { arg in - let viewController = try castOrThrow(UIViewController.self, arg[1]) - let animated = try castOrThrow(Bool.self, arg[2]) - return (viewController, animated) - } - return ControlEvent(events: source) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UINavigationItem+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UINavigationItem+Rx.swift deleted file mode 100644 index 6250033..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UINavigationItem+Rx.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// UINavigationItem+Rx.swift -// RxCocoa -// -// Created by kumapo on 2016/05/09. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UINavigationItem { - - /// Bindable sink for `title` property. - public var title: Binder { - return Binder(self.base) { navigationItem, text in - navigationItem.title = text - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIPageControl+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIPageControl+Rx.swift deleted file mode 100644 index f21decf..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIPageControl+Rx.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// UIPageControl+Rx.swift -// RxCocoa -// -// Created by Francesco Puntillo on 14/04/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIPageControl { - - /// Bindable sink for `currentPage` property. - public var currentPage: Binder { - return Binder(self.base) { controller, page in - controller.currentPage = page - } - } - - /// Bindable sink for `numberOfPages` property. - public var numberOfPages: Binder { - return Binder(self.base) { controller, page in - controller.numberOfPages = page - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIPickerView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIPickerView+Rx.swift deleted file mode 100644 index 317dc13..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIPickerView+Rx.swift +++ /dev/null @@ -1,224 +0,0 @@ -// -// UIPickerView+Rx.swift -// RxCocoa -// -// Created by Segii Shulga on 5/12/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - - import RxSwift - import UIKit - - extension Reactive where Base: UIPickerView { - - /// Reactive wrapper for `delegate`. - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxPickerViewDelegateProxy.proxy(for: base) - } - - /// Installs delegate as forwarding delegate on `delegate`. - /// Delegate won't be retained. - /// - /// It enables using normal delegate mechanism with reactive delegate mechanism. - /// - /// - parameter delegate: Delegate object. - /// - returns: Disposable object that can be used to unbind the delegate. - public func setDelegate(_ delegate: UIPickerViewDelegate) - -> Disposable { - return RxPickerViewDelegateProxy.installForwardDelegate(delegate, retainDelegate: false, onProxyForObject: self.base) - } - - /** - Reactive wrapper for `dataSource`. - - For more information take a look at `DelegateProxyType` protocol documentation. - */ - public var dataSource: DelegateProxy { - return RxPickerViewDataSourceProxy.proxy(for: base) - } - - /** - Reactive wrapper for `delegate` message `pickerView:didSelectRow:inComponent:`. - */ - public var itemSelected: ControlEvent<(row: Int, component: Int)> { - let source = delegate - .methodInvoked(#selector(UIPickerViewDelegate.pickerView(_:didSelectRow:inComponent:))) - .map { - return (row: try castOrThrow(Int.self, $0[1]), component: try castOrThrow(Int.self, $0[2])) - } - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `pickerView:didSelectRow:inComponent:`. - - It can be only used when one of the `rx.itemTitles, rx.itemAttributedTitles, items(_ source: O)` methods is used to bind observable sequence, - or any other data source conforming to a `ViewDataSourceType` protocol. - - ``` - pickerView.rx.modelSelected(MyModel.self) - .map { ... - ``` - - parameter modelType: Type of a Model which bound to the dataSource - */ - public func modelSelected(_ modelType: T.Type) -> ControlEvent<[T]> { - let source = itemSelected.flatMap { [weak view = self.base as UIPickerView] _, component -> Observable<[T]> in - guard let view = view else { - return Observable.empty() - } - - let model: [T] = try (0 ..< view.numberOfComponents).map { component in - let row = view.selectedRow(inComponent: component) - return try view.rx.model(at: IndexPath(row: row, section: component)) - } - - return Observable.just(model) - } - - return ControlEvent(events: source) - } - - /** - Binds sequences of elements to picker view rows. - - - parameter source: Observable sequence of items. - - parameter titleForRow: Transform between sequence elements and row titles. - - returns: Disposable object that can be used to unbind. - - Example: - - let items = Observable.just([ - "First Item", - "Second Item", - "Third Item" - ]) - - items - .bind(to: pickerView.rx.itemTitles) { (row, element) in - return element.title - } - .disposed(by: disposeBag) - - */ - - public func itemTitles - (_ source: Source) - -> (_ titleForRow: @escaping (Int, Sequence.Element) -> String?) - -> Disposable where Source.Element == Sequence { - return { titleForRow in - let adapter = RxStringPickerViewAdapter(titleForRow: titleForRow) - return self.items(adapter: adapter)(source) - } - } - - /** - Binds sequences of elements to picker view rows. - - - parameter source: Observable sequence of items. - - parameter attributedTitleForRow: Transform between sequence elements and row attributed titles. - - returns: Disposable object that can be used to unbind. - - Example: - - let items = Observable.just([ - "First Item", - "Second Item", - "Third Item" - ]) - - items - .bind(to: pickerView.rx.itemAttributedTitles) { (row, element) in - return NSAttributedString(string: element.title) - } - .disposed(by: disposeBag) - - */ - - public func itemAttributedTitles - (_ source: Source) - -> (_ attributedTitleForRow: @escaping (Int, Sequence.Element) -> NSAttributedString?) - -> Disposable where Source.Element == Sequence { - return { attributedTitleForRow in - let adapter = RxAttributedStringPickerViewAdapter(attributedTitleForRow: attributedTitleForRow) - return self.items(adapter: adapter)(source) - } - } - - /** - Binds sequences of elements to picker view rows. - - - parameter source: Observable sequence of items. - - parameter viewForRow: Transform between sequence elements and row views. - - returns: Disposable object that can be used to unbind. - - Example: - - let items = Observable.just([ - "First Item", - "Second Item", - "Third Item" - ]) - - items - .bind(to: pickerView.rx.items) { (row, element, view) in - guard let myView = view as? MyView else { - let view = MyView() - view.configure(with: element) - return view - } - myView.configure(with: element) - return myView - } - .disposed(by: disposeBag) - - */ - - public func items - (_ source: Source) - -> (_ viewForRow: @escaping (Int, Sequence.Element, UIView?) -> UIView) - -> Disposable where Source.Element == Sequence { - return { viewForRow in - let adapter = RxPickerViewAdapter(viewForRow: viewForRow) - return self.items(adapter: adapter)(source) - } - } - - /** - Binds sequences of elements to picker view rows using a custom reactive adapter used to perform the transformation. - This method will retain the adapter for as long as the subscription isn't disposed (result `Disposable` - being disposed). - In case `source` observable sequence terminates successfully, the adapter will present latest element - until the subscription isn't disposed. - - - parameter adapter: Adapter used to transform elements to picker components. - - parameter source: Observable sequence of items. - - returns: Disposable object that can be used to unbind. - */ - public func items(adapter: Adapter) - -> (_ source: Source) - -> Disposable where Source.Element == Adapter.Element { - return { source in - let delegateSubscription = self.setDelegate(adapter) - let dataSourceSubscription = source.subscribeProxyDataSource(ofObject: self.base, dataSource: adapter, retainDataSource: true, binding: { [weak pickerView = self.base] (_: RxPickerViewDataSourceProxy, event) in - guard let pickerView = pickerView else { return } - adapter.pickerView(pickerView, observedEvent: event) - }) - return Disposables.create(delegateSubscription, dataSourceSubscription) - } - } - - /** - Synchronous helper method for retrieving a model at indexPath through a reactive data source. - */ - public func model(at indexPath: IndexPath) throws -> T { - let dataSource: SectionedViewDataSourceType = castOrFatalError(self.dataSource.forwardToDelegate(), message: "This method only works in case one of the `rx.itemTitles, rx.itemAttributedTitles, items(_ source: O)` methods was used.") - - return castOrFatalError(try dataSource.model(at: indexPath)) - } - } - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIProgressView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIProgressView+Rx.swift deleted file mode 100644 index 7a39d9a..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIProgressView+Rx.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// UIProgressView+Rx.swift -// RxCocoa -// -// Created by Samuel Bae on 2/27/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UIProgressView { - - /// Bindable sink for `progress` property - public var progress: Binder { - return Binder(self.base) { progressView, progress in - progressView.progress = progress - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIRefreshControl+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIRefreshControl+Rx.swift deleted file mode 100644 index cdb10be..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIRefreshControl+Rx.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// UIRefreshControl+Rx.swift -// RxCocoa -// -// Created by Yosuke Ishikawa on 1/31/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UIRefreshControl { - /// Bindable sink for `beginRefreshing()`, `endRefreshing()` methods. - public var isRefreshing: Binder { - return Binder(self.base) { refreshControl, refresh in - if refresh { - refreshControl.beginRefreshing() - } else { - refreshControl.endRefreshing() - } - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIScrollView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIScrollView+Rx.swift deleted file mode 100644 index 2d5d74c..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIScrollView+Rx.swift +++ /dev/null @@ -1,138 +0,0 @@ -// -// UIScrollView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/3/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - - import RxSwift - import UIKit - - extension Reactive where Base: UIScrollView { - public typealias EndZoomEvent = (view: UIView?, scale: CGFloat) - public typealias WillEndDraggingEvent = (velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) - - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxScrollViewDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `contentOffset`. - public var contentOffset: ControlProperty { - let proxy = RxScrollViewDelegateProxy.proxy(for: base) - - let bindingObserver = Binder(self.base) { scrollView, contentOffset in - scrollView.contentOffset = contentOffset - } - - return ControlProperty(values: proxy.contentOffsetBehaviorSubject, valueSink: bindingObserver) - } - - /// Bindable sink for `scrollEnabled` property. - public var isScrollEnabled: Binder { - return Binder(self.base) { scrollView, scrollEnabled in - scrollView.isScrollEnabled = scrollEnabled - } - } - - /// Reactive wrapper for delegate method `scrollViewDidScroll` - public var didScroll: ControlEvent { - let source = RxScrollViewDelegateProxy.proxy(for: base).contentOffsetPublishSubject - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewWillBeginDecelerating` - public var willBeginDecelerating: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewWillBeginDecelerating(_:))).map { _ in } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewDidEndDecelerating` - public var didEndDecelerating: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidEndDecelerating(_:))).map { _ in } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewWillBeginDragging` - public var willBeginDragging: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewWillBeginDragging(_:))).map { _ in } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewWillEndDragging(_:withVelocity:targetContentOffset:)` - public var willEndDragging: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewWillEndDragging(_:withVelocity:targetContentOffset:))) - .map { value -> WillEndDraggingEvent in - let velocity = try castOrThrow(CGPoint.self, value[1]) - let targetContentOffsetValue = try castOrThrow(NSValue.self, value[2]) - - guard let rawPointer = targetContentOffsetValue.pointerValue else { throw RxCocoaError.unknown } - let typedPointer = rawPointer.bindMemory(to: CGPoint.self, capacity: MemoryLayout.size) - - return (velocity, typedPointer) - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewDidEndDragging(_:willDecelerate:)` - public var didEndDragging: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidEndDragging(_:willDecelerate:))).map { value -> Bool in - return try castOrThrow(Bool.self, value[1]) - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewDidZoom` - public var didZoom: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidZoom)).map { _ in } - return ControlEvent(events: source) - } - - - /// Reactive wrapper for delegate method `scrollViewDidScrollToTop` - public var didScrollToTop: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidScrollToTop(_:))).map { _ in } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewDidEndScrollingAnimation` - public var didEndScrollingAnimation: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidEndScrollingAnimation(_:))).map { _ in } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewWillBeginZooming(_:with:)` - public var willBeginZooming: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewWillBeginZooming(_:with:))).map { value -> UIView? in - return try castOptionalOrThrow(UIView.self, value[1] as AnyObject) - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `scrollViewDidEndZooming(_:with:atScale:)` - public var didEndZooming: ControlEvent { - let source = delegate.methodInvoked(#selector(UIScrollViewDelegate.scrollViewDidEndZooming(_:with:atScale:))).map { value -> EndZoomEvent in - return (try castOptionalOrThrow(UIView.self, value[1] as AnyObject), try castOrThrow(CGFloat.self, value[2])) - } - return ControlEvent(events: source) - } - - /// Installs delegate as forwarding delegate on `delegate`. - /// Delegate won't be retained. - /// - /// It enables using normal delegate mechanism with reactive delegate mechanism. - /// - /// - parameter delegate: Delegate object. - /// - returns: Disposable object that can be used to unbind the delegate. - public func setDelegate(_ delegate: UIScrollViewDelegate) - -> Disposable { - return RxScrollViewDelegateProxy.installForwardDelegate(delegate, retainDelegate: false, onProxyForObject: self.base) - } - } - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UISearchBar+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UISearchBar+Rx.swift deleted file mode 100644 index bddb48c..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UISearchBar+Rx.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// UISearchBar+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UISearchBar { - - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxSearchBarDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `text` property. - public var text: ControlProperty { - return value - } - - /// Reactive wrapper for `text` property. - public var value: ControlProperty { - let source: Observable = Observable.deferred { [weak searchBar = self.base as UISearchBar] () -> Observable in - let text = searchBar?.text - - let textDidChange = (searchBar?.rx.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBar(_:textDidChange:))) ?? Observable.empty()) - let didEndEditing = (searchBar?.rx.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarTextDidEndEditing(_:))) ?? Observable.empty()) - - return Observable.merge(textDidChange, didEndEditing) - .map { _ in searchBar?.text ?? "" } - .startWith(text) - } - - let bindingObserver = Binder(self.base) { (searchBar, text: String?) in - searchBar.text = text - } - - return ControlProperty(values: source, valueSink: bindingObserver) - } - - /// Reactive wrapper for `selectedScopeButtonIndex` property. - public var selectedScopeButtonIndex: ControlProperty { - let source: Observable = Observable.deferred { [weak source = self.base as UISearchBar] () -> Observable in - let index = source?.selectedScopeButtonIndex ?? 0 - - return (source?.rx.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBar(_:selectedScopeButtonIndexDidChange:))) ?? Observable.empty()) - .map { a in - return try castOrThrow(Int.self, a[1]) - } - .startWith(index) - } - - let bindingObserver = Binder(self.base) { (searchBar, index: Int) in - searchBar.selectedScopeButtonIndex = index - } - - return ControlProperty(values: source, valueSink: bindingObserver) - } - -#if os(iOS) - /// Reactive wrapper for delegate method `searchBarCancelButtonClicked`. - public var cancelButtonClicked: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarCancelButtonClicked(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `searchBarBookmarkButtonClicked`. - public var bookmarkButtonClicked: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarBookmarkButtonClicked(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `searchBarResultsListButtonClicked`. - public var resultsListButtonClicked: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarResultsListButtonClicked(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } -#endif - - /// Reactive wrapper for delegate method `searchBarSearchButtonClicked`. - public var searchButtonClicked: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarSearchButtonClicked(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `searchBarTextDidBeginEditing`. - public var textDidBeginEditing: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarTextDidBeginEditing(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } - - /// Reactive wrapper for delegate method `searchBarTextDidEndEditing`. - public var textDidEndEditing: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UISearchBarDelegate.searchBarTextDidEndEditing(_:))) - .map { _ in - return () - } - return ControlEvent(events: source) - } - - /// Installs delegate as forwarding delegate on `delegate`. - /// Delegate won't be retained. - /// - /// It enables using normal delegate mechanism with reactive delegate mechanism. - /// - /// - parameter delegate: Delegate object. - /// - returns: Disposable object that can be used to unbind the delegate. - public func setDelegate(_ delegate: UISearchBarDelegate) - -> Disposable { - return RxSearchBarDelegateProxy.installForwardDelegate(delegate, retainDelegate: false, onProxyForObject: self.base) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UISearchController+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UISearchController+Rx.swift deleted file mode 100644 index 350c932..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UISearchController+Rx.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// UISearchController+Rx.swift -// RxCocoa -// -// Created by Segii Shulga on 3/17/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - - import RxSwift - import UIKit - - @available(iOS 8.0, *) - extension Reactive where Base: UISearchController { - /// Reactive wrapper for `delegate`. - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxSearchControllerDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `delegate` message. - public var didDismiss: Observable { - return delegate - .methodInvoked( #selector(UISearchControllerDelegate.didDismissSearchController(_:))) - .map { _ in } - } - - /// Reactive wrapper for `delegate` message. - public var didPresent: Observable { - return delegate - .methodInvoked(#selector(UISearchControllerDelegate.didPresentSearchController(_:))) - .map { _ in } - } - - /// Reactive wrapper for `delegate` message. - public var present: Observable { - return delegate - .methodInvoked( #selector(UISearchControllerDelegate.presentSearchController(_:))) - .map { _ in } - } - - /// Reactive wrapper for `delegate` message. - public var willDismiss: Observable { - return delegate - .methodInvoked(#selector(UISearchControllerDelegate.willDismissSearchController(_:))) - .map { _ in } - } - - /// Reactive wrapper for `delegate` message. - public var willPresent: Observable { - return delegate - .methodInvoked( #selector(UISearchControllerDelegate.willPresentSearchController(_:))) - .map { _ in } - } - - } - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UISegmentedControl+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UISegmentedControl+Rx.swift deleted file mode 100644 index 31995a6..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UISegmentedControl+Rx.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// UISegmentedControl+Rx.swift -// RxCocoa -// -// Created by Carlos García on 8/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UISegmentedControl { - /// Reactive wrapper for `selectedSegmentIndex` property. - public var selectedSegmentIndex: ControlProperty { - return value - } - - /// Reactive wrapper for `selectedSegmentIndex` property. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { segmentedControl in - segmentedControl.selectedSegmentIndex - }, setter: { segmentedControl, value in - segmentedControl.selectedSegmentIndex = value - } - ) - } - - /// Reactive wrapper for `setEnabled(_:forSegmentAt:)` - public func enabledForSegment(at index: Int) -> Binder { - return Binder(self.base) { segmentedControl, segmentEnabled -> Void in - segmentedControl.setEnabled(segmentEnabled, forSegmentAt: index) - } - } - - /// Reactive wrapper for `setTitle(_:forSegmentAt:)` - public func titleForSegment(at index: Int) -> Binder { - return Binder(self.base) { segmentedControl, title -> Void in - segmentedControl.setTitle(title, forSegmentAt: index) - } - } - - /// Reactive wrapper for `setImage(_:forSegmentAt:)` - public func imageForSegment(at index: Int) -> Binder { - return Binder(self.base) { segmentedControl, image -> Void in - segmentedControl.setImage(image, forSegmentAt: index) - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UISlider+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UISlider+Rx.swift deleted file mode 100644 index 07d4adb..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UISlider+Rx.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// UISlider+Rx.swift -// RxCocoa -// -// Created by Alexander van der Werff on 28/05/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UISlider { - - /// Reactive wrapper for `value` property. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { slider in - slider.value - }, setter: { slider, value in - slider.value = value - } - ) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIStepper+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIStepper+Rx.swift deleted file mode 100644 index 1fcb57a..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIStepper+Rx.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// UIStepper+Rx.swift -// RxCocoa -// -// Created by Yuta ToKoRo on 9/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UIStepper { - - /// Reactive wrapper for `value` property. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { stepper in - stepper.value - }, setter: { stepper, value in - stepper.value = value - } - ) - } - - /// Reactive wrapper for `stepValue` property. - public var stepValue: Binder { - return Binder(self.base) { stepper, value in - stepper.stepValue = value - } - } - -} - -#endif - diff --git a/Pods/RxCocoa/RxCocoa/iOS/UISwitch+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UISwitch+Rx.swift deleted file mode 100644 index c96f91a..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UISwitch+Rx.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// UISwitch+Rx.swift -// RxCocoa -// -// Created by Carlos García on 8/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UISwitch { - - /// Reactive wrapper for `isOn` property. - public var isOn: ControlProperty { - return value - } - - /// Reactive wrapper for `isOn` property. - /// - /// ⚠️ Versions prior to iOS 10.2 were leaking `UISwitch`'s, so on those versions - /// underlying observable sequence won't complete when nothing holds a strong reference - /// to `UISwitch`. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { uiSwitch in - uiSwitch.isOn - }, setter: { uiSwitch, value in - uiSwitch.isOn = value - } - ) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITabBar+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITabBar+Rx.swift deleted file mode 100644 index 7879684..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITabBar+Rx.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// UITabBar+Rx.swift -// RxCocoa -// -// Created by Jesse Farless on 5/13/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/** - iOS only - */ -#if os(iOS) -extension Reactive where Base: UITabBar { - - /// Reactive wrapper for `delegate` message `tabBar(_:willBeginCustomizing:)`. - public var willBeginCustomizing: ControlEvent<[UITabBarItem]> { - - let source = delegate.methodInvoked(#selector(UITabBarDelegate.tabBar(_:willBeginCustomizing:))) - .map { a in - return try castOrThrow([UITabBarItem].self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `tabBar(_:didBeginCustomizing:)`. - public var didBeginCustomizing: ControlEvent<[UITabBarItem]> { - let source = delegate.methodInvoked(#selector(UITabBarDelegate.tabBar(_:didBeginCustomizing:))) - .map { a in - return try castOrThrow([UITabBarItem].self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `tabBar(_:willEndCustomizing:changed:)`. - public var willEndCustomizing: ControlEvent<([UITabBarItem], Bool)> { - let source = delegate.methodInvoked(#selector(UITabBarDelegate.tabBar(_:willEndCustomizing:changed:))) - .map { (a: [Any]) -> (([UITabBarItem], Bool)) in - let items = try castOrThrow([UITabBarItem].self, a[1]) - let changed = try castOrThrow(Bool.self, a[2]) - return (items, changed) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `tabBar(_:didEndCustomizing:changed:)`. - public var didEndCustomizing: ControlEvent<([UITabBarItem], Bool)> { - let source = delegate.methodInvoked(#selector(UITabBarDelegate.tabBar(_:didEndCustomizing:changed:))) - .map { (a: [Any]) -> (([UITabBarItem], Bool)) in - let items = try castOrThrow([UITabBarItem].self, a[1]) - let changed = try castOrThrow(Bool.self, a[2]) - return (items, changed) - } - - return ControlEvent(events: source) - } - -} -#endif - -/** - iOS and tvOS - */ - -extension Reactive where Base: UITabBar { - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxTabBarDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `delegate` message `tabBar(_:didSelect:)`. - public var didSelectItem: ControlEvent { - let source = delegate.methodInvoked(#selector(UITabBarDelegate.tabBar(_:didSelect:))) - .map { a in - return try castOrThrow(UITabBarItem.self, a[1]) - } - - return ControlEvent(events: source) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITabBarController+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITabBarController+Rx.swift deleted file mode 100644 index 34a3501..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITabBarController+Rx.swift +++ /dev/null @@ -1,79 +0,0 @@ -// -// UITabBarController+Rx.swift -// RxCocoa -// -// Created by Yusuke Kita on 2016/12/07. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -/** - iOS only - */ -#if os(iOS) -extension Reactive where Base: UITabBarController { - - /// Reactive wrapper for `delegate` message `tabBarController:willBeginCustomizing:`. - public var willBeginCustomizing: ControlEvent<[UIViewController]> { - let source = delegate.methodInvoked(#selector(UITabBarControllerDelegate.tabBarController(_:willBeginCustomizing:))) - .map { a in - return try castOrThrow([UIViewController].self, a[1]) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `tabBarController:willEndCustomizing:changed:`. - public var willEndCustomizing: ControlEvent<(viewControllers: [UIViewController], changed: Bool)> { - let source = delegate.methodInvoked(#selector(UITabBarControllerDelegate.tabBarController(_:willEndCustomizing:changed:))) - .map { (a: [Any]) -> (viewControllers: [UIViewController], changed: Bool) in - let viewControllers = try castOrThrow([UIViewController].self, a[1]) - let changed = try castOrThrow(Bool.self, a[2]) - return (viewControllers, changed) - } - - return ControlEvent(events: source) - } - - /// Reactive wrapper for `delegate` message `tabBarController:didEndCustomizing:changed:`. - public var didEndCustomizing: ControlEvent<(viewControllers: [UIViewController], changed: Bool)> { - let source = delegate.methodInvoked(#selector(UITabBarControllerDelegate.tabBarController(_:didEndCustomizing:changed:))) - .map { (a: [Any]) -> (viewControllers: [UIViewController], changed: Bool) in - let viewControllers = try castOrThrow([UIViewController].self, a[1]) - let changed = try castOrThrow(Bool.self, a[2]) - return (viewControllers, changed) - } - - return ControlEvent(events: source) - } -} -#endif - -/** - iOS and tvOS - */ - - extension Reactive where Base: UITabBarController { - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxTabBarControllerDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `delegate` message `tabBarController:didSelect:`. - public var didSelect: ControlEvent { - let source = delegate.methodInvoked(#selector(UITabBarControllerDelegate.tabBarController(_:didSelect:))) - .map { a in - return try castOrThrow(UIViewController.self, a[1]) - } - - return ControlEvent(events: source) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITabBarItem+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITabBarItem+Rx.swift deleted file mode 100644 index 1664e27..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITabBarItem+Rx.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// UITabBarItem+Rx.swift -// RxCocoa -// -// Created by Mateusz Derks on 04/03/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UITabBarItem { - - /// Bindable sink for `badgeValue` property. - public var badgeValue: Binder { - return Binder(self.base) { tabBarItem, badgeValue in - tabBarItem.badgeValue = badgeValue - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITableView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITableView+Rx.swift deleted file mode 100644 index 7c241e2..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITableView+Rx.swift +++ /dev/null @@ -1,405 +0,0 @@ -// -// UITableView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 4/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -// Items - -extension Reactive where Base: UITableView { - - /** - Binds sequences of elements to table view rows. - - - parameter source: Observable sequence of items. - - parameter cellFactory: Transform between sequence elements and view cells. - - returns: Disposable object that can be used to unbind. - - Example: - - let items = Observable.just([ - "First Item", - "Second Item", - "Third Item" - ]) - - items - .bind(to: tableView.rx.items) { (tableView, row, element) in - let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")! - cell.textLabel?.text = "\(element) @ row \(row)" - return cell - } - .disposed(by: disposeBag) - - */ - public func items - (_ source: Source) - -> (_ cellFactory: @escaping (UITableView, Int, Sequence.Element) -> UITableViewCell) - -> Disposable - where Source.Element == Sequence { - return { cellFactory in - let dataSource = RxTableViewReactiveArrayDataSourceSequenceWrapper(cellFactory: cellFactory) - return self.items(dataSource: dataSource)(source) - } - } - - /** - Binds sequences of elements to table view rows. - - - parameter cellIdentifier: Identifier used to dequeue cells. - - parameter source: Observable sequence of items. - - parameter configureCell: Transform between sequence elements and view cells. - - parameter cellType: Type of table view cell. - - returns: Disposable object that can be used to unbind. - - Example: - - let items = Observable.just([ - "First Item", - "Second Item", - "Third Item" - ]) - - items - .bind(to: tableView.rx.items(cellIdentifier: "Cell", cellType: UITableViewCell.self)) { (row, element, cell) in - cell.textLabel?.text = "\(element) @ row \(row)" - } - .disposed(by: disposeBag) - */ - public func items - (cellIdentifier: String, cellType: Cell.Type = Cell.self) - -> (_ source: Source) - -> (_ configureCell: @escaping (Int, Sequence.Element, Cell) -> Void) - -> Disposable - where Source.Element == Sequence { - return { source in - return { configureCell in - let dataSource = RxTableViewReactiveArrayDataSourceSequenceWrapper { tv, i, item in - let indexPath = IndexPath(item: i, section: 0) - let cell = tv.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! Cell - configureCell(i, item, cell) - return cell - } - return self.items(dataSource: dataSource)(source) - } - } - } - - - /** - Binds sequences of elements to table view rows using a custom reactive data used to perform the transformation. - This method will retain the data source for as long as the subscription isn't disposed (result `Disposable` - being disposed). - In case `source` observable sequence terminates successfully, the data source will present latest element - until the subscription isn't disposed. - - - parameter dataSource: Data source used to transform elements to view cells. - - parameter source: Observable sequence of items. - - returns: Disposable object that can be used to unbind. - */ - public func items< - DataSource: RxTableViewDataSourceType & UITableViewDataSource, - Source: ObservableType> - (dataSource: DataSource) - -> (_ source: Source) - -> Disposable - where DataSource.Element == Source.Element { - return { source in - // This is called for sideeffects only, and to make sure delegate proxy is in place when - // data source is being bound. - // This is needed because theoretically the data source subscription itself might - // call `self.rx.delegate`. If that happens, it might cause weird side effects since - // setting data source will set delegate, and UITableView might get into a weird state. - // Therefore it's better to set delegate proxy first, just to be sure. - _ = self.delegate - // Strong reference is needed because data source is in use until result subscription is disposed - return source.subscribeProxyDataSource(ofObject: self.base, dataSource: dataSource as UITableViewDataSource, retainDataSource: true) { [weak tableView = self.base] (_: RxTableViewDataSourceProxy, event) -> Void in - guard let tableView = tableView else { - return - } - dataSource.tableView(tableView, observedEvent: event) - } - } - } - -} - -extension Reactive where Base: UITableView { - /** - Reactive wrapper for `dataSource`. - - For more information take a look at `DelegateProxyType` protocol documentation. - */ - public var dataSource: DelegateProxy { - return RxTableViewDataSourceProxy.proxy(for: base) - } - - /** - Installs data source as forwarding delegate on `rx.dataSource`. - Data source won't be retained. - - It enables using normal delegate mechanism with reactive delegate mechanism. - - - parameter dataSource: Data source object. - - returns: Disposable object that can be used to unbind the data source. - */ - public func setDataSource(_ dataSource: UITableViewDataSource) - -> Disposable { - return RxTableViewDataSourceProxy.installForwardDelegate(dataSource, retainDelegate: false, onProxyForObject: self.base) - } - - // events - - /** - Reactive wrapper for `delegate` message `tableView:didSelectRowAtIndexPath:`. - */ - public var itemSelected: ControlEvent { - let source = self.delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:didSelectRowAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:didDeselectRowAtIndexPath:`. - */ - public var itemDeselected: ControlEvent { - let source = self.delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:didDeselectRowAt:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:accessoryButtonTappedForRowWithIndexPath:`. - */ - public var itemAccessoryButtonTapped: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:accessoryButtonTappedForRowWith:))) - .map { a in - return try castOrThrow(IndexPath.self, a[1]) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:commitEditingStyle:forRowAtIndexPath:`. - */ - public var itemInserted: ControlEvent { - let source = self.dataSource.methodInvoked(#selector(UITableViewDataSource.tableView(_:commit:forRowAt:))) - .filter { a in - return UITableViewCell.EditingStyle(rawValue: (try castOrThrow(NSNumber.self, a[1])).intValue) == .insert - } - .map { a in - return (try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:commitEditingStyle:forRowAtIndexPath:`. - */ - public var itemDeleted: ControlEvent { - let source = self.dataSource.methodInvoked(#selector(UITableViewDataSource.tableView(_:commit:forRowAt:))) - .filter { a in - return UITableViewCell.EditingStyle(rawValue: (try castOrThrow(NSNumber.self, a[1])).intValue) == .delete - } - .map { a in - return try castOrThrow(IndexPath.self, a[2]) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:moveRowAtIndexPath:toIndexPath:`. - */ - public var itemMoved: ControlEvent { - let source: Observable = self.dataSource.methodInvoked(#selector(UITableViewDataSource.tableView(_:moveRowAt:to:))) - .map { a in - return (try castOrThrow(IndexPath.self, a[1]), try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:willDisplayCell:forRowAtIndexPath:`. - */ - public var willDisplayCell: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:willDisplay:forRowAt:))) - .map { a in - return (try castOrThrow(UITableViewCell.self, a[1]), try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:didEndDisplayingCell:forRowAtIndexPath:`. - */ - public var didEndDisplayingCell: ControlEvent { - let source: Observable = self.delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:didEndDisplaying:forRowAt:))) - .map { a in - return (try castOrThrow(UITableViewCell.self, a[1]), try castOrThrow(IndexPath.self, a[2])) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:didSelectRowAtIndexPath:`. - - It can be only used when one of the `rx.itemsWith*` methods is used to bind observable sequence, - or any other data source conforming to `SectionedViewDataSourceType` protocol. - - ``` - tableView.rx.modelSelected(MyModel.self) - .map { ... - ``` - */ - public func modelSelected(_ modelType: T.Type) -> ControlEvent { - let source: Observable = self.itemSelected.flatMap { [weak view = self.base as UITableView] indexPath -> Observable in - guard let view = view else { - return Observable.empty() - } - - return Observable.just(try view.rx.model(at: indexPath)) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:didDeselectRowAtIndexPath:`. - - It can be only used when one of the `rx.itemsWith*` methods is used to bind observable sequence, - or any other data source conforming to `SectionedViewDataSourceType` protocol. - - ``` - tableView.rx.modelDeselected(MyModel.self) - .map { ... - ``` - */ - public func modelDeselected(_ modelType: T.Type) -> ControlEvent { - let source: Observable = self.itemDeselected.flatMap { [weak view = self.base as UITableView] indexPath -> Observable in - guard let view = view else { - return Observable.empty() - } - - return Observable.just(try view.rx.model(at: indexPath)) - } - - return ControlEvent(events: source) - } - - /** - Reactive wrapper for `delegate` message `tableView:commitEditingStyle:forRowAtIndexPath:`. - - It can be only used when one of the `rx.itemsWith*` methods is used to bind observable sequence, - or any other data source conforming to `SectionedViewDataSourceType` protocol. - - ``` - tableView.rx.modelDeleted(MyModel.self) - .map { ... - ``` - */ - public func modelDeleted(_ modelType: T.Type) -> ControlEvent { - let source: Observable = self.itemDeleted.flatMap { [weak view = self.base as UITableView] indexPath -> Observable in - guard let view = view else { - return Observable.empty() - } - - return Observable.just(try view.rx.model(at: indexPath)) - } - - return ControlEvent(events: source) - } - - /** - Synchronous helper method for retrieving a model at indexPath through a reactive data source. - */ - public func model(at indexPath: IndexPath) throws -> T { - let dataSource: SectionedViewDataSourceType = castOrFatalError(self.dataSource.forwardToDelegate(), message: "This method only works in case one of the `rx.items*` methods was used.") - - let element = try dataSource.model(at: indexPath) - - return castOrFatalError(element) - } -} - -@available(iOS 10.0, tvOS 10.0, *) -extension Reactive where Base: UITableView { - - /// Reactive wrapper for `prefetchDataSource`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var prefetchDataSource: DelegateProxy { - return RxTableViewDataSourcePrefetchingProxy.proxy(for: base) - } - - /** - Installs prefetch data source as forwarding delegate on `rx.prefetchDataSource`. - Prefetch data source won't be retained. - - It enables using normal delegate mechanism with reactive delegate mechanism. - - - parameter prefetchDataSource: Prefetch data source object. - - returns: Disposable object that can be used to unbind the data source. - */ - public func setPrefetchDataSource(_ prefetchDataSource: UITableViewDataSourcePrefetching) - -> Disposable { - return RxTableViewDataSourcePrefetchingProxy.installForwardDelegate(prefetchDataSource, retainDelegate: false, onProxyForObject: self.base) - } - - /// Reactive wrapper for `prefetchDataSource` message `tableView(_:prefetchRowsAt:)`. - public var prefetchRows: ControlEvent<[IndexPath]> { - let source = RxTableViewDataSourcePrefetchingProxy.proxy(for: base).prefetchRowsPublishSubject - return ControlEvent(events: source) - } - - /// Reactive wrapper for `prefetchDataSource` message `tableView(_:cancelPrefetchingForRowsAt:)`. - public var cancelPrefetchingForRows: ControlEvent<[IndexPath]> { - let source = prefetchDataSource.methodInvoked(#selector(UITableViewDataSourcePrefetching.tableView(_:cancelPrefetchingForRowsAt:))) - .map { a in - return try castOrThrow(Array.self, a[1]) - } - - return ControlEvent(events: source) - } - -} -#endif - -#if os(tvOS) - - extension Reactive where Base: UITableView { - - /** - Reactive wrapper for `delegate` message `tableView:didUpdateFocusInContext:withAnimationCoordinator:`. - */ - public var didUpdateFocusInContextWithAnimationCoordinator: ControlEvent<(context: UITableViewFocusUpdateContext, animationCoordinator: UIFocusAnimationCoordinator)> { - - let source = delegate.methodInvoked(#selector(UITableViewDelegate.tableView(_:didUpdateFocusIn:with:))) - .map { a -> (context: UITableViewFocusUpdateContext, animationCoordinator: UIFocusAnimationCoordinator) in - let context = try castOrThrow(UITableViewFocusUpdateContext.self, a[1]) - let animationCoordinator = try castOrThrow(UIFocusAnimationCoordinator.self, a[2]) - return (context: context, animationCoordinator: animationCoordinator) - } - - return ControlEvent(events: source) - } - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITextField+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITextField+Rx.swift deleted file mode 100644 index 522fb20..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITextField+Rx.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// UITextField+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import RxSwift -import UIKit - -extension Reactive where Base: UITextField { - /// Reactive wrapper for `text` property. - public var text: ControlProperty { - return value - } - - /// Reactive wrapper for `text` property. - public var value: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { textField in - textField.text - }, - setter: { textField, value in - // This check is important because setting text value always clears control state - // including marked text selection which is imporant for proper input - // when IME input method is used. - if textField.text != value { - textField.text = value - } - } - ) - } - - /// Bindable sink for `attributedText` property. - public var attributedText: ControlProperty { - return base.rx.controlPropertyWithDefaultEvents( - getter: { textField in - textField.attributedText - }, - setter: { textField, value in - // This check is important because setting text value always clears control state - // including marked text selection which is imporant for proper input - // when IME input method is used. - if textField.attributedText != value { - textField.attributedText = value - } - } - ) - } - - /// Bindable sink for `isSecureTextEntry` property. - public var isSecureTextEntry: Binder { - return Binder(self.base) { textField, isSecureTextEntry in - textField.isSecureTextEntry = isSecureTextEntry - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UITextView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UITextView+Rx.swift deleted file mode 100644 index 7e943ca..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UITextView+Rx.swift +++ /dev/null @@ -1,125 +0,0 @@ -// -// UITextView+Rx.swift -// RxCocoa -// -// Created by Yuta ToKoRo on 7/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UITextView { - /// Reactive wrapper for `text` property - public var text: ControlProperty { - return value - } - - /// Reactive wrapper for `text` property. - public var value: ControlProperty { - let source: Observable = Observable.deferred { [weak textView = self.base] in - let text = textView?.text - - let textChanged = textView?.textStorage - // This project uses text storage notifications because - // that's the only way to catch autocorrect changes - // in all cases. Other suggestions are welcome. - .rx.didProcessEditingRangeChangeInLength - // This observe on is here because text storage - // will emit event while process is not completely done, - // so rebinding a value will cause an exception to be thrown. - .observeOn(MainScheduler.asyncInstance) - .map { _ in - return textView?.textStorage.string - } - ?? Observable.empty() - - return textChanged - .startWith(text) - } - - let bindingObserver = Binder(self.base) { (textView, text: String?) in - // This check is important because setting text value always clears control state - // including marked text selection which is imporant for proper input - // when IME input method is used. - if textView.text != text { - textView.text = text - } - } - - return ControlProperty(values: source, valueSink: bindingObserver) - } - - - /// Reactive wrapper for `attributedText` property. - public var attributedText: ControlProperty { - let source: Observable = Observable.deferred { [weak textView = self.base] in - let attributedText = textView?.attributedText - - let textChanged: Observable = textView?.textStorage - // This project uses text storage notifications because - // that's the only way to catch autocorrect changes - // in all cases. Other suggestions are welcome. - .rx.didProcessEditingRangeChangeInLength - // This observe on is here because attributedText storage - // will emit event while process is not completely done, - // so rebinding a value will cause an exception to be thrown. - .observeOn(MainScheduler.asyncInstance) - .map { _ in - return textView?.attributedText - } - ?? Observable.empty() - - return textChanged - .startWith(attributedText) - } - - let bindingObserver = Binder(self.base) { (textView, attributedText: NSAttributedString?) in - // This check is important because setting text value always clears control state - // including marked text selection which is imporant for proper input - // when IME input method is used. - if textView.attributedText != attributedText { - textView.attributedText = attributedText - } - } - - return ControlProperty(values: source, valueSink: bindingObserver) - } - - /// Reactive wrapper for `delegate` message. - public var didBeginEditing: ControlEvent<()> { - return ControlEvent<()>(events: self.delegate.methodInvoked(#selector(UITextViewDelegate.textViewDidBeginEditing(_:))) - .map { _ in - return () - }) - } - - /// Reactive wrapper for `delegate` message. - public var didEndEditing: ControlEvent<()> { - return ControlEvent<()>(events: self.delegate.methodInvoked(#selector(UITextViewDelegate.textViewDidEndEditing(_:))) - .map { _ in - return () - }) - } - - /// Reactive wrapper for `delegate` message. - public var didChange: ControlEvent<()> { - return ControlEvent<()>(events: self.delegate.methodInvoked(#selector(UITextViewDelegate.textViewDidChange(_:))) - .map { _ in - return () - }) - } - - /// Reactive wrapper for `delegate` message. - public var didChangeSelection: ControlEvent<()> { - return ControlEvent<()>(events: self.delegate.methodInvoked(#selector(UITextViewDelegate.textViewDidChangeSelection(_:))) - .map { _ in - return () - }) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIView+Rx.swift deleted file mode 100644 index 4dd2aba..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIView+Rx.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// UIView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 12/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - -import UIKit -import RxSwift - -extension Reactive where Base: UIView { - /// Bindable sink for `hidden` property. - public var isHidden: Binder { - return Binder(self.base) { view, hidden in - view.isHidden = hidden - } - } - - /// Bindable sink for `alpha` property. - public var alpha: Binder { - return Binder(self.base) { view, alpha in - view.alpha = alpha - } - } - - /// Bindable sink for `backgroundColor` property. - public var backgroundColor: Binder { - return Binder(self.base) { view, color in - view.backgroundColor = color - } - } - - /// Bindable sink for `isUserInteractionEnabled` property. - public var isUserInteractionEnabled: Binder { - return Binder(self.base) { view, userInteractionEnabled in - view.isUserInteractionEnabled = userInteractionEnabled - } - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/UIViewController+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/UIViewController+Rx.swift deleted file mode 100644 index a9ab2a5..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/UIViewController+Rx.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// UIViewController+Rx.swift -// RxCocoa -// -// Created by Kyle Fuller on 27/05/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(tvOS) - - import UIKit - import RxSwift - - extension Reactive where Base: UIViewController { - - /// Bindable sink for `title`. - public var title: Binder { - return Binder(self.base) { viewController, title in - viewController.title = title - } - } - - } -#endif diff --git a/Pods/RxCocoa/RxCocoa/iOS/WKWebView+Rx.swift b/Pods/RxCocoa/RxCocoa/iOS/WKWebView+Rx.swift deleted file mode 100644 index b3b4d84..0000000 --- a/Pods/RxCocoa/RxCocoa/iOS/WKWebView+Rx.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// WKWebView+Rx.swift -// RxCocoa -// -// Created by Giuseppe Lanza on 14/02/2020. -// Copyright © 2020 Krunoslav Zaher. All rights reserved. -// - -#if os(iOS) || os(macOS) - -import RxSwift -import WebKit - -@available(iOS 8.0, OSX 10.10, OSXApplicationExtension 10.10, *) -extension Reactive where Base: WKWebView { - - /// Reactive wrapper for `navigationDelegate`. - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var navigationDelegate: DelegateProxy { - RxWKNavigationDelegateProxy.proxy(for: base) - } - - /// Reactive wrapper for `navigationDelegate` message. - public var didCommit: Observable { - navigationDelegate - .methodInvoked(#selector(WKNavigationDelegate.webView(_:didCommit:))) - .map { a in try castOrThrow(WKNavigation.self, a[1]) } - } - - /// Reactive wrapper for `navigationDelegate` message. - public var didStartLoad: Observable { - navigationDelegate - .methodInvoked(#selector(WKNavigationDelegate.webView(_:didStartProvisionalNavigation:))) - .map { a in try castOrThrow(WKNavigation.self, a[1]) } - } - - /// Reactive wrapper for `navigationDelegate` message. - public var didFinishLoad: Observable { - navigationDelegate - .methodInvoked(#selector(WKNavigationDelegate.webView(_:didFinish:))) - .map { a in try castOrThrow(WKNavigation.self, a[1]) } - } - - /// Reactive wrapper for `navigationDelegate` message. - public var didFailLoad: Observable<(WKNavigation, Error)> { - navigationDelegate - .methodInvoked(#selector(WKNavigationDelegate.webView(_:didFail:withError:))) - .map { a in - ( - try castOrThrow(WKNavigation.self, a[1]), - try castOrThrow(Error.self, a[2]) - ) - } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift deleted file mode 100644 index 02a88f6..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSButton+Rx.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// NSButton+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import RxSwift -import Cocoa - -extension Reactive where Base: NSButton { - - /// Reactive wrapper for control event. - public var tap: ControlEvent { - return self.controlEvent - } - - /// Reactive wrapper for `state` property`. - public var state: ControlProperty { - return self.base.rx.controlProperty( - getter: { control in - return control.state - }, setter: { (control: NSButton, state: NSControl.StateValue) in - control.state = state - } - ) - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift deleted file mode 100644 index b1d1932..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSControl+Rx.swift +++ /dev/null @@ -1,94 +0,0 @@ -// -// NSControl+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import Cocoa -import RxSwift - -private var rx_value_key: UInt8 = 0 -private var rx_control_events_key: UInt8 = 0 - -extension Reactive where Base: NSControl { - - /// Reactive wrapper for control event. - public var controlEvent: ControlEvent<()> { - MainScheduler.ensureRunningOnMainThread() - - let source = self.lazyInstanceObservable(&rx_control_events_key) { () -> Observable in - Observable.create { [weak control = self.base] observer in - MainScheduler.ensureRunningOnMainThread() - - guard let control = control else { - observer.on(.completed) - return Disposables.create() - } - - let observer = ControlTarget(control: control) { _ in - observer.on(.next(())) - } - - return observer - } - .takeUntil(self.deallocated) - .share() - } - - return ControlEvent(events: source) - } - - /// Creates a `ControlProperty` that is triggered by target/action pattern value updates. - /// - /// - parameter getter: Property value getter. - /// - parameter setter: Property value setter. - public func controlProperty( - getter: @escaping (Base) -> T, - setter: @escaping (Base, T) -> Void - ) -> ControlProperty { - MainScheduler.ensureRunningOnMainThread() - - let source = self.base.rx.lazyInstanceObservable(&rx_value_key) { () -> Observable<()> in - return Observable.create { [weak weakControl = self.base] (observer: AnyObserver<()>) in - guard let control = weakControl else { - observer.on(.completed) - return Disposables.create() - } - - observer.on(.next(())) - - let observer = ControlTarget(control: control) { _ in - if weakControl != nil { - observer.on(.next(())) - } - } - - return observer - } - .takeUntil(self.deallocated) - .share(replay: 1, scope: .whileConnected) - } - .flatMap { [weak base] _ -> Observable in - guard let control = base else { return Observable.empty() } - return Observable.just(getter(control)) - } - - let bindingObserver = Binder(self.base, binding: setter) - - return ControlProperty(values: source, valueSink: bindingObserver) - } - - /// Bindable sink for `enabled` property. - public var isEnabled: Binder { - return Binder(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 deleted file mode 100644 index 20a0514..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSImageView+Rx.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// NSImageView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import RxSwift -import Cocoa - -extension Reactive where Base: NSImageView { - - /// Bindable sink for `image` property. - public var image: Binder { - return Binder(self.base) { imageView, image in - imageView.image = image - } - } -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift deleted file mode 100644 index 2e5b19a..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSSlider+Rx.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// NSSlider+Rx.swift -// RxCocoa -// -// Created by Junior B. on 24/05/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import RxSwift -import Cocoa - -extension Reactive where Base: NSSlider { - - /// Reactive wrapper for `value` property. - public var value: ControlProperty { - return self.base.rx.controlProperty( - getter: { control -> Double 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 deleted file mode 100644 index fa7a117..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSTextField+Rx.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// NSTextField+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 5/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import Cocoa -import RxSwift - -/// Delegate proxy for `NSTextField`. -/// -/// For more information take a look at `DelegateProxyType`. -open class RxTextFieldDelegateProxy - : DelegateProxy - , DelegateProxyType - , NSTextFieldDelegate { - - /// Typed parent object. - public weak private(set) var textField: NSTextField? - - /// Initializes `RxTextFieldDelegateProxy` - /// - /// - parameter textField: Parent object for delegate proxy. - init(textField: NSTextField) { - self.textField = textField - super.init(parentObject: textField, delegateProxy: RxTextFieldDelegateProxy.self) - } - - public static func registerKnownImplementations() { - self.register { RxTextFieldDelegateProxy(textField: $0) } - } - - fileprivate let textSubject = PublishSubject() - - // MARK: Delegate methods - open func controlTextDidChange(_ notification: Notification) { - let textField: NSTextField = castOrFatalError(notification.object) - let nextValue = textField.stringValue - self.textSubject.on(.next(nextValue)) - _forwardToDelegate?.controlTextDidChange?(notification) - } - - // MARK: Delegate proxy methods - - /// For more information take a look at `DelegateProxyType`. - open class func currentDelegate(for object: ParentObject) -> NSTextFieldDelegate? { - return object.delegate - } - - /// For more information take a look at `DelegateProxyType`. - open class func setCurrentDelegate(_ delegate: NSTextFieldDelegate?, to object: ParentObject) { - object.delegate = delegate - } - -} - -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.proxy(for: self.base) - } - - /// Reactive wrapper for `text` property. - public var text: ControlProperty { - let delegate = RxTextFieldDelegateProxy.proxy(for: self.base) - - let source = Observable.deferred { [weak textField = self.base] in - delegate.textSubject.startWith(textField?.stringValue) - }.takeUntil(self.deallocated) - - let observer = Binder(self.base) { (control, value: String?) in - control.stringValue = value ?? "" - } - - return ControlProperty(values: source, valueSink: observer.asObserver()) - } - -} - -#endif diff --git a/Pods/RxCocoa/RxCocoa/macOS/NSTextView+Rx.swift b/Pods/RxCocoa/RxCocoa/macOS/NSTextView+Rx.swift deleted file mode 100644 index 0e55a20..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSTextView+Rx.swift +++ /dev/null @@ -1,94 +0,0 @@ -// -// NSTextView+Rx.swift -// RxCocoa -// -// Created by Cee on 8/5/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - -import Cocoa -import RxSwift - -/// Delegate proxy for `NSTextView`. -/// -/// For more information take a look at `DelegateProxyType`. -open class RxTextViewDelegateProxy: DelegateProxy, DelegateProxyType, NSTextViewDelegate { - - #if compiler(>=5.2) - /// Typed parent object. - /// - /// - note: Since Swift 5.2 and Xcode 11.4, Apple have suddenly - /// disallowed using `weak` for NSTextView. For more details - /// see this GitHub Issue: https://git.io/JvSRn - public private(set) var textView: NSTextView? - #else - /// Typed parent object. - public weak private(set) var textView: NSTextView? - #endif - - /// Initializes `RxTextViewDelegateProxy` - /// - /// - parameter textView: Parent object for delegate proxy. - init(textView: NSTextView) { - self.textView = textView - super.init(parentObject: textView, delegateProxy: RxTextViewDelegateProxy.self) - } - - public static func registerKnownImplementations() { - self.register { RxTextViewDelegateProxy(textView: $0) } - } - - fileprivate let textSubject = PublishSubject() - - // MARK: Delegate methods - - open func textDidChange(_ notification: Notification) { - let textView: NSTextView = castOrFatalError(notification.object) - let nextValue = textView.string - self.textSubject.on(.next(nextValue)) - self._forwardToDelegate?.textDidChange?(notification) - } - - // MARK: Delegate proxy methods - - /// For more information take a look at `DelegateProxyType`. - open class func currentDelegate(for object: ParentObject) -> NSTextViewDelegate? { - return object.delegate - } - - /// For more information take a look at `DelegateProxyType`. - open class func setCurrentDelegate(_ delegate: NSTextViewDelegate?, to object: ParentObject) { - object.delegate = delegate - } - -} - -extension Reactive where Base: NSTextView { - - /// Reactive wrapper for `delegate`. - /// - /// For more information take a look at `DelegateProxyType` protocol documentation. - public var delegate: DelegateProxy { - return RxTextViewDelegateProxy.proxy(for: self.base) - } - - /// Reactive wrapper for `string` property. - public var string: ControlProperty { - let delegate = RxTextViewDelegateProxy.proxy(for: self.base) - - let source = Observable.deferred { [weak textView = self.base] in - delegate.textSubject.startWith(textView?.string ?? "") - }.takeUntil(self.deallocated) - - let observer = Binder(self.base) { control, value in - control.string = 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 deleted file mode 100644 index 060829d..0000000 --- a/Pods/RxCocoa/RxCocoa/macOS/NSView+Rx.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// NSView+Rx.swift -// RxCocoa -// -// Created by Krunoslav Zaher on 12/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) - - import Cocoa - import RxSwift - - extension Reactive where Base: NSView { - /// Bindable sink for `hidden` property. - public var isHidden: Binder { - return Binder(self.base) { view, value in - view.isHidden = value - } - } - - /// Bindable sink for `alphaValue` property. - public var alpha: Binder { - return Binder(self.base) { view, value in - view.alphaValue = value - } - } - } - -#endif diff --git a/Pods/RxRelay/LICENSE.md b/Pods/RxRelay/LICENSE.md deleted file mode 100644 index d6765d9..0000000 --- a/Pods/RxRelay/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -**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/RxRelay/README.md b/Pods/RxRelay/README.md deleted file mode 100644 index c666142..0000000 --- a/Pods/RxRelay/README.md +++ /dev/null @@ -1,244 +0,0 @@ -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)](https://cocoapods.org/pods/RxSwift) [![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) - -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) -* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, and `ControlProperty` ... 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.
[Join Slack Channel](http://slack.rxswift.org) -* 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) -* Help out [Check out contribution guide](CONTRIBUTING.md) - -###### ... compare - -* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). - -###### ... understand the structure - -RxSwift comprises five separate components depending on eachother in the following way: - -```none -┌──────────────┐ ┌──────────────┐ -│ RxCocoa ├────▶ RxRelay │ -└───────┬──────┘ └──────┬───────┘ - │ │ -┌───────▼──────────────────▼───────┐ -│ RxSwift │ -└───────▲──────────────────▲───────┘ - │ │ -┌───────┴──────┐ ┌──────┴───────┐ -│ RxTest │ │ RxBlocking │ -└──────────────┘ └──────────────┘ -``` - -* **RxSwift**: The core of RxSwift, providing the Rx standard as (mostly) defined by [ReactiveX](https://reactivex.io). It has no other dependencies. -* **RxCocoa**: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Binders, Traits, and much more. It depends on both `RxSwift` and `RxRelay`. -* **RxRelay**: Provides `PublishRelay` and `BehaviorRelay`, two [simple wrappers around Subjects](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Subjects.md#relays). It depends on `RxSwift`. -* **RxTest** and **RxBlocking**: Provides testing capabilities for Rx-based systems. It depends on `RxSwift`. - -###### ... 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(.milliseconds(300), 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
-    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
-        (index, repository: Repository, cell) in
-        cell.textLabel?.text = repository.name
-        cell.detailTextLabel?.text = repository.url
-    }
-    .disposed(by: disposeBag)
- - -## Requirements - -* Xcode 10.2 -* Swift 5.0 - -For Xcode 10.1 and below, [use RxSwift 4.5](https://github.com/ReactiveX/RxSwift/releases/tag/4.5.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) - -```ruby -# Podfile -use_frameworks! - -target 'YOUR_TARGET_NAME' do - pod 'RxSwift', '~> 5' - pod 'RxCocoa', '~> 5' -end - -# RxTest and RxBlocking make the most sense in the context of unit/integration tests -target 'YOUR_TESTING_TARGET' do - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```bash -$ pod install -``` - -### [Carthage](https://github.com/Carthage/Carthage) - -Officially supported: Carthage 0.33 and up. - -Add this to `Cartfile` - -``` -github "ReactiveX/RxSwift" ~> 5.0 -``` - -```bash -$ carthage update -``` - -#### Carthage as a Static Library - -Carthage defaults to building RxSwift as a Dynamic Library. - -If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: - -```bash -carthage update RxSwift --platform iOS --no-build -sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj -carthage build RxSwift --platform iOS -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -Create a `Package.swift` file. - -```swift -// swift-tools-version:5.0 - -import PackageDescription - -let package = Package( - name: "RxTestProject", - dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") - ], - targets: [ - .target(name: "RxTestProject", dependencies: ["RxSwift", "RxCocoa"]) - ] -) -``` - -```bash -$ swift build -``` - -To build or test a module with RxTest dependency, set `TEST=1`. - -```bash -$ TEST=1 swift test -``` - -### Manually using git submodules - -* Add RxSwift as a submodule - -```bash -$ 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) -* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift-reactive-programming-with-swift) -* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) -* [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/RxRelay/RxRelay/BehaviorRelay.swift b/Pods/RxRelay/RxRelay/BehaviorRelay.swift deleted file mode 100644 index 10dfdc0..0000000 --- a/Pods/RxRelay/RxRelay/BehaviorRelay.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// BehaviorRelay.swift -// RxRelay -// -// Created by Krunoslav Zaher on 10/7/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/// BehaviorRelay is a wrapper for `BehaviorSubject`. -/// -/// Unlike `BehaviorSubject` it can't terminate with error or completed. -public final class BehaviorRelay: ObservableType { - private let _subject: BehaviorSubject - - /// Accepts `event` and emits it to subscribers - public func accept(_ event: Element) { - self._subject.onNext(event) - } - - /// Current value of behavior subject - public var value: Element { - // this try! is ok because subject can't error out or be disposed - return try! self._subject.value() - } - - /// Initializes behavior relay with initial value. - public init(value: Element) { - self._subject = BehaviorSubject(value: value) - } - - /// Subscribes observer - public func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - return self._subject.subscribe(observer) - } - - /// - returns: Canonical interface for push style sequence - public func asObservable() -> Observable { - return self._subject.asObservable() - } -} diff --git a/Pods/RxRelay/RxRelay/Observable+Bind.swift b/Pods/RxRelay/RxRelay/Observable+Bind.swift deleted file mode 100644 index d759862..0000000 --- a/Pods/RxRelay/RxRelay/Observable+Bind.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Observable+Bind.swift -// RxRelay -// -// Created by Shai Mishali on 09/04/2019. -// Copyright © 2019 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -extension ObservableType { - /** - Creates new subscription and sends elements to publish relay(s). - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - parameter to: Target publish relays for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to relays: PublishRelay...) -> Disposable { - return bind(to: relays) - } - - /** - Creates new subscription and sends elements to publish relay(s). - - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - - parameter to: Target publish relays for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to relays: PublishRelay...) -> Disposable { - return self.map { $0 as Element? }.bind(to: relays) - } - - /** - Creates new subscription and sends elements to publish relay(s). - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - parameter to: Target publish relays for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - private func bind(to relays: [PublishRelay]) -> Disposable { - return subscribe { e in - switch e { - case let .next(element): - relays.forEach { - $0.accept(element) - } - case let .error(error): - rxFatalErrorInDebug("Binding error to publish relay: \(error)") - case .completed: - break - } - } - } - - /** - Creates new subscription and sends elements to behavior relay(s). - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - parameter to: Target behavior relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to relays: BehaviorRelay...) -> Disposable { - return self.bind(to: relays) - } - - /** - Creates new subscription and sends elements to behavior relay(s). - - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - - parameter to: Target behavior relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - public func bind(to relays: BehaviorRelay...) -> Disposable { - return self.map { $0 as Element? }.bind(to: relays) - } - - /** - Creates new subscription and sends elements to behavior relay(s). - In case error occurs in debug mode, `fatalError` will be raised. - In case error occurs in release mode, `error` will be logged. - - parameter to: Target behavior relay for sequence elements. - - returns: Disposable object that can be used to unsubscribe the observer. - */ - private func bind(to relays: [BehaviorRelay]) -> Disposable { - return subscribe { e in - switch e { - case let .next(element): - relays.forEach { - $0.accept(element) - } - case let .error(error): - rxFatalErrorInDebug("Binding error to behavior relay: \(error)") - case .completed: - break - } - } - } -} diff --git a/Pods/RxRelay/RxRelay/PublishRelay.swift b/Pods/RxRelay/RxRelay/PublishRelay.swift deleted file mode 100644 index 9cacd89..0000000 --- a/Pods/RxRelay/RxRelay/PublishRelay.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// PublishRelay.swift -// RxRelay -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import RxSwift - -/// PublishRelay is a wrapper for `PublishSubject`. -/// -/// Unlike `PublishSubject` it can't terminate with error or completed. -public final class PublishRelay: ObservableType { - private let _subject: PublishSubject - - // Accepts `event` and emits it to subscribers - public func accept(_ event: Element) { - self._subject.onNext(event) - } - - /// Initializes with internal empty subject. - public init() { - self._subject = PublishSubject() - } - - /// Subscribes observer - public func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - return self._subject.subscribe(observer) - } - - /// - returns: Canonical interface for push style sequence - public func asObservable() -> Observable { - return self._subject.asObservable() - } -} diff --git a/Pods/RxRelay/RxRelay/Utils.swift b/Pods/RxRelay/RxRelay/Utils.swift deleted file mode 100644 index 5954fb9..0000000 --- a/Pods/RxRelay/RxRelay/Utils.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// Utils.swift -// RxRelay -// -// Created by Shai Mishali on 09/04/2019. -// Copyright © 2019 Krunoslav Zaher. All rights reserved. -// - -import Foundation - -func rxFatalErrorInDebug(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) { - #if DEBUG - fatalError(lastMessage(), file: file, line: line) - #else - print("\(file):\(line): \(lastMessage())") - #endif -} diff --git a/Pods/RxSwift/LICENSE.md b/Pods/RxSwift/LICENSE.md deleted file mode 100644 index d6765d9..0000000 --- a/Pods/RxSwift/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -**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/AtomicInt.swift b/Pods/RxSwift/Platform/AtomicInt.swift deleted file mode 100644 index d8d9580..0000000 --- a/Pods/RxSwift/Platform/AtomicInt.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// AtomicInt.swift -// Platform -// -// Created by Krunoslav Zaher on 10/28/18. -// Copyright © 2018 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSLock - -final class AtomicInt: NSLock { - fileprivate var value: Int32 - public init(_ value: Int32 = 0) { - self.value = value - } -} - -@discardableResult -@inline(__always) -func add(_ this: AtomicInt, _ value: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value += value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func sub(_ this: AtomicInt, _ value: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value -= value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func fetchOr(_ this: AtomicInt, _ mask: Int32) -> Int32 { - this.lock() - let oldValue = this.value - this.value |= mask - this.unlock() - return oldValue -} - -@inline(__always) -func load(_ this: AtomicInt) -> Int32 { - this.lock() - let oldValue = this.value - this.unlock() - return oldValue -} - -@discardableResult -@inline(__always) -func increment(_ this: AtomicInt) -> Int32 { - return add(this, 1) -} - -@discardableResult -@inline(__always) -func decrement(_ this: AtomicInt) -> Int32 { - return sub(this, 1) -} - -@inline(__always) -func isFlagSet(_ this: AtomicInt, _ mask: Int32) -> Bool { - return (load(this) & mask) != 0 -} diff --git a/Pods/RxSwift/Platform/DataStructures/Bag.swift b/Pods/RxSwift/Platform/DataStructures/Bag.swift deleted file mode 100644 index 71e1e91..0000000 --- a/Pods/RxSwift/Platform/DataStructures/Bag.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// Bag.swift -// Platform -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 and 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) - - private var _nextKey: BagKey = BagKey(rawValue: 0) - - // data - - // first fill inline variables - var _key0: BagKey? - var _value0: T? - - // then fill "array dictionary" - var _pairs = ContiguousArray() - - // last is sparse dictionary - var _dictionary: [BagKey: T]? - - 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 _pairs.count < arrayDictionaryMaxSize { - _pairs.append((key: key, value: element)) - return key - } - - _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) + _pairs.count + dictionaryCount - } - - /// Removes all elements from bag and clears capacity. - mutating func removeAll() { - _key0 = nil - _value0 = nil - - _pairs.removeAll(keepingCapacity: false) - _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 - } - - for i in 0 ..< _pairs.count where _pairs[i].key == key { - let value = _pairs[i].value - _pairs.remove(at: i) - return value - } - - 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) - } - - for i in 0 ..< _pairs.count { - action(_pairs[i].value) - } - - if dictionary?.count ?? 0 > 0 { - for element in dictionary!.values { - action(element) - } - } - } -} - -extension BagKey: Hashable { - func hash(into hasher: inout Hasher) { - hasher.combine(rawValue) - } -} - -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 deleted file mode 100644 index b6404a7..0000000 --- a/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// InfiniteSequence.swift -// Platform -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Sequence that repeats `repeatedValue` infinite number of times. -struct InfiniteSequence : Sequence { - typealias Iterator = AnyIterator - - private let _repeatedValue: Element - - init(repeatedValue: Element) { - _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 deleted file mode 100644 index fac525f..0000000 --- a/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift +++ /dev/null @@ -1,111 +0,0 @@ -// -// PriorityQueue.swift -// Platform -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct PriorityQueue { - private let _hasHigherPriority: (Element, Element) -> Bool - private let _isEqual: (Element, Element) -> Bool - - private 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 { - _elements.swapAt(index, _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 } - _elements.swapAt(unbalancedIndex, 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 } - _elements.swapAt(highestPriorityIndex, 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 deleted file mode 100644 index d05726c..0000000 --- a/Pods/RxSwift/Platform/DataStructures/Queue.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// Queue.swift -// Platform -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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 deleted file mode 100644 index 552314a..0000000 --- a/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// DispatchQueue+Extensions.swift -// Platform -// -// Created by Krunoslav Zaher on 10/22/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -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 deleted file mode 100644 index 6dc36ad..0000000 --- a/Pods/RxSwift/Platform/Platform.Darwin.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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 class Foundation.Thread - import protocol Foundation.NSCopying - - extension Thread { - static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying) { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - if let newValue = value { - threadDictionary[key] = newValue - } - else { - threadDictionary[key] = nil - } - } - - static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - -#endif diff --git a/Pods/RxSwift/Platform/Platform.Linux.swift b/Pods/RxSwift/Platform/Platform.Linux.swift deleted file mode 100644 index a950e1c..0000000 --- a/Pods/RxSwift/Platform/Platform.Linux.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Platform.Linux.swift -// Platform -// -// Created by Krunoslav Zaher on 12/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(Linux) - - import class Foundation.Thread - - extension Thread { - - static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { - if let newValue = value { - Thread.current.threadDictionary[key] = newValue - } - else { - Thread.current.threadDictionary[key] = nil - } - } - - 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/Platform/RecursiveLock.swift b/Pods/RxSwift/Platform/RecursiveLock.swift deleted file mode 100644 index c03471d..0000000 --- a/Pods/RxSwift/Platform/RecursiveLock.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// RecursiveLock.swift -// Platform -// -// Created by Krunoslav Zaher on 12/18/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSRecursiveLock - -#if TRACE_RESOURCES - class RecursiveLock: NSRecursiveLock { - override init() { - _ = Resources.incrementTotal() - super.init() - } - - override func lock() { - super.lock() - _ = Resources.incrementTotal() - } - - override func unlock() { - super.unlock() - _ = Resources.decrementTotal() - } - - deinit { - _ = Resources.decrementTotal() - } - } -#else - typealias RecursiveLock = NSRecursiveLock -#endif diff --git a/Pods/RxSwift/README.md b/Pods/RxSwift/README.md deleted file mode 100644 index c666142..0000000 --- a/Pods/RxSwift/README.md +++ /dev/null @@ -1,244 +0,0 @@ -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)](https://cocoapods.org/pods/RxSwift) [![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) - -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) -* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, and `ControlProperty` ... 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.
[Join Slack Channel](http://slack.rxswift.org) -* 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) -* Help out [Check out contribution guide](CONTRIBUTING.md) - -###### ... compare - -* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). - -###### ... understand the structure - -RxSwift comprises five separate components depending on eachother in the following way: - -```none -┌──────────────┐ ┌──────────────┐ -│ RxCocoa ├────▶ RxRelay │ -└───────┬──────┘ └──────┬───────┘ - │ │ -┌───────▼──────────────────▼───────┐ -│ RxSwift │ -└───────▲──────────────────▲───────┘ - │ │ -┌───────┴──────┐ ┌──────┴───────┐ -│ RxTest │ │ RxBlocking │ -└──────────────┘ └──────────────┘ -``` - -* **RxSwift**: The core of RxSwift, providing the Rx standard as (mostly) defined by [ReactiveX](https://reactivex.io). It has no other dependencies. -* **RxCocoa**: Provides Cocoa-specific capabilities for general iOS/macOS/watchOS & tvOS app development, such as Binders, Traits, and much more. It depends on both `RxSwift` and `RxRelay`. -* **RxRelay**: Provides `PublishRelay` and `BehaviorRelay`, two [simple wrappers around Subjects](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Subjects.md#relays). It depends on `RxSwift`. -* **RxTest** and **RxBlocking**: Provides testing capabilities for Rx-based systems. It depends on `RxSwift`. - -###### ... 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(.milliseconds(300), 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
-    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
-        (index, repository: Repository, cell) in
-        cell.textLabel?.text = repository.name
-        cell.detailTextLabel?.text = repository.url
-    }
-    .disposed(by: disposeBag)
- - -## Requirements - -* Xcode 10.2 -* Swift 5.0 - -For Xcode 10.1 and below, [use RxSwift 4.5](https://github.com/ReactiveX/RxSwift/releases/tag/4.5.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) - -```ruby -# Podfile -use_frameworks! - -target 'YOUR_TARGET_NAME' do - pod 'RxSwift', '~> 5' - pod 'RxCocoa', '~> 5' -end - -# RxTest and RxBlocking make the most sense in the context of unit/integration tests -target 'YOUR_TESTING_TARGET' do - pod 'RxBlocking', '~> 5' - pod 'RxTest', '~> 5' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```bash -$ pod install -``` - -### [Carthage](https://github.com/Carthage/Carthage) - -Officially supported: Carthage 0.33 and up. - -Add this to `Cartfile` - -``` -github "ReactiveX/RxSwift" ~> 5.0 -``` - -```bash -$ carthage update -``` - -#### Carthage as a Static Library - -Carthage defaults to building RxSwift as a Dynamic Library. - -If you wish to build RxSwift as a Static Library using Carthage you may use the script below to manually modify the framework type before building with Carthage: - -```bash -carthage update RxSwift --platform iOS --no-build -sed -i -e 's/MACH_O_TYPE = mh_dylib/MACH_O_TYPE = staticlib/g' Carthage/Checkouts/RxSwift/Rx.xcodeproj/project.pbxproj -carthage build RxSwift --platform iOS -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -Create a `Package.swift` file. - -```swift -// swift-tools-version:5.0 - -import PackageDescription - -let package = Package( - name: "RxTestProject", - dependencies: [ - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "5.0.0") - ], - targets: [ - .target(name: "RxTestProject", dependencies: ["RxSwift", "RxCocoa"]) - ] -) -``` - -```bash -$ swift build -``` - -To build or test a module with RxTest dependency, set `TEST=1`. - -```bash -$ TEST=1 swift test -``` - -### Manually using git submodules - -* Add RxSwift as a submodule - -```bash -$ 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) -* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift-reactive-programming-with-swift) -* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) -* [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 deleted file mode 100644 index 42aa09e..0000000 --- a/Pods/RxSwift/RxSwift/AnyObserver.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// AnyObserver.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 { - /// 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: Observer) where Observer.Element == 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 AnyObserver { - /// Collection of `AnyObserver`s - typealias s = Bag<(Event) -> Void> -} - -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 (Result) throws -> Element) -> AnyObserver { - return AnyObserver { e in - self.on(e.map(transform)) - } - } -} diff --git a/Pods/RxSwift/RxSwift/Cancelable.swift b/Pods/RxSwift/RxSwift/Cancelable.swift deleted file mode 100644 index 1fa7a67..0000000 --- a/Pods/RxSwift/RxSwift/Cancelable.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Cancelable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 deleted file mode 100644 index 80332db..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift +++ /dev/null @@ -1,102 +0,0 @@ -// -// AsyncLock.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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. -*/ -final 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() { - self._lock.lock() - } - - func unlock() { - self._lock.unlock() - } - // } - - private func enqueue(_ action: I) -> I? { - self._lock.lock(); defer { self._lock.unlock() } // { - if self._hasFaulted { - return nil - } - - if self._isExecuting { - self._queue.enqueue(action) - return nil - } - - self._isExecuting = true - - return action - // } - } - - private func dequeue() -> I? { - self._lock.lock(); defer { self._lock.unlock() } // { - if !self._queue.isEmpty { - return self._queue.dequeue() - } - else { - self._isExecuting = false - return nil - } - // } - } - - func invoke(_ action: I) { - let firstEnqueuedAction = self.enqueue(action) - - if let firstEnqueuedAction = firstEnqueuedAction { - firstEnqueuedAction.invoke() - } - else { - // action is enqueued, it's somebody else's concern now - return - } - - while true { - let nextAction = self.dequeue() - - if let nextAction = nextAction { - nextAction.invoke() - } - else { - return - } - } - } - - func dispose() { - self.synchronizedDispose() - } - - func _synchronized_dispose() { - self._queue = Queue(capacity: 0) - self._hasFaulted = true - } -} diff --git a/Pods/RxSwift/RxSwift/Concurrency/Lock.swift b/Pods/RxSwift/RxSwift/Concurrency/Lock.swift deleted file mode 100644 index b26f5b7..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/Lock.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// Lock.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol Lock { - func lock() - func unlock() -} - -// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html -typealias SpinLock = RecursiveLock - -extension RecursiveLock : Lock { - @inline(__always) - final func performLocked(_ action: () -> Void) { - self.lock(); defer { self.unlock() } - action() - } - - @inline(__always) - final func calculateLocked(_ action: () -> T) -> T { - self.lock(); defer { self.unlock() } - return action() - } - - @inline(__always) - final func calculateLockedOrFail(_ action: () throws -> T) throws -> T { - self.lock(); defer { self.unlock() } - let result = try action() - return result - } -} diff --git a/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift b/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift deleted file mode 100644 index ed6b28a..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// LockOwnerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol LockOwnerType : class, Lock { - var _lock: RecursiveLock { get } -} - -extension LockOwnerType { - func lock() { - self._lock.lock() - } - - func unlock() { - self._lock.unlock() - } -} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift deleted file mode 100644 index 0490a69..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SynchronizedDisposeType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedDisposeType : class, Disposable, Lock { - func _synchronized_dispose() -} - -extension SynchronizedDisposeType { - func synchronizedDispose() { - self.lock(); defer { self.unlock() } - self._synchronized_dispose() - } -} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift deleted file mode 100644 index bac051b..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SynchronizedOnType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedOnType : class, ObserverType, Lock { - func _synchronized_on(_ event: Event) -} - -extension SynchronizedOnType { - func synchronizedOn(_ event: Event) { - self.lock(); defer { self.unlock() } - self._synchronized_on(event) - } -} diff --git a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift b/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift deleted file mode 100644 index bb1aa7e..0000000 --- a/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// SynchronizedUnsubscribeType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedUnsubscribeType : class { - associatedtype DisposeKey - - func synchronizedUnsubscribe(_ disposeKey: DisposeKey) -} diff --git a/Pods/RxSwift/RxSwift/ConnectableObservableType.swift b/Pods/RxSwift/RxSwift/ConnectableObservableType.swift deleted file mode 100644 index 52bf93c..0000000 --- a/Pods/RxSwift/RxSwift/ConnectableObservableType.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ConnectableObservableType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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/Date+Dispatch.swift b/Pods/RxSwift/RxSwift/Date+Dispatch.swift deleted file mode 100644 index 0dc3ac3..0000000 --- a/Pods/RxSwift/RxSwift/Date+Dispatch.swift +++ /dev/null @@ -1,65 +0,0 @@ -// -// Date+Dispatch.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/14/19. -// Copyright © 2019 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import struct Foundation.TimeInterval -import enum Dispatch.DispatchTimeInterval - -extension DispatchTimeInterval { - var convertToSecondsFactor: Double { - switch self { - case .nanoseconds: return 1_000_000_000.0 - case .microseconds: return 1_000_000.0 - case .milliseconds: return 1_000.0 - case .seconds: return 1.0 - case .never: fatalError() - @unknown default: fatalError() - } - } - - func map(_ transform: (Int, Double) -> Int) -> DispatchTimeInterval { - switch self { - case .nanoseconds(let value): return .nanoseconds(transform(value, 1_000_000_000.0)) - case .microseconds(let value): return .microseconds(transform(value, 1_000_000.0)) - case .milliseconds(let value): return .milliseconds(transform(value, 1_000.0)) - case .seconds(let value): return .seconds(transform(value, 1.0)) - case .never: return .never - @unknown default: fatalError() - } - } - - var isNow: Bool { - switch self { - case .nanoseconds(let value), .microseconds(let value), .milliseconds(let value), .seconds(let value): return value == 0 - case .never: return false - @unknown default: fatalError() - } - } - - internal func reduceWithSpanBetween(earlierDate: Date, laterDate: Date) -> DispatchTimeInterval { - return self.map { value, factor in - let interval = laterDate.timeIntervalSince(earlierDate) - let remainder = Double(value) - interval * factor - guard remainder > 0 else { return 0 } - return Int(remainder.rounded(.toNearestOrAwayFromZero)) - } - } -} - -extension Date { - - internal func addingDispatchInterval(_ dispatchInterval: DispatchTimeInterval) -> Date { - switch dispatchInterval { - case .nanoseconds(let value), .microseconds(let value), .milliseconds(let value), .seconds(let value): - return self.addingTimeInterval(TimeInterval(value) / dispatchInterval.convertToSecondsFactor) - case .never: return Date.distantFuture - @unknown default: fatalError() - } - } - -} diff --git a/Pods/RxSwift/RxSwift/Deprecated.swift b/Pods/RxSwift/RxSwift/Deprecated.swift deleted file mode 100644 index e5f2ef6..0000000 --- a/Pods/RxSwift/RxSwift/Deprecated.swift +++ /dev/null @@ -1,581 +0,0 @@ -// -// Deprecated.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/5/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -import Foundation - -extension Observable { - /** - 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. - */ - @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:)") - public static func from(_ optional: Element?) -> Observable { - return Observable.from(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: Scheduler to send the optional element on. - - returns: An observable sequence containing the wrapped value or not from given optional. - */ - @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:scheduler:)") - public static func from(_ optional: Element?, scheduler: ImmediateSchedulerType) -> Observable { - return Observable.from(optional: optional, scheduler: scheduler) - } -} - -extension ObservableType { - /** - - 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. - */ - @available(*, deprecated, message: "Please use enumerated().map()") - public func mapWithIndex(_ selector: @escaping (Element, Int) throws -> Result) - -> Observable { - return self.enumerated().map { try selector($0.element, $0.index) } - } - - - /** - - 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. - */ - @available(*, deprecated, message: "Please use enumerated().flatMap()") - public func flatMapWithIndex(_ selector: @escaping (Element, Int) throws -> Source) - -> Observable { - return self.enumerated().flatMap { try selector($0.element, $0.index) } - } - - /** - - 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. - */ - @available(*, deprecated, message: "Please use enumerated().skipWhile().map()") - public func skipWhileWithIndex(_ predicate: @escaping (Element, Int) throws -> Bool) -> Observable { - return self.enumerated().skipWhile { try predicate($0.element, $0.index) }.map { $0.element } - } - - - /** - - 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. - */ - @available(*, deprecated, message: "Please use enumerated().takeWhile().map()") - public func takeWhileWithIndex(_ predicate: @escaping (Element, Int) throws -> Bool) -> Observable { - return self.enumerated().takeWhile { try predicate($0.element, $0.index) }.map { $0.element } - } -} - -extension Disposable { - /// Deprecated in favor of `disposed(by:)` - /// - /// - /// Adds `self` to `bag`. - /// - /// - parameter bag: `DisposeBag` to add `self` to. - @available(*, deprecated, message: "use disposed(by:) instead", renamed: "disposed(by:)") - public func addDisposableTo(_ bag: DisposeBag) { - self.disposed(by: bag) - } -} - - -extension ObservableType { - - /** - 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. - - - 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. - */ - @available(*, deprecated, message: "use share(replay: 1) instead", renamed: "share(replay:)") - public func shareReplayLatestWhileConnected() - -> Observable { - return self.share(replay: 1, scope: .whileConnected) - } -} - - -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. - */ - @available(*, deprecated, message: "Suggested replacement is `share(replay: 1)`. In case old 3.x behavior of `shareReplay` is required please use `share(replay: 1, scope: .forever)` instead.", renamed: "share(replay:)") - public func shareReplay(_ bufferSize: Int) - -> Observable { - return self.share(replay: bufferSize, scope: .forever) - } -} - -/// Variable is a wrapper for `BehaviorSubject`. -/// -/// Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated -/// it will complete its observable sequence (`asObservable`). -/// -/// **This concept will be deprecated from RxSwift but offical migration path hasn't been decided yet.** -/// https://github.com/ReactiveX/RxSwift/issues/1501 -/// -/// Current recommended replacement for this API is `RxCocoa.BehaviorRelay` because: -/// * `Variable` isn't a standard cross platform concept, hence it's out of place in RxSwift target. -/// * It doesn't have a counterpart for handling events (`PublishRelay`). It models state only. -/// * It doesn't have a consistent naming with *Relay or other Rx concepts. -/// * It has an inconsistent memory management model compared to other parts of RxSwift (completes on `deinit`). -/// -/// Once plans are finalized, official availability attribute will be added in one of upcoming versions. -@available(*, deprecated, message: "Variable is deprecated. Please use `BehaviorRelay` as a replacement.") -public final class Variable { - private let _subject: BehaviorSubject - - private var _lock = SpinLock() - - // state - private var _value: Element - - #if DEBUG - private let _synchronizationTracker = SynchronizationTracker() - #endif - - /// Gets or sets current value of variable. - /// - /// Whenever a new value is set, all the observers are notified of the change. - /// - /// Even if the newly set value is same as the old value, observers are still notified for change. - public var value: Element { - get { - self._lock.lock(); defer { self._lock.unlock() } - return self._value - } - set(newValue) { - #if DEBUG - self._synchronizationTracker.register(synchronizationErrorMessage: .variable) - defer { self._synchronizationTracker.unregister() } - #endif - self._lock.lock() - self._value = newValue - self._lock.unlock() - - self._subject.on(.next(newValue)) - } - } - - /// Initializes variable with initial value. - /// - /// - parameter value: Initial variable value. - public init(_ value: Element) { - self._value = value - self._subject = BehaviorSubject(value: value) - } - - /// - returns: Canonical interface for push style sequence - public func asObservable() -> Observable { - return self._subject - } - - deinit { - self._subject.on(.completed) - } -} - -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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "delay(_:scheduler:)") - public func delay(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return self.delay(.milliseconds(Int(dueTime * 1000.0)), scheduler: scheduler) - } -} - -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 `RxError.timeout` in case of a timeout. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timeout(_:scheduler:)") - public func timeout(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return timeout(.milliseconds(Int(dueTime * 1000.0)), 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timeout(_:other:scheduler:)") - public func timeout(_ dueTime: Foundation.TimeInterval, other: OtherSource, scheduler: SchedulerType) - -> Observable where Element == OtherSource.Element { - return timeout(.milliseconds(Int(dueTime * 1000.0)), other: other, scheduler: scheduler) - } -} - -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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "skip(_:scheduler:)") - public func skip(_ duration: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return skip(.milliseconds(Int(duration * 1000.0)), scheduler: scheduler) - } -} - -extension ObservableType where Element : RxAbstractInteger { - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "interval(_:scheduler:)") - public static func interval(_ period: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return interval(.milliseconds(Int(period * 1000.0)), scheduler: scheduler) - } -} - -extension ObservableType where Element: RxAbstractInteger { - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timer(_:period:scheduler:)") - public static func timer(_ dueTime: Foundation.TimeInterval, period: Foundation.TimeInterval? = nil, scheduler: SchedulerType) - -> Observable { - return timer(.milliseconds(Int(dueTime * 1000.0)), period: period.map { .milliseconds(Int($0 * 1000.0)) }, scheduler: scheduler) - } -} - -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 on. - - returns: The throttled sequence. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "throttle(_:latest:scheduler:)") - public func throttle(_ dueTime: Foundation.TimeInterval, latest: Bool = true, scheduler: SchedulerType) - -> Observable { - return throttle(.milliseconds(Int(dueTime * 1000.0)), latest: latest, scheduler: scheduler) - } -} - -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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "take(_:scheduler:)") - public func take(_ duration: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return take(.milliseconds(Int(duration * 1000.0)), scheduler: scheduler) - } -} - - -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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "delaySubscription(_:scheduler:)") - public func delaySubscription(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> Observable { - return delaySubscription(.milliseconds(Int(dueTime * 1000.0)), scheduler: scheduler) - } -} - -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`). - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "window(_:)") - public func window(timeSpan: Foundation.TimeInterval, count: Int, scheduler: SchedulerType) - -> Observable> { - return window(timeSpan: .milliseconds(Int(timeSpan * 1000.0)), count: count, scheduler: scheduler) - } -} - - -extension PrimitiveSequence { - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "delay(_:scheduler:)") - public func delay(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> PrimitiveSequence { - return delay(.milliseconds(Int(dueTime * 1000.0)), scheduler: scheduler) - } - - /** - 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "delaySubscription(_:scheduler:)") - public func delaySubscription(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> PrimitiveSequence { - return delaySubscription(.milliseconds(Int(dueTime * 1000.0)), scheduler: scheduler) - } - - /** - 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 `RxError.timeout` in case of a timeout. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timeout(_:scheduler:)") - public func timeout(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> PrimitiveSequence { - return timeout(.milliseconds(Int(dueTime * 1000.0)), 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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timeout(_:other:scheduler:)") - public func timeout(_ dueTime: Foundation.TimeInterval, - other: PrimitiveSequence, - scheduler: SchedulerType) -> PrimitiveSequence { - return timeout(.milliseconds(Int(dueTime * 1000.0)), other: other, scheduler: scheduler) - } -} - -extension PrimitiveSequenceType where Trait == SingleTrait { - - /** - 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 onSubscribe: Action to invoke before subscribing to source observable sequence. - - parameter onSubscribed: Action to invoke after 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. - */ - @available(*, deprecated, renamed: "do(onSuccess:onError:onSubscribe:onSubscribed:onDispose:)") - public func `do`(onNext: ((Element) throws -> Void)?, - onError: ((Swift.Error) throws -> Void)? = nil, - onSubscribe: (() -> Void)? = nil, - onSubscribed: (() -> Void)? = nil, - onDispose: (() -> Void)? = nil) - -> Single { - return self.`do`( - onSuccess: onNext, - onError: onError, - onSubscribe: onSubscribe, - onSubscribed: onSubscribed, - onDispose: onDispose - ) - } -} - -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. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "buffer(timeSpan:count:scheduler:)") - public func buffer(timeSpan: Foundation.TimeInterval, count: Int, scheduler: SchedulerType) - -> Observable<[Element]> { - return buffer(timeSpan: .milliseconds(Int(timeSpan * 1000.0)), count: count, scheduler: scheduler) - } -} - -extension PrimitiveSequenceType where Element: RxAbstractInteger -{ - /** - 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 scheduler: Scheduler to run timers on. - - returns: An observable sequence that produces a value after due time has elapsed and then each period. - */ - @available(*, deprecated, message: "Use DispatchTimeInterval overload instead.", renamed: "timer(_:scheduler:)") - public static func timer(_ dueTime: Foundation.TimeInterval, scheduler: SchedulerType) - -> PrimitiveSequence { - return timer(.milliseconds(Int(dueTime * 1000.0)), scheduler: scheduler) - } -} - -extension Completable { - /** - Merges the completion of all Completables from a collection into a single Completable. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of Completables to merge. - - returns: A Completable that merges the completion of all Completables. - */ - @available(*, deprecated, message: "Use Completable.zip instead.", renamed: "zip") - public static func merge(_ sources: Collection) -> Completable - where Collection.Element == Completable { - return zip(sources) - } - - /** - Merges the completion of all Completables from an array into a single Completable. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Array of observable sequences to merge. - - returns: A Completable that merges the completion of all Completables. - */ - @available(*, deprecated, message: "Use Completable.zip instead.", renamed: "zip") - public static func merge(_ sources: [Completable]) -> Completable { - return zip(sources) - } - - /** - Merges the completion of all Completables into a single Completable. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - @available(*, deprecated, message: "Use Completable.zip instead.", renamed: "zip") - public static func merge(_ sources: Completable...) -> Completable { - return zip(sources) - } -} diff --git a/Pods/RxSwift/RxSwift/Disposable.swift b/Pods/RxSwift/RxSwift/Disposable.swift deleted file mode 100644 index b79c77a..0000000 --- a/Pods/RxSwift/RxSwift/Disposable.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Disposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents 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 deleted file mode 100644 index 84e42b5..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// AnonymousDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an Action-based disposable. -/// -/// When dispose method is called, disposal action will be dereferenced. -private final class AnonymousDisposable : DisposeBase, Cancelable { - public typealias DisposeAction = () -> Void - - private let _isDisposed = AtomicInt(0) - private var _disposeAction: DisposeAction? - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return isFlagSet(self._isDisposed, 1) - } - - /// Constructs a new disposable with the given action used for disposal. - /// - /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. - private init(_ disposeAction: @escaping DisposeAction) { - self._disposeAction = disposeAction - super.init() - } - - // Non-deprecated version of the constructor, used by `Disposables.create(with:)` - fileprivate init(disposeAction: @escaping DisposeAction) { - self._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 fetchOr(self._isDisposed, 1) == 0 { - if let action = self._disposeAction { - self._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 () -> Void) -> Cancelable { - return AnonymousDisposable(disposeAction: dispose) - } - -} diff --git a/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift deleted file mode 100644 index 5693268..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// BinaryDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents two disposable resources that are disposed together. -private final class BinaryDisposable : DisposeBase, Cancelable { - - private let _isDisposed = AtomicInt(0) - - // state - private var _disposable1: Disposable? - private var _disposable2: Disposable? - - /// - returns: Was resource disposed. - var isDisposed: Bool { - return isFlagSet(self._isDisposed, 1) - } - - /// Constructs new binary disposable from two disposables. - /// - /// - parameter disposable1: First disposable - /// - parameter disposable2: Second disposable - init(_ disposable1: Disposable, _ disposable2: Disposable) { - self._disposable1 = disposable1 - self._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 fetchOr(self._isDisposed, 1) == 0 { - self._disposable1?.dispose() - self._disposable2?.dispose() - self._disposable1 = nil - self._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 deleted file mode 100644 index a0f5c2f..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// BooleanDisposable.swift -// RxSwift -// -// Created by Junior B. on 10/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable resource that can be checked for disposal status. -public final class BooleanDisposable : 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 self._isDisposed - } - - /// Sets the status to disposed, which can be observer through the `isDisposed` property. - public func dispose() { - self._isDisposed = true - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift deleted file mode 100644 index ce0da6a..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift +++ /dev/null @@ -1,151 +0,0 @@ -// -// CompositeDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/20/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a group of disposable resources that are disposed together. -public final class CompositeDisposable : DisposeBase, 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 { - self._lock.lock(); defer { self._lock.unlock() } - return self._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. - _ = self._disposables!.insert(disposable1) - _ = self._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. - _ = self._disposables!.insert(disposable1) - _ = self._disposables!.insert(disposable2) - _ = self._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. - _ = self._disposables!.insert(disposable1) - _ = self._disposables!.insert(disposable2) - _ = self._disposables!.insert(disposable3) - _ = self._disposables!.insert(disposable4) - - for disposable in disposables { - _ = self._disposables!.insert(disposable) - } - } - - /// Initializes a new instance of composite disposable with the specified number of disposables. - public init(disposables: [Disposable]) { - for disposable in disposables { - _ = self._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 = self._insert(disposable) - - if key == nil { - disposable.dispose() - } - - return key - } - - private func _insert(_ disposable: Disposable) -> DisposeKey? { - self._lock.lock(); defer { self._lock.unlock() } - - let bagKey = self._disposables?.insert(disposable) - return bagKey.map(DisposeKey.init) - } - - /// - returns: Gets the number of disposables contained in the `CompositeDisposable`. - public var count: Int { - self._lock.lock(); defer { self._lock.unlock() } - return self._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) { - self._remove(for: disposeKey)?.dispose() - } - - private func _remove(for disposeKey: DisposeKey) -> Disposable? { - self._lock.lock(); defer { self._lock.unlock() } - return self._disposables?.removeKey(disposeKey.key) - } - - /// Disposes all disposables in the group and removes them from the group. - public func dispose() { - if let disposables = self._dispose() { - disposeAll(in: disposables) - } - } - - private func _dispose() -> Bag? { - self._lock.lock(); defer { self._lock.unlock() } - - let disposeBag = self._disposables - self._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 deleted file mode 100644 index 8cd6e28..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/Disposables.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Disposables.swift -// RxSwift -// -// Created by Mohsen Ramezanpoor on 01/08/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -/// 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 deleted file mode 100644 index ee1e728..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift +++ /dev/null @@ -1,114 +0,0 @@ -// -// DisposeBag.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Disposable { - /// Adds `self` to `bag` - /// - /// - parameter bag: `DisposeBag` to add `self` to. - public func disposed(by 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) { - self._insert(disposable)?.dispose() - } - - private func _insert(_ disposable: Disposable) -> Disposable? { - self._lock.lock(); defer { self._lock.unlock() } - if self._isDisposed { - return disposable - } - - self._disposables.append(disposable) - - return nil - } - - /// This is internal on purpose, take a look at `CompositeDisposable` instead. - private func dispose() { - let oldDisposables = self._dispose() - - for disposable in oldDisposables { - disposable.dispose() - } - } - - private func _dispose() -> [Disposable] { - self._lock.lock(); defer { self._lock.unlock() } - - let disposables = self._disposables - - self._disposables.removeAll(keepingCapacity: false) - self._isDisposed = true - - return disposables - } - - deinit { - self.dispose() - } -} - -extension DisposeBag { - - /// Convenience init allows a list of disposables to be gathered for disposal. - public convenience init(disposing disposables: Disposable...) { - self.init() - self._disposables += disposables - } - - /// Convenience init allows an array of disposables to be gathered for disposal. - public convenience init(disposing disposables: [Disposable]) { - self.init() - self._disposables += disposables - } - - /// Convenience function allows a list of disposables to be gathered for disposal. - public func insert(_ disposables: Disposable...) { - self.insert(disposables) - } - - /// Convenience function allows an array of disposables to be gathered for disposal. - public func insert(_ disposables: [Disposable]) { - self._lock.lock(); defer { self._lock.unlock() } - if self._isDisposed { - disposables.forEach { $0.dispose() } - } else { - self._disposables += disposables - } - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift b/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift deleted file mode 100644 index 0d4b2fb..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// DisposeBase.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/4/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Base class for all disposables. -public class DisposeBase { - init() { -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - } - - deinit { -#if TRACE_RESOURCES - _ = Resources.decrementTotal() -#endif - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift deleted file mode 100644 index 729c5fa..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// NopDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable that does nothing on disposal. -/// -/// Nop = No Operation -private struct NopDisposable : Disposable { - - fileprivate static let noOp: Disposable = NopDisposable() - - private 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 deleted file mode 100644 index 922f20a..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift +++ /dev/null @@ -1,113 +0,0 @@ -// -// RefCountDisposable.swift -// RxSwift -// -// Created by Junior B. on 10/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 { - self._lock.lock(); defer { self._lock.unlock() } - return self._disposable == nil - } - - /// Initializes a new instance of the `RefCountDisposable`. - public init(disposable: Disposable) { - self._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 self._lock.calculateLocked { - if self._disposable != nil { - do { - _ = try incrementChecked(&self._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? = self._lock.calculateLocked { - if let oldDisposable = self._disposable, !self._primaryDisposed { - self._primaryDisposed = true - - if self._count == 0 { - self._disposable = nil - return oldDisposable - } - } - - return nil - } - - if let disposable = oldDisposable { - disposable.dispose() - } - } - - fileprivate func release() { - let oldDisposable: Disposable? = self._lock.calculateLocked { - if let oldDisposable = self._disposable { - do { - _ = try decrementChecked(&self._count) - } catch { - rxFatalError("RefCountDisposable decrement on release failed") - } - - guard self._count >= 0 else { - rxFatalError("RefCountDisposable counter is lower than 0") - } - - if self._primaryDisposed && self._count == 0 { - self._disposable = nil - return oldDisposable - } - } - - return nil - } - - if let disposable = oldDisposable { - disposable.dispose() - } - } -} - -internal final class RefCountInnerDisposable: DisposeBase, Disposable -{ - private let _parent: RefCountDisposable - private let _isDisposed = AtomicInt(0) - - init(_ parent: RefCountDisposable) { - self._parent = parent - super.init() - } - - internal func dispose() - { - if fetchOr(self._isDisposed, 1) == 0 { - self._parent.release() - } - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift deleted file mode 100644 index c834f5b..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// ScheduledDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 let _isDisposed = AtomicInt(0) - - // state - private var _disposable: Disposable? - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return isFlagSet(self._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 - self._disposable = disposable - } - - /// Disposes the wrapped disposable on the provided scheduler. - public func dispose() { - _ = self.scheduler.schedule(self, action: disposeScheduledDisposable) - } - - func disposeInner() { - if fetchOr(self._isDisposed, 1) == 0 { - self._disposable!.dispose() - self._disposable = nil - } - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift deleted file mode 100644 index 22dce36..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// SerialDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 self._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 self._lock.calculateLocked { - return self._current ?? Disposables.create() - } - } - set (newDisposable) { - let disposable: Disposable? = self._lock.calculateLocked { - if self._isDisposed { - return newDisposable - } - else { - let toDispose = self._current - self._current = newDisposable - return toDispose - } - } - - if let disposable = disposable { - disposable.dispose() - } - } - } - - /// Disposes the underlying disposable as well as all future replacements. - public func dispose() { - self._dispose()?.dispose() - } - - private func _dispose() -> Disposable? { - self._lock.lock(); defer { self._lock.unlock() } - if self._isDisposed { - return nil - } - else { - self._isDisposed = true - let current = self._current - self._current = nil - return current - } - } -} diff --git a/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift deleted file mode 100644 index ca8e604..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift +++ /dev/null @@ -1,70 +0,0 @@ -// -// SingleAssignmentDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -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 final class SingleAssignmentDisposable : DisposeBase, Cancelable { - - private enum DisposeState: Int32 { - case disposed = 1 - case disposableSet = 2 - } - - // state - private let _state = AtomicInt(0) - private var _disposable = nil as Disposable? - - /// - returns: A value that indicates whether the object is disposed. - public var isDisposed: Bool { - return isFlagSet(self._state, DisposeState.disposed.rawValue) - } - - /// 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) { - self._disposable = disposable - - let previousState = fetchOr(self._state, DisposeState.disposableSet.rawValue) - - if (previousState & DisposeState.disposableSet.rawValue) != 0 { - rxFatalError("oldState.disposable != nil") - } - - if (previousState & DisposeState.disposed.rawValue) != 0 { - disposable.dispose() - self._disposable = nil - } - } - - /// Disposes the underlying disposable. - public func dispose() { - let previousState = fetchOr(self._state, DisposeState.disposed.rawValue) - - if (previousState & DisposeState.disposed.rawValue) != 0 { - return - } - - if (previousState & DisposeState.disposableSet.rawValue) != 0 { - guard let disposable = self._disposable else { - rxFatalError("Disposable not set") - } - disposable.dispose() - self._disposable = nil - } - } - -} diff --git a/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift b/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift deleted file mode 100644 index 430e4c6..0000000 --- a/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// SubscriptionDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct SubscriptionDisposable : Disposable { - private let _key: T.DisposeKey - private weak var _owner: T? - - init(owner: T, key: T.DisposeKey) { - self._owner = owner - self._key = key - } - - func dispose() { - self._owner?.synchronizedUnsubscribe(self._key) - } -} diff --git a/Pods/RxSwift/RxSwift/Errors.swift b/Pods/RxSwift/RxSwift/Errors.swift deleted file mode 100644 index d2d2917..0000000 --- a/Pods/RxSwift/RxSwift/Errors.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// Errors.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -let RxErrorDomain = "RxErrorDomain" -let RxCompositeFailures = "RxCompositeFailures" - -/// Generic Rx error codes. -public enum RxError - : Swift.Error - , CustomDebugStringConvertible { - /// Unknown error occurred. - case unknown - /// Performing an action on disposed object. - case disposed(object: AnyObject) - /// Arithmetic 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 occurred." - case .disposed(let object): - return "Object `\(object)` was already disposed." - case .overflow: - return "Arithmetic overflow occurred." - 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 deleted file mode 100644 index 132170d..0000000 --- a/Pods/RxSwift/RxSwift/Event.swift +++ /dev/null @@ -1,109 +0,0 @@ -// -// Event.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 { - /// 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 - } - - /// If `completed` event, returns `true`. - public var isCompleted: Bool { - if case .completed = self { - return true - } - return false - } -} - -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) - } - } -} - -/// A type that can be converted to `Event`. -public protocol EventConvertible { - /// Type of element in event - associatedtype Element - - @available(*, deprecated, renamed: "Element") - typealias ElementType = Element - - /// Event representation of this instance - var event: Event { get } -} - -extension Event: EventConvertible { - /// Event representation of this instance - public var event: Event { - return self - } -} diff --git a/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift b/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift deleted file mode 100644 index 9794683..0000000 --- a/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// Bag+Rx.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/19/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - - -// MARK: forEach - -@inline(__always) -func dispatch(_ bag: Bag<(Event) -> Void>, _ event: Event) { - bag._value0?(event) - - if bag._onlyFastPath { - return - } - - let pairs = bag._pairs - for i in 0 ..< pairs.count { - pairs[i].value(event) - } - - if let dictionary = bag._dictionary { - for element in dictionary.values { - element(event) - } - } -} - -/// Dispatches `dispose` to all disposables contained inside bag. -func disposeAll(in bag: Bag) { - bag._value0?.dispose() - - if bag._onlyFastPath { - return - } - - let pairs = bag._pairs - for i in 0 ..< pairs.count { - pairs[i].value.dispose() - } - - if let dictionary = bag._dictionary { - for element in dictionary.values { - element.dispose() - } - } -} diff --git a/Pods/RxSwift/RxSwift/GroupedObservable.swift b/Pods/RxSwift/RxSwift/GroupedObservable.swift deleted file mode 100644 index 34a2fc2..0000000 --- a/Pods/RxSwift/RxSwift/GroupedObservable.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// GroupedObservable.swift -// RxSwift -// -// Created by Tomi Koskinen on 01/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an observable sequence of elements that have a common key. -public struct GroupedObservable : ObservableType { - /// Gets the common key. - public let key: Key - - private let source: Observable - - /// Initializes grouped observable sequence with key and source observable sequence. - /// - /// - parameter key: Grouped observable sequence key - /// - parameter source: Observable sequence that represents sequence of elements for the key - /// - returns: Grouped observable sequence of elements for the specific key - public init(key: Key, source: Observable) { - self.key = key - self.source = source - } - - /// Subscribes `observer` to receive events for this sequence. - public func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - return self.source.subscribe(observer) - } - - /// Converts `self` to `Observable` sequence. - public func asObservable() -> Observable { - return self.source - } -} diff --git a/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift b/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift deleted file mode 100644 index 954fbf0..0000000 --- a/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ImmediateSchedulerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an object that immediately schedules units of work. -public protocol ImmediateSchedulerType { - /** - Schedules an action to be executed immediately. - - - 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) -> Void) -> Void) -> 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 deleted file mode 100644 index 52ba80a..0000000 --- a/Pods/RxSwift/RxSwift/Observable.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Observable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// A type-erased `ObservableType`. -/// -/// It represents a push style sequence. -public class Observable : ObservableType { - init() { -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - } - - public func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - rxAbstractMethod() - } - - public func asObservable() -> Observable { - return self - } - - deinit { -#if TRACE_RESOURCES - _ = Resources.decrementTotal() -#endif - } -} - diff --git a/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift b/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift deleted file mode 100644 index 37e1b7f..0000000 --- a/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// ObservableConvertibleType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Type that can be converted to observable sequence (`Observable`). -public protocol ObservableConvertibleType { - /// Type of elements in sequence. - associatedtype Element - - @available(*, deprecated, renamed: "Element") - typealias E = Element - - /// 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 deleted file mode 100644 index 9d098e7..0000000 --- a/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift +++ /dev/null @@ -1,134 +0,0 @@ -// -// ObservableType+Extensions.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if DEBUG - import Foundation -#endif - -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.asObservable().subscribe(observer) - } - - - /** - 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 canceled by disposing subscription). - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func subscribe(onNext: ((Element) -> 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() - } - - #if DEBUG - let synchronizationTracker = SynchronizationTracker() - #endif - - let callStack = Hooks.recordCallStackOnError ? Hooks.customCaptureSubscriptionCallstack() : [] - - let observer = AnonymousObserver { event in - - #if DEBUG - synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { synchronizationTracker.unregister() } - #endif - - switch event { - case .next(let value): - onNext?(value) - case .error(let error): - if let onError = onError { - onError(error) - } - else { - Hooks.defaultErrorHandler(callStack, error) - } - disposable.dispose() - case .completed: - onCompleted?() - disposable.dispose() - } - } - return Disposables.create( - self.asObservable().subscribe(observer), - disposable - ) - } -} - -import class Foundation.NSRecursiveLock - -extension Hooks { - public typealias DefaultErrorHandler = (_ subscriptionCallStack: [String], _ error: Error) -> Void - public typealias CustomCaptureSubscriptionCallstack = () -> [String] - - private static let _lock = RecursiveLock() - private static var _defaultErrorHandler: DefaultErrorHandler = { subscriptionCallStack, error in - #if DEBUG - let serializedCallStack = subscriptionCallStack.joined(separator: "\n") - print("Unhandled error happened: \(error)") - if !serializedCallStack.isEmpty { - print("subscription called from:\n\(serializedCallStack)") - } - #endif - } - private static var _customCaptureSubscriptionCallstack: CustomCaptureSubscriptionCallstack = { - #if DEBUG - return Thread.callStackSymbols - #else - return [] - #endif - } - - /// Error handler called in case onError handler wasn't provided. - public static var defaultErrorHandler: DefaultErrorHandler { - get { - _lock.lock(); defer { _lock.unlock() } - return _defaultErrorHandler - } - set { - _lock.lock(); defer { _lock.unlock() } - _defaultErrorHandler = newValue - } - } - - /// Subscription callstack block to fetch custom callstack information. - public static var customCaptureSubscriptionCallstack: CustomCaptureSubscriptionCallstack { - get { - _lock.lock(); defer { _lock.unlock() } - return _customCaptureSubscriptionCallstack - } - set { - _lock.lock(); defer { _lock.unlock() } - _customCaptureSubscriptionCallstack = newValue - } - } -} - diff --git a/Pods/RxSwift/RxSwift/ObservableType.swift b/Pods/RxSwift/RxSwift/ObservableType.swift deleted file mode 100644 index dea9bfc..0000000 --- a/Pods/RxSwift/RxSwift/ObservableType.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// ObservableType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a push style sequence. -public protocol ObservableType: ObservableConvertibleType { - /** - 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 immediately, 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: Observer) -> Disposable where Observer.Element == Element -} - -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/AddRef.swift b/Pods/RxSwift/RxSwift/Observables/AddRef.swift deleted file mode 100644 index 2c937a4..0000000 --- a/Pods/RxSwift/RxSwift/Observables/AddRef.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// AddRef.swift -// RxSwift -// -// Created by Junior B. on 30/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -final class AddRefSink : Sink, ObserverType { - typealias Element = Observer.Element - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next: - self.forwardOn(event) - case .completed, .error: - self.forwardOn(event) - self.dispose() - } - } -} - -final class AddRef : Producer { - - private let _source: Observable - private let _refCount: RefCountDisposable - - init(source: Observable, refCount: RefCountDisposable) { - self._source = source - self._refCount = refCount - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let releaseDisposable = self._refCount.retain() - let sink = AddRefSink(observer: observer, cancel: cancel) - let subscription = Disposables.create(releaseDisposable, self._source.subscribe(sink)) - - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Amb.swift b/Pods/RxSwift/RxSwift/Observables/Amb.swift deleted file mode 100644 index 1a6dc40..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Amb.swift +++ /dev/null @@ -1,157 +0,0 @@ -// -// Amb.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Sequence) -> Observable - where Sequence.Element == Observable { - return sequence.reduce(Observable.never()) { a, o in - return a.amb(o.asObservable()) - } - } -} - -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.Element == Element { - return Amb(left: self.asObservable(), right: right.asObservable()) - } -} - -private enum AmbState { - case neither - case left - case right -} - -final private class AmbObserver: ObserverType { - typealias Element = Observer.Element - typealias Parent = AmbSink - typealias This = AmbObserver - typealias Sink = (This, Event) -> Void - - private let _parent: Parent - fileprivate var _sink: Sink - fileprivate var _cancel: Disposable - - init(parent: Parent, cancel: Disposable, sink: @escaping Sink) { -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - - self._parent = parent - self._sink = sink - self._cancel = cancel - } - - func on(_ event: Event) { - self._sink(self, event) - if event.isStopEvent { - self._cancel.dispose() - } - } - - deinit { -#if TRACE_RESOURCES - _ = Resources.decrementTotal() -#endif - } -} - -final private class AmbSink: Sink { - typealias Element = Observer.Element - typealias Parent = Amb - typealias AmbObserverType = AmbObserver - - private let _parent: Parent - - private let _lock = RecursiveLock() - // state - private var _choice = AmbState.neither - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._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) - if event.isStopEvent { - self.dispose() - } - } - - 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(self._parent._left.subscribe(sink1)) - subscription2.setDisposable(self._parent._right.subscribe(sink2)) - - return disposeAll - } -} - -final private class Amb: Producer { - fileprivate let _left: Observable - fileprivate let _right: Observable - - init(left: Observable, right: Observable) { - self._left = left - self._right = right - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/AsMaybe.swift b/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift deleted file mode 100644 index 96f30ae..0000000 --- a/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// AsMaybe.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -private final class AsMaybeSink : Sink, ObserverType { - typealias Element = Observer.Element - - private var _element: Event? - - func on(_ event: Event) { - switch event { - case .next: - if self._element != nil { - self.forwardOn(.error(RxError.moreThanOneElement)) - self.dispose() - } - - self._element = event - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - if let element = self._element { - self.forwardOn(element) - } - self.forwardOn(.completed) - self.dispose() - } - } -} - -final class AsMaybe: Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = AsMaybeSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/AsSingle.swift b/Pods/RxSwift/RxSwift/Observables/AsSingle.swift deleted file mode 100644 index a46dad8..0000000 --- a/Pods/RxSwift/RxSwift/Observables/AsSingle.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// AsSingle.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -private final class AsSingleSink : Sink, ObserverType { - typealias Element = Observer.Element - - private var _element: Event? - - func on(_ event: Event) { - switch event { - case .next: - if self._element != nil { - self.forwardOn(.error(RxError.moreThanOneElement)) - self.dispose() - } - - self._element = event - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - if let element = self._element { - self.forwardOn(element) - self.forwardOn(.completed) - } - else { - self.forwardOn(.error(RxError.noElements)) - } - self.dispose() - } - } -} - -final class AsSingle: Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = AsSingleSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Buffer.swift b/Pods/RxSwift/RxSwift/Observables/Buffer.swift deleted file mode 100644 index 0eb65f3..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Buffer.swift +++ /dev/null @@ -1,138 +0,0 @@ -// -// Buffer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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<[Element]> { - return BufferTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) - } -} - -final private 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) { - self._source = source - self._timeSpan = timeSpan - self._count = count - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == [Element] { - let sink = BufferTimeCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final private class BufferTimeCountSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType where Observer.Element == [Element] { - typealias Parent = BufferTimeCount - - private let _parent: Parent - - let _lock = RecursiveLock() - - // state - private let _timerD = SerialDisposable() - private var _buffer = [Element]() - private var _windowID = 0 - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - self.createTimer(self._windowID) - return Disposables.create(_timerD, _parent._source.subscribe(self)) - } - - func startNewWindowAndSendCurrentOne() { - self._windowID = self._windowID &+ 1 - let windowID = self._windowID - - let buffer = self._buffer - self._buffer = [] - self.forwardOn(.next(buffer)) - - self.createTimer(windowID) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - self._buffer.append(element) - - if self._buffer.count == self._parent._count { - self.startNewWindowAndSendCurrentOne() - } - - case .error(let error): - self._buffer = [] - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.next(self._buffer)) - self.forwardOn(.completed) - self.dispose() - } - } - - func createTimer(_ windowID: Int) { - if self._timerD.isDisposed { - return - } - - if self._windowID != windowID { - return - } - - let nextTimer = SingleAssignmentDisposable() - - self._timerD.disposable = nextTimer - - let disposable = self._parent._scheduler.scheduleRelative(windowID, dueTime: self._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/Catch.swift b/Pods/RxSwift/RxSwift/Observables/Catch.swift deleted file mode 100644 index 84569ec..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Catch.swift +++ /dev/null @@ -1,235 +0,0 @@ -// -// Catch.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: self.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: Element) - -> Observable { - return Catch(source: self.asObservable(), handler: { _ in Observable.just(element) }) - } - -} - -extension ObservableType { - /** - 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: Sequence) -> Observable - where Sequence.Element == Observable { - return CatchSequence(sources: sequence) - } -} - -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: Swift.repeatElement(self.asObservable(), count: maxAttemptCount)) - } -} - -// catch with callback - -final private class CatchSinkProxy: ObserverType { - typealias Element = Observer.Element - typealias Parent = CatchSink - - private let _parent: Parent - - init(parent: Parent) { - self._parent = parent - } - - func on(_ event: Event) { - self._parent.forwardOn(event) - - switch event { - case .next: - break - case .error, .completed: - self._parent.dispose() - } - } -} - -final private class CatchSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = Catch - - private let _parent: Parent - private let _subscription = SerialDisposable() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let d1 = SingleAssignmentDisposable() - self._subscription.disposable = d1 - d1.setDisposable(self._parent._source.subscribe(self)) - - return self._subscription - } - - func on(_ event: Event) { - switch event { - case .next: - self.forwardOn(event) - case .completed: - self.forwardOn(event) - self.dispose() - case .error(let error): - do { - let catchSequence = try self._parent._handler(error) - - let observer = CatchSinkProxy(parent: self) - - self._subscription.disposable = catchSequence.subscribe(observer) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - } - } -} - -final private class Catch: Producer { - typealias Handler = (Swift.Error) throws -> Observable - - fileprivate let _source: Observable - fileprivate let _handler: Handler - - init(source: Observable, handler: @escaping Handler) { - self._source = source - self._handler = handler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = CatchSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -// catch enumerable - -final private class CatchSequenceSink - : TailRecursiveSink - , ObserverType where Sequence.Element: ObservableConvertibleType, Sequence.Element.Element == Observer.Element { - typealias Element = Observer.Element - typealias Parent = CatchSequence - - private var _lastError: Swift.Error? - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next: - self.forwardOn(event) - case .error(let error): - self._lastError = error - self.schedule(.moveNext) - case .completed: - self.forwardOn(event) - self.dispose() - } - } - - override func subscribeToNext(_ source: Observable) -> Disposable { - return source.subscribe(self) - } - - override func done() { - if let lastError = self._lastError { - self.forwardOn(.error(lastError)) - } - else { - self.forwardOn(.completed) - } - - self.dispose() - } - - override func extract(_ observable: Observable) -> SequenceGenerator? { - if let onError = observable as? CatchSequence { - return (onError.sources.makeIterator(), nil) - } - else { - return nil - } - } -} - -final private class CatchSequence: Producer where Sequence.Element: ObservableConvertibleType { - typealias Element = Sequence.Element.Element - - let sources: Sequence - - init(sources: Sequence) { - self.sources = sources - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/CombineLatest+Collection.swift b/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift deleted file mode 100644 index f81c704..0000000 --- a/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift +++ /dev/null @@ -1,166 +0,0 @@ -// -// CombineLatest+Collection.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Collection, resultSelector: @escaping ([Collection.Element.Element]) throws -> Element) -> Observable - where Collection.Element: ObservableType { - return CombineLatestCollectionType(sources: collection, resultSelector: resultSelector) - } - - /** - Merges the specified observable sequences into one observable sequence whenever any of the observable sequences produces an element. - - - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest(_ collection: Collection) -> Observable<[Element]> - where Collection.Element: ObservableType, Collection.Element.Element == Element { - return CombineLatestCollectionType(sources: collection, resultSelector: { $0 }) - } -} - -final private class CombineLatestCollectionTypeSink - : Sink where Collection.Element: ObservableConvertibleType { - typealias Result = Observer.Element - typealias Parent = CombineLatestCollectionType - typealias SourceElement = Collection.Element.Element - - let _parent: Parent - - let _lock = RecursiveLock() - - // state - var _numberOfValues = 0 - var _values: [SourceElement?] - var _isDone: [Bool] - var _numberOfDone = 0 - var _subscriptions: [SingleAssignmentDisposable] - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._values = [SourceElement?](repeating: nil, count: parent._count) - self._isDone = [Bool](repeating: false, count: parent._count) - self._subscriptions = [SingleAssignmentDisposable]() - self._subscriptions.reserveCapacity(parent._count) - - for _ in 0 ..< parent._count { - self._subscriptions.append(SingleAssignmentDisposable()) - } - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event, atIndex: Int) { - self._lock.lock(); defer { self._lock.unlock() } // { - switch event { - case .next(let element): - if self._values[atIndex] == nil { - self._numberOfValues += 1 - } - - self._values[atIndex] = element - - if self._numberOfValues < self._parent._count { - let numberOfOthersThatAreDone = self._numberOfDone - (self._isDone[atIndex] ? 1 : 0) - if numberOfOthersThatAreDone == self._parent._count - 1 { - self.forwardOn(.completed) - self.dispose() - } - return - } - - do { - let result = try self._parent._resultSelector(self._values.map { $0! }) - 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 self._isDone[atIndex] { - return - } - - self._isDone[atIndex] = true - self._numberOfDone += 1 - - if self._numberOfDone == self._parent._count { - self.forwardOn(.completed) - self.dispose() - } - else { - self._subscriptions[atIndex].dispose() - } - } - // } - } - - func run() -> Disposable { - var j = 0 - for i in self._parent._sources { - let index = j - let source = i.asObservable() - let disposable = source.subscribe(AnyObserver { event in - self.on(event, atIndex: index) - }) - - self._subscriptions[j].setDisposable(disposable) - - j += 1 - } - - if self._parent._sources.isEmpty { - do { - let result = try self._parent._resultSelector([]) - self.forwardOn(.next(result)) - self.forwardOn(.completed) - self.dispose() - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - } - - return Disposables.create(_subscriptions) - } -} - -final private class CombineLatestCollectionType: Producer where Collection.Element: ObservableConvertibleType { - typealias ResultSelector = ([Collection.Element.Element]) throws -> Result - - let _sources: Collection - let _resultSelector: ResultSelector - let _count: Int - - init(sources: Collection, resultSelector: @escaping ResultSelector) { - self._sources = sources - self._resultSelector = resultSelector - self._count = self._sources.count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - 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/CombineLatest+arity.swift b/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift deleted file mode 100644 index ece5802..0000000 --- a/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift +++ /dev/null @@ -1,843 +0,0 @@ -// 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. -// - - - -// 2 - -extension ObservableType { - /** - 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.Element, O2.Element) throws -> Element) - -> Observable { - return CombineLatest2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2) - -> Observable<(O1.Element, O2.Element)> { - return CombineLatest2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: { ($0, $1) } - ) - } -} - -final class CombineLatestSink2_ : CombineLatestSink { - typealias Result = Observer.Element - typealias Parent = CombineLatest2 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 2, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - - return Disposables.create([ - subscription1, - subscription2 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2) - } -} - -final class CombineLatest2 : Producer { - typealias ResultSelector = (E1, E2) throws -> Result - - let _source1: Observable - let _source2: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { - self._source1 = source1 - self._source2 = source2 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink2_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 3 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element) throws -> Element) - -> Observable { - return CombineLatest3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3) - -> Observable<(O1.Element, O2.Element, O3.Element)> { - return CombineLatest3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: { ($0, $1, $2) } - ) - } -} - -final class CombineLatestSink3_ : CombineLatestSink { - typealias Result = Observer.Element - typealias Parent = CombineLatest3 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3) - } -} - -final class CombineLatest3 : Producer { - typealias ResultSelector = (E1, E2, E3) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink3_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 4 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element) throws -> Element) - -> Observable { - return CombineLatest4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element)> { - return CombineLatest4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: { ($0, $1, $2, $3) } - ) - } -} - -final class CombineLatestSink4_ : CombineLatestSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - subscription4.setDisposable(self._parent._source4.subscribe(observer4)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4) - } -} - -final class CombineLatest4 : Producer { - typealias ResultSelector = (E1, E2, E3, E4) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink4_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 5 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element) throws -> Element) - -> Observable { - return CombineLatest5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element)> { - return CombineLatest5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4) } - ) - } -} - -final class CombineLatestSink5_ : CombineLatestSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - subscription4.setDisposable(self._parent._source4.subscribe(observer4)) - subscription5.setDisposable(self._parent._source5.subscribe(observer5)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5) - } -} - -final class CombineLatest5 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink5_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 6 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element) throws -> Element) - -> Observable { - return CombineLatest6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element)> { - return CombineLatest6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5) } - ) - } -} - -final class CombineLatestSink6_ : CombineLatestSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - subscription4.setDisposable(self._parent._source4.subscribe(observer4)) - subscription5.setDisposable(self._parent._source5.subscribe(observer5)) - subscription6.setDisposable(self._parent._source6.subscribe(observer6)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6) - } -} - -final class CombineLatest6 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink6_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 7 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element) throws -> Element) - -> 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 - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element)> { - return CombineLatest7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } - ) - } -} - -final class CombineLatestSink7_ : CombineLatestSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - let observer7 = CombineLatestObserver(lock: self._lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - subscription4.setDisposable(self._parent._source4.subscribe(observer4)) - subscription5.setDisposable(self._parent._source5.subscribe(observer5)) - subscription6.setDisposable(self._parent._source6.subscribe(observer6)) - subscription7.setDisposable(self._parent._source7.subscribe(observer7)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6, self._latestElement7) - } -} - -final class CombineLatest7 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = CombineLatestSink7_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 8 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element) throws -> Element) - -> 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 - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element)> { - 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: { ($0, $1, $2, $3, $4, $5, $6, $7) } - ) - } -} - -final class CombineLatestSink8_ : CombineLatestSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._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: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - let observer7 = CombineLatestObserver(lock: self._lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) - let observer8 = CombineLatestObserver(lock: self._lock, parent: self, index: 7, setLatestValue: { (e: E8) -> Void in self._latestElement8 = e }, this: subscription8) - - subscription1.setDisposable(self._parent._source1.subscribe(observer1)) - subscription2.setDisposable(self._parent._source2.subscribe(observer2)) - subscription3.setDisposable(self._parent._source3.subscribe(observer3)) - subscription4.setDisposable(self._parent._source4.subscribe(observer4)) - subscription5.setDisposable(self._parent._source5.subscribe(observer5)) - subscription6.setDisposable(self._parent._source6.subscribe(observer6)) - subscription7.setDisposable(self._parent._source7.subscribe(observer7)) - subscription8.setDisposable(self._parent._source8.subscribe(observer8)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7, - subscription8 - ]) - } - - override func getResult() throws-> Result { - return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6, self._latestElement7, self._latestElement8) - } -} - -final class CombineLatest8 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws-> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - 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/CombineLatest.swift b/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift deleted file mode 100644 index 7d6fa7f..0000000 --- a/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift +++ /dev/null @@ -1,131 +0,0 @@ -// -// CombineLatest.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol CombineLatestProtocol : class { - func next(_ index: Int) - func fail(_ error: Swift.Error) - func done(_ index: Int) -} - -class CombineLatestSink - : Sink - , CombineLatestProtocol { - typealias Element = Observer.Element - - let _lock = RecursiveLock() - - private let _arity: Int - private var _numberOfValues = 0 - private var _numberOfDone = 0 - private var _hasValue: [Bool] - private var _isDone: [Bool] - - init(arity: Int, observer: Observer, cancel: Cancelable) { - self._arity = arity - self._hasValue = [Bool](repeating: false, count: arity) - self._isDone = [Bool](repeating: false, count: arity) - - super.init(observer: observer, cancel: cancel) - } - - func getResult() throws -> Element { - rxAbstractMethod() - } - - func next(_ index: Int) { - if !self._hasValue[index] { - self._hasValue[index] = true - self._numberOfValues += 1 - } - - if self._numberOfValues == self._arity { - do { - let result = try self.getResult() - self.forwardOn(.next(result)) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - } - else { - var allOthersDone = true - - for i in 0 ..< self._arity { - if i != index && !self._isDone[i] { - allOthersDone = false - break - } - } - - if allOthersDone { - self.forwardOn(.completed) - self.dispose() - } - } - } - - func fail(_ error: Swift.Error) { - self.forwardOn(.error(error)) - self.dispose() - } - - func done(_ index: Int) { - if self._isDone[index] { - return - } - - self._isDone[index] = true - self._numberOfDone += 1 - - if self._numberOfDone == self._arity { - self.forwardOn(.completed) - self.dispose() - } - } -} - -final class CombineLatestObserver - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias ValueSetter = (Element) -> Void - - private let _parent: CombineLatestProtocol - - let _lock: RecursiveLock - private let _index: Int - private let _this: Disposable - private let _setLatestValue: ValueSetter - - init(lock: RecursiveLock, parent: CombineLatestProtocol, index: Int, setLatestValue: @escaping ValueSetter, this: Disposable) { - self._lock = lock - self._parent = parent - self._index = index - self._this = this - self._setLatestValue = setLatestValue - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let value): - self._setLatestValue(value) - self._parent.next(self._index) - case .error(let error): - self._this.dispose() - self._parent.fail(error) - case .completed: - self._this.dispose() - self._parent.done(self._index) - } - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/CompactMap.swift b/Pods/RxSwift/RxSwift/Observables/CompactMap.swift deleted file mode 100644 index 09cd3a9..0000000 --- a/Pods/RxSwift/RxSwift/Observables/CompactMap.swift +++ /dev/null @@ -1,82 +0,0 @@ -// -// CompactMap.swift -// RxSwift -// -// Created by Michael Long on 04/09/2019. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Projects each element of an observable sequence into an optional form and filters all optional results. - - Equivalent to: - - func compactMap(_ transform: @escaping (Self.E) throws -> Result?) -> RxSwift.Observable { - return self.map { try? transform($0) }.filter { $0 != nil }.map { $0! } - } - - - parameter transform: A transform function to apply to each source element and which returns an element or nil. - - returns: An observable sequence whose elements are the result of filtering the transform function for each element of the source. - - */ - public func compactMap(_ transform: @escaping (Element) throws -> Result?) - -> Observable { - return CompactMap(source: self.asObservable(), transform: transform) - } -} - -final private class CompactMapSink: Sink, ObserverType { - typealias Transform = (SourceType) throws -> ResultType? - - typealias ResultType = Observer.Element - typealias Element = SourceType - - private let _transform: Transform - - init(transform: @escaping Transform, observer: Observer, cancel: Cancelable) { - self._transform = transform - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - if let mappedElement = try self._transform(element) { - self.forwardOn(.next(mappedElement)) - } - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class CompactMap: Producer { - typealias Transform = (SourceType) throws -> ResultType? - - private let _source: Observable - - private let _transform: Transform - - init(source: Observable, transform: @escaping Transform) { - self._source = source - self._transform = transform - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == ResultType { - let sink = CompactMapSink(transform: self._transform, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Concat.swift b/Pods/RxSwift/RxSwift/Observables/Concat.swift deleted file mode 100644 index 6d76a04..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Concat.swift +++ /dev/null @@ -1,131 +0,0 @@ -// -// Concat.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Source) -> Observable where Source.Element == Element { - return Observable.concat([self.asObservable(), second.asObservable()]) - } -} - -extension ObservableType { - /** - 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: Sequence) -> Observable - where Sequence.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: Collection) -> Observable - where Collection.Element == Observable { - return Concat(sources: collection, count: Int64(collection.count)) - } - - /** - 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(_ sources: Observable ...) -> Observable { - return Concat(sources: sources, count: Int64(sources.count)) - } -} - -final private class ConcatSink - : TailRecursiveSink - , ObserverType where Sequence.Element: ObservableConvertibleType, Sequence.Element.Element == Observer.Element { - typealias Element = Observer.Element - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event){ - switch event { - case .next: - self.forwardOn(event) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.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 - } - } -} - -final private class Concat: Producer where Sequence.Element: ObservableConvertibleType { - typealias Element = Sequence.Element.Element - - fileprivate let _sources: Sequence - fileprivate let _count: IntMax? - - init(sources: Sequence, count: IntMax?) { - self._sources = sources - self._count = count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = ConcatSink(observer: observer, cancel: cancel) - let subscription = sink.run((self._sources.makeIterator(), self._count)) - return (sink: sink, subscription: subscription) - } -} - diff --git a/Pods/RxSwift/RxSwift/Observables/Create.swift b/Pods/RxSwift/RxSwift/Observables/Create.swift deleted file mode 100644 index d08bd8e..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Create.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// Create.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - // 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) - } -} - -final private class AnonymousObservableSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = AnonymousObservable - - // state - private let _isStopped = AtomicInt(0) - - #if DEBUG - private let _synchronizationTracker = SynchronizationTracker() - #endif - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - #if DEBUG - self._synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { self._synchronizationTracker.unregister() } - #endif - switch event { - case .next: - if load(self._isStopped) == 1 { - return - } - self.forwardOn(event) - case .error, .completed: - if fetchOr(self._isStopped, 1) == 0 { - self.forwardOn(event) - self.dispose() - } - } - } - - func run(_ parent: Parent) -> Disposable { - return parent._subscribeHandler(AnyObserver(self)) - } -} - -final private class AnonymousObservable: Producer { - typealias SubscribeHandler = (AnyObserver) -> Disposable - - let _subscribeHandler: SubscribeHandler - - init(_ subscribeHandler: @escaping SubscribeHandler) { - self._subscribeHandler = subscribeHandler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Debounce.swift b/Pods/RxSwift/RxSwift/Observables/Debounce.swift deleted file mode 100644 index 6f84711..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Debounce.swift +++ /dev/null @@ -1,118 +0,0 @@ -// -// Debounce.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/11/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - 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 on. - - returns: The throttled sequence. - */ - public func debounce(_ dueTime: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return Debounce(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) - } -} - -final private class DebounceSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = Observer.Element - typealias ParentType = Debounce - - private let _parent: ParentType - - let _lock = RecursiveLock() - - // state - private var _id = 0 as UInt64 - private var _value: Element? - - let cancellable = SerialDisposable() - - init(parent: ParentType, observer: Observer, cancel: Cancelable) { - self._parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = self._parent._source.subscribe(self) - - return Disposables.create(subscription, cancellable) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - self._id = self._id &+ 1 - let currentId = self._id - self._value = element - - - let scheduler = self._parent._scheduler - let dueTime = self._parent._dueTime - - let d = SingleAssignmentDisposable() - self.cancellable.disposable = d - d.setDisposable(scheduler.scheduleRelative(currentId, dueTime: dueTime, action: self.propagate)) - case .error: - self._value = nil - self.forwardOn(event) - self.dispose() - case .completed: - if let value = self._value { - self._value = nil - self.forwardOn(.next(value)) - } - self.forwardOn(.completed) - self.dispose() - } - } - - func propagate(_ currentId: UInt64) -> Disposable { - self._lock.lock(); defer { self._lock.unlock() } // { - let originalValue = self._value - - if let value = originalValue, self._id == currentId { - self._value = nil - self.forwardOn(.next(value)) - } - // } - return Disposables.create() - } -} - -final private class Debounce: Producer { - fileprivate let _source: Observable - fileprivate let _dueTime: RxTimeInterval - fileprivate let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - self._source = source - self._dueTime = dueTime - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Debug.swift b/Pods/RxSwift/RxSwift/Observables/Debug.swift deleted file mode 100644 index 770ecc0..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Debug.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Debug.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import class Foundation.DateFormatter - -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) - } -} - -private let dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" - -private func logEvent(_ identifier: String, dateFormat: DateFormatter, content: String) { - print("\(dateFormat.string(from: Date())): \(identifier) -> \(content)") -} - -final private class DebugSink: Sink, ObserverType where Observer.Element == Source.Element { - typealias Element = Observer.Element - typealias Parent = Debug - - private let _parent: Parent - private let _timestampFormatter = DateFormatter() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._timestampFormatter.dateFormat = dateFormat - - logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "subscribed") - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - let maxEventTextLength = 40 - let eventText = "\(event)" - - let eventNormalized = (eventText.count > maxEventTextLength) && self._parent._trimOutput - ? String(eventText.prefix(maxEventTextLength / 2)) + "..." + String(eventText.suffix(maxEventTextLength / 2)) - : eventText - - logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "Event \(eventNormalized)") - - self.forwardOn(event) - if event.isStopEvent { - self.dispose() - } - } - - override func dispose() { - if !self.disposed { - logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "isDisposed") - } - super.dispose() - } -} - -final private class Debug: Producer { - fileprivate let _identifier: String - fileprivate let _trimOutput: Bool - private let _source: Source - - init(source: Source, identifier: String?, trimOutput: Bool, file: String, line: UInt, function: String) { - self._trimOutput = trimOutput - if let identifier = identifier { - self._identifier = identifier - } - else { - let trimmedFile: String - if let lastIndex = file.lastIndex(of: "/") { - trimmedFile = String(file[file.index(after: lastIndex) ..< file.endIndex]) - } - else { - trimmedFile = file - } - self._identifier = "\(trimmedFile):\(line) (\(function))" - } - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Source.Element { - let sink = DebugSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift b/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift deleted file mode 100644 index 5ad1bef..0000000 --- a/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// DefaultIfEmpty.swift -// RxSwift -// -// Created by sergdort on 23/12/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Emits elements from the source observable sequence, or a default element if the source observable sequence is empty. - - - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) - - - parameter default: Default element to be sent if the source does not emit any elements - - returns: An observable sequence which emits default element end completes in case the original sequence is empty - */ - public func ifEmpty(default: Element) -> Observable { - return DefaultIfEmpty(source: self.asObservable(), default: `default`) - } -} - -final private class DefaultIfEmptySink: Sink, ObserverType { - typealias Element = Observer.Element - private let _default: Element - private var _isEmpty = true - - init(default: Element, observer: Observer, cancel: Cancelable) { - self._default = `default` - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next: - self._isEmpty = false - self.forwardOn(event) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - if self._isEmpty { - self.forwardOn(.next(self._default)) - } - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class DefaultIfEmpty: Producer { - private let _source: Observable - private let _default: SourceType - - init(source: Observable, `default`: SourceType) { - self._source = source - self._default = `default` - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceType { - let sink = DefaultIfEmptySink(default: self._default, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Deferred.swift b/Pods/RxSwift/RxSwift/Observables/Deferred.swift deleted file mode 100644 index 8152f5c..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Deferred.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// Deferred.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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) - } -} - -final private class DeferredSink: Sink, ObserverType where Source.Element == Observer.Element { - typealias Element = Observer.Element - - private let _observableFactory: () throws -> Source - - init(observableFactory: @escaping () throws -> Source, observer: Observer, cancel: Cancelable) { - self._observableFactory = observableFactory - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - do { - let result = try self._observableFactory() - return result.subscribe(self) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - return Disposables.create() - } - } - - func on(_ event: Event) { - self.forwardOn(event) - - switch event { - case .next: - break - case .error: - self.dispose() - case .completed: - self.dispose() - } - } -} - -final private class Deferred: Producer { - typealias Factory = () throws -> Source - - private let _observableFactory : Factory - - init(observableFactory: @escaping Factory) { - self._observableFactory = observableFactory - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) - where Observer.Element == Source.Element { - let sink = DeferredSink(observableFactory: self._observableFactory, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Delay.swift b/Pods/RxSwift/RxSwift/Observables/Delay.swift deleted file mode 100644 index 1c00a49..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Delay.swift +++ /dev/null @@ -1,176 +0,0 @@ -// -// Delay.swift -// RxSwift -// -// Created by tarunon on 2016/02/09. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -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) - } -} - -final private class DelaySink - : Sink - , ObserverType { - typealias Element = Observer.Element - typealias Source = Observable - typealias DisposeKey = Bag.KeyType - - private let _lock = RecursiveLock() - - 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? - - // state - private var _queue = Queue<(eventTime: RxTime, event: Event)>(capacity: 0) - private var _disposed = false - - init(observer: Observer, dueTime: RxTimeInterval, scheduler: SchedulerType, cancel: Cancelable) { - self._dueTime = dueTime - self._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 immediately. Error can be potentially 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<()>) { - - self._lock.lock() // { - let hasFailed = self._errorEvent != nil - if !hasFailed { - self._running = true - } - self._lock.unlock() // } - - if hasFailed { - return - } - - var ranAtLeastOnce = false - - while true { - self._lock.lock() // { - let errorEvent = self._errorEvent - - let eventToForwardImmediately = ranAtLeastOnce ? nil : self._queue.dequeue()?.event - let nextEventToScheduleOriginalTime: Date? = ranAtLeastOnce && !self._queue.isEmpty ? self._queue.peek().eventTime : nil - - if errorEvent == nil { - if eventToForwardImmediately != nil { - } - else if nextEventToScheduleOriginalTime != nil { - self._running = false - } - else { - self._running = false - self._active = false - } - } - self._lock.unlock() // { - - if let errorEvent = errorEvent { - self.forwardOn(errorEvent) - self.dispose() - return - } - else { - if let eventToForwardImmediately = eventToForwardImmediately { - ranAtLeastOnce = true - self.forwardOn(eventToForwardImmediately) - if case .completed = eventToForwardImmediately { - self.dispose() - return - } - } - else if let nextEventToScheduleOriginalTime = nextEventToScheduleOriginalTime { - scheduler.schedule((), dueTime: self._dueTime.reduceWithSpanBetween(earlierDate: nextEventToScheduleOriginalTime, laterDate: self._scheduler.now)) - return - } - else { - return - } - } - } - } - - func on(_ event: Event) { - if event.isStopEvent { - self._sourceSubscription.dispose() - } - - switch event { - case .error: - self._lock.lock() // { - let shouldSendImmediately = !self._running - self._queue = Queue(capacity: 0) - self._errorEvent = event - self._lock.unlock() // } - - if shouldSendImmediately { - self.forwardOn(event) - self.dispose() - } - default: - self._lock.lock() // { - let shouldSchedule = !self._active - self._active = true - self._queue.enqueue((self._scheduler.now, event)) - self._lock.unlock() // } - - if shouldSchedule { - self._cancelable.disposable = self._scheduler.scheduleRecursive((), dueTime: self._dueTime, action: self.drainQueue) - } - } - } - - func run(source: Observable) -> Disposable { - self._sourceSubscription.setDisposable(source.subscribe(self)) - return Disposables.create(_sourceSubscription, _cancelable) - } -} - -final private class Delay: Producer { - private let _source: Observable - private let _dueTime: RxTimeInterval - private let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - self._source = source - self._dueTime = dueTime - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = DelaySink(observer: observer, dueTime: self._dueTime, scheduler: self._scheduler, cancel: cancel) - let subscription = sink.run(source: self._source) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift b/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift deleted file mode 100644 index a329d60..0000000 --- a/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift +++ /dev/null @@ -1,58 +0,0 @@ -// -// DelaySubscription.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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) - } -} - -final private class DelaySubscriptionSink - : Sink, ObserverType { - typealias Element = Observer.Element - - func on(_ event: Event) { - self.forwardOn(event) - if event.isStopEvent { - self.dispose() - } - } - -} - -final private class DelaySubscription: Producer { - private let _source: Observable - private let _dueTime: RxTimeInterval - private let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - self._source = source - self._dueTime = dueTime - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = DelaySubscriptionSink(observer: observer, cancel: cancel) - let subscription = self._scheduler.scheduleRelative((), dueTime: self._dueTime) { _ in - return self._source.subscribe(sink) - } - - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift b/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift deleted file mode 100644 index 4cf9037..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// Dematerialize.swift -// RxSwift -// -// Created by Jamie Pinkham on 3/13/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where Element: EventConvertible { - /** - Convert any previously materialized Observable into it's original form. - - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) - - returns: The dematerialized observable sequence. - */ - public func dematerialize() -> Observable { - return Dematerialize(source: self.asObservable()) - } - -} - -private final class DematerializeSink: Sink, ObserverType where Observer.Element == T.Element { - fileprivate func on(_ event: Event) { - switch event { - case .next(let element): - self.forwardOn(element.event) - if element.event.isStopEvent { - self.dispose() - } - case .completed: - self.forwardOn(.completed) - self.dispose() - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - } - } -} - -final private class Dematerialize: Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == T.Element { - let sink = DematerializeSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift b/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift deleted file mode 100644 index d397e73..0000000 --- a/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift +++ /dev/null @@ -1,125 +0,0 @@ -// -// DistinctUntilChanged.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where Element: 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 (Element) throws -> Key) - -> 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 (Element, Element) 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 (Element) throws -> K, comparer: @escaping (K, K) throws -> Bool) - -> Observable { - return DistinctUntilChanged(source: self.asObservable(), selector: keySelector, comparer: comparer) - } -} - -final private class DistinctUntilChangedSink: Sink, ObserverType { - typealias Element = Observer.Element - - private let _parent: DistinctUntilChanged - private var _currentKey: Key? - - init(parent: DistinctUntilChanged, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let key = try self._parent._selector(value) - var areEqual = false - if let currentKey = self._currentKey { - areEqual = try self._parent._comparer(currentKey, key) - } - - if areEqual { - return - } - - self._currentKey = key - - self.forwardOn(event) - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - case .error, .completed: - self.forwardOn(event) - self.dispose() - } - } -} - -final private class DistinctUntilChanged: Producer { - typealias KeySelector = (Element) throws -> Key - typealias EqualityComparer = (Key, Key) throws -> Bool - - private let _source: Observable - fileprivate let _selector: KeySelector - fileprivate let _comparer: EqualityComparer - - init(source: Observable, selector: @escaping KeySelector, comparer: @escaping EqualityComparer) { - self._source = source - self._selector = selector - self._comparer = comparer - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = DistinctUntilChangedSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Do.swift b/Pods/RxSwift/RxSwift/Observables/Do.swift deleted file mode 100644 index 0aee1d6..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Do.swift +++ /dev/null @@ -1,112 +0,0 @@ -// -// Do.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 afterNext: Action to invoke for each element after the observable has passed an onNext event along to its downstream. - - parameter onError: Action to invoke upon errored termination of the observable sequence. - - parameter afterError: Action to invoke after errored termination of the observable sequence. - - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - - parameter afterCompleted: Action to invoke after graceful termination of the observable sequence. - - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. - - parameter onSubscribed: Action to invoke after 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: ((Element) throws -> Void)? = nil, afterNext: ((Element) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, afterError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, afterCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = 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?() - } - }, afterEventHandler: { e in - switch e { - case .next(let element): - try afterNext?(element) - case .error(let e): - try afterError?(e) - case .completed: - try afterCompleted?() - } - }, onSubscribe: onSubscribe, onSubscribed: onSubscribed, onDispose: onDispose) - } -} - -final private class DoSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias EventHandler = (Event) throws -> Void - typealias AfterEventHandler = (Event) throws -> Void - - private let _eventHandler: EventHandler - private let _afterEventHandler: AfterEventHandler - - init(eventHandler: @escaping EventHandler, afterEventHandler: @escaping AfterEventHandler, observer: Observer, cancel: Cancelable) { - self._eventHandler = eventHandler - self._afterEventHandler = afterEventHandler - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - do { - try self._eventHandler(event) - self.forwardOn(event) - try self._afterEventHandler(event) - if event.isStopEvent { - self.dispose() - } - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - } -} - -final private class Do: Producer { - typealias EventHandler = (Event) throws -> Void - typealias AfterEventHandler = (Event) throws -> Void - - private let _source: Observable - private let _eventHandler: EventHandler - private let _afterEventHandler: AfterEventHandler - private let _onSubscribe: (() -> Void)? - private let _onSubscribed: (() -> Void)? - private let _onDispose: (() -> Void)? - - init(source: Observable, eventHandler: @escaping EventHandler, afterEventHandler: @escaping AfterEventHandler, onSubscribe: (() -> Void)?, onSubscribed: (() -> Void)?, onDispose: (() -> Void)?) { - self._source = source - self._eventHandler = eventHandler - self._afterEventHandler = afterEventHandler - self._onSubscribe = onSubscribe - self._onSubscribed = onSubscribed - self._onDispose = onDispose - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - self._onSubscribe?() - let sink = DoSink(eventHandler: self._eventHandler, afterEventHandler: self._afterEventHandler, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - self._onSubscribed?() - let onDispose = self._onDispose - let allSubscriptions = Disposables.create { - subscription.dispose() - onDispose?() - } - return (sink: sink, subscription: allSubscriptions) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/ElementAt.swift b/Pods/RxSwift/RxSwift/Observables/ElementAt.swift deleted file mode 100644 index f8750f0..0000000 --- a/Pods/RxSwift/RxSwift/Observables/ElementAt.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// ElementAt.swift -// RxSwift -// -// Created by Junior B. on 21/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns a sequence emitting only element _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 element (starting from 0). - - returns: An observable sequence that emits the desired element as its own sole emission. - */ - public func elementAt(_ index: Int) - -> Observable { - return ElementAt(source: self.asObservable(), index: index, throwOnEmpty: true) - } -} - -final private class ElementAtSink: Sink, ObserverType { - typealias SourceType = Observer.Element - typealias Parent = ElementAt - - let _parent: Parent - var _i: Int - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._i = parent._index - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next: - - if self._i == 0 { - self.forwardOn(event) - self.forwardOn(.completed) - self.dispose() - } - - do { - _ = try decrementChecked(&self._i) - } catch let e { - self.forwardOn(.error(e)) - self.dispose() - return - } - - case .error(let e): - self.forwardOn(.error(e)) - self.dispose() - case .completed: - if self._parent._throwOnEmpty { - self.forwardOn(.error(RxError.argumentOutOfRange)) - } else { - self.forwardOn(.completed) - } - - self.dispose() - } - } -} - -final private 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: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceType { - let sink = ElementAtSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Empty.swift b/Pods/RxSwift/RxSwift/Observables/Empty.swift deleted file mode 100644 index 4ea2995..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Empty.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Empty.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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 EmptyProducer() - } -} - -final private class EmptyProducer: Producer { - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - observer.on(.completed) - return Disposables.create() - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Enumerated.swift b/Pods/RxSwift/RxSwift/Observables/Enumerated.swift deleted file mode 100644 index bd92381..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Enumerated.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// Enumerated.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/6/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Enumerates the elements of an observable sequence. - - - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) - - - returns: An observable sequence that contains tuples of source sequence elements and their indexes. - */ - public func enumerated() - -> Observable<(index: Int, element: Element)> { - return Enumerated(source: self.asObservable()) - } -} - -final private class EnumeratedSink: Sink, ObserverType where Observer.Element == (index: Int, element: Element) { - var index = 0 - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let nextIndex = try incrementChecked(&self.index) - let next = (index: nextIndex, element: value) - self.forwardOn(.next(next)) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .completed: - self.forwardOn(.completed) - self.dispose() - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - } - } -} - -final private class Enumerated: Producer<(index: Int, element: Element)> { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == (index: Int, element: Element) { - let sink = EnumeratedSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Error.swift b/Pods/RxSwift/RxSwift/Observables/Error.swift deleted file mode 100644 index 530fe3e..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Error.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Error.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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 ErrorProducer(error: error) - } -} - -final private class ErrorProducer: Producer { - private let _error: Swift.Error - - init(error: Swift.Error) { - self._error = error - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - observer.on(.error(self._error)) - return Disposables.create() - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Filter.swift b/Pods/RxSwift/RxSwift/Observables/Filter.swift deleted file mode 100644 index 5f787d6..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Filter.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// Filter.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Bool) - -> Observable { - return Filter(source: self.asObservable(), predicate: predicate) - } -} - -extension ObservableType { - - /** - Skips elements and completes (or errors) when the observable sequence 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() - -> Completable { - return self.flatMap { _ in - return Observable.empty() - } - .asCompletable() - } -} - -final private class FilterSink: Sink, ObserverType { - typealias Predicate = (Element) throws -> Bool - typealias Element = Observer.Element - - private let _predicate: Predicate - - init(predicate: @escaping Predicate, observer: Observer, cancel: Cancelable) { - self._predicate = predicate - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let satisfies = try self._predicate(value) - if satisfies { - self.forwardOn(.next(value)) - } - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .completed, .error: - self.forwardOn(event) - self.dispose() - } - } -} - -final private class Filter: Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - private let _predicate: Predicate - - init(source: Observable, predicate: @escaping Predicate) { - self._source = source - self._predicate = predicate - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = FilterSink(predicate: self._predicate, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/First.swift b/Pods/RxSwift/RxSwift/Observables/First.swift deleted file mode 100644 index 96682c2..0000000 --- a/Pods/RxSwift/RxSwift/Observables/First.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// First.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/31/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -private final class FirstSink : Sink, ObserverType where Observer.Element == Element? { - typealias Parent = First - - func on(_ event: Event) { - switch event { - case .next(let value): - self.forwardOn(.next(value)) - self.forwardOn(.completed) - self.dispose() - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.next(nil)) - self.forwardOn(.completed) - self.dispose() - } - } -} - -final class First: Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element? { - let sink = FirstSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Generate.swift b/Pods/RxSwift/RxSwift/Observables/Generate.swift deleted file mode 100644 index 5c9d0c1..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Generate.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// Generate.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Element, condition: @escaping (Element) throws -> Bool, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance, iterate: @escaping (Element) throws -> Element) -> Observable { - return Generate(initialState: initialState, condition: condition, iterate: iterate, resultSelector: { $0 }, scheduler: scheduler) - } -} - -final private class GenerateSink: Sink { - typealias Parent = Generate - - private let _parent: Parent - - private var _state: Sequence - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._state = parent._initialState - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._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() - } - } - } -} - -final private class Generate: Producer { - fileprivate let _initialState: Sequence - fileprivate let _condition: (Sequence) throws -> Bool - fileprivate let _iterate: (Sequence) throws -> Sequence - fileprivate let _resultSelector: (Sequence) throws -> Element - fileprivate let _scheduler: ImmediateSchedulerType - - init(initialState: Sequence, condition: @escaping (Sequence) throws -> Bool, iterate: @escaping (Sequence) throws -> Sequence, resultSelector: @escaping (Sequence) throws -> Element, scheduler: ImmediateSchedulerType) { - self._initialState = initialState - self._condition = condition - self._iterate = iterate - self._resultSelector = resultSelector - self._scheduler = scheduler - super.init() - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - 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/GroupBy.swift b/Pods/RxSwift/RxSwift/Observables/GroupBy.swift deleted file mode 100644 index 6ae101c..0000000 --- a/Pods/RxSwift/RxSwift/Observables/GroupBy.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// GroupBy.swift -// RxSwift -// -// Created by Tomi Koskinen on 01/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /* - Groups the elements of an observable sequence according to a specified key selector function. - - - seealso: [groupBy operator on reactivex.io](http://reactivex.io/documentation/operators/groupby.html) - - - parameter keySelector: A function to extract the key for each element. - - returns: A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. - */ - public func groupBy(keySelector: @escaping (Element) throws -> Key) - -> Observable> { - return GroupBy(source: self.asObservable(), selector: keySelector) - } -} - -final private class GroupedObservableImpl: Observable { - private var _subject: PublishSubject - private var _refCount: RefCountDisposable - - init(subject: PublishSubject, refCount: RefCountDisposable) { - self._subject = subject - self._refCount = refCount - } - - override public func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - let release = self._refCount.retain() - let subscription = self._subject.subscribe(observer) - return Disposables.create(release, subscription) - } -} - - -final private class GroupBySink - : Sink - , ObserverType where Observer.Element == GroupedObservable { - typealias ResultType = Observer.Element - typealias Parent = GroupBy - - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - private var _refCountDisposable: RefCountDisposable! - private var _groupedSubjectTable: [Key: PublishSubject] - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._groupedSubjectTable = [Key: PublishSubject]() - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - self._refCountDisposable = RefCountDisposable(disposable: self._subscription) - - self._subscription.setDisposable(self._parent._source.subscribe(self)) - - return self._refCountDisposable - } - - private func onGroupEvent(key: Key, value: Element) { - if let writer = self._groupedSubjectTable[key] { - writer.on(.next(value)) - } else { - let writer = PublishSubject() - self._groupedSubjectTable[key] = writer - - let group = GroupedObservable( - key: key, - source: GroupedObservableImpl(subject: writer, refCount: _refCountDisposable) - ) - - self.forwardOn(.next(group)) - writer.on(.next(value)) - } - } - - final func on(_ event: Event) { - switch event { - case let .next(value): - do { - let groupKey = try self._parent._selector(value) - self.onGroupEvent(key: groupKey, value: value) - } - catch let e { - self.error(e) - return - } - case let .error(e): - self.error(e) - case .completed: - self.forwardOnGroups(event: .completed) - self.forwardOn(.completed) - self._subscription.dispose() - self.dispose() - } - } - - final func error(_ error: Swift.Error) { - self.forwardOnGroups(event: .error(error)) - self.forwardOn(.error(error)) - self._subscription.dispose() - self.dispose() - } - - final func forwardOnGroups(event: Event) { - for writer in self._groupedSubjectTable.values { - writer.on(event) - } - } -} - -final private class GroupBy: Producer> { - typealias KeySelector = (Element) throws -> Key - - fileprivate let _source: Observable - fileprivate let _selector: KeySelector - - init(source: Observable, selector: @escaping KeySelector) { - self._source = source - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == GroupedObservable { - let sink = GroupBySink(parent: self, observer: observer, cancel: cancel) - return (sink: sink, subscription: sink.run()) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Just.swift b/Pods/RxSwift/RxSwift/Observables/Just.swift deleted file mode 100644 index df4f302..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Just.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// Just.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Element) -> 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: Scheduler to send the single element on. - - returns: An observable sequence containing the single specified element. - */ - public static func just(_ element: Element, scheduler: ImmediateSchedulerType) -> Observable { - return JustScheduled(element: element, scheduler: scheduler) - } -} - -final private class JustScheduledSink: Sink { - typealias Parent = JustScheduled - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let scheduler = self._parent._scheduler - return scheduler.schedule(self._parent._element) { element in - self.forwardOn(.next(element)) - return scheduler.schedule(()) { _ in - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } - } -} - -final private class JustScheduled: Producer { - fileprivate let _scheduler: ImmediateSchedulerType - fileprivate let _element: Element - - init(element: Element, scheduler: ImmediateSchedulerType) { - self._scheduler = scheduler - self._element = element - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = JustScheduledSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final private class Just: Producer { - private let _element: Element - - init(element: Element) { - self._element = element - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - observer.on(.next(self._element)) - observer.on(.completed) - return Disposables.create() - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Map.swift b/Pods/RxSwift/RxSwift/Observables/Map.swift deleted file mode 100644 index 339beb6..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Map.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// Map.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Result) - -> Observable { - return Map(source: self.asObservable(), transform: transform) - } -} - -final private class MapSink: Sink, ObserverType { - typealias Transform = (SourceType) throws -> ResultType - - typealias ResultType = Observer.Element - typealias Element = SourceType - - private let _transform: Transform - - init(transform: @escaping Transform, observer: Observer, cancel: Cancelable) { - self._transform = transform - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - let mappedElement = try self._transform(element) - self.forwardOn(.next(mappedElement)) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class Map: Producer { - typealias Transform = (SourceType) throws -> ResultType - - private let _source: Observable - - private let _transform: Transform - - init(source: Observable, transform: @escaping Transform) { - self._source = source - self._transform = transform - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == ResultType { - let sink = MapSink(transform: self._transform, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Materialize.swift b/Pods/RxSwift/RxSwift/Observables/Materialize.swift deleted file mode 100644 index a4fc19d..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Materialize.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// Materialize.swift -// RxSwift -// -// Created by sergdort on 08/03/2017. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Convert any Observable into an Observable of its events. - - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) - - returns: An observable sequence that wraps events in an Event. The returned Observable never errors, but it does complete after observing all of the events of the underlying Observable. - */ - public func materialize() -> Observable> { - return Materialize(source: self.asObservable()) - } -} - -private final class MaterializeSink: Sink, ObserverType where Observer.Element == Event { - - func on(_ event: Event) { - self.forwardOn(.next(event)) - if event.isStopEvent { - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class Materialize: Producer> { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = MaterializeSink(observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Merge.swift b/Pods/RxSwift/RxSwift/Observables/Merge.swift deleted file mode 100644 index 5fd71b0..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Merge.swift +++ /dev/null @@ -1,598 +0,0 @@ -// -// Merge.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Source) - -> Observable { - return FlatMap(source: self.asObservable(), selector: selector) - } - -} - -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 (Element) throws -> Source) - -> Observable { - return FlatMapFirst(source: self.asObservable(), selector: selector) - } -} - -extension ObservableType where Element : 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: self.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: self.asObservable(), maxConcurrent: maxConcurrent) - } -} - -extension ObservableType where Element : 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 self.merge(maxConcurrent: 1) - } -} - -extension ObservableType { - /** - Merges elements from all observable sequences from collection into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: Collection) -> Observable where Collection.Element == Observable { - return MergeArray(sources: Array(sources)) - } - - /** - Merges elements from all observable sequences from array into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Array of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: [Observable]) -> Observable { - return MergeArray(sources: sources) - } - - /** - Merges elements from all observable sequences into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: Observable...) -> Observable { - return MergeArray(sources: sources) - } -} - -// MARK: concatMap - -extension ObservableType { - /** - Projects each element of an observable sequence to an observable sequence and concatenates the resulting observable sequences into one observable sequence. - - - 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 concatMap(_ selector: @escaping (Element) throws -> Source) - -> Observable { - return ConcatMap(source: self.asObservable(), selector: selector) - } -} - -private final class MergeLimitedSinkIter - : ObserverType - , LockOwnerType - , SynchronizedOnType where SourceSequence.Element == Observer.Element { - typealias Element = Observer.Element - typealias DisposeKey = CompositeDisposable.DisposeKey - typealias Parent = MergeLimitedSink - - private let _parent: Parent - private let _disposeKey: DisposeKey - - var _lock: RecursiveLock { - return self._parent._lock - } - - init(parent: Parent, disposeKey: DisposeKey) { - self._parent = parent - self._disposeKey = disposeKey - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - self._parent.forwardOn(event) - case .error: - self._parent.forwardOn(event) - self._parent.dispose() - case .completed: - self._parent._group.remove(for: self._disposeKey) - if let next = self._parent._queue.dequeue() { - self._parent.subscribe(next, group: self._parent._group) - } - else { - self._parent._activeCount -= 1 - - if self._parent._stopped && self._parent._activeCount == 0 { - self._parent.forwardOn(.completed) - self._parent.dispose() - } - } - } - } -} - -private final class ConcatMapSink: MergeLimitedSink where Observer.Element == SourceSequence.Element { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - self._selector = selector - super.init(maxConcurrent: 1, observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try self._selector(element) - } -} - -private final class MergeLimitedBasicSink: MergeLimitedSink where Observer.Element == SourceSequence.Element { - - override func performMap(_ element: SourceSequence) throws -> SourceSequence { - return element - } -} - -private class MergeLimitedSink - : Sink - , ObserverType where Observer.Element == SourceSequence.Element { - typealias QueueType = Queue - - let _maxConcurrent: Int - - let _lock = RecursiveLock() - - // state - var _stopped = false - var _activeCount = 0 - var _queue = QueueType(capacity: 2) - - let _sourceSubscription = SingleAssignmentDisposable() - let _group = CompositeDisposable() - - init(maxConcurrent: Int, observer: Observer, cancel: Cancelable) { - self._maxConcurrent = maxConcurrent - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - _ = self._group.insert(self._sourceSubscription) - - let disposable = source.subscribe(self) - self._sourceSubscription.setDisposable(disposable) - return self._group - } - - func subscribe(_ innerSource: SourceSequence, 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 performMap(_ element: SourceElement) throws -> SourceSequence { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: SourceElement) -> SourceSequence? { - self._lock.lock(); defer { self._lock.unlock() } // { - let subscribe: Bool - if self._activeCount < self._maxConcurrent { - self._activeCount += 1 - subscribe = true - } - else { - do { - let value = try self.performMap(element) - self._queue.enqueue(value) - } catch { - self.forwardOn(.error(error)) - self.dispose() - } - subscribe = false - } - - if subscribe { - do { - return try self.performMap(element) - } catch { - self.forwardOn(.error(error)) - self.dispose() - } - } - - return nil - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let sequence = self.nextElementArrived(element: element) { - self.subscribe(sequence, group: self._group) - } - case .error(let error): - self._lock.lock(); defer { self._lock.unlock() } - - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self._lock.lock(); defer { self._lock.unlock() } - - if self._activeCount == 0 { - self.forwardOn(.completed) - self.dispose() - } - else { - self._sourceSubscription.dispose() - } - - self._stopped = true - } - } -} - -final private class MergeLimited: Producer { - private let _source: Observable - private let _maxConcurrent: Int - - init(source: Observable, maxConcurrent: Int) { - self._source = source - self._maxConcurrent = maxConcurrent - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceSequence.Element { - let sink = MergeLimitedBasicSink(maxConcurrent: self._maxConcurrent, observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -// MARK: Merge - -private final class MergeBasicSink : MergeSink where Observer.Element == Source.Element { - override func performMap(_ element: Source) throws -> Source { - return element - } -} - -// MARK: flatMap - -private final class FlatMapSink : MergeSink where Observer.Element == SourceSequence.Element { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - self._selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try self._selector(element) - } -} - -// MARK: FlatMapFirst - -private final class FlatMapFirstSink : MergeSink where Observer.Element == SourceSequence.Element { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - override var subscribeNext: Bool { - return self._activeCount == 0 - } - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - self._selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try self._selector(element) - } -} - -private final class MergeSinkIter : ObserverType where Observer.Element == SourceSequence.Element { - typealias Parent = MergeSink - typealias DisposeKey = CompositeDisposable.DisposeKey - typealias Element = Observer.Element - - private let _parent: Parent - private let _disposeKey: DisposeKey - - init(parent: Parent, disposeKey: DisposeKey) { - self._parent = parent - self._disposeKey = disposeKey - } - - func on(_ event: Event) { - self._parent._lock.lock(); defer { self._parent._lock.unlock() } // lock { - switch event { - case .next(let value): - self._parent.forwardOn(.next(value)) - case .error(let error): - self._parent.forwardOn(.error(error)) - self._parent.dispose() - case .completed: - self._parent._group.remove(for: self._disposeKey) - self._parent._activeCount -= 1 - self._parent.checkCompleted() - } - // } - } -} - - -private class MergeSink - : Sink - , ObserverType where Observer.Element == SourceSequence.Element { - typealias ResultType = Observer.Element - typealias Element = SourceElement - - let _lock = RecursiveLock() - - var subscribeNext: Bool { - return true - } - - // state - let _group = CompositeDisposable() - let _sourceSubscription = SingleAssignmentDisposable() - - var _activeCount = 0 - var _stopped = false - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func performMap(_ element: SourceElement) throws -> SourceSequence { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: SourceElement) -> SourceSequence? { - self._lock.lock(); defer { self._lock.unlock() } // { - if !self.subscribeNext { - return nil - } - - do { - let value = try self.performMap(element) - self._activeCount += 1 - return value - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - return nil - } - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let value = self.nextElementArrived(element: element) { - self.subscribeInner(value.asObservable()) - } - case .error(let error): - self._lock.lock(); defer { self._lock.unlock() } - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self._lock.lock(); defer { self._lock.unlock() } - self._stopped = true - self._sourceSubscription.dispose() - self.checkCompleted() - } - } - - func subscribeInner(_ source: Observable) { - let iterDisposable = SingleAssignmentDisposable() - if let disposeKey = self._group.insert(iterDisposable) { - let iter = MergeSinkIter(parent: self, disposeKey: disposeKey) - let subscription = source.subscribe(iter) - iterDisposable.setDisposable(subscription) - } - } - - func run(_ sources: [Observable]) -> Disposable { - self._activeCount += sources.count - - for source in sources { - self.subscribeInner(source) - } - - self._stopped = true - - self.checkCompleted() - - return self._group - } - - @inline(__always) - func checkCompleted() { - if self._stopped && self._activeCount == 0 { - self.forwardOn(.completed) - self.dispose() - } - } - - func run(_ source: Observable) -> Disposable { - _ = self._group.insert(self._sourceSubscription) - - let subscription = source.subscribe(self) - self._sourceSubscription.setDisposable(subscription) - - return self._group - } -} - -// MARK: Producers - -final private class FlatMap: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - self._source = source - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceSequence.Element { - let sink = FlatMapSink(selector: self._selector, observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -final private class FlatMapFirst: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - self._source = source - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceSequence.Element { - let sink = FlatMapFirstSink(selector: self._selector, observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -final class ConcatMap: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - self._source = source - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceSequence.Element { - let sink = ConcatMapSink(selector: self._selector, observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -final class Merge : Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == SourceSequence.Element { - let sink = MergeBasicSink(observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -final private class MergeArray: Producer { - private let _sources: [Observable] - - init(sources: [Observable]) { - self._sources = sources - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = MergeBasicSink, Observer>(observer: observer, cancel: cancel) - let subscription = sink.run(self._sources) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Multicast.swift b/Pods/RxSwift/RxSwift/Observables/Multicast.swift deleted file mode 100644 index f605996..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Multicast.swift +++ /dev/null @@ -1,409 +0,0 @@ -// -// Multicast.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** - 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 { - rxAbstractMethod() - } -} - -extension ObservableType { - - /** - 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 -> Subject, selector: @escaping (Observable) throws -> Observable) - -> Observable where Subject.Observer.Element == Element { - return Multicast( - source: self.asObservable(), - subjectSelector: subjectSelector, - selector: selector - ) - } -} - -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() } - } -} - -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() } - } -} - -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) - } -} - -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: Subject) - -> ConnectableObservable where Subject.Observer.Element == Element { - return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: { subject }) - } - - /** - Multicasts the source sequence notifications through an instantiated 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. - - Subject is cleared on connection disposal or in case source sequence produces terminal event. - - - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) - - - parameter makeSubject: Factory function used to instantiate a subject for each connection. - - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. - */ - public func multicast(makeSubject: @escaping () -> Subject) - -> ConnectableObservable where Subject.Observer.Element == Element { - return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: makeSubject) - } -} - -final private class Connection: ObserverType, Disposable { - typealias Element = Subject.Observer.Element - - private var _lock: RecursiveLock - // state - private var _parent: ConnectableObservableAdapter? - private var _subscription : Disposable? - private var _subjectObserver: Subject.Observer - - private let _disposed = AtomicInt(0) - - init(parent: ConnectableObservableAdapter, subjectObserver: Subject.Observer, lock: RecursiveLock, subscription: Disposable) { - self._parent = parent - self._subscription = subscription - self._lock = lock - self._subjectObserver = subjectObserver - } - - func on(_ event: Event) { - if isFlagSet(self._disposed, 1) { - return - } - if event.isStopEvent { - self.dispose() - } - self._subjectObserver.on(event) - } - - func dispose() { - _lock.lock(); defer { _lock.unlock() } // { - fetchOr(self._disposed, 1) - guard let parent = _parent else { - return - } - - if parent._connection === self { - parent._connection = nil - parent._subject = nil - } - self._parent = nil - - self._subscription?.dispose() - self._subscription = nil - // } - } -} - -final private class ConnectableObservableAdapter - : ConnectableObservable { - typealias ConnectionType = Connection - - private let _source: Observable - private let _makeSubject: () -> Subject - - fileprivate let _lock = RecursiveLock() - fileprivate var _subject: Subject? - - // state - fileprivate var _connection: ConnectionType? - - init(source: Observable, makeSubject: @escaping () -> Subject) { - self._source = source - self._makeSubject = makeSubject - self._subject = nil - self._connection = nil - } - - override func connect() -> Disposable { - return self._lock.calculateLocked { - if let connection = self._connection { - return connection - } - - let singleAssignmentDisposable = SingleAssignmentDisposable() - let connection = Connection(parent: self, subjectObserver: self.lazySubject.asObserver(), lock: self._lock, subscription: singleAssignmentDisposable) - self._connection = connection - let subscription = self._source.subscribe(connection) - singleAssignmentDisposable.setDisposable(subscription) - return connection - } - } - - private var lazySubject: Subject { - if let subject = self._subject { - return subject - } - - let subject = self._makeSubject() - self._subject = subject - return subject - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Subject.Element { - return self.lazySubject.subscribe(observer) - } -} - -final private class RefCountSink - : Sink - , ObserverType where ConnectableSource.Element == Observer.Element { - typealias Element = Observer.Element - typealias Parent = RefCount - - private let _parent: Parent - - private var _connectionIdSnapshot: Int64 = -1 - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = self._parent._source.subscribe(self) - self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { - - self._connectionIdSnapshot = self._parent._connectionId - - if self.disposed { - return Disposables.create() - } - - if self._parent._count == 0 { - self._parent._count = 1 - self._parent._connectableSubscription = self._parent._source.connect() - } - else { - self._parent._count += 1 - } - // } - - return Disposables.create { - subscription.dispose() - self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { - if self._parent._connectionId != self._connectionIdSnapshot { - return - } - if self._parent._count == 1 { - self._parent._count = 0 - guard let connectableSubscription = self._parent._connectableSubscription else { - return - } - - connectableSubscription.dispose() - self._parent._connectableSubscription = nil - } - else if self._parent._count > 1 { - self._parent._count -= 1 - } - else { - rxFatalError("Something went wrong with RefCount disposing mechanism") - } - // } - } - } - - func on(_ event: Event) { - switch event { - case .next: - self.forwardOn(event) - case .error, .completed: - self._parent._lock.lock() // { - if self._parent._connectionId == self._connectionIdSnapshot { - let connection = self._parent._connectableSubscription - defer { connection?.dispose() } - self._parent._count = 0 - self._parent._connectionId = self._parent._connectionId &+ 1 - self._parent._connectableSubscription = nil - } - // } - self._parent._lock.unlock() - self.forwardOn(event) - self.dispose() - } - } -} - -final private class RefCount: Producer { - fileprivate let _lock = RecursiveLock() - - // state - fileprivate var _count = 0 - fileprivate var _connectionId: Int64 = 0 - fileprivate var _connectableSubscription = nil as Disposable? - - fileprivate let _source: ConnectableSource - - init(source: ConnectableSource) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) - where Observer.Element == ConnectableSource.Element { - let sink = RefCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final private class MulticastSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias ResultType = Element - typealias MutlicastType = Multicast - - private let _parent: MutlicastType - - init(parent: MutlicastType, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - do { - let subject = try self._parent._subjectSelector() - let connectable = ConnectableObservableAdapter(source: self._parent._source, makeSubject: { subject }) - - let observable = try self._parent._selector(connectable) - - let subscription = observable.subscribe(self) - let connection = connectable.connect() - - return Disposables.create(subscription, connection) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - return Disposables.create() - } - } - - func on(_ event: Event) { - self.forwardOn(event) - switch event { - case .next: break - case .error, .completed: - self.dispose() - } - } -} - -final private class Multicast: Producer { - typealias SubjectSelectorType = () throws -> Subject - 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) { - self._source = source - self._subjectSelector = subjectSelector - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - 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/Never.swift b/Pods/RxSwift/RxSwift/Observables/Never.swift deleted file mode 100644 index c56e567..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Never.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Never.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - 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 NeverProducer() - } -} - -final private class NeverProducer: Producer { - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - return Disposables.create() - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift b/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift deleted file mode 100644 index 287b429..0000000 --- a/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift +++ /dev/null @@ -1,231 +0,0 @@ -// -// ObserveOn.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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) - } - } -} - -final private class ObserveOn: Producer { - let scheduler: ImmediateSchedulerType - let source: Observable - - init(source: Observable, scheduler: ImmediateSchedulerType) { - self.scheduler = scheduler - self.source = source - -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = ObserveOnSink(scheduler: self.scheduler, observer: observer, cancel: cancel) - let subscription = self.source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - -#if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } -#endif -} - -enum ObserveOnState : Int32 { - // pump is not running - case stopped = 0 - // pump is running - case running = 1 -} - -final private class ObserveOnSink: ObserverBase { - typealias Element = Observer.Element - - let _scheduler: ImmediateSchedulerType - - var _lock = SpinLock() - let _observer: Observer - - // state - var _state = ObserveOnState.stopped - var _queue = Queue>(capacity: 10) - - let _scheduleDisposable = SerialDisposable() - let _cancel: Cancelable - - init(scheduler: ImmediateSchedulerType, observer: Observer, cancel: Cancelable) { - self._scheduler = scheduler - self._observer = observer - self._cancel = cancel - } - - override func onCore(_ event: Event) { - let shouldStart = self._lock.calculateLocked { () -> Bool in - self._queue.enqueue(event) - - switch self._state { - case .stopped: - self._state = .running - return true - case .running: - return false - } - } - - if shouldStart { - self._scheduleDisposable.disposable = self._scheduler.scheduleRecursive((), action: self.run) - } - } - - func run(_ state: (), _ recurse: (()) -> Void) { - let (nextEvent, observer) = self._lock.calculateLocked { () -> (Event?, Observer) in - if !self._queue.isEmpty { - return (self._queue.dequeue(), self._observer) - } - else { - self._state = .stopped - return (nil, self._observer) - } - } - - if let nextEvent = nextEvent, !self._cancel.isDisposed { - observer.on(nextEvent) - if nextEvent.isStopEvent { - self.dispose() - } - } - else { - return - } - - let shouldContinue = self._shouldContinue_synchronized() - - if shouldContinue { - recurse(()) - } - } - - func _shouldContinue_synchronized() -> Bool { - self._lock.lock(); defer { self._lock.unlock() } // { - if !self._queue.isEmpty { - return true - } - else { - self._state = .stopped - return false - } - // } - } - - override func dispose() { - super.dispose() - - self._cancel.dispose() - self._scheduleDisposable.dispose() - } -} - -#if TRACE_RESOURCES - private let _numberOfSerialDispatchQueueObservables = AtomicInt(0) - extension Resources { - /** - Counts number of `SerialDispatchQueueObservables`. - - Purposed for unit tests. - */ - public static var numberOfSerialDispatchQueueObservables: Int32 { - return load(_numberOfSerialDispatchQueueObservables) - } - } -#endif - -final private class ObserveOnSerialDispatchQueueSink: ObserverBase { - let scheduler: SerialDispatchQueueScheduler - let observer: Observer - - let cancel: Cancelable - - var cachedScheduleLambda: (((sink: ObserveOnSerialDispatchQueueSink, event: Event)) -> Disposable)! - - init(scheduler: SerialDispatchQueueScheduler, observer: Observer, cancel: Cancelable) { - self.scheduler = scheduler - self.observer = observer - self.cancel = cancel - super.init() - - self.cachedScheduleLambda = { pair in - guard !cancel.isDisposed else { return Disposables.create() } - - pair.sink.observer.on(pair.event) - - if pair.event.isStopEvent { - pair.sink.dispose() - } - - return Disposables.create() - } - } - - override func onCore(_ event: Event) { - _ = self.scheduler.schedule((self, event), action: self.cachedScheduleLambda!) - } - - override func dispose() { - super.dispose() - - self.cancel.dispose() - } -} - -final private class ObserveOnSerialDispatchQueue: Producer { - let scheduler: SerialDispatchQueueScheduler - let source: Observable - - init(source: Observable, scheduler: SerialDispatchQueueScheduler) { - self.scheduler = scheduler - self.source = source - - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - _ = increment(_numberOfSerialDispatchQueueObservables) - #endif - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = ObserveOnSerialDispatchQueueSink(scheduler: self.scheduler, observer: observer, cancel: cancel) - let subscription = self.source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - _ = decrement(_numberOfSerialDispatchQueueObservables) - } - #endif -} diff --git a/Pods/RxSwift/RxSwift/Observables/Optional.swift b/Pods/RxSwift/RxSwift/Observables/Optional.swift deleted file mode 100644 index 9bf5b1c..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Optional.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// Optional.swift -// RxSwift -// -// Created by tarunon on 2016/12/13. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Element?) -> 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: 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: Element?, scheduler: ImmediateSchedulerType) -> Observable { - return ObservableOptionalScheduled(optional: optional, scheduler: scheduler) - } -} - -final private class ObservableOptionalScheduledSink: Sink { - typealias Element = Observer.Element - typealias Parent = ObservableOptionalScheduled - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.schedule(self._parent._optional) { (optional: Element?) -> Disposable in - if let next = optional { - self.forwardOn(.next(next)) - return self._parent._scheduler.schedule(()) { _ in - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } else { - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } - } -} - -final private class ObservableOptionalScheduled: Producer { - fileprivate let _optional: Element? - fileprivate let _scheduler: ImmediateSchedulerType - - init(optional: Element?, scheduler: ImmediateSchedulerType) { - self._optional = optional - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = ObservableOptionalScheduledSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final private class ObservableOptional: Producer { - private let _optional: Element? - - init(optional: Element?) { - self._optional = optional - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - if let element = self._optional { - observer.on(.next(element)) - } - observer.on(.completed) - return Disposables.create() - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Producer.swift b/Pods/RxSwift/RxSwift/Observables/Producer.swift deleted file mode 100644 index 713672e..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Producer.swift +++ /dev/null @@ -1,92 +0,0 @@ -// -// Producer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/20/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class Producer : Observable { - override init() { - super.init() - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - if !CurrentThreadScheduler.isScheduleRequired { - // The returned disposable needs to release all references once it was disposed. - let disposer = SinkDisposer() - let sinkAndSubscription = self.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: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - rxAbstractMethod() - } -} - -private final class SinkDisposer: Cancelable { - private enum DisposeState: Int32 { - case disposed = 1 - case sinkAndSubscriptionSet = 2 - } - - private let _state = AtomicInt(0) - private var _sink: Disposable? - private var _subscription: Disposable? - - var isDisposed: Bool { - return isFlagSet(self._state, DisposeState.disposed.rawValue) - } - - func setSinkAndSubscription(sink: Disposable, subscription: Disposable) { - self._sink = sink - self._subscription = subscription - - let previousState = fetchOr(self._state, DisposeState.sinkAndSubscriptionSet.rawValue) - if (previousState & DisposeState.sinkAndSubscriptionSet.rawValue) != 0 { - rxFatalError("Sink and subscription were already set") - } - - if (previousState & DisposeState.disposed.rawValue) != 0 { - sink.dispose() - subscription.dispose() - self._sink = nil - self._subscription = nil - } - } - - func dispose() { - let previousState = fetchOr(self._state, DisposeState.disposed.rawValue) - - if (previousState & DisposeState.disposed.rawValue) != 0 { - return - } - - if (previousState & DisposeState.sinkAndSubscriptionSet.rawValue) != 0 { - guard let sink = self._sink else { - rxFatalError("Sink not set") - } - guard let subscription = self._subscription else { - rxFatalError("Subscription not set") - } - - sink.dispose() - subscription.dispose() - - self._sink = nil - self._subscription = nil - } - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Range.swift b/Pods/RxSwift/RxSwift/Observables/Range.swift deleted file mode 100644 index f88c999..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Range.swift +++ /dev/null @@ -1,73 +0,0 @@ -// -// Range.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where Element : RxAbstractInteger { - /** - 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: Element, count: Element, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return RangeProducer(start: start, count: count, scheduler: scheduler) - } -} - -final private class RangeProducer: Producer { - fileprivate let _start: Element - fileprivate let _count: Element - fileprivate let _scheduler: ImmediateSchedulerType - - init(start: Element, count: Element, scheduler: ImmediateSchedulerType) { - guard count >= 0 else { - rxFatalError("count can't be negative") - } - - guard start &+ (count - 1) >= start || count == 0 else { - rxFatalError("overflow of count") - } - - self._start = start - self._count = count - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = RangeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final private class RangeSink: Sink where Observer.Element: RxAbstractInteger { - typealias Parent = RangeProducer - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.scheduleRecursive(0 as Observer.Element) { 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/Reduce.swift b/Pods/RxSwift/RxSwift/Observables/Reduce.swift deleted file mode 100644 index 3f58290..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Reduce.swift +++ /dev/null @@ -1,109 +0,0 @@ -// -// Reduce.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - -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, Element) throws -> A, mapResult: @escaping (A) throws -> Result) - -> 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, Element) throws -> A) - -> Observable { - return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: { $0 }) - } -} - -final private class ReduceSink: Sink, ObserverType { - typealias ResultType = Observer.Element - typealias Parent = Reduce - - private let _parent: Parent - private var _accumulation: AccumulateType - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._accumulation = parent._seed - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - self._accumulation = try self._parent._accumulator(self._accumulation, value) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .error(let e): - self.forwardOn(.error(e)) - self.dispose() - case .completed: - do { - let result = try self._parent._mapResult(self._accumulation) - self.forwardOn(.next(result)) - self.forwardOn(.completed) - self.dispose() - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - } - } -} - -final private class Reduce: Producer { - typealias AccumulatorType = (AccumulateType, SourceType) throws -> AccumulateType - typealias ResultSelectorType = (AccumulateType) throws -> ResultType - - private 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) { - self._source = source - self._seed = seed - self._accumulator = accumulator - self._mapResult = mapResult - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == ResultType { - let sink = ReduceSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} - diff --git a/Pods/RxSwift/RxSwift/Observables/Repeat.swift b/Pods/RxSwift/RxSwift/Observables/Repeat.swift deleted file mode 100644 index 4fed45c..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Repeat.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// Repeat.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Element, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return RepeatElement(element: element, scheduler: scheduler) - } -} - -final private class RepeatElement: Producer { - fileprivate let _element: Element - fileprivate let _scheduler: ImmediateSchedulerType - - init(element: Element, scheduler: ImmediateSchedulerType) { - self._element = element - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - - return (sink: sink, subscription: subscription) - } -} - -final private class RepeatElementSink: Sink { - typealias Parent = RepeatElement - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.scheduleRecursive(self._parent._element) { e, recurse in - self.forwardOn(.next(e)) - recurse(e) - } - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift b/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift deleted file mode 100644 index f25ba94..0000000 --- a/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift +++ /dev/null @@ -1,182 +0,0 @@ -// -// RetryWhen.swift -// RxSwift -// -// Created by Junior B. on 06/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - 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) - } -} - -final private class RetryTriggerSink - : ObserverType where Sequence.Element: ObservableType, Sequence.Element.Element == Observer.Element { - typealias Element = TriggerObservable.Element - - typealias Parent = RetryWhenSequenceSinkIter - - private let _parent: Parent - - init(parent: Parent) { - self._parent = parent - } - - func on(_ event: Event) { - switch event { - case .next: - self._parent._parent._lastError = nil - self._parent._parent.schedule(.moveNext) - case .error(let e): - self._parent._parent.forwardOn(.error(e)) - self._parent._parent.dispose() - case .completed: - self._parent._parent.forwardOn(.completed) - self._parent._parent.dispose() - } - } -} - -final private class RetryWhenSequenceSinkIter - : ObserverType - , Disposable where Sequence.Element: ObservableType, Sequence.Element.Element == Observer.Element { - typealias Element = Observer.Element - typealias Parent = RetryWhenSequenceSink - - fileprivate let _parent: Parent - private let _errorHandlerSubscription = SingleAssignmentDisposable() - private let _subscription: Disposable - - init(parent: Parent, subscription: Disposable) { - self._parent = parent - self._subscription = subscription - } - - func on(_ event: Event) { - switch event { - case .next: - self._parent.forwardOn(event) - case .error(let error): - self._parent._lastError = error - - if let failedWith = error as? Error { - // dispose current subscription - self._subscription.dispose() - - let errorHandlerSubscription = self._parent._notifier.subscribe(RetryTriggerSink(parent: self)) - self._errorHandlerSubscription.setDisposable(errorHandlerSubscription) - self._parent._errorSubject.on(.next(failedWith)) - } - else { - self._parent.forwardOn(.error(error)) - self._parent.dispose() - } - case .completed: - self._parent.forwardOn(event) - self._parent.dispose() - } - } - - final func dispose() { - self._subscription.dispose() - self._errorHandlerSubscription.dispose() - } -} - -final private class RetryWhenSequenceSink - : TailRecursiveSink where Sequence.Element: ObservableType, Sequence.Element.Element == Observer.Element { - typealias Element = Observer.Element - typealias Parent = RetryWhenSequence - - let _lock = RecursiveLock() - - private let _parent: Parent - - fileprivate var _lastError: Swift.Error? - fileprivate let _errorSubject = PublishSubject() - private let _handler: Observable - fileprivate let _notifier = PublishSubject() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._handler = parent._notificationHandler(self._errorSubject).asObservable() - super.init(observer: observer, cancel: cancel) - } - - override func done() { - if let lastError = self._lastError { - self.forwardOn(.error(lastError)) - self._lastError = nil - } - else { - self.forwardOn(.completed) - } - - self.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 subscription = SingleAssignmentDisposable() - let iter = RetryWhenSequenceSinkIter(parent: self, subscription: subscription) - subscription.setDisposable(source.subscribe(iter)) - return iter - } - - override func run(_ sources: SequenceGenerator) -> Disposable { - let triggerSubscription = self._handler.subscribe(self._notifier.asObserver()) - let superSubscription = super.run(sources) - return Disposables.create(superSubscription, triggerSubscription) - } -} - -final private class RetryWhenSequence: Producer where Sequence.Element: ObservableType { - typealias Element = Sequence.Element.Element - - private let _sources: Sequence - fileprivate let _notificationHandler: (Observable) -> TriggerObservable - - init(sources: Sequence, notificationHandler: @escaping (Observable) -> TriggerObservable) { - self._sources = sources - self._notificationHandler = notificationHandler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Sample.swift b/Pods/RxSwift/RxSwift/Observables/Sample.swift deleted file mode 100644 index 7a8c721..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Sample.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// Sample.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Source) - -> Observable { - return Sample(source: self.asObservable(), sampler: sampler.asObservable()) - } -} - -final private class SamplerSink - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = SampleType - - typealias Parent = SampleSequenceSink - - private let _parent: Parent - - var _lock: RecursiveLock { - return self._parent._lock - } - - init(parent: Parent) { - self._parent = parent - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next, .completed: - if let element = _parent._element { - self._parent._element = nil - self._parent.forwardOn(.next(element)) - } - - if self._parent._atEnd { - self._parent.forwardOn(.completed) - self._parent.dispose() - } - case .error(let e): - self._parent.forwardOn(.error(e)) - self._parent.dispose() - } - } -} - -final private class SampleSequenceSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = Observer.Element - typealias Parent = Sample - - private let _parent: Parent - - let _lock = RecursiveLock() - - // state - fileprivate var _element = nil as Element? - fileprivate var _atEnd = false - - private let _sourceSubscription = SingleAssignmentDisposable() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - self._sourceSubscription.setDisposable(self._parent._source.subscribe(self)) - let samplerSubscription = self._parent._sampler.subscribe(SamplerSink(parent: self)) - - return Disposables.create(_sourceSubscription, samplerSubscription) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - self._element = element - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self._atEnd = true - self._sourceSubscription.dispose() - } - } - -} - -final private class Sample: Producer { - fileprivate let _source: Observable - fileprivate let _sampler: Observable - - init(source: Observable, sampler: Observable) { - self._source = source - self._sampler = sampler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Scan.swift b/Pods/RxSwift/RxSwift/Observables/Scan.swift deleted file mode 100644 index d998e54..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Scan.swift +++ /dev/null @@ -1,100 +0,0 @@ -// -// Scan.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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(into seed: A, accumulator: @escaping (inout A, Element) throws -> Void) - -> Observable { - return Scan(source: self.asObservable(), seed: seed, accumulator: accumulator) - } - - /** - 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, Element) throws -> A) - -> Observable { - return Scan(source: self.asObservable(), seed: seed) { acc, element in - let currentAcc = acc - acc = try accumulator(currentAcc, element) - } - } -} - -final private class ScanSink: Sink, ObserverType { - typealias Accumulate = Observer.Element - typealias Parent = Scan - - private let _parent: Parent - private var _accumulate: Accumulate - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._accumulate = parent._seed - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - try self._parent._accumulator(&self._accumulate, element) - self.forwardOn(.next(self._accumulate)) - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.completed) - self.dispose() - } - } - -} - -final private class Scan: Producer { - typealias Accumulator = (inout Accumulate, Element) throws -> Void - - private let _source: Observable - fileprivate let _seed: Accumulate - fileprivate let _accumulator: Accumulator - - init(source: Observable, seed: Accumulate, accumulator: @escaping Accumulator) { - self._source = source - self._seed = seed - self._accumulator = accumulator - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Accumulate { - let sink = ScanSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Sequence.swift b/Pods/RxSwift/RxSwift/Observables/Sequence.swift deleted file mode 100644 index f158565..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Sequence.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// Sequence.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - // 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 immediately on subscription. - - returns: The observable sequence whose elements are pulled from the given arguments. - */ - public static func of(_ elements: Element ..., scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return ObservableSequence(elements: elements, scheduler: scheduler) - } -} - -extension ObservableType { - /** - 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: [Element], 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: Sequence, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable where Sequence.Element == Element { - return ObservableSequence(elements: sequence, scheduler: scheduler) - } -} - -final private class ObservableSequenceSink: Sink where Sequence.Element == Observer.Element { - typealias Parent = ObservableSequence - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.scheduleRecursive(self._parent._elements.makeIterator()) { iterator, recurse in - var mutableIterator = iterator - if let next = mutableIterator.next() { - self.forwardOn(.next(next)) - recurse(mutableIterator) - } - else { - self.forwardOn(.completed) - self.dispose() - } - } - } -} - -final private class ObservableSequence: Producer { - fileprivate let _elements: Sequence - fileprivate let _scheduler: ImmediateSchedulerType - - init(elements: Sequence, scheduler: ImmediateSchedulerType) { - self._elements = elements - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - 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/ShareReplayScope.swift b/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift deleted file mode 100644 index a5c8a23..0000000 --- a/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift +++ /dev/null @@ -1,456 +0,0 @@ -// -// ShareReplayScope.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/28/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -/// Subject lifetime scope -public enum SubjectLifetimeScope { - /** - **Each connection will have it's own subject instance to store replay events.** - **Connections will be isolated from each another.** - - Configures the underlying implementation to behave equivalent to. - - ``` - source.multicast(makeSubject: { MySubject() }).refCount() - ``` - - **This is the recommended default.** - - This has the following consequences: - * `retry` or `concat` operators will function as expected because terminating the sequence will clear internal state. - * Each connection to source observable sequence will use it's own subject. - * When the number of subscribers drops from 1 to 0 and connection to source sequence is disposed, subject will be cleared. - - - ``` - let xs = Observable.deferred { () -> Observable in - print("Performing work ...") - return Observable.just(Date().timeIntervalSince1970) - } - .share(replay: 1, scope: .whileConnected) - - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - - ``` - - Notice how time interval is different and `Performing work ...` is printed each time) - - ``` - Performing work ... - next 1495998900.82141 - completed - - Performing work ... - next 1495998900.82359 - completed - - Performing work ... - next 1495998900.82444 - completed - - - ``` - - */ - case whileConnected - - /** - **One subject will store replay events for all connections to source.** - **Connections won't be isolated from each another.** - - Configures the underlying implementation behave equivalent to. - - ``` - source.multicast(MySubject()).refCount() - ``` - - This has the following consequences: - * Using `retry` or `concat` operators after this operator usually isn't advised. - * Each connection to source observable sequence will share the same subject. - * After number of subscribers drops from 1 to 0 and connection to source observable sequence is dispose, this operator will - continue holding a reference to the same subject. - If at some later moment a new observer initiates a new connection to source it can potentially receive - some of the stale events received during previous connection. - * After source sequence terminates any new observer will always immediately receive replayed elements and terminal event. - No new subscriptions to source observable sequence will be attempted. - - ``` - let xs = Observable.deferred { () -> Observable in - print("Performing work ...") - return Observable.just(Date().timeIntervalSince1970) - } - .share(replay: 1, scope: .forever) - - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - ``` - - Notice how time interval is the same, replayed, and `Performing work ...` is printed only once - - ``` - Performing work ... - next 1495999013.76356 - completed - - next 1495999013.76356 - completed - - next 1495999013.76356 - completed - ``` - - */ - case forever -} - -extension ObservableType { - - /** - Returns an observable sequence that **shares a single subscription to the underlying sequence**, and immediately upon subscription replays elements in buffer. - - This operator is equivalent to: - * `.whileConnected` - ``` - // Each connection will have it's own subject instance to store replay events. - // Connections will be isolated from each another. - source.multicast(makeSubject: { Replay.create(bufferSize: replay) }).refCount() - ``` - * `.forever` - ``` - // One subject will store replay events for all connections to source. - // Connections won't be isolated from each another. - source.multicast(Replay.create(bufferSize: replay)).refCount() - ``` - - It uses optimized versions of the operators for most common operations. - - - parameter replay: Maximum element count of the replay buffer. - - parameter scope: Lifetime scope of sharing subject. For more information see `SubjectLifetimeScope` enum. - - - 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 share(replay: Int = 0, scope: SubjectLifetimeScope = .whileConnected) - -> Observable { - switch scope { - case .forever: - switch replay { - case 0: return self.multicast(PublishSubject()).refCount() - default: return self.multicast(ReplaySubject.create(bufferSize: replay)).refCount() - } - case .whileConnected: - switch replay { - case 0: return ShareWhileConnected(source: self.asObservable()) - case 1: return ShareReplay1WhileConnected(source: self.asObservable()) - default: return self.multicast(makeSubject: { ReplaySubject.create(bufferSize: replay) }).refCount() - } - } - } -} - -private final class ShareReplay1WhileConnectedConnection - : ObserverType - , SynchronizedUnsubscribeType { - typealias Observers = AnyObserver.s - typealias DisposeKey = Observers.KeyType - - typealias Parent = ShareReplay1WhileConnected - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - - private let _lock: RecursiveLock - private var _disposed: Bool = false - fileprivate var _observers = Observers() - private var _element: Element? - - init(parent: Parent, lock: RecursiveLock) { - self._parent = parent - self._lock = lock - - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - #endif - } - - final func on(_ event: Event) { - self._lock.lock() - let observers = self._synchronized_on(event) - self._lock.unlock() - dispatch(observers, event) - } - - final private func _synchronized_on(_ event: Event) -> Observers { - if self._disposed { - return Observers() - } - - switch event { - case .next(let element): - self._element = element - return self._observers - case .error, .completed: - let observers = self._observers - self._synchronized_dispose() - return observers - } - } - - final func connect() { - self._subscription.setDisposable(self._parent._source.subscribe(self)) - } - - final func _synchronized_subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - self._lock.lock(); defer { self._lock.unlock() } - if let element = self._element { - observer.on(.next(element)) - } - - let disposeKey = self._observers.insert(observer.on) - - return SubscriptionDisposable(owner: self, key: disposeKey) - } - - final private func _synchronized_dispose() { - self._disposed = true - if self._parent._connection === self { - self._parent._connection = nil - } - self._observers = Observers() - } - - final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { - self._lock.lock() - let shouldDisconnect = self._synchronized_unsubscribe(disposeKey) - self._lock.unlock() - if shouldDisconnect { - self._subscription.dispose() - } - } - - @inline(__always) - final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { - // if already unsubscribed, just return - if self._observers.removeKey(disposeKey) == nil { - return false - } - - if self._observers.count == 0 { - self._synchronized_dispose() - return true - } - - return false - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif -} - -// optimized version of share replay for most common case -final private class ShareReplay1WhileConnected - : Observable { - - fileprivate typealias Connection = ShareReplay1WhileConnectedConnection - - fileprivate let _source: Observable - - private let _lock = RecursiveLock() - - fileprivate var _connection: Connection? - - init(source: Observable) { - self._source = source - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - self._lock.lock() - - let connection = self._synchronized_subscribe(observer) - let count = connection._observers.count - - let disposable = connection._synchronized_subscribe(observer) - - self._lock.unlock() - - if count == 0 { - connection.connect() - } - - return disposable - } - - @inline(__always) - private func _synchronized_subscribe(_ observer: Observer) -> Connection where Observer.Element == Element { - let connection: Connection - - if let existingConnection = self._connection { - connection = existingConnection - } - else { - connection = ShareReplay1WhileConnectedConnection( - parent: self, - lock: self._lock) - self._connection = connection - } - - return connection - } -} - -private final class ShareWhileConnectedConnection - : ObserverType - , SynchronizedUnsubscribeType { - typealias Observers = AnyObserver.s - typealias DisposeKey = Observers.KeyType - - typealias Parent = ShareWhileConnected - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - - private let _lock: RecursiveLock - private var _disposed: Bool = false - fileprivate var _observers = Observers() - - init(parent: Parent, lock: RecursiveLock) { - self._parent = parent - self._lock = lock - - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - #endif - } - - final func on(_ event: Event) { - self._lock.lock() - let observers = self._synchronized_on(event) - self._lock.unlock() - dispatch(observers, event) - } - - final private func _synchronized_on(_ event: Event) -> Observers { - if self._disposed { - return Observers() - } - - switch event { - case .next: - return self._observers - case .error, .completed: - let observers = self._observers - self._synchronized_dispose() - return observers - } - } - - final func connect() { - self._subscription.setDisposable(self._parent._source.subscribe(self)) - } - - final func _synchronized_subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - self._lock.lock(); defer { self._lock.unlock() } - - let disposeKey = self._observers.insert(observer.on) - - return SubscriptionDisposable(owner: self, key: disposeKey) - } - - final private func _synchronized_dispose() { - self._disposed = true - if self._parent._connection === self { - self._parent._connection = nil - } - self._observers = Observers() - } - - final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { - self._lock.lock() - let shouldDisconnect = self._synchronized_unsubscribe(disposeKey) - self._lock.unlock() - if shouldDisconnect { - self._subscription.dispose() - } - } - - @inline(__always) - final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { - // if already unsubscribed, just return - if self._observers.removeKey(disposeKey) == nil { - return false - } - - if self._observers.count == 0 { - self._synchronized_dispose() - return true - } - - return false - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif -} - -// optimized version of share replay for most common case -final private class ShareWhileConnected - : Observable { - - fileprivate typealias Connection = ShareWhileConnectedConnection - - fileprivate let _source: Observable - - private let _lock = RecursiveLock() - - fileprivate var _connection: Connection? - - init(source: Observable) { - self._source = source - } - - override func subscribe(_ observer: Observer) -> Disposable where Observer.Element == Element { - self._lock.lock() - - let connection = self._synchronized_subscribe(observer) - let count = connection._observers.count - - let disposable = connection._synchronized_subscribe(observer) - - self._lock.unlock() - - if count == 0 { - connection.connect() - } - - return disposable - } - - @inline(__always) - private func _synchronized_subscribe(_ observer: Observer) -> Connection where Observer.Element == Element { - let connection: Connection - - if let existingConnection = self._connection { - connection = existingConnection - } - else { - connection = ShareWhileConnectedConnection( - parent: self, - lock: self._lock) - self._connection = connection - } - - return connection - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift b/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift deleted file mode 100644 index 9374227..0000000 --- a/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// SingleAsync.swift -// RxSwift -// -// Created by Junior B. on 09/11/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 element before successfully completing. - - - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) - - - returns: An observable sequence that emits a single element or throws an exception if more (or none) of them are emitted. - */ - public func single() - -> Observable { - return SingleAsync(source: self.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 element 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 element or throws an exception if more (or none) of them are emitted. - */ - public func single(_ predicate: @escaping (Element) throws -> Bool) - -> Observable { - return SingleAsync(source: self.asObservable(), predicate: predicate) - } -} - -private final class SingleAsyncSink : Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = SingleAsync - - private let _parent: Parent - private var _seenValue: Bool = false - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let forward = try self._parent._predicate?(value) ?? true - if !forward { - return - } - } - catch let error { - self.forwardOn(.error(error as Swift.Error)) - self.dispose() - return - } - - if self._seenValue { - self.forwardOn(.error(RxError.moreThanOneElement)) - self.dispose() - return - } - - self._seenValue = true - self.forwardOn(.next(value)) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - if self._seenValue { - self.forwardOn(.completed) - } else { - self.forwardOn(.error(RxError.noElements)) - } - self.dispose() - } - } -} - -final class SingleAsync: Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - fileprivate let _predicate: Predicate? - - init(source: Observable, predicate: Predicate? = nil) { - self._source = source - self._predicate = predicate - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = SingleAsyncSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Sink.swift b/Pods/RxSwift/RxSwift/Observables/Sink.swift deleted file mode 100644 index d721fca..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Sink.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// Sink.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class Sink : Disposable { - fileprivate let _observer: Observer - fileprivate let _cancel: Cancelable - private let _disposed = AtomicInt(0) - - #if DEBUG - private let _synchronizationTracker = SynchronizationTracker() - #endif - - init(observer: Observer, cancel: Cancelable) { -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - self._observer = observer - self._cancel = cancel - } - - final func forwardOn(_ event: Event) { - #if DEBUG - self._synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { self._synchronizationTracker.unregister() } - #endif - if isFlagSet(self._disposed, 1) { - return - } - self._observer.on(event) - } - - final func forwarder() -> SinkForward { - return SinkForward(forward: self) - } - - final var disposed: Bool { - return isFlagSet(self._disposed, 1) - } - - func dispose() { - fetchOr(self._disposed, 1) - self._cancel.dispose() - } - - deinit { -#if TRACE_RESOURCES - _ = Resources.decrementTotal() -#endif - } -} - -final class SinkForward: ObserverType { - typealias Element = Observer.Element - - private let _forward: Sink - - init(forward: Sink) { - self._forward = forward - } - - final func on(_ event: Event) { - switch event { - case .next: - self._forward._observer.on(event) - case .error, .completed: - self._forward._observer.on(event) - self._forward._cancel.dispose() - } - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Skip.swift b/Pods/RxSwift/RxSwift/Observables/Skip.swift deleted file mode 100644 index 3076f9c..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Skip.swift +++ /dev/null @@ -1,158 +0,0 @@ -// -// Skip.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: self.asObservable(), count: count) - } -} - -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) - } -} - -// count version - -final private class SkipCountSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = SkipCount - - let parent: Parent - - var remaining: Int - - init(parent: Parent, observer: Observer, 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 self.remaining <= 0 { - self.forwardOn(.next(value)) - } - else { - self.remaining -= 1 - } - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.forwardOn(event) - self.dispose() - } - } - -} - -final private class SkipCount: Producer { - let source: Observable - let count: Int - - init(source: Observable, count: Int) { - self.source = source - self.count = count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = SkipCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = self.source.subscribe(sink) - - return (sink: sink, subscription: subscription) - } -} - -// time version - -final private class SkipTimeSink: Sink, ObserverType where Observer.Element == Element { - typealias Parent = SkipTime - - let parent: Parent - - // state - var open = false - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self.parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if self.open { - self.forwardOn(.next(value)) - } - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.forwardOn(event) - self.dispose() - } - } - - func tick() { - self.open = true - } - - func run() -> Disposable { - let disposeTimer = self.parent.scheduler.scheduleRelative((), dueTime: self.parent.duration) { _ in - self.tick() - return Disposables.create() - } - - let disposeSubscription = self.parent.source.subscribe(self) - - return Disposables.create(disposeTimer, disposeSubscription) - } -} - -final private 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: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/SkipUntil.swift b/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift deleted file mode 100644 index 4670c5e..0000000 --- a/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift +++ /dev/null @@ -1,139 +0,0 @@ -// -// SkipUntil.swift -// RxSwift -// -// Created by Yury Korolev on 10/3/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Source) - -> Observable { - return SkipUntil(source: self.asObservable(), other: other.asObservable()) - } -} - -final private class SkipUntilSinkOther - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Parent = SkipUntilSink - typealias Element = Other - - private let _parent: Parent - - var _lock: RecursiveLock { - return self._parent._lock - } - - let _subscription = SingleAssignmentDisposable() - - init(parent: Parent) { - self._parent = parent - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - #endif - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - self._parent._forwardElements = true - self._subscription.dispose() - case .error(let e): - self._parent.forwardOn(.error(e)) - self._parent.dispose() - case .completed: - self._subscription.dispose() - } - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif - -} - - -final private class SkipUntilSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = Observer.Element - typealias Parent = SkipUntil - - let _lock = RecursiveLock() - private let _parent: Parent - fileprivate var _forwardElements = false - - private let _sourceSubscription = SingleAssignmentDisposable() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - if self._forwardElements { - self.forwardOn(event) - } - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - if self._forwardElements { - self.forwardOn(event) - } - self.dispose() - } - } - - func run() -> Disposable { - let sourceSubscription = self._parent._source.subscribe(self) - let otherObserver = SkipUntilSinkOther(parent: self) - let otherSubscription = self._parent._other.subscribe(otherObserver) - self._sourceSubscription.setDisposable(sourceSubscription) - otherObserver._subscription.setDisposable(otherSubscription) - - return Disposables.create(_sourceSubscription, otherObserver._subscription) - } -} - -final private class SkipUntil: Producer { - - fileprivate let _source: Observable - fileprivate let _other: Observable - - init(source: Observable, other: Observable) { - self._source = source - self._other = other - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/SkipWhile.swift b/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift deleted file mode 100644 index 7ea87d8..0000000 --- a/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// SkipWhile.swift -// RxSwift -// -// Created by Yury Korolev on 10/9/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Bool) -> Observable { - return SkipWhile(source: self.asObservable(), predicate: predicate) - } -} - -final private class SkipWhileSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = SkipWhile - - private let _parent: Parent - private var _running = false - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !self._running { - do { - self._running = try !self._parent._predicate(value) - } catch let e { - self.forwardOn(.error(e)) - self.dispose() - return - } - } - - if self._running { - self.forwardOn(.next(value)) - } - case .error, .completed: - self.forwardOn(event) - self.dispose() - } - } -} - -final private class SkipWhile: Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - fileprivate let _predicate: Predicate - - init(source: Observable, predicate: @escaping Predicate) { - self._source = source - self._predicate = predicate - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = SkipWhileSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/StartWith.swift b/Pods/RxSwift/RxSwift/Observables/StartWith.swift deleted file mode 100644 index 13fb31d..0000000 --- a/Pods/RxSwift/RxSwift/Observables/StartWith.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// StartWith.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Element ...) - -> Observable { - return StartWith(source: self.asObservable(), elements: elements) - } -} - -final private 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: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - for e in self.elements { - observer.on(.next(e)) - } - - return (sink: Disposables.create(), subscription: self.source.subscribe(observer)) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift b/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift deleted file mode 100644 index 5f7be0b..0000000 --- a/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift +++ /dev/null @@ -1,83 +0,0 @@ -// -// SubscribeOn.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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) - } -} - -final private class SubscribeOnSink: Sink, ObserverType where Ob.Element == Observer.Element { - typealias Element = Observer.Element - typealias Parent = SubscribeOn - - let parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self.parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - self.forwardOn(event) - - if event.isStopEvent { - self.dispose() - } - } - - func run() -> Disposable { - let disposeEverything = SerialDisposable() - let cancelSchedule = SingleAssignmentDisposable() - - disposeEverything.disposable = cancelSchedule - - let disposeSchedule = self.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 - } -} - -final private class SubscribeOn: Producer { - let source: Ob - let scheduler: ImmediateSchedulerType - - init(source: Ob, scheduler: ImmediateSchedulerType) { - self.source = source - self.scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Ob.Element { - 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/Switch.swift b/Pods/RxSwift/RxSwift/Observables/Switch.swift deleted file mode 100644 index ae876cc..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Switch.swift +++ /dev/null @@ -1,234 +0,0 @@ -// -// Switch.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Source) - -> Observable { - return FlatMapLatest(source: self.asObservable(), selector: selector) - } -} - -extension ObservableType where Element : 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: self.asObservable()) - } -} - -private class SwitchSink - : Sink - , ObserverType where Source.Element == Observer.Element { - typealias Element = SourceType - - private let _subscriptions: SingleAssignmentDisposable = SingleAssignmentDisposable() - private let _innerSubscription: SerialDisposable = SerialDisposable() - - let _lock = RecursiveLock() - - // state - fileprivate var _stopped = false - fileprivate var _latest = 0 - fileprivate var _hasLatest = false - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - let subscription = source.subscribe(self) - self._subscriptions.setDisposable(subscription) - return Disposables.create(_subscriptions, _innerSubscription) - } - - func performMap(_ element: SourceType) throws -> Source { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: Element) -> (Int, Observable)? { - self._lock.lock(); defer { self._lock.unlock() } // { - do { - let observable = try self.performMap(element).asObservable() - self._hasLatest = true - self._latest = self._latest &+ 1 - return (self._latest, observable) - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - - return nil - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let (latest, observable) = self.nextElementArrived(element: element) { - let d = SingleAssignmentDisposable() - self._innerSubscription.disposable = d - - let observer = SwitchSinkIter(parent: self, id: latest, _self: d) - let disposable = observable.subscribe(observer) - d.setDisposable(disposable) - } - case .error(let error): - self._lock.lock(); defer { self._lock.unlock() } - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self._lock.lock(); defer { self._lock.unlock() } - self._stopped = true - - self._subscriptions.dispose() - - if !self._hasLatest { - self.forwardOn(.completed) - self.dispose() - } - } - } -} - -final private class SwitchSinkIter - : ObserverType - , LockOwnerType - , SynchronizedOnType where Source.Element == Observer.Element { - typealias Element = Source.Element - typealias Parent = SwitchSink - - private let _parent: Parent - private let _id: Int - private let _self: Disposable - - var _lock: RecursiveLock { - return self._parent._lock - } - - init(parent: Parent, id: Int, _self: Disposable) { - self._parent = parent - self._id = id - self._self = _self - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: break - case .error, .completed: - self._self.dispose() - } - - if self._parent._latest != self._id { - return - } - - switch event { - case .next: - self._parent.forwardOn(event) - case .error: - self._parent.forwardOn(event) - self._parent.dispose() - case .completed: - self._parent._hasLatest = false - if self._parent._stopped { - self._parent.forwardOn(event) - self._parent.dispose() - } - } - } -} - -// MARK: Specializations - -final private class SwitchIdentitySink: SwitchSink - where Observer.Element == Source.Element { - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: Source) throws -> Source { - return element - } -} - -final private class MapSwitchSink: SwitchSink where Observer.Element == Source.Element { - typealias Selector = (SourceType) throws -> Source - - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - self._selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceType) throws -> Source { - return try self._selector(element) - } -} - -// MARK: Producers - -final private class Switch: Producer { - private let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Source.Element { - let sink = SwitchIdentitySink(observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} - -final private class FlatMapLatest: Producer { - typealias Selector = (SourceType) throws -> Source - - private let _source: Observable - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - self._source = source - self._selector = selector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Source.Element { - let sink = MapSwitchSink(selector: self._selector, observer: observer, cancel: cancel) - let subscription = sink.run(self._source) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift b/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift deleted file mode 100644 index 5ead0f2..0000000 --- a/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// SwitchIfEmpty.swift -// RxSwift -// -// Created by sergdort on 23/12/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Returns the elements of the specified sequence or `switchTo` sequence if the sequence is empty. - - - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) - - - parameter switchTo: Observable sequence being returned when source sequence is empty. - - returns: Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements. - */ - public func ifEmpty(switchTo other: Observable) -> Observable { - return SwitchIfEmpty(source: self.asObservable(), ifEmpty: other) - } -} - -final private class SwitchIfEmpty: Producer { - - private let _source: Observable - private let _ifEmpty: Observable - - init(source: Observable, ifEmpty: Observable) { - self._source = source - self._ifEmpty = ifEmpty - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = SwitchIfEmptySink(ifEmpty: self._ifEmpty, - observer: observer, - cancel: cancel) - let subscription = sink.run(self._source.asObservable()) - - return (sink: sink, subscription: subscription) - } -} - -final private class SwitchIfEmptySink: Sink - , ObserverType { - typealias Element = Observer.Element - - private let _ifEmpty: Observable - private var _isEmpty = true - private let _ifEmptySubscription = SingleAssignmentDisposable() - - init(ifEmpty: Observable, observer: Observer, cancel: Cancelable) { - self._ifEmpty = ifEmpty - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - let subscription = source.subscribe(self) - return Disposables.create(subscription, _ifEmptySubscription) - } - - func on(_ event: Event) { - switch event { - case .next: - self._isEmpty = false - self.forwardOn(event) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - guard self._isEmpty else { - self.forwardOn(.completed) - self.dispose() - return - } - let ifEmptySink = SwitchIfEmptySinkIter(parent: self) - self._ifEmptySubscription.setDisposable(self._ifEmpty.subscribe(ifEmptySink)) - } - } -} - -final private class SwitchIfEmptySinkIter - : ObserverType { - typealias Element = Observer.Element - typealias Parent = SwitchIfEmptySink - - private let _parent: Parent - - init(parent: Parent) { - self._parent = parent - } - - func on(_ event: Event) { - switch event { - case .next: - self._parent.forwardOn(event) - case .error: - self._parent.forwardOn(event) - self._parent.dispose() - case .completed: - self._parent.forwardOn(event) - self._parent.dispose() - } - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Take.swift b/Pods/RxSwift/RxSwift/Observables/Take.swift deleted file mode 100644 index 696a336..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Take.swift +++ /dev/null @@ -1,179 +0,0 @@ -// -// Take.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: self.asObservable(), count: count) - } - } -} - -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) - } -} - -// count version - -final private class TakeCountSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = TakeCount - - private let _parent: Parent - - private var _remaining: Int - - init(parent: Parent, observer: Observer, 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 self._remaining > 0 { - self._remaining -= 1 - - self.forwardOn(.next(value)) - - if self._remaining == 0 { - self.forwardOn(.completed) - self.dispose() - } - } - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.forwardOn(event) - self.dispose() - } - } - -} - -final private class TakeCount: Producer { - private let _source: Observable - fileprivate let _count: Int - - init(source: Observable, count: Int) { - if count < 0 { - rxFatalError("count can't be negative") - } - self._source = source - self._count = count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = TakeCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} - -// time version - -final private class TakeTimeSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType where Observer.Element == Element { - typealias Parent = TakeTime - - private let _parent: Parent - - let _lock = RecursiveLock() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let value): - self.forwardOn(.next(value)) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.forwardOn(event) - self.dispose() - } - } - - func tick() { - self._lock.lock(); defer { self._lock.unlock() } - - self.forwardOn(.completed) - self.dispose() - } - - func run() -> Disposable { - let disposeTimer = self._parent._scheduler.scheduleRelative((), dueTime: self._parent._duration) { _ in - self.tick() - return Disposables.create() - } - - let disposeSubscription = self._parent._source.subscribe(self) - - return Disposables.create(disposeTimer, disposeSubscription) - } -} - -final private 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) { - self._source = source - self._scheduler = scheduler - self._duration = duration - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/TakeLast.swift b/Pods/RxSwift/RxSwift/Observables/TakeLast.swift deleted file mode 100644 index ad3b3b7..0000000 --- a/Pods/RxSwift/RxSwift/Observables/TakeLast.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// TakeLast.swift -// RxSwift -// -// Created by Tomi Koskinen on 25/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: self.asObservable(), count: count) - } -} - -final private class TakeLastSink: Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = TakeLast - - private let _parent: Parent - - private var _elements: Queue - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - self._elements = Queue(capacity: parent._count + 1) - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - self._elements.enqueue(value) - if self._elements.count > self._parent._count { - _ = self._elements.dequeue() - } - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - for e in self._elements { - self.forwardOn(.next(e)) - } - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class TakeLast: Producer { - private let _source: Observable - fileprivate let _count: Int - - init(source: Observable, count: Int) { - if count < 0 { - rxFatalError("count can't be negative") - } - self._source = source - self._count = count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift b/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift deleted file mode 100644 index 3c11f30..0000000 --- a/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift +++ /dev/null @@ -1,227 +0,0 @@ -// -// TakeUntil.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Source) - -> Observable { - return TakeUntil(source: self.asObservable(), other: other.asObservable()) - } - - /** - Returns elements from an observable sequence until the specified condition is true. - - - seealso: [takeUntil operator on reactivex.io](http://reactivex.io/documentation/operators/takeuntil.html) - - - parameter behavior: Whether or not to include the last element matching the predicate. - - 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 passes. - */ - public func takeUntil(_ behavior: TakeUntilBehavior, - predicate: @escaping (Element) throws -> Bool) - -> Observable { - return TakeUntilPredicate(source: self.asObservable(), - behavior: behavior, - predicate: predicate) - } -} - -/// Behaviors for the `takeUntil(_ behavior:predicate:)` operator. -public enum TakeUntilBehavior { - /// Include the last element matching the predicate. - case inclusive - - /// Exclude the last element matching the predicate. - case exclusive -} - -// MARK: - TakeUntil Observable -final private class TakeUntilSinkOther - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Parent = TakeUntilSink - typealias Element = Other - - private let _parent: Parent - - var _lock: RecursiveLock { - return self._parent._lock - } - - fileprivate let _subscription = SingleAssignmentDisposable() - - init(parent: Parent) { - self._parent = parent -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - self._parent.forwardOn(.completed) - self._parent.dispose() - case .error(let e): - self._parent.forwardOn(.error(e)) - self._parent.dispose() - case .completed: - self._subscription.dispose() - } - } - -#if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } -#endif -} - -final private class TakeUntilSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType { - typealias Element = Observer.Element - typealias Parent = TakeUntil - - private let _parent: Parent - - let _lock = RecursiveLock() - - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - self.forwardOn(event) - case .error: - self.forwardOn(event) - self.dispose() - case .completed: - self.forwardOn(event) - self.dispose() - } - } - - func run() -> Disposable { - let otherObserver = TakeUntilSinkOther(parent: self) - let otherSubscription = self._parent._other.subscribe(otherObserver) - otherObserver._subscription.setDisposable(otherSubscription) - let sourceSubscription = self._parent._source.subscribe(self) - - return Disposables.create(sourceSubscription, otherObserver._subscription) - } -} - -final private class TakeUntil: Producer { - - fileprivate let _source: Observable - fileprivate let _other: Observable - - init(source: Observable, other: Observable) { - self._source = source - self._other = other - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = TakeUntilSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -// MARK: - TakeUntil Predicate -final private class TakeUntilPredicateSink - : Sink, ObserverType { - typealias Element = Observer.Element - typealias Parent = TakeUntilPredicate - - private let _parent: Parent - private var _running = true - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !self._running { - return - } - - do { - self._running = try !self._parent._predicate(value) - } catch let e { - self.forwardOn(.error(e)) - self.dispose() - return - } - - if self._running { - self.forwardOn(.next(value)) - } else { - if self._parent._behavior == .inclusive { - self.forwardOn(.next(value)) - } - - self.forwardOn(.completed) - self.dispose() - } - case .error, .completed: - self.forwardOn(event) - self.dispose() - } - } - -} - -final private class TakeUntilPredicate: Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - fileprivate let _predicate: Predicate - fileprivate let _behavior: TakeUntilBehavior - - init(source: Observable, - behavior: TakeUntilBehavior, - predicate: @escaping Predicate) { - self._source = source - self._behavior = behavior - self._predicate = predicate - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = TakeUntilPredicateSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift b/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift deleted file mode 100644 index 61cfc9f..0000000 --- a/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift +++ /dev/null @@ -1,85 +0,0 @@ -// -// TakeWhile.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 (Element) throws -> Bool) - -> Observable { - return TakeWhile(source: self.asObservable(), predicate: predicate) - } -} - -final private class TakeWhileSink - : Sink - , ObserverType { - typealias Element = Observer.Element - typealias Parent = TakeWhile - - private let _parent: Parent - - private var _running = true - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !self._running { - return - } - - do { - self._running = try self._parent._predicate(value) - } catch let e { - self.forwardOn(.error(e)) - self.dispose() - return - } - - if self._running { - self.forwardOn(.next(value)) - } else { - self.forwardOn(.completed) - self.dispose() - } - case .error, .completed: - self.forwardOn(event) - self.dispose() - } - } - -} - -final private class TakeWhile: Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - fileprivate let _predicate: Predicate - - init(source: Observable, predicate: @escaping Predicate) { - self._source = source - self._predicate = predicate - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - let sink = TakeWhileSink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Throttle.swift b/Pods/RxSwift/RxSwift/Observables/Throttle.swift deleted file mode 100644 index f682433..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Throttle.swift +++ /dev/null @@ -1,159 +0,0 @@ -// -// Throttle.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/22/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -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 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) - } -} - -final private class ThrottleSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = Observer.Element - typealias ParentType = Throttle - - private let _parent: ParentType - - let _lock = RecursiveLock() - - // state - private var _lastUnsentElement: Element? - private var _lastSentTime: Date? - private var _completed: Bool = false - - let cancellable = SerialDisposable() - - init(parent: ParentType, observer: Observer, cancel: Cancelable) { - self._parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = self._parent._source.subscribe(self) - - return Disposables.create(subscription, cancellable) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - let now = self._parent._scheduler.now - - let reducedScheduledTime: RxTimeInterval - - if let lastSendingTime = self._lastSentTime { - reducedScheduledTime = self._parent._dueTime.reduceWithSpanBetween(earlierDate: lastSendingTime, laterDate: now) - } - else { - reducedScheduledTime = .nanoseconds(0) - } - - if reducedScheduledTime.isNow { - self.sendNow(element: element) - return - } - - if !self._parent._latest { - return - } - - let isThereAlreadyInFlightRequest = self._lastUnsentElement != nil - - self._lastUnsentElement = element - - if isThereAlreadyInFlightRequest { - return - } - - let scheduler = self._parent._scheduler - - let d = SingleAssignmentDisposable() - self.cancellable.disposable = d - - d.setDisposable(scheduler.scheduleRelative(0, dueTime: reducedScheduledTime, action: self.propagate)) - case .error: - self._lastUnsentElement = nil - self.forwardOn(event) - self.dispose() - case .completed: - if self._lastUnsentElement != nil { - self._completed = true - } - else { - self.forwardOn(.completed) - self.dispose() - } - } - } - - private func sendNow(element: Element) { - self._lastUnsentElement = nil - self.forwardOn(.next(element)) - // in case element processing takes a while, this should give some more room - self._lastSentTime = self._parent._scheduler.now - } - - func propagate(_: Int) -> Disposable { - self._lock.lock(); defer { self._lock.unlock() } // { - if let lastUnsentElement = self._lastUnsentElement { - self.sendNow(element: lastUnsentElement) - } - - if self._completed { - self.forwardOn(.completed) - self.dispose() - } - // } - return Disposables.create() - } -} - -final private 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) { - self._source = source - self._dueTime = dueTime - self._latest = latest - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Timeout.swift b/Pods/RxSwift/RxSwift/Observables/Timeout.swift deleted file mode 100644 index 3177c42..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Timeout.swift +++ /dev/null @@ -1,151 +0,0 @@ -// -// Timeout.swift -// RxSwift -// -// Created by Tomi Koskinen on 13/11/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 `RxError.timeout` 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: Source, scheduler: SchedulerType) - -> Observable where Element == Source.Element { - return Timeout(source: self.asObservable(), dueTime: dueTime, other: other.asObservable(), scheduler: scheduler) - } -} - -final private class TimeoutSink: Sink, LockOwnerType, ObserverType { - typealias Element = Observer.Element - typealias Parent = Timeout - - private let _parent: Parent - - let _lock = RecursiveLock() - - private let _timerD = SerialDisposable() - private let _subscription = SerialDisposable() - - private var _id = 0 - private var _switched = false - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let original = SingleAssignmentDisposable() - self._subscription.disposable = original - - self._createTimeoutTimer() - - original.setDisposable(self._parent._source.subscribe(self)) - - return Disposables.create(_subscription, _timerD) - } - - func on(_ event: Event) { - switch event { - case .next: - var onNextWins = false - - self._lock.performLocked { - onNextWins = !self._switched - if onNextWins { - self._id = self._id &+ 1 - } - } - - if onNextWins { - self.forwardOn(event) - self._createTimeoutTimer() - } - case .error, .completed: - var onEventWins = false - - self._lock.performLocked { - onEventWins = !self._switched - if onEventWins { - self._id = self._id &+ 1 - } - } - - if onEventWins { - self.forwardOn(event) - self.dispose() - } - } - } - - private func _createTimeoutTimer() { - if self._timerD.isDisposed { - return - } - - let nextTimer = SingleAssignmentDisposable() - self._timerD.disposable = nextTimer - - let disposeSchedule = self._parent._scheduler.scheduleRelative(self._id, dueTime: self._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.subscribe(self.forwarder()) - } - - return Disposables.create() - } - - nextTimer.setDisposable(disposeSchedule) - } -} - - -final private 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) { - self._source = source - self._dueTime = dueTime - self._other = other - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Timer.swift b/Pods/RxSwift/RxSwift/Observables/Timer.swift deleted file mode 100644 index 7b29bca..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Timer.swift +++ /dev/null @@ -1,116 +0,0 @@ -// -// Timer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where Element : RxAbstractInteger { - /** - 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 - ) - } -} - -extension ObservableType where Element: RxAbstractInteger { - /** - 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 - ) - } -} - -import Foundation - -final private class TimerSink : Sink where Observer.Element : RxAbstractInteger { - typealias Parent = Timer - - private let _parent: Parent - private let _lock = RecursiveLock() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.schedulePeriodic(0 as Observer.Element, startAfter: self._parent._dueTime, period: self._parent._period!) { state in - self._lock.lock(); defer { self._lock.unlock() } - self.forwardOn(.next(state)) - return state &+ 1 - } - } -} - -final private class TimerOneOffSink: Sink where Observer.Element: RxAbstractInteger { - typealias Parent = Timer - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return self._parent._scheduler.scheduleRelative(self, dueTime: self._parent._dueTime) { [unowned self] _ -> Disposable in - self.forwardOn(.next(0)) - self.forwardOn(.completed) - self.dispose() - - return Disposables.create() - } - } -} - -final private class Timer: Producer { - fileprivate let _scheduler: SchedulerType - fileprivate let _dueTime: RxTimeInterval - fileprivate let _period: RxTimeInterval? - - init(dueTime: RxTimeInterval, period: RxTimeInterval?, scheduler: SchedulerType) { - self._scheduler = scheduler - self._dueTime = dueTime - self._period = period - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - if self._period != nil { - 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/ToArray.swift b/Pods/RxSwift/RxSwift/Observables/ToArray.swift deleted file mode 100644 index 2821a60..0000000 --- a/Pods/RxSwift/RxSwift/Observables/ToArray.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// ToArray.swift -// RxSwift -// -// Created by Junior B. on 20/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - -extension ObservableType { - - /** - Converts an Observable into a Single 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: A Single sequence containing all the emitted elements as array. - */ - public func toArray() - -> Single<[Element]> { - return PrimitiveSequence(raw: ToArray(source: self.asObservable())) - } -} - -final private class ToArraySink: Sink, ObserverType where Observer.Element == [SourceType] { - typealias Parent = ToArray - - let _parent: Parent - var _list = [SourceType]() - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._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): - self.forwardOn(.error(e)) - self.dispose() - case .completed: - self.forwardOn(.next(self._list)) - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class ToArray: Producer<[SourceType]> { - let _source: Observable - - init(source: Observable) { - self._source = source - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == [SourceType] { - let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) - let subscription = self._source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/Pods/RxSwift/RxSwift/Observables/Using.swift b/Pods/RxSwift/RxSwift/Observables/Using.swift deleted file mode 100644 index 14c5698..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Using.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// Using.swift -// RxSwift -// -// Created by Yury Korolev on 10/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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 -> Resource, observableFactory: @escaping (Resource) throws -> Observable) -> Observable { - return Using(resourceFactory: resourceFactory, observableFactory: observableFactory) - } -} - -final private class UsingSink: Sink, ObserverType { - typealias SourceType = Observer.Element - typealias Parent = Using - - private let _parent: Parent - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - var disposable = Disposables.create() - - do { - let resource = try self._parent._resourceFactory() - disposable = resource - let source = try self._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): - self.forwardOn(.next(value)) - case let .error(error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self.forwardOn(.completed) - self.dispose() - } - } -} - -final private class Using: Producer { - - typealias Element = 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) { - self._resourceFactory = resourceFactory - self._observableFactory = observableFactory - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Element { - 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/Window.swift b/Pods/RxSwift/RxSwift/Observables/Window.swift deleted file mode 100644 index b93cfa6..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Window.swift +++ /dev/null @@ -1,168 +0,0 @@ -// -// Window.swift -// RxSwift -// -// Created by Junior B. on 29/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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) - } -} - -final private class WindowTimeCountSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType where Observer.Element == Observable { - typealias Parent = WindowTimeCount - - private let _parent: Parent - - let _lock = RecursiveLock() - - 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: Observer, cancel: Cancelable) { - self._parent = parent - - _ = self._groupDisposable.insert(self._timerD) - - self._refCountDisposable = RefCountDisposable(disposable: self._groupDisposable) - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - - self.forwardOn(.next(AddRef(source: self._subject, refCount: self._refCountDisposable).asObservable())) - self.createTimer(self._windowId) - - _ = self._groupDisposable.insert(self._parent._source.subscribe(self)) - return self._refCountDisposable - } - - func startNewWindowAndCompleteCurrentOne() { - self._subject.on(.completed) - self._subject = PublishSubject() - - self.forwardOn(.next(AddRef(source: self._subject, refCount: self._refCountDisposable).asObservable())) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - var newWindow = false - var newId = 0 - - switch event { - case .next(let element): - self._subject.on(.next(element)) - - do { - _ = try incrementChecked(&self._count) - } catch let e { - self._subject.on(.error(e as Swift.Error)) - self.dispose() - } - - if self._count == self._parent._count { - newWindow = true - self._count = 0 - self._windowId += 1 - newId = self._windowId - self.startNewWindowAndCompleteCurrentOne() - } - - case .error(let error): - self._subject.on(.error(error)) - self.forwardOn(.error(error)) - self.dispose() - case .completed: - self._subject.on(.completed) - self.forwardOn(.completed) - self.dispose() - } - - if newWindow { - self.createTimer(newId) - } - } - - func createTimer(_ windowId: Int) { - if self._timerD.isDisposed { - return - } - - if self._windowId != windowId { - return - } - - let nextTimer = SingleAssignmentDisposable() - - self._timerD.disposable = nextTimer - - let scheduledRelative = self._parent._scheduler.scheduleRelative(windowId, dueTime: self._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) - } -} - -final private 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) { - self._source = source - self._timeSpan = timeSpan - self._count = count - self._scheduler = scheduler - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/WithLatestFrom.swift b/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift deleted file mode 100644 index 7e62dcd..0000000 --- a/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift +++ /dev/null @@ -1,149 +0,0 @@ -// -// WithLatestFrom.swift -// RxSwift -// -// Created by Yury Korolev on 10/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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: Source, resultSelector: @escaping (Element, Source.Element) throws -> ResultType) -> Observable { - return WithLatestFrom(first: self.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` emits 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: Source) -> Observable { - return WithLatestFrom(first: self.asObservable(), second: second.asObservable(), resultSelector: { $1 }) - } -} - -final private class WithLatestFromSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias ResultType = Observer.Element - typealias Parent = WithLatestFrom - typealias Element = FirstType - - private let _parent: Parent - - fileprivate var _lock = RecursiveLock() - fileprivate var _latest: SecondType? - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let sndSubscription = SingleAssignmentDisposable() - let sndO = WithLatestFromSecond(parent: self, disposable: sndSubscription) - - sndSubscription.setDisposable(self._parent._second.subscribe(sndO)) - let fstSubscription = self._parent._first.subscribe(self) - - return Disposables.create(fstSubscription, sndSubscription) - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case let .next(value): - guard let latest = self._latest else { return } - do { - let res = try self._parent._resultSelector(value, latest) - - self.forwardOn(.next(res)) - } catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - case .completed: - self.forwardOn(.completed) - self.dispose() - case let .error(error): - self.forwardOn(.error(error)) - self.dispose() - } - } -} - -final private class WithLatestFromSecond - : ObserverType - , LockOwnerType - , SynchronizedOnType { - - typealias ResultType = Observer.Element - typealias Parent = WithLatestFromSink - typealias Element = SecondType - - private let _parent: Parent - private let _disposable: Disposable - - var _lock: RecursiveLock { - return self._parent._lock - } - - init(parent: Parent, disposable: Disposable) { - self._parent = parent - self._disposable = disposable - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case let .next(value): - self._parent._latest = value - case .completed: - self._disposable.dispose() - case let .error(error): - self._parent.forwardOn(.error(error)) - self._parent.dispose() - } - } -} - -final private 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) { - self._first = first - self._second = second - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == 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/Zip+Collection.swift b/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift deleted file mode 100644 index cc232ab..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift +++ /dev/null @@ -1,169 +0,0 @@ -// -// Zip+Collection.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - 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: Collection, resultSelector: @escaping ([Collection.Element.Element]) throws -> Element) -> Observable - where Collection.Element: ObservableType { - return ZipCollectionType(sources: collection, resultSelector: resultSelector) - } - - /** - Merges the specified observable sequences into one observable sequence 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip(_ collection: Collection) -> Observable<[Element]> - where Collection.Element: ObservableType, Collection.Element.Element == Element { - return ZipCollectionType(sources: collection, resultSelector: { $0 }) - } - -} - -final private class ZipCollectionTypeSink - : Sink where Collection.Element: ObservableConvertibleType { - typealias Result = Observer.Element - typealias Parent = ZipCollectionType - typealias SourceElement = Collection.Element.Element - - private let _parent: Parent - - private let _lock = RecursiveLock() - - // 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: Observer, cancel: Cancelable) { - self._parent = parent - self._values = [Queue](repeating: Queue(capacity: 4), count: parent.count) - self._isDone = [Bool](repeating: false, count: parent.count) - self._subscriptions = [SingleAssignmentDisposable]() - self._subscriptions.reserveCapacity(parent.count) - - for _ in 0 ..< parent.count { - self._subscriptions.append(SingleAssignmentDisposable()) - } - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event, atIndex: Int) { - self._lock.lock(); defer { self._lock.unlock() } // { - switch event { - case .next(let element): - self._values[atIndex].enqueue(element) - - if self._values[atIndex].count == 1 { - self._numberOfValues += 1 - } - - if self._numberOfValues < self._parent.count { - if self._numberOfDone == self._parent.count - 1 { - self.forwardOn(.completed) - self.dispose() - } - return - } - - do { - var arguments = [SourceElement]() - arguments.reserveCapacity(self._parent.count) - - // recalculate number of values - self._numberOfValues = 0 - - for i in 0 ..< self._values.count { - arguments.append(self._values[i].dequeue()!) - if !self._values[i].isEmpty { - self._numberOfValues += 1 - } - } - - let result = try self._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 self._isDone[atIndex] { - return - } - - self._isDone[atIndex] = true - self._numberOfDone += 1 - - if self._numberOfDone == self._parent.count { - self.forwardOn(.completed) - self.dispose() - } - else { - self._subscriptions[atIndex].dispose() - } - } - // } - } - - func run() -> Disposable { - var j = 0 - for i in self._parent.sources { - let index = j - let source = i.asObservable() - - let disposable = source.subscribe(AnyObserver { event in - self.on(event, atIndex: index) - }) - self._subscriptions[j].setDisposable(disposable) - j += 1 - } - - if self._parent.sources.isEmpty { - self.forwardOn(.completed) - } - - return Disposables.create(_subscriptions) - } -} - -final private class ZipCollectionType: Producer where Collection.Element: ObservableConvertibleType { - typealias ResultSelector = ([Collection.Element.Element]) throws -> Result - - let sources: Collection - let resultSelector: ResultSelector - let count: Int - - init(sources: Collection, resultSelector: @escaping ResultSelector) { - self.sources = sources - self.resultSelector = resultSelector - self.count = self.sources.count - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - 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/Zip+arity.swift b/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift deleted file mode 100644 index d2a28d4..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift +++ /dev/null @@ -1,934 +0,0 @@ -// 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. -// - - - -// 2 - -extension ObservableType { - /** - 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.Element, O2.Element) throws -> Element) - -> Observable { - return Zip2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2) - -> Observable<(O1.Element, O2.Element)> { - return Zip2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: { ($0, $1) } - ) - } -} - -final class ZipSink2_ : ZipSink { - typealias Result = Observer.Element - typealias Parent = Zip2 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 2, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - - return Disposables.create([ - subscription1, - subscription2 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!) - } -} - -final class Zip2 : Producer { - typealias ResultSelector = (E1, E2) throws -> Result - - let source1: Observable - let source2: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink2_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 3 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element) throws -> Element) - -> Observable { - return Zip3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3) - -> Observable<(O1.Element, O2.Element, O3.Element)> { - return Zip3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: { ($0, $1, $2) } - ) - } -} - -final class ZipSink3_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 3, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!) - } -} - -final class Zip3 : Producer { - typealias ResultSelector = (E1, E2, E3) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink3_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 4 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element) throws -> Element) - -> Observable { - return Zip4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element)> { - return Zip4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: { ($0, $1, $2, $3) } - ) - } -} - -final class ZipSink4_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 4, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - case 3: return !self._values4.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - subscription4.setDisposable(self._parent.source4.subscribe(observer4)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!) - } -} - -final class Zip4 : Producer { - typealias ResultSelector = (E1, E2, E3, E4) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink4_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 5 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element) throws -> Element) - -> Observable { - return Zip5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element)> { - return Zip5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4) } - ) - } -} - -final class ZipSink5_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 5, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - case 3: return !self._values4.isEmpty - case 4: return !self._values5.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - subscription4.setDisposable(self._parent.source4.subscribe(observer4)) - subscription5.setDisposable(self._parent.source5.subscribe(observer5)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!) - } -} - -final class Zip5 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink5_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 6 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element) throws -> Element) - -> Observable { - return Zip6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element)> { - return Zip6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5) } - ) - } -} - -final class ZipSink6_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 6, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - case 3: return !self._values4.isEmpty - case 4: return !self._values5.isEmpty - case 5: return !self._values6.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - 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: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - subscription4.setDisposable(self._parent.source4.subscribe(observer4)) - subscription5.setDisposable(self._parent.source5.subscribe(observer5)) - subscription6.setDisposable(self._parent.source6.subscribe(observer6)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!) - } -} - -final class Zip6 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink6_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 7 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element) throws -> Element) - -> 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 - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element)> { - return Zip7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } - ) - } -} - -final class ZipSink7_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 7, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - case 3: return !self._values4.isEmpty - case 4: return !self._values5.isEmpty - case 5: return !self._values6.isEmpty - case 6: return !self._values7.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - 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: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - let observer7 = ZipObserver(lock: self._lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - subscription4.setDisposable(self._parent.source4.subscribe(observer4)) - subscription5.setDisposable(self._parent.source5.subscribe(observer5)) - subscription6.setDisposable(self._parent.source6.subscribe(observer6)) - subscription7.setDisposable(self._parent.source7.subscribe(observer7)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!, self._values7.dequeue()!) - } -} - -final class Zip7 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - let sink = ZipSink7_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 8 - -extension ObservableType { - /** - 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.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element) throws -> Element) - -> 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 - ) - } -} - -extension ObservableType where Element == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples 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) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> Observable<(O1.Element, O2.Element, O3.Element, O4.Element, O5.Element, O6.Element, O7.Element, O8.Element)> { - 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: { ($0, $1, $2, $3, $4, $5, $6, $7) } - ) - } -} - -final class ZipSink8_ : ZipSink { - typealias Result = Observer.Element - 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: Observer, cancel: Cancelable) { - self._parent = parent - super.init(arity: 8, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch index { - case 0: return !self._values1.isEmpty - case 1: return !self._values2.isEmpty - case 2: return !self._values3.isEmpty - case 3: return !self._values4.isEmpty - case 4: return !self._values5.isEmpty - case 5: return !self._values6.isEmpty - case 6: return !self._values7.isEmpty - case 7: return !self._values8.isEmpty - - default: - rxFatalError("Unhandled case (Function)") - } - } - - 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: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - let observer7 = ZipObserver(lock: self._lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) - let observer8 = ZipObserver(lock: self._lock, parent: self, index: 7, setNextValue: { self._values8.enqueue($0) }, this: subscription8) - - subscription1.setDisposable(self._parent.source1.subscribe(observer1)) - subscription2.setDisposable(self._parent.source2.subscribe(observer2)) - subscription3.setDisposable(self._parent.source3.subscribe(observer3)) - subscription4.setDisposable(self._parent.source4.subscribe(observer4)) - subscription5.setDisposable(self._parent.source5.subscribe(observer5)) - subscription6.setDisposable(self._parent.source6.subscribe(observer6)) - subscription7.setDisposable(self._parent.source7.subscribe(observer7)) - subscription8.setDisposable(self._parent.source8.subscribe(observer8)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7, - subscription8 - ]) - } - - override func getResult() throws -> Result { - return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!, self._values7.dequeue()!, self._values8.dequeue()!) - } -} - -final class Zip8 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> Result - - 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 - - self._resultSelector = resultSelector - } - - override func run(_ observer: Observer, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where Observer.Element == Result { - 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/Zip.swift b/Pods/RxSwift/RxSwift/Observables/Zip.swift deleted file mode 100644 index 911eb57..0000000 --- a/Pods/RxSwift/RxSwift/Observables/Zip.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// Zip.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol ZipSinkProtocol : class -{ - func next(_ index: Int) - func fail(_ error: Swift.Error) - func done(_ index: Int) -} - -class ZipSink : Sink, ZipSinkProtocol { - typealias Element = Observer.Element - - let _arity: Int - - let _lock = RecursiveLock() - - // state - private var _isDone: [Bool] - - init(arity: Int, observer: Observer, cancel: Cancelable) { - self._isDone = [Bool](repeating: false, count: arity) - self._arity = arity - - super.init(observer: observer, cancel: cancel) - } - - func getResult() throws -> Element { - rxAbstractMethod() - } - - func hasElements(_ index: Int) -> Bool { - rxAbstractMethod() - } - - func next(_ index: Int) { - var hasValueAll = true - - for i in 0 ..< self._arity { - if !self.hasElements(i) { - hasValueAll = false - break - } - } - - if hasValueAll { - do { - let result = try self.getResult() - self.forwardOn(.next(result)) - } - catch let e { - self.forwardOn(.error(e)) - self.dispose() - } - } - } - - func fail(_ error: Swift.Error) { - self.forwardOn(.error(error)) - self.dispose() - } - - func done(_ index: Int) { - self._isDone[index] = true - - var allDone = true - - for done in self._isDone where !done { - allDone = false - break - } - - if allDone { - self.forwardOn(.completed) - self.dispose() - } - } -} - -final class ZipObserver - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias ValueSetter = (Element) -> Void - - private var _parent: ZipSinkProtocol? - - let _lock: RecursiveLock - - // state - private let _index: Int - private let _this: Disposable - private let _setNextValue: ValueSetter - - init(lock: RecursiveLock, parent: ZipSinkProtocol, index: Int, setNextValue: @escaping ValueSetter, this: Disposable) { - self._lock = lock - self._parent = parent - self._index = index - self._this = this - self._setNextValue = setNextValue - } - - func on(_ event: Event) { - self.synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - if self._parent != nil { - switch event { - case .next: - break - case .error: - self._this.dispose() - case .completed: - self._this.dispose() - } - } - - if let parent = self._parent { - switch event { - case .next(let value): - self._setNextValue(value) - parent.next(self._index) - case .error(let error): - parent.fail(error) - case .completed: - parent.done(self._index) - } - } - } -} diff --git a/Pods/RxSwift/RxSwift/ObserverType.swift b/Pods/RxSwift/RxSwift/ObserverType.swift deleted file mode 100644 index fe38d4f..0000000 --- a/Pods/RxSwift/RxSwift/ObserverType.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// ObserverType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Supports push-style iteration over an observable sequence. -public protocol ObserverType { - /// The type of elements in sequence that observer can observe. - associatedtype Element - - @available(*, deprecated, renamed: "Element") - typealias E = Element - - /// Notify observer about sequence event. - /// - /// - parameter event: Event that occurred. - func on(_ event: Event) -} - -/// Convenience API extensions to provide alternate next, error, completed events -extension ObserverType { - - /// Convenience method equivalent to `on(.next(element: Element))` - /// - /// - parameter element: Next element to send to observer(s) - public func onNext(_ element: Element) { - self.on(.next(element)) - } - - /// Convenience method equivalent to `on(.completed)` - public func onCompleted() { - self.on(.completed) - } - - /// Convenience method equivalent to `on(.error(Swift.Error))` - /// - parameter error: Swift.Error to send to observer(s) - public func onError(_ error: Swift.Error) { - self.on(.error(error)) - } -} diff --git a/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift b/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift deleted file mode 100644 index 804e289..0000000 --- a/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// AnonymousObserver.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -final class AnonymousObserver: ObserverBase { - typealias EventHandler = (Event) -> Void - - private let _eventHandler : EventHandler - - init(_ eventHandler: @escaping EventHandler) { -#if TRACE_RESOURCES - _ = Resources.incrementTotal() -#endif - self._eventHandler = eventHandler - } - - override func onCore(_ event: Event) { - return self._eventHandler(event) - } - -#if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } -#endif -} diff --git a/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift b/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift deleted file mode 100644 index 57be8e2..0000000 --- a/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// ObserverBase.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class ObserverBase : Disposable, ObserverType { - private let _isStopped = AtomicInt(0) - - func on(_ event: Event) { - switch event { - case .next: - if load(self._isStopped) == 0 { - self.onCore(event) - } - case .error, .completed: - if fetchOr(self._isStopped, 1) == 0 { - self.onCore(event) - } - } - } - - func onCore(_ event: Event) { - rxAbstractMethod() - } - - func dispose() { - fetchOr(self._isStopped, 1) - } -} diff --git a/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift b/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift deleted file mode 100644 index 41363a9..0000000 --- a/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift +++ /dev/null @@ -1,151 +0,0 @@ -// -// TailRecursiveSink.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 Sequence.Element: ObservableConvertibleType, Sequence.Element.Element == Observer.Element { - typealias Value = TailRecursiveSinkCommand - typealias Element = Observer.Element - typealias SequenceGenerator = (generator: Sequence.Iterator, remaining: IntMax?) - - var _generators: [SequenceGenerator] = [] - var _isDisposed = false - var _subscription = SerialDisposable() - - // this is thread safe object - var _gate = AsyncLock>>() - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func run(_ sources: SequenceGenerator) -> Disposable { - self._generators.append(sources) - - self.schedule(.moveNext) - - return self._subscription - } - - func invoke(_ command: TailRecursiveSinkCommand) { - switch command { - case .dispose: - self.disposeCommand() - case .moveNext: - self.moveNextCommand() - } - } - - // simple implementation for now - func schedule(_ command: TailRecursiveSinkCommand) { - self._gate.invoke(InvocableScheduledItem(invocable: self, state: command)) - } - - func done() { - self.forwardOn(.completed) - self.dispose() - } - - func extract(_ observable: Observable) -> SequenceGenerator? { - rxAbstractMethod() - } - - // should be done on gate locked - - private func moveNextCommand() { - var next: Observable? - - repeat { - guard let (g, left) = self._generators.last else { - break - } - - if self._isDisposed { - return - } - - self._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 { - self._generators.append((e, knownOriginalLeft - 1)) - } - } - else { - self._generators.append((e, nil)) - } - - let nextGenerator = self.extract(nextCandidate) - - if let nextGenerator = nextGenerator { - self._generators.append(nextGenerator) - #if DEBUG || TRACE_RESOURCES - if maxTailRecursiveSinkStackSize < self._generators.count { - maxTailRecursiveSinkStackSize = self._generators.count - } - #endif - } - else { - next = nextCandidate - } - } while next == nil - - guard let existingNext = next else { - self.done() - return - } - - let disposable = SingleAssignmentDisposable() - self._subscription.disposable = disposable - disposable.setDisposable(self.subscribeToNext(existingNext)) - } - - func subscribeToNext(_ source: Observable) -> Disposable { - rxAbstractMethod() - } - - func disposeCommand() { - self._isDisposed = true - self._generators.removeAll(keepingCapacity: false) - } - - override func dispose() { - super.dispose() - - self._subscription.dispose() - self._gate.dispose() - - self.schedule(.dispose) - } -} - diff --git a/Pods/RxSwift/RxSwift/Reactive.swift b/Pods/RxSwift/RxSwift/Reactive.swift deleted file mode 100644 index 4974b14..0000000 --- a/Pods/RxSwift/RxSwift/Reactive.swift +++ /dev/null @@ -1,79 +0,0 @@ -// -// 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 ReactiveBase - - @available(*, deprecated, renamed: "ReactiveBase") - typealias CompatibleType = ReactiveBase - - /// 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 - } - // swiftlint:disable:next unused_setter_value - set { - // this enables using Reactive to "mutate" base type - } - } - - /// Reactive extensions. - public var rx: Reactive { - get { - return Reactive(self) - } - // swiftlint:disable:next unused_setter_value - set { - // this enables using Reactive to "mutate" base object - } - } -} - -import class Foundation.NSObject - -/// Extend NSObject with `rx` proxy. -extension NSObject: ReactiveCompatible { } diff --git a/Pods/RxSwift/RxSwift/Rx.swift b/Pods/RxSwift/RxSwift/Rx.swift deleted file mode 100644 index 37c9f2d..0000000 --- a/Pods/RxSwift/RxSwift/Rx.swift +++ /dev/null @@ -1,141 +0,0 @@ -// -// Rx.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if TRACE_RESOURCES - private let 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 load(resourceCount) - } - - /// Increments `Resources.total` resource count. - /// - /// - returns: New resource count - public static func incrementTotal() -> Int32 { - return increment(resourceCount) - } - - /// Decrements `Resources.total` resource count - /// - /// - returns: New resource count - public static func decrementTotal() -> Int32 { - return decrement(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 rxAbstractMethod(file: StaticString = #file, line: UInt = #line) -> Swift.Never { - rxFatalError("Abstract method", file: file, line: line) -} - -func rxFatalError(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) -> Swift.Never { - fatalError(lastMessage(), file: file, line: line) -} - -func rxFatalErrorInDebug(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) { - #if DEBUG - fatalError(lastMessage(), file: file, line: line) - #else - print("\(file):\(line): \(lastMessage())") - #endif -} - -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 -} - -#if DEBUG - import class Foundation.Thread - final class SynchronizationTracker { - private let _lock = RecursiveLock() - - public enum SynchronizationErrorMessages: String { - case variable = "Two different threads are trying to assign the same `Variable.value` unsynchronized.\n This is undefined behavior because the end result (variable value) is nondeterministic and depends on the \n operating system thread scheduler. This will cause random behavior of your program.\n" - case `default` = "Two different unsynchronized threads are trying to send some event simultaneously.\n This is undefined behavior because the ordering of the effects caused by these events is nondeterministic and depends on the \n operating system thread scheduler. This will result in a random behavior of your program.\n" - } - - private var _threads = [UnsafeMutableRawPointer: Int]() - - private func synchronizationError(_ message: String) { - #if FATAL_SYNCHRONIZATION - rxFatalError(message) - #else - print(message) - #endif - } - - func register(synchronizationErrorMessage: SynchronizationErrorMessages) { - self._lock.lock(); defer { self._lock.unlock() } - let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() - let count = (self._threads[pointer] ?? 0) + 1 - - if count > 1 { - self.synchronizationError( - "⚠️ Reentrancy anomaly was detected.\n" + - " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + - " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + - " This behavior breaks the grammar because there is overlapping between sequence events.\n" + - " Observable sequence is trying to send an event before sending of previous event has finished.\n" + - " > Interpretation: This could mean that there is some kind of unexpected cyclic dependency in your code,\n" + - " or that the system is not behaving in the expected way.\n" + - " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + - " or by enqueuing sequence events in some other way.\n" - ) - } - - self._threads[pointer] = count - - if self._threads.count > 1 { - self.synchronizationError( - "⚠️ Synchronization anomaly was detected.\n" + - " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + - " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + - " This behavior breaks the grammar because there is overlapping between sequence events.\n" + - " Observable sequence is trying to send an event before sending of previous event has finished.\n" + - " > Interpretation: " + synchronizationErrorMessage.rawValue + - " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + - " or by synchronizing sequence events in some other way.\n" - ) - } - } - - func unregister() { - self._lock.lock(); defer { self._lock.unlock() } - let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() - self._threads[pointer] = (self._threads[pointer] ?? 1) - 1 - if self._threads[pointer] == 0 { - self._threads[pointer] = nil - } - } - } - -#endif - -/// RxSwift global hooks -public enum Hooks { - - // Should capture call stack - public static var recordCallStackOnError: Bool = false - -} diff --git a/Pods/RxSwift/RxSwift/RxMutableBox.swift b/Pods/RxSwift/RxSwift/RxMutableBox.swift deleted file mode 100644 index fd6fc98..0000000 --- a/Pods/RxSwift/RxSwift/RxMutableBox.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// RxMutableBox.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/22/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(Linux) -/// As Swift 5 was released, A patch to `Thread` for Linux -/// changed `threadDictionary` to a `NSMutableDictionary` instead of -/// a `Dictionary`: https://github.com/apple/swift-corelibs-foundation/pull/1762/files -/// -/// This means that on Linux specifically, `RxMutableBox` must be a `NSObject` -/// or it won't be possible to store it in `Thread.threadDictionary`. -/// -/// For more information, read the discussion at: -/// https://github.com/ReactiveX/RxSwift/issues/1911#issuecomment-479723298 -import class Foundation.NSObject - -/// Creates mutable reference wrapper for any type. -final class RxMutableBox: NSObject { - /// Wrapped value - var value: T - - /// Creates reference wrapper for `value`. - /// - /// - parameter value: Value to wrap. - init (_ value: T) { - self.value = value - } -} -#else -/// Creates mutable reference wrapper for any type. -final 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))" - } -} -#endif diff --git a/Pods/RxSwift/RxSwift/SchedulerType.swift b/Pods/RxSwift/RxSwift/SchedulerType.swift deleted file mode 100644 index 96664b4..0000000 --- a/Pods/RxSwift/RxSwift/SchedulerType.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// SchedulerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import enum Dispatch.DispatchTimeInterval -import struct Foundation.Date - -// Type that represents time interval in the context of RxSwift. -public typealias RxTimeInterval = DispatchTimeInterval - -/// 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) -> Void) -> 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 deleted file mode 100644 index ac51324..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift +++ /dev/null @@ -1,84 +0,0 @@ -// -// ConcurrentDispatchQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/5/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import struct Foundation.TimeInterval -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. - /// - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - public init(queue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - self.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. - /// - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - @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 immediately. - - - 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: RxTimeInterval, 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: RxTimeInterval, period: RxTimeInterval, 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 deleted file mode 100644 index f535a22..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// ConcurrentMainScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import struct Foundation.TimeInterval -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 self._mainScheduler.now as Date - } - - private init(mainScheduler: MainScheduler) { - self._mainQueue = DispatchQueue.main - self._mainScheduler = mainScheduler - } - - /// Singleton instance of `ConcurrentMainScheduler` - public static let instance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance) - - /** - Schedules an action to be executed immediately. - - - 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() - - self._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: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - return self._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: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - return self._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 deleted file mode 100644 index c238ebd..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift +++ /dev/null @@ -1,138 +0,0 @@ -// -// CurrentThreadScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSObject -import protocol Foundation.NSCopying -import class Foundation.Thread -import Dispatch - -#if os(Linux) - import struct Foundation.pthread_key_t - import func Foundation.pthread_setspecific - import func Foundation.pthread_getspecific - import func Foundation.pthread_key_create - - fileprivate enum CurrentThreadSchedulerQueueKey { - fileprivate static let instance = "RxSwift.CurrentThreadScheduler.Queue" - } -#else - private class CurrentThreadSchedulerQueueKey: NSObject, NSCopying { - static let instance = CurrentThreadSchedulerQueueKey() - private override init() { - super.init() - } - - override var hash: Int { - return 0 - } - - public func copy(with zone: NSZone? = nil) -> Any { - return self - } - } -#endif - -/// 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() - - private static var isScheduleRequiredKey: pthread_key_t = { () -> pthread_key_t in - let key = UnsafeMutablePointer.allocate(capacity: 1) - defer { key.deallocate() } - - guard pthread_key_create(key, nil) == 0 else { - rxFatalError("isScheduleRequired key creation failed") - } - - return key.pointee - }() - - private static var scheduleInProgressSentinel: UnsafeRawPointer = { () -> UnsafeRawPointer in - return UnsafeRawPointer(UnsafeMutablePointer.allocate(capacity: 1)) - }() - - static var queue : ScheduleQueue? { - get { - return Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerQueueKey.instance) - } - set { - Thread.setThreadLocalStorageValue(newValue, forKey: CurrentThreadSchedulerQueueKey.instance) - } - } - - /// Gets a value that indicates whether the caller must call a `schedule` method. - public static private(set) var isScheduleRequired: Bool { - get { - return pthread_getspecific(CurrentThreadScheduler.isScheduleRequiredKey) == nil - } - set(isScheduleRequired) { - if pthread_setspecific(CurrentThreadScheduler.isScheduleRequiredKey, isScheduleRequired ? nil : scheduleInProgressSentinel) != 0 { - rxFatalError("pthread_setspecific failed") - } - } - } - - /** - 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 deleted file mode 100644 index 11af238..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// HistoricalScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -/// 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 deleted file mode 100644 index 12eeb5c..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// HistoricalSchedulerTimeConverter.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import Foundation - -/// Converts historical 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 = TimeInterval - - /// 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) -> TimeInterval { - 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: TimeInterval) -> 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/Internal/DispatchQueueConfiguration.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift deleted file mode 100644 index bac5e9a..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// DispatchQueueConfiguration.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/23/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import Dispatch -import struct Foundation.TimeInterval - -struct DispatchQueueConfiguration { - let queue: DispatchQueue - let leeway: DispatchTimeInterval -} - -extension DispatchQueueConfiguration { - func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let cancel = SingleAssignmentDisposable() - - self.queue.async { - if cancel.isDisposed { - return - } - - - cancel.setDisposable(action(state)) - } - - return cancel - } - - func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - let deadline = DispatchTime.now() + dueTime - - let compositeDisposable = CompositeDisposable() - - let timer = DispatchSource.makeTimerSource(queue: self.queue) - timer.schedule(deadline: deadline, leeway: self.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 compositeDisposable.isDisposed { - return - } - _ = compositeDisposable.insert(action(state)) - cancelTimer.dispose() - }) - timer.resume() - - _ = compositeDisposable.insert(cancelTimer) - - return compositeDisposable - } - - func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - let initial = DispatchTime.now() + startAfter - - var timerState = state - - let timer = DispatchSource.makeTimerSource(queue: self.queue) - timer.schedule(deadline: initial, repeating: period, leeway: self.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 deleted file mode 100644 index f31469e..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// InvocableScheduledItem.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct InvocableScheduledItem : InvocableType { - - let _invocable: I - let _state: I.Value - - init(invocable: I, state: I.Value) { - self._invocable = invocable - self._state = state - } - - func invoke() { - self._invocable.invoke(self._state) - } -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift deleted file mode 100644 index 0dba433..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// InvocableType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -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 deleted file mode 100644 index 6e7a0c1..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ScheduledItem.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct ScheduledItem - : ScheduledItemType - , InvocableType { - typealias Action = (T) -> Disposable - - private let _action: Action - private let _state: T - - private let _disposable = SingleAssignmentDisposable() - - var isDisposed: Bool { - return self._disposable.isDisposed - } - - init(action: @escaping Action, state: T) { - self._action = action - self._state = state - } - - func invoke() { - self._disposable.setDisposable(self._action(self._state)) - } - - func dispose() { - self._disposable.dispose() - } -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift b/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift deleted file mode 100644 index d2b16ca..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// ScheduledItemType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol ScheduledItemType - : Cancelable - , InvocableType { - func invoke() -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift deleted file mode 100644 index 8fb0907..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift +++ /dev/null @@ -1,80 +0,0 @@ -// -// MainScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import Dispatch -#if !os(Linux) - import Foundation -#endif - -/** -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 - - let numberEnqueued = AtomicInt(0) - - /// Initializes new instance of `MainScheduler`. - public init() { - self._mainQueue = DispatchQueue.main - super.init(serialQueue: self._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 background thread. Please use `MainScheduler.instance.schedule` to schedule work on main thread.") - } - } - - /// In case this method is running on a background thread it will throw an exception. - public class func ensureRunningOnMainThread(errorMessage: String? = nil) { - #if !os(Linux) // isMainThread is not implemented in Linux Foundation - guard Thread.isMainThread else { - rxFatalError(errorMessage ?? "Running on background thread.") - } - #endif - } - - override func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let previousNumberEnqueued = increment(self.numberEnqueued) - - if DispatchQueue.isMain && previousNumberEnqueued == 0 { - let disposable = action(state) - decrement(self.numberEnqueued) - return disposable - } - - let cancel = SingleAssignmentDisposable() - - self._mainQueue.async { - if !cancel.isDisposed { - _ = action(state) - } - - decrement(self.numberEnqueued) - } - - return cancel - } -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift deleted file mode 100644 index 81ba59f..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// OperationQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/4/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.Operation -import class Foundation.OperationQueue -import class Foundation.BlockOperation -import Dispatch - -/// 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 - public let queuePriority: Operation.QueuePriority - - /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. - /// - /// - parameter operationQueue: Operation queue targeted to perform work on. - /// - parameter queuePriority: Queue priority which will be assigned to new operations. - public init(operationQueue: OperationQueue, queuePriority: Operation.QueuePriority = .normal) { - self.operationQueue = operationQueue - self.queuePriority = queuePriority - } - - /** - 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)) - } - - operation.queuePriority = self.queuePriority - - self.operationQueue.addOperation(operation) - - return cancel - } - -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift b/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift deleted file mode 100644 index 9e9b4ff..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift +++ /dev/null @@ -1,220 +0,0 @@ -// -// RecursiveScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -private enum ScheduleState { - case initial - case added(CompositeDisposable.DisposeKey) - case done -} - -/// Type erased recursive scheduler. -final class AnyRecursiveScheduler { - - typealias Action = (State, AnyRecursiveScheduler) -> Void - - private let _lock = RecursiveLock() - - // state - private let _group = CompositeDisposable() - - private var _scheduler: SchedulerType - private var _action: Action? - - init(scheduler: SchedulerType, action: @escaping Action) { - self._action = action - self._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 = self._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() - } - - self._lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - case .initial: - if let removeKey = self._group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - 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 = self._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() - } - - self._lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - case .initial: - if let removeKey = self._group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - case .done: - break - } - } - } - - func dispose() { - self._lock.performLocked { - self._action = nil - } - self._group.dispose() - } -} - -/// Type erased recursive scheduler. -final 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) { - self._action = action - self._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 = self._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() - } - - self._lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - case .initial: - if let removeKey = self._group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - case .done: - break - } - } - } - - func dispose() { - self._lock.performLocked { - self._action = nil - } - self._group.dispose() - } -} diff --git a/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift b/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift deleted file mode 100644 index 5b7b840..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// SchedulerServices+Emulation.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -enum SchedulePeriodicRecursiveCommand { - case tick - case dispatchStart -} - -final 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 let _pendingTickCount = AtomicInt(0) - - init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { - self._scheduler = scheduler - self._startAfter = startAfter - self._period = period - self._action = action - self._state = state - } - - func start() -> Disposable { - return self._scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: self._startAfter, action: self.tick) - } - - func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) { - // 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: self._period) - - // The idea is that if on tick there wasn't any item enqueued, schedule to perform work immediately. - // Else work will be scheduled after previous enqueued work completes. - if increment(self._pendingTickCount) == 0 { - self.tick(.dispatchStart, scheduler: scheduler) - } - - case .dispatchStart: - self._state = self._action(self._state) - // Start work and schedule check is this last batch of work - if decrement(self._pendingTickCount) > 1 { - // 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 deleted file mode 100644 index 321877e..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift +++ /dev/null @@ -1,132 +0,0 @@ -// -// SerialDispatchQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.TimeInterval -import struct Foundation.Date -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 - - /** - Constructs new `SerialDispatchQueueScheduler` that wraps `serialQueue`. - - - parameter serialQueue: Target dispatch queue. - - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - */ - init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - self.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. - - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - */ - 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. - - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - */ - 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 one 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. - - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. - */ - @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 immediately. - - - 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: RxTimeInterval, 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: RxTimeInterval, period: RxTimeInterval, 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 deleted file mode 100644 index 7069b00..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// 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) -> TimeInterval - - /** - Converts from `NSTimeInterval` to virtual time interval. - - - parameter timeInterval: `NSTimeInterval` to convert to virtual time interval. - - returns: Virtual time interval corresponding to time interval. - */ - func convertToVirtualTimeInterval(_ timeInterval: TimeInterval) -> 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 additional 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 additional 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 deleted file mode 100644 index 1170a01..0000000 --- a/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift +++ /dev/null @@ -1,267 +0,0 @@ -// -// VirtualTimeScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// 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 - - private var _schedulerQueue : PriorityQueue> - private var _converter: Converter - - private var _nextId = 0 - - /// - returns: Current time. - public var now: RxTime { - return self._converter.convertFromVirtualTime(self.clock) - } - - /// - returns: Scheduler's absolute time clock value. - public var clock: VirtualTime { - return self._clock - } - - /// Creates a new virtual time scheduler. - /// - /// - parameter initialClock: Initial value for the clock. - public init(initialClock: VirtualTime, converter: Converter) { - self._clock = initialClock - self._running = false - self._converter = converter - self._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 - _ = Resources.incrementTotal() - #endif - } - - /** - Schedules an action to be executed immediately. - - - 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: .microseconds(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.addingDispatchInterval(dueTime) - let absoluteTime = self._converter.convertToVirtualTime(time) - let adjustedTime = self.adjustScheduledTime(absoluteTime) - return self.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 = self._converter.offsetVirtualTime(self.clock, offset: dueTime) - return self.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: VirtualTime, action: @escaping (StateType) -> Disposable) -> Disposable { - MainScheduler.ensureExecutingOnScheduler() - - let compositeDisposable = CompositeDisposable() - - let item = VirtualSchedulerItem(action: { - return action(state) - }, time: time, id: self._nextId) - - self._nextId += 1 - - self._schedulerQueue.enqueue(item) - - _ = compositeDisposable.insert(item) - - return compositeDisposable - } - - /// Adjusts time of scheduling before adding item to schedule queue. - open func adjustScheduledTime(_ time: VirtualTime) -> VirtualTime { - return time - } - - /// Starts the virtual time scheduler. - public func start() { - MainScheduler.ensureExecutingOnScheduler() - - if self._running { - return - } - - self._running = true - repeat { - guard let next = self.findNext() else { - break - } - - if self._converter.compareVirtualTime(next.time, self.clock).greaterThan { - self._clock = next.time - } - - next.invoke() - self._schedulerQueue.remove(next) - } while self._running - - self._running = false - } - - func findNext() -> VirtualSchedulerItem? { - while let front = self._schedulerQueue.peek() { - if front.isDisposed { - self._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 self._running { - fatalError("Scheduler is already running") - } - - self._running = true - repeat { - guard let next = self.findNext() else { - break - } - - if self._converter.compareVirtualTime(next.time, virtualTime).greaterThan { - break - } - - if self._converter.compareVirtualTime(next.time, self.clock).greaterThan { - self._clock = next.time - } - next.invoke() - self._schedulerQueue.remove(next) - } while self._running - - self._clock = virtualTime - self._running = false - } - - /// Advances the scheduler's clock by the specified relative time. - public func sleep(_ virtualInterval: VirtualTimeInterval) { - MainScheduler.ensureExecutingOnScheduler() - - let sleepTo = self._converter.offsetVirtualTime(self.clock, offset: virtualInterval) - if self._converter.compareVirtualTime(sleepTo, self.clock).lessThen { - fatalError("Can't sleep to past.") - } - - self._clock = sleepTo - } - - /// Stops the virtual time scheduler. - public func stop() { - MainScheduler.ensureExecutingOnScheduler() - - self._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 - } -} - -final class VirtualSchedulerItem