├── .swift-version ├── Amber ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── AmberMiddleware.swift │ ├── AmberReducer.swift │ ├── AmberController.swift │ ├── AmberController+UI.swift │ └── Amber.swift ├── _Pods.xcodeproj ├── Assets ├── amberLogo.png ├── overview.png └── amberLogo2.png ├── Example ├── Podfile ├── Pods │ ├── Target Support Files │ │ ├── Bond │ │ │ ├── Bond.modulemap │ │ │ ├── Bond-dummy.m │ │ │ ├── Bond-prefix.pch │ │ │ ├── Bond-umbrella.h │ │ │ ├── Bond.xcconfig │ │ │ └── Info.plist │ │ ├── Amber │ │ │ ├── Amber.modulemap │ │ │ ├── Amber-dummy.m │ │ │ ├── Amber-prefix.pch │ │ │ ├── Amber-umbrella.h │ │ │ ├── Amber.xcconfig │ │ │ └── Info.plist │ │ ├── Differ │ │ │ ├── Differ.modulemap │ │ │ ├── Differ-dummy.m │ │ │ ├── Differ-prefix.pch │ │ │ ├── Differ-umbrella.h │ │ │ ├── Differ.xcconfig │ │ │ └── Info.plist │ │ ├── ReactiveKit │ │ │ ├── ReactiveKit.modulemap │ │ │ ├── ReactiveKit-dummy.m │ │ │ ├── ReactiveKit-prefix.pch │ │ │ ├── ReactiveKit-umbrella.h │ │ │ ├── ReactiveKit.xcconfig │ │ │ └── Info.plist │ │ └── Pods-Amber_Tests │ │ │ ├── Pods-Amber_Tests.modulemap │ │ │ ├── Pods-Amber_Tests-dummy.m │ │ │ ├── Pods-Amber_Tests-umbrella.h │ │ │ ├── Info.plist │ │ │ ├── Pods-Amber_Tests.debug.xcconfig │ │ │ ├── Pods-Amber_Tests.release.xcconfig │ │ │ ├── Pods-Amber_Tests-acknowledgements.markdown │ │ │ ├── Pods-Amber_Tests-frameworks.sh │ │ │ ├── Pods-Amber_Tests-resources.sh │ │ │ └── Pods-Amber_Tests-acknowledgements.plist │ ├── Bond │ │ ├── Sources │ │ │ ├── Bond │ │ │ │ ├── UIKit │ │ │ │ │ ├── UIAccessibilityIdentification.swift │ │ │ │ │ ├── UINavigationBar.swift │ │ │ │ │ ├── UIApplication.swift │ │ │ │ │ ├── UINavigationItem.swift │ │ │ │ │ ├── UIImageView.swift │ │ │ │ │ ├── UIProgressView.swift │ │ │ │ │ ├── UISwitch.swift │ │ │ │ │ ├── UISlider.swift │ │ │ │ │ ├── UIDatePicker.swift │ │ │ │ │ ├── UIStepper.swift │ │ │ │ │ ├── UIBarItem.swift │ │ │ │ │ ├── UIRefreshControl.swift │ │ │ │ │ ├── UISegmentedControl.swift │ │ │ │ │ ├── UILabel.swift │ │ │ │ │ ├── UIActivityIndicatorView.swift │ │ │ │ │ ├── UIView.swift │ │ │ │ │ ├── UITextField.swift │ │ │ │ │ ├── UIButton.swift │ │ │ │ │ ├── UITextView.swift │ │ │ │ │ ├── UIBarButtonItem.swift │ │ │ │ │ ├── UIControl.swift │ │ │ │ │ ├── UIGestureRecognizer.swift │ │ │ │ │ └── UICollectionView.swift │ │ │ │ ├── Shared │ │ │ │ │ ├── SignalProtocol.swift │ │ │ │ │ ├── NSLayoutConstraint.swift │ │ │ │ │ ├── CALayer.swift │ │ │ │ │ ├── NotificationCenter.swift │ │ │ │ │ └── NSObject.swift │ │ │ │ ├── Observable.swift │ │ │ │ ├── QueryableDataSource.swift │ │ │ │ ├── Property.swift │ │ │ │ ├── Bond.swift │ │ │ │ └── DataSource.swift │ │ │ └── BNDProtocolProxyBase │ │ │ │ ├── include │ │ │ │ └── BNDProtocolProxyBase.h │ │ │ │ └── BNDProtocolProxyBase.m │ │ ├── Supporting Files │ │ │ └── Bond.h │ │ └── LICENSE │ ├── Manifest.lock │ ├── Differ │ │ ├── Sources │ │ │ └── Differ │ │ │ │ ├── Patch+Apply.swift │ │ │ │ ├── ExtendedPatch+Apply.swift │ │ │ │ ├── LinkedList.swift │ │ │ │ ├── Patch.swift │ │ │ │ ├── Patch+Sort.swift │ │ │ │ ├── GenericPatch.swift │ │ │ │ └── NestedDiff.swift │ │ └── LICENSE.md │ ├── Local Podspecs │ │ └── Amber.podspec.json │ └── ReactiveKit │ │ ├── LICENSE │ │ ├── Sources │ │ ├── NoError.swift │ │ ├── Optional.swift │ │ ├── Lock.swift │ │ ├── Typealiases.swift │ │ ├── Signal.swift │ │ ├── Deallocatable.swift │ │ ├── Event.swift │ │ ├── Result.swift │ │ ├── Reactive.swift │ │ ├── Property.swift │ │ ├── Observer.swift │ │ ├── Connectable.swift │ │ ├── ExecutionContext.swift │ │ └── Subjects.swift │ │ └── ReactiveKit │ │ └── ReactiveKit.h ├── Amber.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Amber-Example.xcscheme ├── Amber.xcworkspace │ ├── xcshareddata │ │ └── WorkspaceSettings.xcsettings │ └── contents.xcworkspacedata ├── Podfile.lock └── Tests │ ├── Info.plist │ └── Tests.swift ├── .travis.yml ├── .gitignore ├── LICENSE └── Amber.podspec /.swift-version: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Amber/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Amber/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /Assets/amberLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anvics/Amber/HEAD/Assets/amberLogo.png -------------------------------------------------------------------------------- /Assets/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anvics/Amber/HEAD/Assets/overview.png -------------------------------------------------------------------------------- /Assets/amberLogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anvics/Amber/HEAD/Assets/amberLogo2.png -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'Amber_Tests' do 4 | pod 'Amber', :path => '../' 5 | pod 'Bond', '~> 6.5.0' 6 | 7 | 8 | end 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Bond.modulemap: -------------------------------------------------------------------------------- 1 | framework module Bond { 2 | umbrella header "Bond-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Amber.modulemap: -------------------------------------------------------------------------------- 1 | framework module Amber { 2 | umbrella header "Amber-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Bond-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Bond : NSObject 3 | @end 4 | @implementation PodsDummy_Bond 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Differ.modulemap: -------------------------------------------------------------------------------- 1 | framework module Differ { 2 | umbrella header "Differ-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Amber-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Amber : NSObject 3 | @end 4 | @implementation PodsDummy_Amber 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Differ-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Differ : NSObject 3 | @end 4 | @implementation PodsDummy_Differ 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/ReactiveKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module ReactiveKit { 2 | umbrella header "ReactiveKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/ReactiveKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ReactiveKit : NSObject 3 | @end 4 | @implementation PodsDummy_ReactiveKit 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Amber_Tests { 2 | umbrella header "Pods-Amber_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Amber_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Amber_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Amber.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Amber.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Amber-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Bond-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Differ-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Amber.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/ReactiveKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Amber-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double AmberVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char AmberVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Differ-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double DifferVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char DifferVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_Amber_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_Amber_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/ReactiveKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "ReactiveKit.h" 14 | 15 | FOUNDATION_EXPORT double ReactiveKitVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char ReactiveKitVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Bond-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "BNDProtocolProxyBase.h" 14 | #import "Bond.h" 15 | 16 | FOUNDATION_EXPORT double BondVersionNumber; 17 | FOUNDATION_EXPORT const unsigned char BondVersionString[]; 18 | 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/Amber.xcworkspace -scheme Amber-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIAccessibilityIdentification.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIAI.swift 3 | // Bond 4 | // 5 | // Created by Srdan Rasic on 02/04/2017. 6 | // Copyright © 2017 Swift Bond. All rights reserved. 7 | // 8 | 9 | #if os(iOS) || os(tvOS) 10 | 11 | import UIKit 12 | import ReactiveKit 13 | 14 | extension ReactiveExtensions where Base: Deallocatable, Base: UIAccessibilityIdentification { 15 | 16 | var accessibilityIdentifier: Bond { 17 | return bond(context: .immediateOnMain) { 18 | $0.accessibilityIdentifier = $1 19 | } 20 | } 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Supporting Files/Bond.h: -------------------------------------------------------------------------------- 1 | // 2 | // Bond.h 3 | // Bond 4 | // 5 | // Created by Srdan Rasic on 19/07/16. 6 | // Copyright © 2016 Swift Bond. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | //! Project version number for Bond. 13 | FOUNDATION_EXPORT double BondVersionNumber; 14 | 15 | //! Project version string for Bond. 16 | FOUNDATION_EXPORT const unsigned char BondVersionString[]; 17 | 18 | // In this header, you should import all the public headers of your framework using statements like #import 19 | 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/ReactiveKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ReactiveKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/ReactiveKit 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Differ.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Differ 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Differ 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | SWIFT_VERSION = 4.0 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Amber (1.0.15): 3 | - Bond (~> 6.5.0) 4 | - Bond (6.5.0): 5 | - Differ (~> 1.0.0) 6 | - ReactiveKit (~> 3.7.4) 7 | - Differ (1.0.2) 8 | - ReactiveKit (3.7.4) 9 | 10 | DEPENDENCIES: 11 | - Amber (from `../`) 12 | - Bond (~> 6.5.0) 13 | 14 | EXTERNAL SOURCES: 15 | Amber: 16 | :path: ../ 17 | 18 | SPEC CHECKSUMS: 19 | Amber: 9f44ef3181fdf6d5b248b66a1039dc969eb374b9 20 | Bond: 03e45b192c605a87937299b0e0f3164f3de00f95 21 | Differ: a571b66c49d0fc83fe5af9a4a41f09bb09e91c85 22 | ReactiveKit: 0af7e43958a532342e0e247d2aeb318653628e68 23 | 24 | PODFILE CHECKSUM: 9c9325304bf35672a6ff58089cc699c4589b5870 25 | 26 | COCOAPODS: 1.3.1 27 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Amber (1.0.15): 3 | - Bond (~> 6.5.0) 4 | - Bond (6.5.0): 5 | - Differ (~> 1.0.0) 6 | - ReactiveKit (~> 3.7.4) 7 | - Differ (1.0.2) 8 | - ReactiveKit (3.7.4) 9 | 10 | DEPENDENCIES: 11 | - Amber (from `../`) 12 | - Bond (~> 6.5.0) 13 | 14 | EXTERNAL SOURCES: 15 | Amber: 16 | :path: ../ 17 | 18 | SPEC CHECKSUMS: 19 | Amber: 9f44ef3181fdf6d5b248b66a1039dc969eb374b9 20 | Bond: 03e45b192c605a87937299b0e0f3164f3de00f95 21 | Differ: a571b66c49d0fc83fe5af9a4a41f09bb09e91c85 22 | ReactiveKit: 0af7e43958a532342e0e247d2aeb318653628e68 23 | 24 | PODFILE CHECKSUM: 9c9325304bf35672a6ff58089cc699c4589b5870 25 | 26 | COCOAPODS: 1.3.1 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Bond.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Bond 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Differ" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_SWIFT_FLAGS = -DBUILDING_WITH_XCODE $(inherited) $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Bond 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | # Pods/ 34 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/Patch+Apply.swift: -------------------------------------------------------------------------------- 1 | public extension RangeReplaceableCollection where Self.Iterator.Element: Equatable { 2 | 3 | public func apply(_ patch: [Patch]) -> Self { 4 | var mutableSelf = self 5 | 6 | for change in patch { 7 | switch change { 8 | case let .insertion(i, element): 9 | let target = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(i)) 10 | mutableSelf.insert(element, at: target) 11 | case let .deletion(i): 12 | let target = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(i)) 13 | mutableSelf.remove(at: target) 14 | } 15 | } 16 | 17 | return mutableSelf 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Amber.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Amber 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Bond" "$PODS_CONFIGURATION_BUILD_DIR/Differ" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_LDFLAGS = -framework "UIKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/Amber.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Amber", 3 | "version": "1.0.15", 4 | "summary": "flexible and convenient iOS architecture based on Flex & Elm", 5 | "description": "Amber is flexible and convenient iOS architecture based on Flex & Elm.\nIt uses Reducer to process Actions and Router to process Transitions.", 6 | "homepage": "https://github.com/Anvics/Amber", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Nikita Arkhipov": "nikitarkhipov@gmail.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/Anvics/Amber.git", 16 | "tag": "1.0.15" 17 | }, 18 | "platforms": { 19 | "ios": "9.0" 20 | }, 21 | "source_files": "Amber/Classes/**/*", 22 | "frameworks": "UIKit", 23 | "dependencies": { 24 | "Bond": [ 25 | "~> 6.5.0" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import Amber 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Bond/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 6.5.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Amber/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.15 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Differ/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/ReactiveKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.7.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Differ/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Tony Arnold 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Shared/SignalProtocol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SignalProtocol.swift 3 | // Bond 4 | // 5 | // Created by Srdan Rasic on 14/12/2016. 6 | // Copyright © 2016 Swift Bond. All rights reserved. 7 | // 8 | 9 | import ReactiveKit 10 | 11 | extension SignalProtocol { 12 | 13 | #if os(iOS) || os(tvOS) 14 | 15 | /// Fires an event on start and every `interval` seconds as long as the app is in foreground. 16 | /// Pauses when the app goes to background. Restarts when the app is back in foreground. 17 | public static func heartbeat(interval seconds: Double) -> Signal { 18 | let willEnterForeground = NotificationCenter.default.reactive.notification(name: .UIApplicationWillEnterForeground) 19 | let didEnterBackgorund = NotificationCenter.default.reactive.notification(name: .UIApplicationDidEnterBackground) 20 | return willEnterForeground.replace(with: ()).start(with: ()).flatMapLatest { () -> Signal in 21 | return Signal.interval(seconds, queue: .global()).replace(with: ()).start(with: ()).take(until: didEnterBackgorund) 22 | } 23 | } 24 | 25 | #endif 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Nikita Arkhipov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Amber" "$PODS_CONFIGURATION_BUILD_DIR/Bond" "$PODS_CONFIGURATION_BUILD_DIR/Differ" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Amber/Amber.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bond/Bond.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Differ/Differ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit/ReactiveKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Amber" -framework "Bond" -framework "Differ" -framework "ReactiveKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Amber" "$PODS_CONFIGURATION_BUILD_DIR/Bond" "$PODS_CONFIGURATION_BUILD_DIR/Differ" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Amber/Amber.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Bond/Bond.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Differ/Differ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ReactiveKit/ReactiveKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Amber" -framework "Bond" -framework "Differ" -framework "ReactiveKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Bond/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2016 Bond 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ReactiveKit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/ExtendedPatch+Apply.swift: -------------------------------------------------------------------------------- 1 | public extension RangeReplaceableCollection where Self.Iterator.Element: Equatable { 2 | 3 | public func apply(_ patch: [ExtendedPatch]) -> Self { 4 | var mutableSelf = self 5 | 6 | for change in patch { 7 | switch change { 8 | case let .insertion(i, element): 9 | let target = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(i)) 10 | mutableSelf.insert(element, at: target) 11 | case let .deletion(i): 12 | let target = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(i)) 13 | mutableSelf.remove(at: target) 14 | case let .move(from, to): 15 | let fromIndex = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(from)) 16 | let toIndex = mutableSelf.index(mutableSelf.startIndex, offsetBy: IndexDistance(to)) 17 | let element = mutableSelf.remove(at: fromIndex) 18 | mutableSelf.insert(element, at: toIndex) 19 | } 20 | } 21 | 22 | return mutableSelf 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Amber/Classes/AmberMiddleware.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmberMiddleware.swift 3 | // TrainBrain 4 | // 5 | // Created by Nikita Arkhipov on 10.10.2017. 6 | // Copyright © 2017 Nikita Arkhipov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol AmberMiddleware{ 12 | func process(state: Any, beforeEvent event: Any) 13 | 14 | func perform(event: Any, onState state: Any, route: AmberRoutePerformer, performBlock: @escaping () -> ()) 15 | 16 | func process(state: Any, afterEvent event: Any, route: AmberRoutePerformer) 17 | } 18 | 19 | public extension AmberMiddleware{ 20 | public func process(state: Any, beforeEvent event: Any) { } 21 | 22 | public func perform(event: Any, onState state: Any, route: AmberRoutePerformer, performBlock: @escaping () -> ()){ performBlock() } 23 | 24 | public func process(state: Any, afterEvent event: Any, route: AmberRoutePerformer){ } 25 | } 26 | 27 | public class AmberLoggingMiddleware: AmberMiddleware{ 28 | public init(){} 29 | 30 | public func process(state: Any, afterEvent event: Any, route: AmberRoutePerformer){ 31 | print("----------------------------------------") 32 | print("\(type(of: event)).\(event) -> \(state)") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Observable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import ReactiveKit 26 | 27 | public typealias Observable = Property 28 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/NoError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /// An error type that cannot be instantiated. Used to make signals non-failable. 26 | public enum NoError: Error { 27 | } 28 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/ReactiveKit/ReactiveKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | //! Project version number for ReactiveKit. 28 | FOUNDATION_EXPORT double ReactiveKitVersionNumber; 29 | 30 | //! Project version string for ReactiveKit. 31 | FOUNDATION_EXPORT const unsigned char ReactiveKitVersionString[]; 32 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UINavigationBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UINavigationBar { 31 | 32 | public var barTintColor: Bond { 33 | return bond { $0.barTintColor = $1 } 34 | } 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Amber/Classes/AmberReducer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmberReducer.swift 3 | // TrainBrain 4 | // 5 | // Created by Nikita Arkhipov on 09.10.2017. 6 | // Copyright © 2017 Nikita Arkhipov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol AmberReducer{ 12 | associatedtype State: AmberState 13 | associatedtype Action: AmberAction 14 | associatedtype OutputAction: AmberAction 15 | associatedtype InputAction: AmberAction 16 | associatedtype Transition: AmberTransition 17 | 18 | typealias ActionBlock = (Action) -> Void 19 | typealias InputActionListener = (InputAction) -> Void 20 | typealias OutputActionListener = (OutputAction) -> Void 21 | typealias TransitionBlock = (Transition) -> Void 22 | 23 | func initialize(state: State, performAction: @escaping ActionBlock, performOutputAction: @escaping OutputActionListener) 24 | 25 | func reduce(action: Action, state: State, performTransition: @escaping TransitionBlock, performAction: @escaping ActionBlock, performOutputAction: @escaping OutputActionListener) -> State 26 | 27 | func reduceInput(action: InputAction, state: State, performAction: @escaping ActionBlock, performOutputAction: @escaping OutputActionListener) -> State 28 | } 29 | 30 | public extension AmberReducer{ 31 | public func initialize(state: State, performAction: @escaping ActionBlock, performOutputAction: @escaping OutputActionListener){ } 32 | 33 | public func reduceInput(action: InputAction, state: State, performAction: @escaping ActionBlock, performOutputAction: @escaping OutputActionListener) -> State{ return state } 34 | } 35 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/QueryableDataSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2017 Tony Arnold (@tonyarnold) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | public protocol QueryableDataSourceProtocol: DataSourceProtocol { 26 | associatedtype Item 27 | associatedtype Index 28 | func item(at index: Index) -> Item 29 | } 30 | 31 | extension Array: QueryableDataSourceProtocol { 32 | 33 | public func item(at index: Int) -> Element { 34 | return self[index] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIApplication.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIApplication { 31 | 32 | #if os(iOS) 33 | public var isNetworkActivityIndicatorVisible: Bond { 34 | return bond { $0.isNetworkActivityIndicatorVisible = $1 } 35 | } 36 | #endif 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Amber.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint Amber.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'Amber' 11 | s.version = '1.1.0' 12 | s.summary = 'flexible and convenient iOS architecture based on Flex & Elm' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | Amber is flexible and convenient iOS architecture based on Flex & Elm. 22 | It uses Reducer to process Actions and Router to process Transitions. 23 | DESC 24 | 25 | s.homepage = 'https://github.com/Anvics/Amber' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'Nikita Arkhipov' => 'nikitarkhipov@gmail.com' } 28 | s.source = { :git => 'https://github.com/Anvics/Amber.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '9.0' 32 | #.swift-version = '4.0' 33 | 34 | s.source_files = 'Amber/Classes/**/*' 35 | 36 | # s.resource_bundles = { 37 | # 'Amber' => ['Amber/Assets/*.png'] 38 | # } 39 | 40 | # s.public_header_files = 'Pod/Classes/**/*.h' 41 | s.frameworks = 'UIKit' 42 | s.dependency 'Bond', '~> 6.5.0' 43 | end 44 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UINavigationItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | extension UINavigationItem: BindingExecutionContextProvider { 31 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 32 | } 33 | 34 | public extension ReactiveExtensions where Base: UINavigationItem { 35 | 36 | public var title: Bond { 37 | return bond { $0.title = $1 } 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIImageView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIImageView { 31 | 32 | public var image: Bond { 33 | return bond { $0.image = $1 } 34 | } 35 | } 36 | 37 | extension UIImageView: BindableProtocol { 38 | 39 | public func bind(signal: Signal) -> Disposable { 40 | return reactive.image.bind(signal: signal) 41 | } 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Shared/NSLayoutConstraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(macOS) 26 | import AppKit 27 | #else 28 | import UIKit 29 | #endif 30 | 31 | import ReactiveKit 32 | 33 | extension NSLayoutConstraint: BindingExecutionContextProvider { 34 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 35 | } 36 | 37 | public extension ReactiveExtensions where Base: NSLayoutConstraint { 38 | 39 | public var isActive: Bond { 40 | return bond { $0.isActive = $1 } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIProgressView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import ReactiveKit 28 | import UIKit 29 | 30 | public extension ReactiveExtensions where Base: UIProgressView { 31 | 32 | public var progress: Bond { 33 | return bond { $0.progress = $1 } 34 | } 35 | } 36 | 37 | extension UIProgressView: BindableProtocol { 38 | 39 | public func bind(signal: Signal) -> Disposable { 40 | return reactive.progress.bind(signal: signal) 41 | } 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UISwitch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UISwitch { 31 | 32 | public var isOn: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.isOn }, 36 | set: { $0.isOn = $1 } 37 | ) 38 | } 39 | } 40 | 41 | extension UISwitch: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.isOn.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UISlider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UISlider { 31 | 32 | public var value: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.value }, 36 | set: { $0.value = $1 } 37 | ) 38 | } 39 | } 40 | 41 | extension UISlider: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.value.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIDatePicker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIDatePicker { 31 | 32 | public var date: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.date }, 36 | set: { $0.date = $1 } 37 | ) 38 | } 39 | } 40 | 41 | extension UIDatePicker: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.date.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIStepper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIStepper { 31 | 32 | public var value: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.value }, 36 | set: { $0.value = $1 } 37 | ) 38 | } 39 | } 40 | 41 | extension UIStepper: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.value.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Optional.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | public protocol OptionalProtocol { 26 | associatedtype Wrapped 27 | var _unbox: Optional { get } 28 | init(nilLiteral: ()) 29 | init(_ some: Wrapped) 30 | } 31 | 32 | extension Optional: OptionalProtocol { 33 | public var _unbox: Optional { 34 | return self 35 | } 36 | } 37 | 38 | func ==(lhs: O, rhs: O) -> Bool 39 | where O.Wrapped: Equatable { 40 | return lhs._unbox == rhs._unbox 41 | } 42 | 43 | func !=(lhs: O, rhs: O) -> Bool 44 | where O.Wrapped: Equatable { 45 | return !(lhs == rhs) 46 | } 47 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Shared/CALayer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import QuartzCore 26 | import ReactiveKit 27 | 28 | extension CALayer: BindingExecutionContextProvider { 29 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 30 | } 31 | 32 | public extension ReactiveExtensions where Base: CALayer { 33 | 34 | public var opacity: Bond { 35 | return bond { $0.opacity = $1 } 36 | } 37 | 38 | public var backgroundColor: Bond { 39 | return bond { $0.backgroundColor = $1 } 40 | } 41 | 42 | public var contents: Bond { 43 | return bond { $0.contents = $1 } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIBarItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | extension UIBarItem: BindingExecutionContextProvider { 31 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 32 | } 33 | 34 | public extension ReactiveExtensions where Base: UIBarItem { 35 | 36 | public var title: Bond { 37 | return bond { $0.title = $1 } 38 | } 39 | 40 | public var image: Bond { 41 | return bond { $0.image = $1 } 42 | } 43 | 44 | public var isEnabled: Bond { 45 | return bond { $0.isEnabled = $1 } 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Lock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Common lock interface. 28 | public protocol Lock { 29 | func lock() 30 | func unlock() 31 | } 32 | 33 | public extension Lock { 34 | 35 | public func atomic(body: () -> T) -> T { 36 | lock(); defer { unlock() } 37 | return body() 38 | } 39 | } 40 | 41 | /// Lock 42 | extension NSLock: Lock { 43 | 44 | public convenience init(name: String) { 45 | self.init() 46 | self.name = name 47 | } 48 | } 49 | 50 | /// Recursive Lock 51 | extension NSRecursiveLock: Lock { 52 | 53 | public convenience init(name: String) { 54 | self.init() 55 | self.name = name 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Shared/NotificationCenter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | import ReactiveKit 27 | 28 | public extension ReactiveExtensions where Base: NotificationCenter { 29 | 30 | /// Observe notifications using a signal. 31 | public func notification(name: NSNotification.Name, object: AnyObject? = nil) -> Signal { 32 | return Signal { observer in 33 | let subscription = self.base.addObserver(forName: name, object: object, queue: nil, using: { notification in 34 | observer.next(notification) 35 | }) 36 | return BlockDisposable { 37 | self.base.removeObserver(subscription) 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIRefreshControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIRefreshControl { 31 | 32 | public var refreshing: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.isRefreshing }, 36 | set: { if $1 { $0.beginRefreshing() } else { $0.endRefreshing() } } 37 | ) 38 | } 39 | } 40 | 41 | extension UIRefreshControl: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.refreshing.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UISegmentedControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UISegmentedControl { 31 | 32 | public var selectedSegmentIndex: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.valueChanged).eraseType(), 35 | get: { $0.selectedSegmentIndex }, 36 | set: { $0.selectedSegmentIndex = $1 } 37 | ) 38 | } 39 | } 40 | 41 | extension UISegmentedControl: BindableProtocol { 42 | 43 | public func bind(signal: Signal) -> Disposable { 44 | return reactive.selectedSegmentIndex.bind(signal: signal) 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UILabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UILabel { 31 | 32 | public var text: Bond { 33 | return bond { $0.text = $1 } 34 | } 35 | 36 | public var attributedText: Bond { 37 | return bond { $0.attributedText = $1 } 38 | } 39 | 40 | public var textColor: Bond { 41 | return bond { $0.textColor = $1 } 42 | } 43 | } 44 | 45 | extension UILabel: BindableProtocol { 46 | 47 | public func bind(signal: Signal) -> Disposable { 48 | return reactive.text.bind(signal: signal) 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Property.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import ReactiveKit 26 | import Foundation 27 | 28 | extension Property { 29 | 30 | /// Transform the `getter` and `setter` by applying a `transform` on them. 31 | public func bidirectionalMap(to getTransform: @escaping (Element) -> U, 32 | from setTransform: @escaping (U) -> Element) -> DynamicSubject { 33 | return DynamicSubject( 34 | target: self, 35 | signal: eraseType(), 36 | context: .immediate, 37 | get: { (property) -> U in 38 | return getTransform(property.value) 39 | }, 40 | set: { (propery, value) in 41 | propery.value = setTransform(value) 42 | } 43 | ) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Shared/NSObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | import ReactiveKit 27 | 28 | extension NSObject { 29 | 30 | /// Bind `signal` to `bindable` and dispose in `bnd_bag` of receiver. 31 | public func bind(_ signal: O, to bindable: B) where O.Element == B.Element, O.Error == NoError { 32 | signal.bind(to: bindable).dispose(in: bag) 33 | } 34 | 35 | /// Bind `signal` to `bindable` and dispose in `bnd_bag` of receiver. 36 | public func bind(_ signal: O, to bindable: B) where B.Element: OptionalProtocol, O.Element == B.Element.Wrapped, O.Error == NoError { 37 | signal.bind(to: bindable).dispose(in: bag) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIActivityIndicatorView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // /Users/srdan/Dropbox/Ideas/Bond/Sources/UIKit/UIActivityIndicatorView.swift:32:10: '(NSObject, Bool)' is not convertible to 'Bool' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIActivityIndicatorView { 31 | 32 | public var isAnimating: Bond { 33 | return bond { 34 | if $1 { 35 | $0.startAnimating() 36 | } else { 37 | $0.stopAnimating() 38 | } 39 | } 40 | } 41 | } 42 | 43 | extension UIActivityIndicatorView: BindableProtocol { 44 | 45 | public func bind(signal: Signal) -> Disposable { 46 | return reactive.isAnimating.bind(signal: signal) 47 | } 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Typealiases.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | public typealias Signal1 = Signal 26 | public typealias SafeSignal = Signal 27 | 28 | public typealias Observer1 = (Event) -> Void 29 | public typealias SafeObserver = (Event) -> Void 30 | 31 | public typealias PublishSubject1 = PublishSubject 32 | public typealias SafePublishSubject = PublishSubject 33 | 34 | public typealias ReplaySubject1 = ReplaySubject 35 | public typealias SafeReplaySubject = ReplaySubject 36 | 37 | public typealias ReplayOneSubject1 = ReplayOneSubject 38 | public typealias SafeReplayOneSubject = ReplayOneSubject 39 | -------------------------------------------------------------------------------- /Amber/Classes/AmberController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmberController.swift 3 | // TrainBrain 4 | // 5 | // Created by Nikita Arkhipov on 09.10.2017. 6 | // Copyright © 2017 Nikita Arkhipov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import ReactiveKit 11 | 12 | public protocol AmberPresenter: class { 13 | func embedIn(view: UIView, container: UIViewController) 14 | 15 | func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Swift.Void)?) 16 | 17 | func show(_ viewController: UIViewController, animated: Bool) 18 | 19 | func close(animated: Bool) 20 | 21 | func dismiss(animated: Bool) 22 | func pop(animated: Bool) 23 | func popToRoot(animated: Bool) 24 | } 25 | 26 | public protocol AmberPresentable { 27 | static var storyboardFile: String { get } 28 | static var storyboardID: String { get } 29 | } 30 | 31 | public protocol AmberController: class, AmberPresenter, AmberPresentable { 32 | associatedtype Reducer: AmberReducer 33 | 34 | var store: AmberStore { get } 35 | } 36 | 37 | public extension AmberController{ 38 | typealias InputActionListener = (Reducer.InputAction) -> Void 39 | typealias OutputActionListener = (Reducer.OutputAction) -> Void 40 | 41 | public func initialize(with data: Reducer.State.RequiredData){ 42 | store.initialize(with: data, routePerformer: AmberRoutePerformerImplementation(controller: self, embedder: self)) 43 | } 44 | 45 | public var action: Subject { return store.action } 46 | public var outputAction: Subject { return store.outputAction } 47 | public var transition: Subject { return store.transition } 48 | 49 | public var state: Signal { return store.state } 50 | } 51 | 52 | public extension AmberController where Reducer.State.RequiredData == Void{ 53 | public func initialize(){ 54 | store.initialize(with: (), routePerformer: AmberRoutePerformerImplementation(controller: self, embedder: self)) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Signal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /// A signal represents a sequence of elements. 26 | public struct Signal: SignalProtocol { 27 | 28 | public typealias Producer = (AtomicObserver) -> Disposable 29 | 30 | private let producer: Producer 31 | 32 | /// Create new signal given a producer closure. 33 | public init(producer: @escaping Producer) { 34 | self.producer = producer 35 | } 36 | 37 | /// Register the observer that will receive events from the signal. 38 | public func observe(with observer: @escaping Observer) -> Disposable { 39 | let serialDisposable = SerialDisposable(otherDisposable: nil) 40 | let observer = AtomicObserver(disposable: serialDisposable, observer: observer) 41 | serialDisposable.otherDisposable = producer(observer) 42 | return observer.disposable 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | extension UIResponder: BindingExecutionContextProvider { 31 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 32 | } 33 | 34 | extension ReactiveExtensions where Base: UIView { 35 | 36 | public var alpha: Bond { 37 | return bond { $0.alpha = $1 } 38 | } 39 | 40 | public var backgroundColor: Bond { 41 | return bond { $0.backgroundColor = $1 } 42 | } 43 | 44 | public var isHidden: Bond { 45 | return bond { $0.isHidden = $1 } 46 | } 47 | 48 | public var isUserInteractionEnabled: Bond { 49 | return bond { $0.isUserInteractionEnabled = $1 } 50 | } 51 | 52 | public var tintColor: Bond { 53 | return bond { $0.tintColor = $1 } 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Amber/Classes/AmberController+UI.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AmberControllerHelper.swift 3 | // TrainBrain 4 | // 5 | // Created by Nikita Arkhipov on 09.10.2017. 6 | // Copyright © 2017 Nikita Arkhipov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension AmberPresentable{ 12 | public static func instantiate() -> Self{ 13 | let sb = UIStoryboard(name: storyboardFile, bundle: nil) 14 | guard let vc = sb.instantiateViewController(withIdentifier: storyboardID) as? Self else { fatalError() } 15 | return vc 16 | } 17 | } 18 | 19 | extension UIViewController: AmberPresenter{ 20 | public func push(_ viewController: UIViewController, animated: Bool){ 21 | navigationController?.pushViewController(viewController, animated: animated) 22 | } 23 | 24 | public func embedIn(view: UIView, container: UIViewController){ 25 | self.view.frame = view.bounds 26 | container.addChildViewController(self) 27 | view.addSubview(self.view) 28 | didMove(toParentViewController: container) 29 | } 30 | 31 | public func show(_ viewController: UIViewController, animated: Bool){ 32 | if navigationController != nil { push(viewController, animated: true) } 33 | else { present(viewController, animated: true, completion: nil) } 34 | } 35 | 36 | public func close(animated: Bool){ 37 | if let nav = navigationController{ nav.popViewController(animated: animated) } 38 | else if parent != nil { unembed() } 39 | else{ dismiss(animated: animated, completion: nil) } 40 | } 41 | 42 | public func dismiss(animated: Bool) { 43 | dismiss(animated: animated, completion: nil) 44 | } 45 | 46 | public func pop(animated: Bool){ 47 | navigationController?.popViewController(animated: animated) 48 | } 49 | 50 | public func popToRoot(animated: Bool){ 51 | navigationController?.popToRootViewController(animated: animated) 52 | } 53 | 54 | private func unembed(){ 55 | removeFromParentViewController() 56 | view.removeFromSuperview() 57 | didMove(toParentViewController: nil) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Deallocatable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Deallocatable.swift 3 | // ReactiveKit 4 | // 5 | // Created by Srdan Rasic on 17/03/2017. 6 | // Copyright © 2017 Srdan Rasic. All rights reserved. 7 | // 8 | 9 | /// A type that notifies about its own deallocation. 10 | /// 11 | /// `Deallocatable` can be used as a binding target. For example, 12 | /// instead of observing a signal, one can bind it to a `Deallocatable`. 13 | /// 14 | /// class View: Deallocatable { ... } 15 | /// 16 | /// let view: View = ... 17 | /// let signal: SafeSignal = ... 18 | /// 19 | /// signal.bind(to: view) { view, number in 20 | /// view.display(number) 21 | /// } 22 | public protocol Deallocatable: class { 23 | 24 | /// A signal that fires `completed` event when the receiver is deallocated. 25 | var deallocated: SafeSignal { get } 26 | } 27 | 28 | /// A type that provides a dispose bag. 29 | /// `DisposeBagProvider` conforms to `Deallocatable` out of the box. 30 | public protocol DisposeBagProvider: Deallocatable { 31 | 32 | /// A `DisposeBag` that can be used to dispose observations and bindings. 33 | var bag: DisposeBag { get } 34 | } 35 | 36 | extension DisposeBagProvider { 37 | 38 | /// A signal that fires `completed` event when the receiver is deallocated. 39 | public var deallocated: SafeSignal { 40 | return bag.deallocated 41 | } 42 | } 43 | 44 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 45 | 46 | import ObjectiveC.runtime 47 | 48 | extension NSObject: DisposeBagProvider { 49 | 50 | private struct AssociatedKeys { 51 | static var DisposeBagKey = "DisposeBagKey" 52 | } 53 | 54 | /// A `DisposeBag` that can be used to dispose observations and bindings. 55 | public var bag: DisposeBag { 56 | if let disposeBag = objc_getAssociatedObject(self, &NSObject.AssociatedKeys.DisposeBagKey) { 57 | return disposeBag as! DisposeBag 58 | } else { 59 | let disposeBag = DisposeBag() 60 | objc_setAssociatedObject(self, &NSObject.AssociatedKeys.DisposeBagKey, disposeBag, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 61 | return disposeBag 62 | } 63 | } 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UITextField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UITextField { 31 | 32 | public var text: DynamicSubject { 33 | return dynamicSubject( 34 | signal: controlEvents(.allEditingEvents).eraseType(), 35 | get: { $0.text }, 36 | set: { $0.text = $1 } 37 | ) 38 | } 39 | 40 | public var attributedText: DynamicSubject { 41 | return dynamicSubject( 42 | signal: controlEvents(.allEditingEvents).eraseType(), 43 | get: { $0.attributedText }, 44 | set: { $0.attributedText = $1 } 45 | ) 46 | } 47 | 48 | public var textColor: Bond { 49 | return bond { $0.textColor = $1 } 50 | } 51 | } 52 | 53 | extension UITextField: BindableProtocol { 54 | 55 | public func bind(signal: Signal) -> Disposable { 56 | return reactive.text.bind(signal: signal) 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIButton { 31 | 32 | public var title: Bond { 33 | return bond { $0.setTitle($1, for: .normal) } 34 | } 35 | 36 | public var tap: SafeSignal { 37 | return controlEvents(.touchUpInside) 38 | } 39 | 40 | public var isSelected: Bond { 41 | return bond { $0.isSelected = $1 } 42 | } 43 | 44 | public var isHighlighted: Bond { 45 | return bond { $0.isHighlighted = $1 } 46 | } 47 | 48 | @available(*, deprecated, renamed: "backgroundImage") 49 | public var backgroungImage: Bond { 50 | return backgroundImage 51 | } 52 | 53 | public var backgroundImage: Bond { 54 | return bond { $0.setBackgroundImage($1, for: .normal) } 55 | } 56 | 57 | public var image: Bond { 58 | return bond { $0.setImage($1, for: .normal) } 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Amber/Classes/Amber.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Amber.swift 3 | // TrainBrain 4 | // 5 | // Created by Nikita Arkhipov on 09.10.2017. 6 | // Copyright © 2017 Nikita Arkhipov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol AmberState: CustomStringConvertible { 12 | associatedtype RequiredData 13 | 14 | init(data: RequiredData) 15 | } 16 | 17 | public extension AmberState where RequiredData == Void{ 18 | init(){ 19 | self.init(data: ()) 20 | } 21 | } 22 | 23 | public protocol AmberTransition { } 24 | 25 | public protocol AmberAction { } 26 | 27 | public enum AmberEither{ 28 | case first(A) 29 | case second(B) 30 | } 31 | 32 | public class Amber{ 33 | public static let main = Amber() 34 | 35 | private(set) var middleware: [AmberMiddleware] = [] 36 | 37 | public func registerSharedMiddleware(_ sharedMiddleware: AmberMiddleware...){ 38 | for m in sharedMiddleware{ 39 | middleware.append(m) 40 | } 41 | } 42 | 43 | func process(state: Any, beforeEvent event: Any){ 44 | middleware.forEach { $0.process(state: state, beforeEvent: event) } 45 | } 46 | 47 | func perform(event: Any, onState state: Any, route: AmberRoutePerformer, index: Int = 0, completion: @escaping () -> ()){ 48 | if index == middleware.count { completion(); return } 49 | middleware[index].perform(event: event, onState: state, route: route) { 50 | self.perform(event: event, onState: state, route: route, index: index + 1, completion: completion) 51 | } 52 | } 53 | 54 | func process(state: Any, afterEvent event: Any, route: AmberRoutePerformer){ 55 | middleware.forEach { $0.process(state: state, afterEvent: event, route: route) } 56 | } 57 | 58 | public static func setInitial(module: Module.Type, data: Module.Reducer.State.RequiredData, window: UIWindow!){ 59 | let (vc, _) = AmberControllerHelper.create(module: module, data: data, outputListener: nil) 60 | window.rootViewController = vc 61 | window.makeKeyAndVisible() 62 | } 63 | 64 | public static func setInitial(module: Module.Type, window: UIWindow!) where Module.Reducer.State.RequiredData == Void{ 65 | setInitial(module: module, data: (), window: window) 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Event.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | /// An event of a sequence. 26 | public enum Event { 27 | 28 | /// An event that carries next element. 29 | case next(Element) 30 | 31 | /// An event that represents failure. Carries an error. 32 | case failed(Error) 33 | 34 | /// An event that marks the completion of a sequence. 35 | case completed 36 | } 37 | 38 | extension Event { 39 | 40 | /// Return `true` in case of `.failure` or `.completed` event. 41 | public var isTerminal: Bool { 42 | switch self { 43 | case .next: 44 | return false 45 | default: 46 | return true 47 | } 48 | } 49 | 50 | /// Returns the next element, or nil if the event is not `.next` 51 | public var element: Element? { 52 | switch self { 53 | case .next(let element): 54 | return element 55 | 56 | default: 57 | return nil 58 | } 59 | } 60 | 61 | /// Return the failed error, or nil if the event is not `.failed` 62 | public var error: Error? { 63 | switch self { 64 | case .failed(let error): 65 | return error 66 | 67 | default: 68 | return nil 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/LinkedList.swift: -------------------------------------------------------------------------------- 1 | class LinkedList { 2 | let next: LinkedList? 3 | let value: T 4 | 5 | init(next: LinkedList?, value: T) { 6 | self.next = next 7 | self.value = value 8 | } 9 | 10 | init?(array: [T]) { 11 | let reversed = array.reversed() 12 | guard let first = array.first else { 13 | return nil 14 | } 15 | 16 | var tailLinkedList: LinkedList? 17 | 18 | for i in 0 ..< reversed.count - 1 { 19 | tailLinkedList = LinkedList(next: tailLinkedList, value: reversed.itemOnStartIndex(advancedBy: i)) 20 | } 21 | 22 | next = tailLinkedList 23 | value = first 24 | } 25 | 26 | func array() -> Array { 27 | if let next = next { 28 | return [value] + next.array() 29 | } 30 | return [value] 31 | } 32 | } 33 | 34 | class DoublyLinkedList { 35 | let next: DoublyLinkedList? 36 | private(set) weak var previous: DoublyLinkedList? 37 | var head: DoublyLinkedList { 38 | guard let previous = previous else { 39 | return self 40 | } 41 | return previous.head 42 | } 43 | 44 | var value: T 45 | 46 | init(next: DoublyLinkedList?, value: T) { 47 | self.value = value 48 | self.next = next 49 | self.next?.previous = self 50 | } 51 | 52 | init?(array: [T]) { 53 | let reversed = array.reversed() 54 | guard let first = array.first else { 55 | return nil 56 | } 57 | 58 | var tailDoublyLinkedList: DoublyLinkedList? 59 | 60 | for i in 0 ..< reversed.count - 1 { 61 | let nextTail = DoublyLinkedList(next: tailDoublyLinkedList, value: reversed.itemOnStartIndex(advancedBy: i)) 62 | tailDoublyLinkedList?.previous = nextTail 63 | tailDoublyLinkedList = nextTail 64 | } 65 | 66 | value = first 67 | next = tailDoublyLinkedList 68 | next?.previous = self 69 | } 70 | 71 | convenience init?(linkedList: LinkedList?) { 72 | guard let linkedList = linkedList else { 73 | return nil 74 | } 75 | self.init(array: linkedList.array()) 76 | } 77 | 78 | func array() -> Array { 79 | if let next = next { 80 | return [value] + next.array() 81 | } 82 | return [value] 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UITextView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UITextView { 31 | 32 | public var text: DynamicSubject { 33 | let notificationName = NSNotification.Name.UITextViewTextDidChange 34 | return dynamicSubject( 35 | signal: NotificationCenter.default.reactive.notification(name: notificationName, object: base).eraseType(), 36 | get: { $0.text }, 37 | set: { $0.text = $1 } 38 | ) 39 | } 40 | 41 | public var attributedText: DynamicSubject { 42 | let notificationName = NSNotification.Name.UITextViewTextDidChange 43 | return dynamicSubject( 44 | signal: NotificationCenter.default.reactive.notification(name: notificationName, object: base).eraseType(), 45 | get: { $0.attributedText }, 46 | set: { $0.attributedText = $1 } 47 | ) 48 | } 49 | 50 | public var textColor: Bond { 51 | return bond { $0.textColor = $1 } 52 | } 53 | } 54 | 55 | extension UITextView: BindableProtocol { 56 | 57 | public func bind(signal: Signal) -> Disposable { 58 | return reactive.text.bind(signal: signal) 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/Patch.swift: -------------------------------------------------------------------------------- 1 | /// Single step in a patch sequence. 2 | public enum Patch { 3 | /// A single patch step containing an insertion index and an element to be inserted 4 | case insertion(index: Int, element: Element) 5 | /// A single patch step containing a deletion index 6 | case deletion(index: Int) 7 | 8 | func index() -> Int { 9 | switch self { 10 | case let .insertion(index, _): 11 | return index 12 | case let .deletion(index): 13 | return index 14 | } 15 | } 16 | } 17 | 18 | public extension Diff { 19 | 20 | /// Generates a patch sequence based on a diff. It is a list of steps to be applied to obtain the `to` collection from the `from` one. 21 | /// 22 | /// - Complexity: O(N) 23 | /// 24 | /// - Parameters: 25 | /// - from: The source collection (usually the source collecetion of the callee) 26 | /// - to: The target collection (usually the target collecetion of the callee) 27 | /// - Returns: A sequence of steps to obtain `to` collection from the `from` one. 28 | public func patch( 29 | from: T, 30 | to: T 31 | ) -> [Patch] where T.Iterator.Element: Equatable { 32 | var shift = 0 33 | return map { element in 34 | switch element { 35 | case let .delete(at): 36 | shift -= 1 37 | return .deletion(index: at + shift + 1) 38 | case let .insert(at): 39 | shift += 1 40 | return .insertion(index: at, element: to.itemOnStartIndex(advancedBy: at)) 41 | } 42 | } 43 | } 44 | } 45 | 46 | /// Generates a patch sequence. It is a list of steps to be applied to obtain the `to` collection from the `from` one. 47 | /// 48 | /// - Complexity: O((N+M)*D) 49 | /// 50 | /// - Parameters: 51 | /// - from: The source collection 52 | /// - to: The target collection 53 | /// - Returns: A sequence of steps to obtain `to` collection from the `from` one. 54 | public func patch( 55 | from: T, 56 | to: T 57 | ) -> [Patch] where T.Iterator.Element: Equatable { 58 | return from.diff(to).patch(from: from, to: to) 59 | } 60 | 61 | extension Patch: CustomDebugStringConvertible { 62 | public var debugDescription: String { 63 | switch self { 64 | case let .deletion(at): 65 | return "D(\(at))" 66 | case let .insertion(at, element): 67 | return "I(\(at),\(element))" 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | public protocol ResultProtocol { 26 | associatedtype Value 27 | associatedtype Error: Swift.Error 28 | 29 | var value: Value? { get } 30 | var error: Error? { get } 31 | } 32 | 33 | /// An enum representing either a failure or a success. 34 | public enum Result: CustomStringConvertible { 35 | 36 | case success(T) 37 | case failure(E) 38 | 39 | /// Constructs a result with a success value. 40 | public init(_ value: T) { 41 | self = .success(value) 42 | } 43 | 44 | /// Constructs a result with an error. 45 | public init(_ error: E) { 46 | self = .failure(error) 47 | } 48 | 49 | public var description: String { 50 | switch self { 51 | case let .success(value): 52 | return ".success(\(value))" 53 | case let .failure(error): 54 | return ".failure(\(error))" 55 | } 56 | } 57 | } 58 | 59 | extension Result: ResultProtocol { 60 | 61 | public var value: T? { 62 | if case .success(let value) = self { 63 | return value 64 | } else { 65 | return nil 66 | } 67 | } 68 | 69 | public var error: E? { 70 | if case .failure(let error) = self { 71 | return error 72 | } else { 73 | return nil 74 | } 75 | } 76 | 77 | public var unbox: Result { 78 | return self 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/Patch+Sort.swift: -------------------------------------------------------------------------------- 1 | /// Generates arbitrarly sorted patch sequence. It is a list of steps to be applied to obtain the `to` collection from the `from` one. The sorting function lets you sort the output e.g. you might want the output patch to have insertions first. 2 | /// 3 | /// - Complexity: O((N+M)*D) 4 | /// 5 | /// - Parameters: 6 | /// - from: The source collection 7 | /// - to: The target collection 8 | /// - sort: A sorting function 9 | /// - Returns: Arbitrarly sorted sequence of steps to obtain `to` collection from the `from` one. 10 | public func patch( 11 | from: T, 12 | to: T, 13 | sort: Diff.OrderedBefore 14 | ) -> [Patch] where T.Iterator.Element: Equatable { 15 | return from.diff(to).patch(from: from, to: to, sort: sort) 16 | } 17 | 18 | public extension Diff { 19 | 20 | public typealias OrderedBefore = (_ fst: Diff.Element, _ snd: Diff.Element) -> Bool 21 | 22 | /// Generates arbitrarly sorted patch sequence based on the callee. It is a list of steps to be applied to obtain the `to` collection from the `from` one. The sorting function lets you sort the output e.g. you might want the output patch to have insertions first. 23 | /// 24 | /// - Complexity: O(D^2) 25 | /// 26 | /// - Parameters: 27 | /// - from: The source collection (usually the source collecetion of the callee) 28 | /// - to: The target collection (usually the target collecetion of the callee) 29 | /// - sort: A sorting function 30 | /// - Returns: Arbitrarly sorted sequence of steps to obtain `to` collection from the `from` one. 31 | public func patch( 32 | from: T, 33 | to: T, 34 | sort: OrderedBefore 35 | ) -> [Patch] where T.Iterator.Element: Equatable { 36 | let shiftedPatch = patch(from: from, to: to) 37 | return shiftedPatchElements(from: sortedPatchElements( 38 | from: shiftedPatch, 39 | sortBy: sort 40 | )).map { $0.value } 41 | } 42 | 43 | private func sortedPatchElements(from source: [Patch], sortBy areInIncreasingOrder: OrderedBefore) -> [SortedPatchElement] { 44 | let sorted = indices.map { (self[$0], $0) } 45 | .sorted { areInIncreasingOrder($0.0, $1.0) } 46 | return sorted.indices.map { i in 47 | let p = sorted[i] 48 | return SortedPatchElement( 49 | value: source[p.1], 50 | sourceIndex: p.1, 51 | sortedIndex: i) 52 | }.sorted(by: { (fst, snd) -> Bool in 53 | fst.sourceIndex < snd.sourceIndex 54 | }) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIBarButtonItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | extension UIBarButtonItem { 31 | 32 | fileprivate struct AssociatedKeys { 33 | static var BarButtonItemHelperKey = "bnd_BarButtonItemHelperKey" 34 | } 35 | 36 | @objc fileprivate class BondTarget: NSObject 37 | { 38 | weak var barButtonItem: UIBarButtonItem? 39 | let subject = PublishSubject() 40 | 41 | init(barButtonItem: UIBarButtonItem) { 42 | self.barButtonItem = barButtonItem 43 | super.init() 44 | 45 | barButtonItem.target = self 46 | barButtonItem.action = #selector(eventHandler) 47 | } 48 | 49 | @objc func eventHandler() { 50 | subject.next(()) 51 | } 52 | 53 | deinit { 54 | barButtonItem?.target = nil 55 | barButtonItem?.action = nil 56 | subject.completed() 57 | } 58 | } 59 | } 60 | 61 | public extension ReactiveExtensions where Base: UIBarButtonItem { 62 | 63 | public var tap: SafeSignal { 64 | if let target = objc_getAssociatedObject(base, &UIBarButtonItem.AssociatedKeys.BarButtonItemHelperKey) as AnyObject? { 65 | return (target as! UIBarButtonItem.BondTarget).subject.toSignal() 66 | } else { 67 | let target = UIBarButtonItem.BondTarget(barButtonItem: base) 68 | objc_setAssociatedObject(base, &UIBarButtonItem.AssociatedKeys.BarButtonItemHelperKey, target, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 69 | return target.subject.toSignal() 70 | } 71 | } 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public extension ReactiveExtensions where Base: UIControl { 31 | 32 | public func controlEvents(_ events: UIControlEvents) -> SafeSignal { 33 | let base = self.base 34 | return Signal { [weak base] observer in 35 | guard let base = base else { 36 | observer.completed() 37 | return NonDisposable.instance 38 | } 39 | let target = BNDControlTarget(control: base, events: events) { 40 | observer.next(()) 41 | } 42 | return BlockDisposable { 43 | target.unregister() 44 | } 45 | }.take(until: base.deallocated) 46 | } 47 | 48 | public var isEnabled: Bond { 49 | return bond { $0.isEnabled = $1 } 50 | } 51 | } 52 | 53 | @objc fileprivate class BNDControlTarget: NSObject 54 | { 55 | private weak var control: UIControl? 56 | private let observer: () -> Void 57 | private let events: UIControlEvents 58 | 59 | fileprivate init(control: UIControl, events: UIControlEvents, observer: @escaping () -> Void) { 60 | self.control = control 61 | self.events = events 62 | self.observer = observer 63 | 64 | super.init() 65 | 66 | control.addTarget(self, action: #selector(actionHandler), for: events) 67 | } 68 | 69 | @objc private func actionHandler() { 70 | observer() 71 | } 72 | 73 | fileprivate func unregister() { 74 | control?.removeTarget(self, action: nil, for: events) 75 | } 76 | 77 | deinit { 78 | unregister() 79 | } 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Reactive.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// A proxy protocol for reactive extensions. 28 | /// 29 | /// To provide reactive extensions on type `X`, do 30 | /// 31 | /// extension ReactiveExtensions where Base == X { 32 | /// var y: SafeSignal { ... } 33 | /// } 34 | /// 35 | /// where `X` conforms to `ReactiveExtensionsProvider`. 36 | public protocol ReactiveExtensions { 37 | associatedtype Base 38 | var base: Base { get } 39 | } 40 | 41 | public struct Reactive: ReactiveExtensions { 42 | public let base: Base 43 | 44 | public init(_ base: Base) { 45 | self.base = base 46 | } 47 | } 48 | 49 | public protocol ReactiveExtensionsProvider: class {} 50 | 51 | public extension ReactiveExtensionsProvider { 52 | 53 | /// Reactive extensions of `self`. 54 | public var reactive: Reactive { 55 | return Reactive(self) 56 | } 57 | 58 | /// Reactive extensions of `Self`. 59 | public static var reactive: Reactive.Type { 60 | return Reactive.self 61 | } 62 | } 63 | 64 | extension NSObject: ReactiveExtensionsProvider {} 65 | 66 | #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) 67 | 68 | extension ReactiveExtensions where Base: NSObject { 69 | 70 | /// A signal that fires completion event when the object is deallocated. 71 | public var deallocated: SafeSignal { 72 | return base.bag.deallocated 73 | } 74 | 75 | /// A `DisposeBag` that can be used to dispose observations and bindings. 76 | public var bag: DisposeBag { 77 | return base.bag 78 | } 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/Bond.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import ReactiveKit 26 | 27 | public struct Bond: BindableProtocol { 28 | 29 | private weak var target: Deallocatable? 30 | private let setter: (AnyObject, Element) -> Void 31 | private let context: ExecutionContext 32 | 33 | public init(target: Target, context: ExecutionContext, setter: @escaping (Target, Element) -> Void) { 34 | self.target = target 35 | self.context = context 36 | self.setter = { setter($0 as! Target, $1) } 37 | } 38 | 39 | public init(target: Target, setter: @escaping (Target, Element) -> Void) where Target: BindingExecutionContextProvider { 40 | self.target = target 41 | self.context = target.bindingExecutionContext 42 | self.setter = { setter($0 as! Target, $1) } 43 | } 44 | 45 | public func bind(signal: Signal) -> Disposable { 46 | if let target = target { 47 | return signal.take(until: target.deallocated).observeNext { element in 48 | self.context.execute { 49 | if let target = self.target { 50 | self.setter(target, element) 51 | } 52 | } 53 | } 54 | } else { 55 | return NonDisposable.instance 56 | } 57 | } 58 | } 59 | 60 | extension ReactiveExtensions where Base: Deallocatable { 61 | 62 | /// Creates a bond on the receiver. 63 | public func bond(context: ExecutionContext, setter: @escaping (Base, Element) -> Void) -> Bond { 64 | return Bond(target: base, context: context, setter: setter) 65 | } 66 | } 67 | 68 | extension ReactiveExtensions where Base: Deallocatable, Base: BindingExecutionContextProvider { 69 | 70 | /// Creates a bond on the receiver. 71 | public func bond(setter: @escaping (Base, Element) -> Void) -> Bond { 72 | return Bond(target: base, setter: setter) 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/GenericPatch.swift: -------------------------------------------------------------------------------- 1 | struct SortedPatchElement { 2 | var value: Patch 3 | let sourceIndex: Int 4 | let sortedIndex: Int 5 | } 6 | 7 | enum Direction { 8 | case left 9 | case right 10 | } 11 | 12 | enum EdgeType { 13 | case cycle 14 | case neighbor(direction: Direction) 15 | case jump(direction: Direction) 16 | } 17 | 18 | func edgeType(from: DoublyLinkedList>, to: DoublyLinkedList>) -> EdgeType { 19 | let fromIndex = from.value.sortedIndex 20 | let toIndex = to.value.sortedIndex 21 | 22 | if fromIndex == toIndex { 23 | return .cycle 24 | } else if abs(fromIndex - toIndex) == 1 { 25 | if fromIndex > toIndex { 26 | return .neighbor(direction: .left) 27 | } else { 28 | return .neighbor(direction: .right) 29 | } 30 | } else if fromIndex > toIndex { 31 | return .jump(direction: .left) 32 | } else { 33 | return .jump(direction: .right) 34 | } 35 | } 36 | 37 | func shiftPatchElement(node: DoublyLinkedList>) { 38 | var from = node.previous 39 | while let nextFrom = from, nextFrom.value.sourceIndex < node.value.sourceIndex { 40 | shiftPatchElement(from: nextFrom, to: node) 41 | from = nextFrom.previous 42 | } 43 | 44 | if let next = node.next { 45 | shiftPatchElement(node: next) 46 | } 47 | } 48 | 49 | func shiftPatchElement(from: DoublyLinkedList>, to: DoublyLinkedList>) { 50 | let type = edgeType(from: from, to: to) 51 | switch type { 52 | case .cycle: 53 | fatalError() 54 | case let .neighbor(direction), let .jump(direction): 55 | if case .left = direction { 56 | switch (from.value.value, to.value.value) { 57 | case (.insertion, _): 58 | to.value = to.value.decremented() 59 | case (.deletion, _): 60 | to.value = to.value.incremented() 61 | } 62 | } 63 | } 64 | } 65 | 66 | extension SortedPatchElement { 67 | func incremented() -> SortedPatchElement { 68 | return SortedPatchElement( 69 | value: value.incremented(), 70 | sourceIndex: sourceIndex, 71 | sortedIndex: sortedIndex) 72 | } 73 | 74 | func decremented() -> SortedPatchElement { 75 | return SortedPatchElement( 76 | value: value.decremented(), 77 | sourceIndex: sourceIndex, 78 | sortedIndex: sortedIndex) 79 | } 80 | } 81 | 82 | extension Patch { 83 | 84 | func incremented() -> Patch { 85 | return shiftedIndex(by: 1) 86 | } 87 | 88 | func decremented() -> Patch { 89 | return shiftedIndex(by: -1) 90 | } 91 | 92 | func shiftedIndex(by n: Int) -> Patch { 93 | switch self { 94 | case let .insertion(index, element): 95 | return .insertion(index: index + n, element: element) 96 | case let .deletion(index): 97 | return .deletion(index: index + n) 98 | } 99 | } 100 | } 101 | 102 | func shiftedPatchElements(from sortedPatchElements: [SortedPatchElement]) -> [SortedPatchElement] { 103 | let linkedList = DoublyLinkedList(linkedList: LinkedList(array: sortedPatchElements)) 104 | if let secondElement = linkedList?.next { 105 | shiftPatchElement(node: secondElement) 106 | } 107 | 108 | guard let result = linkedList?.array().sorted(by: { (fst, second) -> Bool in 109 | fst.sortedIndex < second.sortedIndex 110 | }) else { 111 | return [] 112 | } 113 | return result 114 | } 115 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/BNDProtocolProxyBase/include/BNDProtocolProxyBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | enum BNDNSObjCValueType { 28 | NSObjCNoType = 0, 29 | NSObjCVoidType = 'v', 30 | NSObjCCharType = 'c', 31 | NSObjCShortType = 's', 32 | NSObjCIntType = 'i', 33 | NSObjCLongType = 'l', 34 | NSObjCLonglongType = 'q', 35 | NSObjCUCharType = 'C', 36 | NSObjCUShortType = 'S', 37 | NSObjCUIntType = 'I', 38 | NSObjCULongType = 'L', 39 | NSObjCULonglongType = 'Q', 40 | NSObjCFloatType = 'f', 41 | NSObjCDoubleType = 'd', 42 | NSObjCBoolType = 'B', 43 | NSObjCSelectorType = ':', 44 | NSObjCObjectType = '@', 45 | NSObjCStructType = '{', 46 | NSObjCPointerType = '^', 47 | NSObjCStringType = '*', 48 | NSObjCArrayType = '[', 49 | NSObjCUnionType = '(', 50 | NSObjCBitfield = 'b' 51 | }; 52 | 53 | @interface BNDMethodSignature: NSObject 54 | 55 | @property (readonly) NSUInteger numberOfArguments; 56 | - (enum BNDNSObjCValueType)getArgumentTypeAtIndex:(NSUInteger)idx; 57 | - (NSUInteger)getArgumentAlignmentAtIndex:(NSUInteger)idx; 58 | - (NSUInteger)getArgumentSizeAtIndex:(NSUInteger)idx; 59 | 60 | @property (readonly) NSUInteger frameLength; 61 | 62 | - (BOOL)isOneway; 63 | 64 | @property (readonly) const char * _Nonnull methodReturnType; 65 | @property (readonly) NSUInteger methodReturnLength; 66 | 67 | - (enum BNDNSObjCValueType)getReturnArgumentType; 68 | - (NSUInteger)getReturnArgumentSize; 69 | - (NSUInteger)getReturnArgumentAlignment; 70 | 71 | @end 72 | 73 | @interface BNDInvocation: NSObject 74 | 75 | @property (readonly, nonnull) BNDMethodSignature * methodSignature; 76 | 77 | - (void)retainArguments; 78 | 79 | @property (readonly) BOOL argumentsRetained; 80 | 81 | @property (nonnull, readonly) SEL selector; 82 | 83 | - (void)getReturnValue:(void * _Nonnull)retLoc; 84 | - (void)setReturnValue:(void * _Nonnull)retLoc; 85 | 86 | - (void)getArgument:(void * _Nonnull)argumentLocation atIndex:(NSInteger)idx; 87 | - (void)setArgument:(void * _Nonnull)argumentLocation atIndex:(NSInteger)idx; 88 | 89 | @end 90 | 91 | @interface BNDProtocolProxyBase : NSObject 92 | 93 | @property (nonatomic, readonly, nonnull, strong) Protocol *protocol; 94 | 95 | /// An object conforming to protocol `protocol` to which forward methods calls. 96 | @property (nonatomic, nullable, weak) NSObject *forwardTo; 97 | 98 | - (nonnull instancetype)initWithProtocol:(nonnull Protocol *)protocol; 99 | - (BOOL)hasHandlerForSelector:(nonnull SEL)selector; 100 | - (void)handleInvocation:(nonnull BNDInvocation *)invocation; 101 | @end 102 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/DataSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | import ReactiveKit 27 | 28 | public protocol DataSourceProtocol { 29 | var numberOfSections: Int { get } 30 | func numberOfItems(inSection section: Int) -> Int 31 | } 32 | 33 | public enum DataSourceEventKind { 34 | case reload 35 | 36 | case insertItems([IndexPath]) 37 | case deleteItems([IndexPath]) 38 | case reloadItems([IndexPath]) 39 | case moveItem(IndexPath, IndexPath) 40 | 41 | case insertSections(IndexSet) 42 | case deleteSections(IndexSet) 43 | case reloadSections(IndexSet) 44 | case moveSection(Int, Int) 45 | 46 | case beginUpdates 47 | case endUpdates 48 | } 49 | 50 | public protocol DataSourceBatchKind {} 51 | 52 | public enum BatchKindDiff: DataSourceBatchKind {} 53 | public enum BatchKindPatch: DataSourceBatchKind {} 54 | 55 | public protocol DataSourceEventProtocol { 56 | associatedtype DataSource: DataSourceProtocol 57 | associatedtype BatchKind: DataSourceBatchKind 58 | 59 | var kind: DataSourceEventKind { get } 60 | var dataSource: DataSource { get } 61 | } 62 | 63 | extension DataSourceEventProtocol { 64 | 65 | public var _unbox: DataSourceEvent { 66 | if let event = self as? DataSourceEvent { 67 | return event 68 | } else { 69 | return DataSourceEvent(kind: self.kind, dataSource: self.dataSource) 70 | } 71 | } 72 | } 73 | 74 | public struct DataSourceEvent: DataSourceEventProtocol { 75 | public typealias BatchKind = _BatchKind 76 | 77 | public let kind: DataSourceEventKind 78 | public let dataSource: DataSource 79 | } 80 | 81 | extension Array: DataSourceProtocol { 82 | 83 | public var numberOfSections: Int { 84 | return 1 85 | } 86 | 87 | public func numberOfItems(inSection section: Int) -> Int { 88 | return count 89 | } 90 | } 91 | 92 | extension Array: DataSourceEventProtocol, ObservableArrayEventProtocol { 93 | 94 | public typealias BatchKind = BatchKindDiff 95 | 96 | public var kind: DataSourceEventKind { 97 | return .reload 98 | } 99 | 100 | public var dataSource: Array { 101 | return self 102 | } 103 | 104 | public var change: ObservableArrayChange { 105 | return .reset 106 | } 107 | 108 | public var source: ObservableArray { 109 | return ObservableArray(self) 110 | } 111 | } 112 | 113 | extension SignalProtocol where Element: DataSourceProtocol, Error == NoError { 114 | 115 | public func mapToDataSourceEvent() -> SafeSignal> { 116 | return map { collection in DataSourceEvent(kind: .reload, dataSource: collection) } 117 | } 118 | } 119 | 120 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Property.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Represents mutable state that can be observed as a signal of events. 28 | public protocol PropertyProtocol { 29 | associatedtype ProperyElement 30 | var value: ProperyElement { get } 31 | } 32 | 33 | /// Represents mutable state that can be observed as a signal of events. 34 | public class Property: PropertyProtocol, SubjectProtocol, BindableProtocol, DisposeBagProvider { 35 | 36 | private var _value: Value 37 | private let subject = PublishSubject() 38 | private let lock = NSRecursiveLock(name: "com.reactivekit.property") 39 | 40 | @available(*, deprecated, renamed: "bag") 41 | public var disposeBag: DisposeBag { 42 | return subject.disposeBag 43 | } 44 | 45 | public var bag: DisposeBag { 46 | return subject.disposeBag 47 | } 48 | 49 | /// Underlying value. Changing it emits `.next` event with new value. 50 | public var value: Value { 51 | get { 52 | lock.lock(); defer { lock.unlock() } 53 | return _value 54 | } 55 | set { 56 | lock.lock(); defer { lock.unlock() } 57 | _value = newValue 58 | subject.next(newValue) 59 | } 60 | } 61 | 62 | public init(_ value: Value) { 63 | _value = value 64 | } 65 | 66 | public func on(_ event: Event) { 67 | if case .next(let element) = event { 68 | _value = element 69 | } 70 | subject.on(event) 71 | } 72 | 73 | public func observe(with observer: @escaping (Event) -> Void) -> Disposable { 74 | return subject.start(with: value).observe(with: observer) 75 | } 76 | 77 | public var readOnlyView: AnyProperty { 78 | return AnyProperty(property: self) 79 | } 80 | 81 | /// Change the underlying value without notifying the observers. 82 | public func silentUpdate(value: Value) { 83 | _value = value 84 | } 85 | 86 | public func bind(signal: Signal) -> Disposable { 87 | return signal 88 | .take(until: bag.deallocated) 89 | .observeIn(.nonRecursive()) 90 | .observeNext { [weak self] element in 91 | guard let s = self else { return } 92 | s.on(.next(element)) 93 | } 94 | } 95 | 96 | deinit { 97 | subject.completed() 98 | } 99 | } 100 | 101 | /// Represents mutable state that can be observed as a signal of events. 102 | public final class AnyProperty: PropertyProtocol, SignalProtocol { 103 | 104 | private let property: Property 105 | 106 | public var value: Value { 107 | return property.value 108 | } 109 | 110 | public init(property: Property) { 111 | self.property = property 112 | } 113 | 114 | public func observe(with observer: @escaping (Event) -> Void) -> Disposable { 115 | return property.observe(with: observer) 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Observer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Represents a type that receives events. 28 | public typealias Observer = (Event) -> Void 29 | 30 | /// Represents a type that receives events. 31 | public protocol ObserverProtocol { 32 | 33 | /// Type of elements being received. 34 | associatedtype Element 35 | 36 | /// Type of error that can be received. 37 | associatedtype Error: Swift.Error 38 | 39 | /// Send the event to the observer. 40 | func on(_ event: Event) 41 | } 42 | 43 | /// Represents a type that receives events. Observer is just a convenience 44 | /// wrapper around a closure observer `Observer`. 45 | public struct AnyObserver: ObserverProtocol { 46 | 47 | private let observer: Observer 48 | 49 | /// Creates an observer that wraps a closure observer. 50 | public init(observer: @escaping Observer) { 51 | self.observer = observer 52 | } 53 | 54 | /// Calles wrapped closure with the given element. 55 | public func on(_ event: Event) { 56 | observer(event) 57 | } 58 | } 59 | 60 | /// Observer that ensures events are sent atomically. 61 | public class AtomicObserver: ObserverProtocol { 62 | 63 | private var observer: Observer? 64 | private let lock = NSRecursiveLock(name: "com.reactivekit.signal.atomicobserver") 65 | private let parentDisposable: Disposable 66 | 67 | public private(set) var disposable: Disposable! 68 | 69 | /// Creates an observer that wraps given closure. 70 | public init(disposable: Disposable, observer: @escaping Observer) { 71 | self.observer = observer 72 | self.parentDisposable = disposable 73 | self.disposable = BlockDisposable { [weak self] in 74 | self?.observer = nil 75 | disposable.dispose() 76 | } 77 | } 78 | 79 | /// Calles wrapped closure with the given element. 80 | public func on(_ event: Event) { 81 | lock.lock(); defer { lock.unlock() } 82 | if let observer = observer { 83 | observer(event) 84 | if event.isTerminal { 85 | disposable.dispose() 86 | } 87 | } 88 | } 89 | } 90 | 91 | // MARK: - Extensions 92 | 93 | public extension ObserverProtocol { 94 | 95 | /// Convenience method to send `.next` event. 96 | public func next(_ element: Element) { 97 | on(.next(element)) 98 | } 99 | 100 | /// Convenience method to send `.failed` event. 101 | public func failed(_ error: Error) { 102 | on(.failed(error)) 103 | } 104 | 105 | /// Convenience method to send `.completed` event. 106 | public func completed() { 107 | on(.completed) 108 | } 109 | 110 | /// Convenience method to send `.next` event followed by a `.completed` event. 111 | public func completed(with element: Element) { 112 | next(element) 113 | completed() 114 | } 115 | 116 | /// Converts the receiver to the Observer closure. 117 | public func toObserver() -> Observer { 118 | return on 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Connectable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// Represents a signal that is started by calling `connect` on it. 28 | public protocol ConnectableSignalProtocol: SignalProtocol { 29 | 30 | /// Start the signal. 31 | func connect() -> Disposable 32 | } 33 | 34 | /// Makes a signal connectable through the given subject. 35 | public final class ConnectableSignal: ConnectableSignalProtocol { 36 | 37 | private let source: Source 38 | private let lock = NSRecursiveLock() 39 | private let subject: Subject 40 | 41 | public init(source: Source, subject: Subject) { 42 | self.source = source 43 | self.subject = subject 44 | } 45 | 46 | /// Start the signal. 47 | public func connect() -> Disposable { 48 | lock.lock(); defer { lock.unlock() } 49 | if !subject.isTerminated { 50 | return source.observe(with: subject) 51 | } else { 52 | return SimpleDisposable(isDisposed: true) 53 | } 54 | } 55 | 56 | /// Register an observer that will receive events from the signal. 57 | /// Note that the events will not be generated until `connect` is called. 58 | public func observe(with observer: @escaping (Event) -> Void) -> Disposable { 59 | return subject.observe(with: observer) 60 | } 61 | } 62 | 63 | public extension ConnectableSignalProtocol { 64 | 65 | /// Convert connectable signal into the ordinary signal by calling `connect` 66 | /// on the first observation and calling dispose when number of observers goes down to zero. 67 | public func refCount() -> Signal { 68 | var count = 0 69 | var connectionDisposable: Disposable? = nil 70 | return Signal { observer in 71 | count = count + 1 72 | let disposable = self.observe(with: observer.on) 73 | if connectionDisposable == nil { 74 | connectionDisposable = self.connect() 75 | } 76 | return BlockDisposable { 77 | disposable.dispose() 78 | count = count - 1 79 | if count == 0 { 80 | connectionDisposable?.dispose() 81 | connectionDisposable = nil 82 | } 83 | } 84 | } 85 | } 86 | } 87 | 88 | extension SignalProtocol { 89 | 90 | /// Ensure that all observers see the same sequence of elements. Connectable. 91 | public func replay(limit: Int = Int.max) -> ConnectableSignal { 92 | if limit == 0 { 93 | return ConnectableSignal(source: self, subject: PublishSubject()) 94 | } else if limit == 1 { 95 | return ConnectableSignal(source: self, subject: ReplayOneSubject()) 96 | } else { 97 | return ConnectableSignal(source: self, subject: ReplaySubject(bufferSize: limit)) 98 | } 99 | } 100 | 101 | /// Convert signal to a connectable signal. 102 | public func publish() -> ConnectableSignal { 103 | return ConnectableSignal(source: self, subject: PublishSubject()) 104 | } 105 | 106 | /// Ensure that all observers see the same sequence of elements. 107 | /// Shorthand for `replay(limit).refCount()`. 108 | public func shareReplay(limit: Int = Int.max) -> Signal { 109 | return replay(limit: limit).refCount() 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Amber 5 | 6 | Copyright (c) 2017 Nikita Arkhipov 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## Bond 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2015-2016 Bond 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | 51 | 52 | 53 | ## Differ 54 | 55 | The MIT License (MIT) 56 | 57 | Copyright (c) 2017 Tony Arnold 58 | 59 | 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: 60 | 61 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 62 | 63 | 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. 64 | 65 | 66 | ## ReactiveKit 67 | 68 | The MIT License (MIT) 69 | 70 | Copyright (c) 2015 ReactiveKit 71 | 72 | Permission is hereby granted, free of charge, to any person obtaining a copy 73 | of this software and associated documentation files (the "Software"), to deal 74 | in the Software without restriction, including without limitation the rights 75 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 76 | copies of the Software, and to permit persons to whom the Software is 77 | furnished to do so, subject to the following conditions: 78 | 79 | The above copyright notice and this permission notice shall be included in all 80 | copies or substantial portions of the Software. 81 | 82 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 83 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 84 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 85 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 86 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 87 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 88 | SOFTWARE. 89 | 90 | 91 | Generated by CocoaPods - https://cocoapods.org 92 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/ExecutionContext.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | import Dispatch 27 | 28 | /// Execution context is an abstraction over a thread or a dispatch queue. 29 | /// 30 | /// let context = ExecutionContext.main 31 | /// 32 | /// context.execute { 33 | /// print("Printing on main queue.") 34 | /// } 35 | /// 36 | public struct ExecutionContext { 37 | 38 | private let context: (@escaping () -> Void) -> Void 39 | 40 | /// Execution context is just a function that executes other function. 41 | public init(_ context: @escaping (@escaping () -> Void) -> Void) { 42 | self.context = context 43 | } 44 | 45 | /// Execute given block in the context. 46 | public func execute(_ block: @escaping () -> Void) { 47 | context(block) 48 | } 49 | 50 | /// Execution context that executes immediately and synchronously on current thread or queue. 51 | public static var immediate: ExecutionContext { 52 | return ExecutionContext { block in block () } 53 | } 54 | 55 | /// Executes immediately and synchronously if current thread is main thread. Otherwise executes 56 | /// asynchronously on main dispatch queue (main thread). 57 | public static var immediateOnMain: ExecutionContext { 58 | return ExecutionContext { block in 59 | if Thread.isMainThread { 60 | block() 61 | } else { 62 | DispatchQueue.main.async(execute: block) 63 | } 64 | } 65 | } 66 | 67 | /// Execution context bound to main dispatch queue. 68 | public static var main: ExecutionContext { 69 | return DispatchQueue.main.context 70 | } 71 | 72 | /// Execution context bound to global dispatch queue. 73 | @available(macOS 10.10, *) 74 | public static func global(qos: DispatchQoS.QoSClass = .default) -> ExecutionContext { 75 | return DispatchQueue.global(qos: qos).context 76 | } 77 | 78 | /// Execution context that breaks recursive class by ingoring them. 79 | public static func nonRecursive() -> ExecutionContext { 80 | var updating: Bool = false 81 | return ExecutionContext { block in 82 | guard !updating else { return } 83 | updating = true 84 | block() 85 | updating = false 86 | } 87 | } 88 | } 89 | 90 | public extension DispatchQueue { 91 | 92 | /// Creates ExecutionContext from the queue. 93 | public var context: ExecutionContext { 94 | return ExecutionContext(context) 95 | } 96 | 97 | private func context(_ block: @escaping () -> Void) { 98 | async(execute: block) 99 | } 100 | 101 | /// Schedule given block for execution after given interval passes. 102 | public func after(when interval: Double, block: @escaping () -> Void) { 103 | asyncAfter(deadline: .now() + interval, execute: block) 104 | } 105 | 106 | /// Schedule given block for execution after given interval passes. 107 | /// Scheduled execution can be cancelled by disposing the returned disposable. 108 | public func disposableAfter(when interval: Double, block: @escaping () -> Void) -> Disposable { 109 | let disposable = SimpleDisposable() 110 | after(when: interval) { 111 | if !disposable.isDisposed { 112 | block() 113 | } 114 | } 115 | return disposable 116 | } 117 | } 118 | 119 | // MARK: Compatibility 120 | 121 | @available(*, deprecated, message: "Use ExecutionContext.immediate instead.") 122 | public let ImmediateExecutionContext: ExecutionContext = .immediate 123 | 124 | @available(*, deprecated, message: "Use ExecutionContext.immediateOnMain instead.") 125 | public let ImmediateOnMainExecutionContext: ExecutionContext = .immediateOnMain 126 | -------------------------------------------------------------------------------- /Example/Amber.xcodeproj/xcshareddata/xcschemes/Amber-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 80 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 101 | 107 | 108 | 109 | 110 | 112 | 113 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Example/Pods/Differ/Sources/Differ/NestedDiff.swift: -------------------------------------------------------------------------------- 1 | public struct NestedDiff: DiffProtocol { 2 | 3 | public typealias Index = Int 4 | 5 | public enum Element { 6 | case deleteSection(Int) 7 | case insertSection(Int) 8 | case deleteElement(Int, section: Int) 9 | case insertElement(Int, section: Int) 10 | } 11 | 12 | /// Returns the position immediately after the given index. 13 | /// 14 | /// - Parameters: 15 | /// - i: A valid index of the collection. `i` must be less than `endIndex`. 16 | /// - Returns: The index value immediately after `i`. 17 | public func index(after i: Int) -> Int { 18 | return i + 1 19 | } 20 | 21 | public let elements: [Element] 22 | } 23 | 24 | public extension Collection 25 | where Iterator.Element: Collection { 26 | 27 | /// Creates a diff between the callee and `other` collection. It diffs elements two levels deep (therefore "nested") 28 | /// 29 | /// - Parameters: 30 | /// - other: a collection to compare the calee to 31 | /// - Returns: a `NestedDiff` between the calee and `other` collection 32 | public func nestedDiff( 33 | to: Self, 34 | isEqualSection: EqualityChecker, 35 | isEqualElement: NestedElementEqualityChecker 36 | ) -> NestedDiff { 37 | let diffTraces = outputDiffPathTraces(to: to, isEqual: isEqualSection) 38 | 39 | // Diff sections 40 | let sectionDiff = Diff(traces: diffTraces).map { element -> NestedDiff.Element in 41 | switch element { 42 | case let .delete(at): 43 | return .deleteSection(at) 44 | case let .insert(at): 45 | return .insertSection(at) 46 | } 47 | } 48 | 49 | // Diff matching sections (moves, deletions, insertions) 50 | let filterMatchPoints = { (trace: Trace) -> Bool in 51 | if case .matchPoint = trace.type() { 52 | return true 53 | } 54 | return false 55 | } 56 | 57 | // offset & section 58 | 59 | let matchingSectionTraces = diffTraces 60 | .filter(filterMatchPoints) 61 | 62 | let fromSections = matchingSectionTraces.map { 63 | itemOnStartIndex(advancedBy: $0.from.x) 64 | } 65 | 66 | let toSections = matchingSectionTraces.map { 67 | to.itemOnStartIndex(advancedBy: $0.from.y) 68 | } 69 | 70 | let elementDiff = zip(zip(fromSections, toSections), matchingSectionTraces) 71 | .flatMap { (args) -> [NestedDiff.Element] in 72 | let (sections, trace) = args 73 | return sections.0.diff(sections.1, isEqual: isEqualElement).map { diffElement -> NestedDiff.Element in 74 | switch diffElement { 75 | case let .delete(at): 76 | return .deleteElement(at, section: trace.from.x) 77 | case let .insert(at): 78 | return .insertElement(at, section: trace.from.y) 79 | } 80 | } 81 | } 82 | 83 | return NestedDiff(elements: sectionDiff + elementDiff) 84 | } 85 | } 86 | 87 | public extension Collection 88 | where Iterator.Element: Collection, 89 | Iterator.Element.Iterator.Element: Equatable { 90 | 91 | /// - SeeAlso: `nestedDiff(to:isEqualSection:isEqualElement:)` 92 | public func nestedDiff( 93 | to: Self, 94 | isEqualSection: EqualityChecker 95 | ) -> NestedDiff { 96 | return nestedDiff( 97 | to: to, 98 | isEqualSection: isEqualSection, 99 | isEqualElement: { $0 == $1 } 100 | ) 101 | } 102 | } 103 | 104 | public extension Collection 105 | where Iterator.Element: Collection, 106 | Iterator.Element: Equatable { 107 | 108 | /// - SeeAlso: `nestedDiff(to:isEqualSection:isEqualElement:)` 109 | public func nestedDiff( 110 | to: Self, 111 | isEqualElement: NestedElementEqualityChecker 112 | ) -> NestedDiff { 113 | return nestedDiff( 114 | to: to, 115 | isEqualSection: { $0 == $1 }, 116 | isEqualElement: isEqualElement 117 | ) 118 | } 119 | } 120 | 121 | public extension Collection 122 | where Iterator.Element: Collection, 123 | Iterator.Element: Equatable, 124 | Iterator.Element.Iterator.Element: Equatable { 125 | 126 | /// - SeeAlso: `nestedDiff(to:isEqualSection:isEqualElement:)` 127 | public func nestedDiff(to: Self) -> NestedDiff { 128 | return nestedDiff( 129 | to: to, 130 | isEqualSection: { $0 == $1 }, 131 | isEqualElement: { $0 == $1 } 132 | ) 133 | } 134 | } 135 | 136 | extension NestedDiff.Element: CustomDebugStringConvertible { 137 | public var debugDescription: String { 138 | switch self { 139 | case let .deleteElement(row, section): 140 | return "DE(\(row),\(section))" 141 | case let .deleteSection(section): 142 | return "DS(\(section))" 143 | case let .insertElement(row, section): 144 | return "IE(\(row),\(section))" 145 | case let .insertSection(section): 146 | return "IS(\(section))" 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UIGestureRecognizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Sam Galizia (@sgalizia) 5 | // Copyright (c) 2017 Andy Bennett (@akbsteam) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #if os(iOS) || os(tvOS) 27 | 28 | import UIKit 29 | import ReactiveKit 30 | 31 | extension UIGestureRecognizer: BindingExecutionContextProvider { 32 | public var bindingExecutionContext: ExecutionContext { return .immediateOnMain } 33 | } 34 | 35 | public extension ReactiveExtensions where Base: UIGestureRecognizer { 36 | 37 | public var isEnabled: Bond { 38 | return bond { $0.isEnabled = $1 } 39 | } 40 | } 41 | 42 | #endif 43 | 44 | #if os(iOS) 45 | 46 | public extension ReactiveExtensions where Base: UIView { 47 | 48 | public func addGestureRecognizer(_ gestureRecognizer: T) -> SafeSignal { 49 | let base = self.base 50 | return Signal { [weak base] observer in 51 | guard let base = base else { 52 | observer.completed() 53 | return NonDisposable.instance 54 | } 55 | let target = BNDGestureTarget(view: base, gestureRecognizer: gestureRecognizer) { recog in 56 | observer.next(recog as! T) 57 | } 58 | return BlockDisposable { 59 | target.unregister() 60 | } 61 | }.take(until: base.deallocated) 62 | } 63 | 64 | public func tapGesture(numberOfTaps: Int = 1, numberOfTouches: Int = 1) -> SafeSignal { 65 | let gesture = UITapGestureRecognizer() 66 | gesture.numberOfTapsRequired = numberOfTaps 67 | gesture.numberOfTouchesRequired = numberOfTouches 68 | 69 | return addGestureRecognizer(gesture) 70 | } 71 | 72 | public func panGesture(numberOfTouches: Int = 1) -> SafeSignal { 73 | let gesture = UIPanGestureRecognizer() 74 | gesture.minimumNumberOfTouches = numberOfTouches 75 | 76 | return addGestureRecognizer(gesture) 77 | } 78 | 79 | public func swipeGesture(numberOfTouches: Int, direction: UISwipeGestureRecognizerDirection) -> SafeSignal { 80 | let gesture = UISwipeGestureRecognizer() 81 | gesture.numberOfTouchesRequired = numberOfTouches 82 | gesture.direction = direction 83 | 84 | return addGestureRecognizer(gesture) 85 | } 86 | 87 | public func pinchGesture() -> SafeSignal { 88 | return addGestureRecognizer(UIPinchGestureRecognizer()) 89 | } 90 | 91 | public func longPressGesture(numberOfTaps: Int = 0, numberOfTouches: Int = 1, minimumPressDuration: CFTimeInterval = 0.3, allowableMovement: CGFloat = 10) -> SafeSignal { 92 | let gesture = UILongPressGestureRecognizer() 93 | gesture.numberOfTapsRequired = numberOfTaps 94 | gesture.numberOfTouchesRequired = numberOfTouches 95 | gesture.minimumPressDuration = minimumPressDuration 96 | gesture.allowableMovement = allowableMovement 97 | 98 | return addGestureRecognizer(gesture) 99 | } 100 | 101 | public func rotationGesture() -> SafeSignal { 102 | return addGestureRecognizer(UIRotationGestureRecognizer()) 103 | } 104 | } 105 | 106 | @objc fileprivate class BNDGestureTarget: NSObject { 107 | 108 | private weak var view: UIView? 109 | private let observer: (UIGestureRecognizer) -> Void 110 | private let gestureRecognizer: UIGestureRecognizer 111 | 112 | fileprivate init(view: UIView, gestureRecognizer: UIGestureRecognizer, observer: @escaping (UIGestureRecognizer) -> Void) { 113 | self.view = view 114 | self.gestureRecognizer = gestureRecognizer 115 | self.observer = observer 116 | 117 | super.init() 118 | 119 | gestureRecognizer.addTarget(self, action: #selector(actionHandler(recogniser:))) 120 | view.addGestureRecognizer(gestureRecognizer) 121 | } 122 | 123 | @objc private func actionHandler(recogniser: UIGestureRecognizer) { 124 | observer(recogniser) 125 | } 126 | 127 | fileprivate func unregister() { 128 | view?.removeGestureRecognizer(gestureRecognizer) 129 | } 130 | 131 | deinit { 132 | unregister() 133 | } 134 | } 135 | 136 | #endif 137 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | 104 | if [[ "$CONFIGURATION" == "Debug" ]]; then 105 | install_framework "${BUILT_PRODUCTS_DIR}/Amber/Amber.framework" 106 | install_framework "${BUILT_PRODUCTS_DIR}/Bond/Bond.framework" 107 | install_framework "${BUILT_PRODUCTS_DIR}/Differ/Differ.framework" 108 | install_framework "${BUILT_PRODUCTS_DIR}/ReactiveKit/ReactiveKit.framework" 109 | fi 110 | if [[ "$CONFIGURATION" == "Release" ]]; then 111 | install_framework "${BUILT_PRODUCTS_DIR}/Amber/Amber.framework" 112 | install_framework "${BUILT_PRODUCTS_DIR}/Bond/Bond.framework" 113 | install_framework "${BUILT_PRODUCTS_DIR}/Differ/Differ.framework" 114 | install_framework "${BUILT_PRODUCTS_DIR}/ReactiveKit/ReactiveKit.framework" 115 | fi 116 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 117 | wait 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/Pods/ReactiveKit/Sources/Subjects.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | import Foundation 26 | 27 | /// A type that is both a signal and an observer. 28 | public protocol SubjectProtocol: SignalProtocol, ObserverProtocol { 29 | } 30 | 31 | /// A type that is both a signal and an observer. 32 | open class Subject: SubjectProtocol { 33 | 34 | private typealias Token = Int64 35 | private var nextToken: Token = 0 36 | 37 | private var observers: [(Token, Observer)] = [] 38 | 39 | public private(set) var isTerminated = false 40 | 41 | public let lock = NSRecursiveLock(name: "com.reactivekit.subject") 42 | public let disposeBag = DisposeBag() 43 | 44 | public init() {} 45 | 46 | public func on(_ event: Event) { 47 | lock.lock(); defer { lock.unlock() } 48 | guard !isTerminated else { return } 49 | isTerminated = event.isTerminal 50 | send(event) 51 | } 52 | 53 | open func send(_ event: Event) { 54 | forEachObserver { $0(event) } 55 | } 56 | 57 | open func observe(with observer: @escaping Observer) -> Disposable { 58 | lock.lock(); defer { lock.unlock() } 59 | willAdd(observer: observer) 60 | return add(observer: observer) 61 | } 62 | 63 | open func willAdd(observer: @escaping Observer) { 64 | } 65 | 66 | private func add(observer: @escaping Observer) -> Disposable { 67 | let token = nextToken 68 | nextToken = nextToken + 1 69 | 70 | observers.append((token, observer)) 71 | 72 | return BlockDisposable { [weak self] in 73 | guard let me = self else { return } 74 | guard let index = me.observers.index(where: { $0.0 == token }) else { return } 75 | me.observers.remove(at: index) 76 | } 77 | } 78 | 79 | private func forEachObserver(_ execute: (Observer) -> Void) { 80 | for (_, observer) in observers { 81 | execute(observer) 82 | } 83 | } 84 | } 85 | 86 | extension Subject: BindableProtocol { 87 | 88 | public func bind(signal: Signal) -> Disposable { 89 | return signal 90 | .take(until: disposeBag.deallocated) 91 | .observeIn(.nonRecursive()) 92 | .observeNext { [weak self] element in 93 | guard let s = self else { return } 94 | s.on(.next(element)) 95 | } 96 | } 97 | } 98 | 99 | /// A subject that propagates received events to the registered observes. 100 | public final class PublishSubject: Subject {} 101 | 102 | /// A subject that replies accumulated sequence of events to each observer. 103 | public final class ReplaySubject: Subject { 104 | 105 | private var buffer: ArraySlice> = [] 106 | public let bufferSize: Int 107 | 108 | public init(bufferSize: Int = Int.max) { 109 | if bufferSize < Int.max { 110 | self.bufferSize = bufferSize + 1 // plus terminal event 111 | } else { 112 | self.bufferSize = bufferSize 113 | } 114 | } 115 | 116 | public override func send(_ event: Event) { 117 | buffer.append(event) 118 | buffer = buffer.suffix(bufferSize) 119 | super.send(event) 120 | } 121 | 122 | public override func willAdd(observer: @escaping Observer) { 123 | buffer.forEach(observer) 124 | } 125 | } 126 | 127 | /// A subject that replies latest event to each observer. 128 | public final class ReplayOneSubject: Subject { 129 | 130 | private var lastEvent: Event? = nil 131 | private var terminalEvent: Event? = nil 132 | 133 | public override func send(_ event: Event) { 134 | if event.isTerminal { 135 | terminalEvent = event 136 | } else { 137 | lastEvent = event 138 | } 139 | super.send(event) 140 | } 141 | 142 | public override func willAdd(observer: @escaping Observer) { 143 | if let event = lastEvent { 144 | observer(event) 145 | } 146 | if let event = terminalEvent { 147 | observer(event) 148 | } 149 | } 150 | } 151 | 152 | 153 | @available(*, deprecated, message: "All subjects now inherit 'Subject' that can be used in place of 'AnySubject'.") 154 | public final class AnySubject: SubjectProtocol { 155 | private let baseObserve: (@escaping Observer) -> Disposable 156 | private let baseOn: Observer 157 | 158 | public let disposeBag = DisposeBag() 159 | 160 | public init(base: S) where S.Element == Element, S.Error == Error { 161 | baseObserve = base.observe 162 | baseOn = base.on 163 | } 164 | 165 | public func on(_ event: Event) { 166 | return baseOn(event) 167 | } 168 | 169 | public func observe(with observer: @escaping Observer) -> Disposable { 170 | return baseObserve(observer) 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/Bond/UIKit/UICollectionView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #if os(iOS) || os(tvOS) 26 | 27 | import UIKit 28 | import ReactiveKit 29 | 30 | public protocol CollectionViewBond { 31 | associatedtype DataSource: DataSourceProtocol 32 | func cellForRow(at indexPath: IndexPath, collectionView: UICollectionView, dataSource: DataSource) -> UICollectionViewCell 33 | } 34 | 35 | private struct SimpleCollectionViewBond: CollectionViewBond { 36 | 37 | let createCell: (DataSource, IndexPath, UICollectionView) -> UICollectionViewCell 38 | 39 | func cellForRow(at indexPath: IndexPath, collectionView: UICollectionView, dataSource: DataSource) -> UICollectionViewCell { 40 | return createCell(dataSource, indexPath, collectionView) 41 | } 42 | } 43 | 44 | public extension ReactiveExtensions where Base: UICollectionView { 45 | 46 | public var delegate: ProtocolProxy { 47 | return base.protocolProxy(for: UICollectionViewDelegate.self, setter: NSSelectorFromString("setDelegate:")) 48 | } 49 | 50 | public var dataSource: ProtocolProxy { 51 | return base.protocolProxy(for: UICollectionViewDataSource.self, setter: NSSelectorFromString("setDataSource:")) 52 | } 53 | } 54 | 55 | public extension SignalProtocol where Element: DataSourceEventProtocol, Element.BatchKind == BatchKindDiff, Error == NoError { 56 | 57 | @discardableResult 58 | public func bind(to collectionView: UICollectionView, createCell: @escaping (DataSource, IndexPath, UICollectionView) -> UICollectionViewCell) -> Disposable { 59 | return bind(to: collectionView, using: SimpleCollectionViewBond(createCell: createCell)) 60 | } 61 | 62 | @discardableResult 63 | public func bind(to collectionView: UICollectionView, using bond: B) -> Disposable where B.DataSource == DataSource { 64 | 65 | let dataSource = Property(nil) 66 | let disposable = CompositeDisposable() 67 | 68 | disposable += collectionView.reactive.dataSource.feed( 69 | property: dataSource, 70 | to: #selector(UICollectionViewDataSource.collectionView(_:cellForItemAt:)), 71 | map: { (dataSource: DataSource?, collectionView: UICollectionView, indexPath: NSIndexPath) -> UICollectionViewCell in 72 | return bond.cellForRow(at: indexPath as IndexPath, collectionView: collectionView, dataSource: dataSource!) 73 | }) 74 | 75 | disposable += collectionView.reactive.dataSource.feed( 76 | property: dataSource, 77 | to: #selector(UICollectionViewDataSource.collectionView(_:numberOfItemsInSection:)), 78 | map: { (dataSource: DataSource?, _: UICollectionView, section: Int) -> Int in dataSource?.numberOfItems(inSection: section) ?? 0 } 79 | ) 80 | 81 | disposable += collectionView.reactive.dataSource.feed( 82 | property: dataSource, 83 | to: #selector(UICollectionViewDataSource.numberOfSections(in:)), 84 | map: { (dataSource: DataSource?, _: UICollectionView) -> Int in dataSource?.numberOfSections ?? 0 } 85 | ) 86 | 87 | var bufferedEvents: [DataSourceEventKind]? = nil 88 | 89 | disposable += bind(to: collectionView) { collectionView, event in 90 | dataSource.value = event.dataSource 91 | 92 | let applyEventOfKind: (DataSourceEventKind) -> () = { kind in 93 | switch kind { 94 | case .reload: 95 | collectionView.reloadData() 96 | case .insertItems(let indexPaths): 97 | collectionView.insertItems(at: indexPaths) 98 | case .deleteItems(let indexPaths): 99 | collectionView.deleteItems(at: indexPaths) 100 | case .reloadItems(let indexPaths): 101 | collectionView.reloadItems(at: indexPaths) 102 | case .moveItem(let indexPath, let newIndexPath): 103 | collectionView.moveItem(at: indexPath, to: newIndexPath) 104 | case .insertSections(let indexSet): 105 | collectionView.insertSections(indexSet) 106 | case .deleteSections(let indexSet): 107 | collectionView.deleteSections(indexSet) 108 | case .reloadSections(let indexSet): 109 | collectionView.reloadSections(indexSet) 110 | case .moveSection(let index, let newIndex): 111 | collectionView.moveSection(index, toSection: newIndex) 112 | case .beginUpdates: 113 | fatalError() 114 | case .endUpdates: 115 | fatalError() 116 | } 117 | } 118 | 119 | switch event.kind { 120 | case .reload: 121 | collectionView.reloadData() 122 | case .beginUpdates: 123 | bufferedEvents = [] 124 | case .endUpdates: 125 | if let bufferedEvents = bufferedEvents { 126 | collectionView.performBatchUpdates({ bufferedEvents.forEach(applyEventOfKind) }, completion: nil) 127 | } else { 128 | fatalError("Bond: Unexpected event .endUpdates. Should have been preceded by a .beginUpdates event.") 129 | } 130 | bufferedEvents = nil 131 | default: 132 | if bufferedEvents != nil { 133 | bufferedEvents!.append(event.kind) 134 | } else { 135 | applyEventOfKind(event.kind) 136 | } 137 | } 138 | } 139 | 140 | return disposable 141 | } 142 | } 143 | 144 | #endif 145 | -------------------------------------------------------------------------------- /Example/Pods/Bond/Sources/BNDProtocolProxyBase/BNDProtocolProxyBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2016 Srdan Rasic (@srdanrasic) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import "BNDProtocolProxyBase.h" 26 | #import 27 | 28 | @interface BNDMethodSignature () 29 | @property (nonatomic, strong) NSMethodSignature *signature; 30 | @end 31 | 32 | @interface BNDInvocation () 33 | @property (nonatomic, strong) NSInvocation *invocation; 34 | @property (nonatomic, strong) BNDMethodSignature *signature; 35 | - (instancetype)initWithInvocation:(NSInvocation *)invocation; 36 | @end 37 | 38 | 39 | @interface BNDProtocolProxyBase () 40 | @property (nonatomic, readwrite, strong) Protocol *protocol; 41 | @end 42 | 43 | @implementation BNDProtocolProxyBase 44 | 45 | - (instancetype)initWithProtocol:(Protocol *)protocol 46 | { 47 | self = [super init]; 48 | if (self) { 49 | _protocol = protocol; 50 | } 51 | return self; 52 | } 53 | 54 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)selector 55 | { 56 | NSMethodSignature *signature = [super methodSignatureForSelector:selector]; 57 | 58 | if (!signature && [self hasHandlerForSelector:selector]) { 59 | struct objc_method_description description = protocol_getMethodDescription(self.protocol, selector, NO, YES); 60 | if (description.types == NULL) { 61 | description = protocol_getMethodDescription(self.protocol, selector, YES, YES); 62 | } 63 | signature = [NSMethodSignature signatureWithObjCTypes:description.types]; 64 | } 65 | 66 | if (!signature) { 67 | signature = [self.forwardTo methodSignatureForSelector:selector]; 68 | } 69 | 70 | return signature; 71 | } 72 | 73 | - (BOOL)hasHandlerForSelector:(SEL)selector 74 | { 75 | return NO; 76 | } 77 | 78 | - (void)handleInvocation:(BNDInvocation *)invocation 79 | { 80 | // Overridden in Swift subclass 81 | } 82 | 83 | - (void)forwardInvocation:(NSInvocation *)invocation 84 | { 85 | if ([self hasHandlerForSelector:invocation.selector]) { 86 | [self handleInvocation:[[BNDInvocation alloc] initWithInvocation:invocation]]; 87 | } else if ([self.forwardTo respondsToSelector:invocation.selector]) { 88 | [invocation invokeWithTarget:self.forwardTo]; 89 | } else { 90 | [super forwardInvocation:invocation]; 91 | } 92 | } 93 | 94 | @end 95 | 96 | @implementation BNDMethodSignature 97 | 98 | - (instancetype)initWithMethodSignature:(NSMethodSignature *)methodSignature 99 | { 100 | self = [super init]; 101 | if (self) { 102 | _signature = methodSignature; 103 | } 104 | return self; 105 | } 106 | 107 | - (NSUInteger)numberOfArguments { 108 | return self.signature.numberOfArguments; 109 | } 110 | 111 | - (enum BNDNSObjCValueType)getArgumentTypeAtIndex:(NSUInteger)idx { 112 | return [self.signature getArgumentTypeAtIndex:idx][0]; 113 | } 114 | 115 | - (NSUInteger)getArgumentSizeAtIndex:(NSUInteger)idx { 116 | NSUInteger size; 117 | NSGetSizeAndAlignment([self.signature getArgumentTypeAtIndex:idx], &size, NULL); 118 | return size; 119 | } 120 | 121 | - (NSUInteger)getArgumentAlignmentAtIndex:(NSUInteger)idx { 122 | NSUInteger alignment; 123 | NSGetSizeAndAlignment([self.signature getArgumentTypeAtIndex:idx], NULL, &alignment); 124 | return alignment; 125 | } 126 | 127 | - (NSUInteger)frameLength { 128 | return self.signature.frameLength; 129 | } 130 | 131 | - (BOOL)isOneway { 132 | return [self.signature isOneway]; 133 | } 134 | 135 | - (const char *)methodReturnType { 136 | return [self.signature methodReturnType]; 137 | } 138 | 139 | - (NSUInteger)methodReturnLength { 140 | return self.signature.methodReturnLength; 141 | } 142 | 143 | - (enum BNDNSObjCValueType)getReturnArgumentType { 144 | return [self methodReturnType][0]; 145 | } 146 | 147 | - (NSUInteger)getReturnArgumentSize { 148 | NSUInteger size; 149 | NSGetSizeAndAlignment(self.methodReturnType, &size, NULL); 150 | return size; 151 | } 152 | 153 | - (NSUInteger)getReturnArgumentAlignment { 154 | NSUInteger alignment; 155 | NSGetSizeAndAlignment(self.methodReturnType, NULL, &alignment); 156 | return alignment; 157 | } 158 | 159 | @end 160 | 161 | @implementation BNDInvocation 162 | 163 | - (instancetype)initWithInvocation:(NSInvocation *)invocation 164 | { 165 | self = [super init]; 166 | if (self) { 167 | _invocation = invocation; 168 | _signature = [[BNDMethodSignature alloc] initWithMethodSignature:[invocation methodSignature]]; 169 | } 170 | return self; 171 | } 172 | 173 | - (BNDMethodSignature *)methodSignature { 174 | return self.signature; 175 | } 176 | 177 | - (void)retainArguments { 178 | [self.invocation retainArguments]; 179 | } 180 | 181 | - (BOOL)argumentsRetained { 182 | return [self.invocation argumentsRetained]; 183 | } 184 | 185 | - (SEL)selector { 186 | return [self.invocation selector]; 187 | } 188 | 189 | - (void)getReturnValue:(void *)retLoc { 190 | [self.invocation getReturnValue:retLoc]; 191 | } 192 | 193 | - (void)setReturnValue:(void *)retLoc { 194 | [self.invocation setReturnValue:retLoc]; 195 | } 196 | 197 | - (void)getArgument:(void *)argumentLocation atIndex:(NSInteger)idx { 198 | [self.invocation getArgument:argumentLocation atIndex:idx]; 199 | } 200 | 201 | - (void)setArgument:(void *)argumentLocation atIndex:(NSInteger)idx { 202 | [self.invocation setArgument:argumentLocation atIndex:idx]; 203 | } 204 | 205 | @end 206 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Amber_Tests/Pods-Amber_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2017 Nikita Arkhipov <nikitarkhipov@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | Amber 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | The MIT License (MIT) 47 | 48 | Copyright (c) 2015-2016 Bond 49 | 50 | Permission is hereby granted, free of charge, to any person obtaining a copy 51 | of this software and associated documentation files (the "Software"), to deal 52 | in the Software without restriction, including without limitation the rights 53 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 54 | copies of the Software, and to permit persons to whom the Software is 55 | furnished to do so, subject to the following conditions: 56 | 57 | The above copyright notice and this permission notice shall be included in all 58 | copies or substantial portions of the Software. 59 | 60 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 61 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 62 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 63 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 64 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 65 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 66 | SOFTWARE. 67 | 68 | 69 | License 70 | MIT 71 | Title 72 | Bond 73 | Type 74 | PSGroupSpecifier 75 | 76 | 77 | FooterText 78 | The MIT License (MIT) 79 | 80 | Copyright (c) 2017 Tony Arnold 81 | 82 | 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: 83 | 84 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 85 | 86 | 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. 87 | 88 | License 89 | MIT 90 | Title 91 | Differ 92 | Type 93 | PSGroupSpecifier 94 | 95 | 96 | FooterText 97 | The MIT License (MIT) 98 | 99 | Copyright (c) 2015 ReactiveKit 100 | 101 | Permission is hereby granted, free of charge, to any person obtaining a copy 102 | of this software and associated documentation files (the "Software"), to deal 103 | in the Software without restriction, including without limitation the rights 104 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 105 | copies of the Software, and to permit persons to whom the Software is 106 | furnished to do so, subject to the following conditions: 107 | 108 | The above copyright notice and this permission notice shall be included in all 109 | copies or substantial portions of the Software. 110 | 111 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 112 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 113 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 114 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 115 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 116 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 117 | SOFTWARE. 118 | 119 | 120 | License 121 | MIT 122 | Title 123 | ReactiveKit 124 | Type 125 | PSGroupSpecifier 126 | 127 | 128 | FooterText 129 | Generated by CocoaPods - https://cocoapods.org 130 | Title 131 | 132 | Type 133 | PSGroupSpecifier 134 | 135 | 136 | StringsTable 137 | Acknowledgements 138 | Title 139 | Acknowledgements 140 | 141 | 142 | --------------------------------------------------------------------------------