├── .gitignore
├── LICENSE
├── MVC-Code
├── MVC-Code.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── giftbot.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── MVC-Code.xcscheme
│ │ └── xcschememanagement.plist
└── MVC-Code
│ ├── AppDelegate.swift
│ ├── Model
│ ├── Repository.swift
│ └── ServiceSetting.swift
│ ├── Module
│ ├── Base
│ │ ├── BaseView.swift
│ │ └── BaseViewController.swift
│ ├── Repositories
│ │ ├── RepositoriesTableViewCell.swift
│ │ ├── RepositoriesView.swift
│ │ └── RepositoriesViewController.swift
│ └── Setting
│ │ ├── SettingTableViewCell.swift
│ │ ├── SettingView.swift
│ │ └── SettingViewController.swift
│ ├── Resources
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── btn_setting.imageset
│ │ │ ├── Contents.json
│ │ │ ├── btn_setting.png
│ │ │ ├── btn_setting@2x.png
│ │ │ └── btn_setting@3x.png
│ │ ├── img_fork.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_fork.png
│ │ │ ├── img_fork@2x.png
│ │ │ └── img_fork@3x.png
│ │ └── img_star.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_star.png
│ │ │ ├── img_star@2x.png
│ │ │ └── img_star@3x.png
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
│ ├── Service
│ ├── GitHubService.swift
│ ├── GitHubServiceType.swift
│ └── ServiceResult.swift
│ └── Utility
│ ├── Cell+TableViewCellType.swift
│ ├── Data+Decode.swift
│ ├── UIColor+BaseColor.swift
│ ├── UIView+LayoutAnchor.swift
│ └── UIView+SubView.swift
├── MVC-Storyboard
├── MVC-Storyboard.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── giftbot.xcuserdatad
│ │ └── xcschemes
│ │ ├── MVC-Storyboard.xcscheme
│ │ └── xcschememanagement.plist
└── MVC-Storyboard
│ ├── AppDelegate.swift
│ ├── Model
│ ├── Repository.swift
│ └── ServiceSetting.swift
│ ├── Module
│ ├── Base
│ │ └── BaseViewController.swift
│ ├── Repositories
│ │ ├── RepositoriesTableViewCell.swift
│ │ └── RepositoriesViewController.swift
│ └── Setting
│ │ ├── SettingTableViewCell.swift
│ │ └── SettingViewController.swift
│ ├── Resources
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── btn_setting.imageset
│ │ │ ├── Contents.json
│ │ │ ├── btn_setting.png
│ │ │ ├── btn_setting@2x.png
│ │ │ └── btn_setting@3x.png
│ │ ├── img_fork.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_fork.png
│ │ │ ├── img_fork@2x.png
│ │ │ └── img_fork@3x.png
│ │ └── img_star.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_star.png
│ │ │ ├── img_star@2x.png
│ │ │ └── img_star@3x.png
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
│ ├── Service
│ ├── GitHubService.swift
│ └── ServiceResult.swift
│ ├── Storyboard
│ └── Base.lproj
│ │ └── Main.storyboard
│ └── Utility
│ ├── Cell+TableViewCellType.swift
│ ├── Data+Decode.swift
│ ├── UIColor+BaseColor.swift
│ └── UIStoryboard+Instantiate.swift
├── MVP-Code
├── MVP-Code.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── giftbot.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── MVP-Code.xcscheme
│ │ └── xcschememanagement.plist
└── MVP-Code
│ ├── AppDelegate.swift
│ ├── Model
│ ├── Repository.swift
│ └── ServiceSetting.swift
│ ├── Module
│ ├── Base
│ │ ├── BasePresenterType.swift
│ │ └── BaseViewController.swift
│ ├── Repositories
│ │ ├── RepositoriesPresenter.swift
│ │ ├── RepositoriesTableViewCell.swift
│ │ └── RepositoriesViewController.swift
│ └── Setting
│ │ ├── SettingPresenter.swift
│ │ ├── SettingTableViewCell.swift
│ │ └── SettingViewController.swift
│ ├── Resources
│ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ ├── btn_setting.imageset
│ │ │ ├── Contents.json
│ │ │ ├── btn_setting.png
│ │ │ ├── btn_setting@2x.png
│ │ │ └── btn_setting@3x.png
│ │ ├── img_fork.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_fork.png
│ │ │ ├── img_fork@2x.png
│ │ │ └── img_fork@3x.png
│ │ └── img_star.imageset
│ │ │ ├── Contents.json
│ │ │ ├── img_star.png
│ │ │ ├── img_star@2x.png
│ │ │ └── img_star@3x.png
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
│ ├── Service
│ ├── GitHubService.swift
│ ├── GitHubServiceType.swift
│ └── ServiceResult.swift
│ └── Utility
│ ├── Cell+TableViewCellType.swift
│ ├── Data+Decode.swift
│ ├── UIColor+BaseColor.swift
│ ├── UIView+LayoutAnchor.swift
│ └── UIView+SubView.swift
├── MVVM-Rx
├── MVVM-Rx.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── giftbot.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
├── MVVM-Rx.xcworkspace
│ └── contents.xcworkspacedata
├── MVVM-Rx
│ ├── AppDelegate.swift
│ ├── Model
│ │ ├── Repository.swift
│ │ └── ServiceSetting.swift
│ ├── Module
│ │ ├── Base
│ │ │ ├── ViewModelType.swift
│ │ │ └── ViewType.swift
│ │ ├── Repositories
│ │ │ ├── RepositoriesTableViewCell.swift
│ │ │ ├── RepositoriesViewController.swift
│ │ │ └── RepositoriesViewModel.swift
│ │ └── Setting
│ │ │ ├── SettingTableViewCell.swift
│ │ │ ├── SettingViewController.swift
│ │ │ └── SettingViewModel.swift
│ ├── Resources
│ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ ├── btn_setting.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── btn_setting.png
│ │ │ │ ├── btn_setting@2x.png
│ │ │ │ └── btn_setting@3x.png
│ │ │ ├── img_fork.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── img_fork.png
│ │ │ │ ├── img_fork@2x.png
│ │ │ │ └── img_fork@3x.png
│ │ │ └── img_star.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── img_star.png
│ │ │ │ ├── img_star@2x.png
│ │ │ │ └── img_star@3x.png
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Service
│ │ ├── GitHubService.swift
│ │ ├── GitHubServiceType.swift
│ │ └── ServiceResult.swift
│ └── Utility
│ │ ├── Cell+TableViewCellType.swift
│ │ ├── Data+Decode.swift
│ │ ├── Reactive+Base.swift
│ │ ├── UIColor+BaseColor.swift
│ │ ├── UIView+LayoutAnchor.swift
│ │ └── UIView+SubView.swift
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Differentiator
│ ├── LICENSE.md
│ ├── README.md
│ └── Sources
│ │ └── Differentiator
│ │ ├── AnimatableSectionModel.swift
│ │ ├── AnimatableSectionModelType+ItemPath.swift
│ │ ├── AnimatableSectionModelType.swift
│ │ ├── Changeset.swift
│ │ ├── Diff.swift
│ │ ├── IdentifiableType.swift
│ │ ├── IdentifiableValue.swift
│ │ ├── ItemPath.swift
│ │ ├── Optional+Extensions.swift
│ │ ├── SectionModel.swift
│ │ ├── SectionModelType.swift
│ │ └── Utilities.swift
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── giftbot.xcuserdatad
│ │ └── xcschemes
│ │ ├── Differentiator.xcscheme
│ │ ├── Pods-MVVM-Rx.xcscheme
│ │ ├── RxCocoa.xcscheme
│ │ ├── RxDataSources.xcscheme
│ │ ├── RxSwift.xcscheme
│ │ └── xcschememanagement.plist
│ ├── RxCocoa
│ ├── LICENSE.md
│ ├── Platform
│ │ ├── DataStructures
│ │ │ ├── Bag.swift
│ │ │ ├── InfiniteSequence.swift
│ │ │ ├── PriorityQueue.swift
│ │ │ └── Queue.swift
│ │ ├── DispatchQueue+Extensions.swift
│ │ ├── Platform.Darwin.swift
│ │ ├── Platform.Linux.swift
│ │ └── RecursiveLock.swift
│ ├── README.md
│ └── RxCocoa
│ │ ├── Common
│ │ ├── Binder.swift
│ │ ├── ControlTarget.swift
│ │ ├── DelegateProxy.swift
│ │ ├── DelegateProxyType.swift
│ │ ├── NSLayoutConstraint+Rx.swift
│ │ ├── Observable+Bind.swift
│ │ ├── RxCocoaObjCRuntimeError+Extensions.swift
│ │ ├── RxTarget.swift
│ │ ├── SectionedViewDataSourceType.swift
│ │ └── TextInput.swift
│ │ ├── Deprecated.swift
│ │ ├── Foundation
│ │ ├── KVORepresentable+CoreGraphics.swift
│ │ ├── KVORepresentable+Swift.swift
│ │ ├── KVORepresentable.swift
│ │ ├── Logging.swift
│ │ ├── NSObject+Rx+KVORepresentable.swift
│ │ ├── NSObject+Rx+RawRepresentable.swift
│ │ ├── NSObject+Rx.swift
│ │ ├── NotificationCenter+Rx.swift
│ │ └── URLSession+Rx.swift
│ │ ├── Runtime
│ │ ├── _RX.m
│ │ ├── _RXDelegateProxy.m
│ │ ├── _RXKVOObserver.m
│ │ ├── _RXObjCRuntime.m
│ │ └── include
│ │ │ ├── RxCocoaRuntime.h
│ │ │ ├── _RX.h
│ │ │ ├── _RXDelegateProxy.h
│ │ │ ├── _RXKVOObserver.h
│ │ │ └── _RXObjCRuntime.h
│ │ ├── RxCocoa.h
│ │ ├── RxCocoa.swift
│ │ ├── Traits
│ │ ├── BehaviorRelay.swift
│ │ ├── ControlEvent.swift
│ │ ├── ControlProperty.swift
│ │ ├── Driver
│ │ │ ├── BehaviorRelay+Driver.swift
│ │ │ ├── ControlEvent+Driver.swift
│ │ │ ├── ControlProperty+Driver.swift
│ │ │ ├── Driver+Subscription.swift
│ │ │ ├── Driver.swift
│ │ │ └── ObservableConvertibleType+Driver.swift
│ │ ├── PublishRelay.swift
│ │ ├── SharedSequence
│ │ │ ├── SchedulerType+SharedSequence.swift
│ │ │ ├── SharedSequence+Operators+arity.swift
│ │ │ ├── SharedSequence+Operators.swift
│ │ │ └── SharedSequence.swift
│ │ └── Signal
│ │ │ ├── ObservableConvertibleType+Signal.swift
│ │ │ ├── PublishRelay+Signal.swift
│ │ │ ├── Signal+Subscription.swift
│ │ │ └── Signal.swift
│ │ └── iOS
│ │ ├── DataSources
│ │ ├── RxCollectionViewReactiveArrayDataSource.swift
│ │ ├── RxPickerViewAdapter.swift
│ │ └── RxTableViewReactiveArrayDataSource.swift
│ │ ├── Events
│ │ └── ItemEvents.swift
│ │ ├── NSTextStorage+Rx.swift
│ │ ├── Protocols
│ │ ├── RxCollectionViewDataSourceType.swift
│ │ ├── RxPickerViewDataSourceType.swift
│ │ └── RxTableViewDataSourceType.swift
│ │ ├── Proxies
│ │ ├── RxCollectionViewDataSourceProxy.swift
│ │ ├── RxCollectionViewDelegateProxy.swift
│ │ ├── RxNavigationControllerDelegateProxy.swift
│ │ ├── RxPickerViewDataSourceProxy.swift
│ │ ├── RxPickerViewDelegateProxy.swift
│ │ ├── RxScrollViewDelegateProxy.swift
│ │ ├── RxSearchBarDelegateProxy.swift
│ │ ├── RxSearchControllerDelegateProxy.swift
│ │ ├── RxTabBarControllerDelegateProxy.swift
│ │ ├── RxTabBarDelegateProxy.swift
│ │ ├── RxTableViewDataSourceProxy.swift
│ │ ├── RxTableViewDelegateProxy.swift
│ │ ├── RxTextStorageDelegateProxy.swift
│ │ ├── RxTextViewDelegateProxy.swift
│ │ └── RxWebViewDelegateProxy.swift
│ │ ├── UIActivityIndicatorView+Rx.swift
│ │ ├── UIAlertAction+Rx.swift
│ │ ├── UIApplication+Rx.swift
│ │ ├── UIBarButtonItem+Rx.swift
│ │ ├── UIButton+Rx.swift
│ │ ├── UICollectionView+Rx.swift
│ │ ├── UIControl+Rx.swift
│ │ ├── UIDatePicker+Rx.swift
│ │ ├── UIGestureRecognizer+Rx.swift
│ │ ├── UIImageView+Rx.swift
│ │ ├── UILabel+Rx.swift
│ │ ├── UINavigationController+Rx.swift
│ │ ├── UINavigationItem+Rx.swift
│ │ ├── UIPageControl+Rx.swift
│ │ ├── UIPickerView+Rx.swift
│ │ ├── UIProgressView+Rx.swift
│ │ ├── UIRefreshControl+Rx.swift
│ │ ├── UIScrollView+Rx.swift
│ │ ├── UISearchBar+Rx.swift
│ │ ├── UISearchController+Rx.swift
│ │ ├── UISegmentedControl+Rx.swift
│ │ ├── UISlider+Rx.swift
│ │ ├── UIStepper+Rx.swift
│ │ ├── UISwitch+Rx.swift
│ │ ├── UITabBar+Rx.swift
│ │ ├── UITabBarController+Rx.swift
│ │ ├── UITabBarItem+Rx.swift
│ │ ├── UITableView+Rx.swift
│ │ ├── UITextField+Rx.swift
│ │ ├── UITextView+Rx.swift
│ │ ├── UIView+Rx.swift
│ │ ├── UIViewController+Rx.swift
│ │ └── UIWebView+Rx.swift
│ ├── RxDataSources
│ ├── LICENSE.md
│ ├── README.md
│ └── Sources
│ │ └── RxDataSources
│ │ ├── AnimationConfiguration.swift
│ │ ├── Array+Extensions.swift
│ │ ├── CollectionViewSectionedDataSource.swift
│ │ ├── DataSources.swift
│ │ ├── Deprecated.swift
│ │ ├── FloatingPointType+IdentifiableType.swift
│ │ ├── IntegerType+IdentifiableType.swift
│ │ ├── RxCollectionViewSectionedAnimatedDataSource.swift
│ │ ├── RxCollectionViewSectionedReloadDataSource.swift
│ │ ├── RxPickerViewAdapter.swift
│ │ ├── RxTableViewSectionedAnimatedDataSource.swift
│ │ ├── RxTableViewSectionedReloadDataSource.swift
│ │ ├── String+IdentifiableType.swift
│ │ ├── TableViewSectionedDataSource.swift
│ │ ├── UI+SectionedViewType.swift
│ │ └── ViewTransition.swift
│ ├── RxSwift
│ ├── LICENSE.md
│ ├── Platform
│ │ ├── DataStructures
│ │ │ ├── Bag.swift
│ │ │ ├── InfiniteSequence.swift
│ │ │ ├── PriorityQueue.swift
│ │ │ └── Queue.swift
│ │ ├── DispatchQueue+Extensions.swift
│ │ ├── Platform.Darwin.swift
│ │ ├── Platform.Linux.swift
│ │ └── RecursiveLock.swift
│ ├── README.md
│ └── RxSwift
│ │ ├── AnyObserver.swift
│ │ ├── Cancelable.swift
│ │ ├── Concurrency
│ │ ├── AsyncLock.swift
│ │ ├── Lock.swift
│ │ ├── LockOwnerType.swift
│ │ ├── SynchronizedDisposeType.swift
│ │ ├── SynchronizedOnType.swift
│ │ └── SynchronizedUnsubscribeType.swift
│ │ ├── ConnectableObservableType.swift
│ │ ├── Deprecated.swift
│ │ ├── Disposable.swift
│ │ ├── Disposables
│ │ ├── AnonymousDisposable.swift
│ │ ├── BinaryDisposable.swift
│ │ ├── BooleanDisposable.swift
│ │ ├── CompositeDisposable.swift
│ │ ├── Disposables.swift
│ │ ├── DisposeBag.swift
│ │ ├── DisposeBase.swift
│ │ ├── NopDisposable.swift
│ │ ├── RefCountDisposable.swift
│ │ ├── ScheduledDisposable.swift
│ │ ├── SerialDisposable.swift
│ │ ├── SingleAssignmentDisposable.swift
│ │ └── SubscriptionDisposable.swift
│ │ ├── Errors.swift
│ │ ├── Event.swift
│ │ ├── Extensions
│ │ ├── Bag+Rx.swift
│ │ └── String+Rx.swift
│ │ ├── GroupedObservable.swift
│ │ ├── ImmediateSchedulerType.swift
│ │ ├── Observable.swift
│ │ ├── ObservableConvertibleType.swift
│ │ ├── ObservableType+Extensions.swift
│ │ ├── ObservableType.swift
│ │ ├── Observables
│ │ ├── AddRef.swift
│ │ ├── Amb.swift
│ │ ├── AsMaybe.swift
│ │ ├── AsSingle.swift
│ │ ├── Buffer.swift
│ │ ├── Catch.swift
│ │ ├── CombineLatest+Collection.swift
│ │ ├── CombineLatest+arity.swift
│ │ ├── CombineLatest.swift
│ │ ├── Concat.swift
│ │ ├── Create.swift
│ │ ├── Debounce.swift
│ │ ├── Debug.swift
│ │ ├── DefaultIfEmpty.swift
│ │ ├── Deferred.swift
│ │ ├── Delay.swift
│ │ ├── DelaySubscription.swift
│ │ ├── Dematerialize.swift
│ │ ├── DistinctUntilChanged.swift
│ │ ├── Do.swift
│ │ ├── ElementAt.swift
│ │ ├── Empty.swift
│ │ ├── Enumerated.swift
│ │ ├── Error.swift
│ │ ├── Filter.swift
│ │ ├── First.swift
│ │ ├── Generate.swift
│ │ ├── GroupBy.swift
│ │ ├── Just.swift
│ │ ├── Map.swift
│ │ ├── Materialize.swift
│ │ ├── Merge.swift
│ │ ├── Multicast.swift
│ │ ├── Never.swift
│ │ ├── ObserveOn.swift
│ │ ├── Optional.swift
│ │ ├── Producer.swift
│ │ ├── Range.swift
│ │ ├── Reduce.swift
│ │ ├── Repeat.swift
│ │ ├── RetryWhen.swift
│ │ ├── Sample.swift
│ │ ├── Scan.swift
│ │ ├── Sequence.swift
│ │ ├── ShareReplayScope.swift
│ │ ├── SingleAsync.swift
│ │ ├── Sink.swift
│ │ ├── Skip.swift
│ │ ├── SkipUntil.swift
│ │ ├── SkipWhile.swift
│ │ ├── StartWith.swift
│ │ ├── SubscribeOn.swift
│ │ ├── Switch.swift
│ │ ├── SwitchIfEmpty.swift
│ │ ├── Take.swift
│ │ ├── TakeLast.swift
│ │ ├── TakeUntil.swift
│ │ ├── TakeWhile.swift
│ │ ├── Throttle.swift
│ │ ├── Timeout.swift
│ │ ├── Timer.swift
│ │ ├── ToArray.swift
│ │ ├── Using.swift
│ │ ├── Window.swift
│ │ ├── WithLatestFrom.swift
│ │ ├── Zip+Collection.swift
│ │ ├── Zip+arity.swift
│ │ └── Zip.swift
│ │ ├── ObserverType.swift
│ │ ├── Observers
│ │ ├── AnonymousObserver.swift
│ │ ├── ObserverBase.swift
│ │ └── TailRecursiveSink.swift
│ │ ├── Reactive.swift
│ │ ├── Rx.swift
│ │ ├── RxMutableBox.swift
│ │ ├── SchedulerType.swift
│ │ ├── Schedulers
│ │ ├── ConcurrentDispatchQueueScheduler.swift
│ │ ├── ConcurrentMainScheduler.swift
│ │ ├── CurrentThreadScheduler.swift
│ │ ├── HistoricalScheduler.swift
│ │ ├── HistoricalSchedulerTimeConverter.swift
│ │ ├── Internal
│ │ │ ├── DispatchQueueConfiguration.swift
│ │ │ ├── InvocableScheduledItem.swift
│ │ │ ├── InvocableType.swift
│ │ │ ├── ScheduledItem.swift
│ │ │ └── ScheduledItemType.swift
│ │ ├── MainScheduler.swift
│ │ ├── OperationQueueScheduler.swift
│ │ ├── RecursiveScheduler.swift
│ │ ├── SchedulerServices+Emulation.swift
│ │ ├── SerialDispatchQueueScheduler.swift
│ │ ├── VirtualTimeConverterType.swift
│ │ └── VirtualTimeScheduler.swift
│ │ ├── Subjects
│ │ ├── AsyncSubject.swift
│ │ ├── BehaviorSubject.swift
│ │ ├── PublishSubject.swift
│ │ ├── ReplaySubject.swift
│ │ └── SubjectType.swift
│ │ ├── SwiftSupport
│ │ └── SwiftSupport.swift
│ │ └── Traits
│ │ ├── Completable+AndThen.swift
│ │ ├── Completable.swift
│ │ ├── Maybe.swift
│ │ ├── ObservableType+PrimitiveSequence.swift
│ │ ├── PrimitiveSequence+Zip+arity.swift
│ │ ├── PrimitiveSequence.swift
│ │ └── Single.swift
│ └── Target Support Files
│ ├── Differentiator
│ ├── Differentiator-dummy.m
│ ├── Differentiator-prefix.pch
│ ├── Differentiator-umbrella.h
│ ├── Differentiator.modulemap
│ ├── Differentiator.xcconfig
│ └── Info.plist
│ ├── Pods-MVVM-Rx
│ ├── Info.plist
│ ├── Pods-MVVM-Rx-acknowledgements.markdown
│ ├── Pods-MVVM-Rx-acknowledgements.plist
│ ├── Pods-MVVM-Rx-dummy.m
│ ├── Pods-MVVM-Rx-frameworks.sh
│ ├── Pods-MVVM-Rx-resources.sh
│ ├── Pods-MVVM-Rx-umbrella.h
│ ├── Pods-MVVM-Rx.debug.xcconfig
│ ├── Pods-MVVM-Rx.modulemap
│ └── Pods-MVVM-Rx.release.xcconfig
│ ├── RxCocoa
│ ├── Info.plist
│ ├── RxCocoa-dummy.m
│ ├── RxCocoa-prefix.pch
│ ├── RxCocoa-umbrella.h
│ ├── RxCocoa.modulemap
│ └── RxCocoa.xcconfig
│ ├── RxDataSources
│ ├── Info.plist
│ ├── RxDataSources-dummy.m
│ ├── RxDataSources-prefix.pch
│ ├── RxDataSources-umbrella.h
│ ├── RxDataSources.modulemap
│ └── RxDataSources.xcconfig
│ └── RxSwift
│ ├── Info.plist
│ ├── RxSwift-dummy.m
│ ├── RxSwift-prefix.pch
│ ├── RxSwift-umbrella.h
│ ├── RxSwift.modulemap
│ └── RxSwift.xcconfig
├── README.md
└── VIPER-Code
├── VIPER-Code.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── xcuserdata
│ └── giftbot.xcuserdatad
│ └── xcschemes
│ ├── VIPER-Code.xcscheme
│ └── xcschememanagement.plist
└── VIPER-Code
├── AppDelegate.swift
├── AppWireframe.swift
├── Model
├── Repository.swift
└── ServiceSetting.swift
├── Module
├── Base
│ ├── BasePresenter.swift
│ ├── BaseViewController.swift
│ ├── BaseWireframe.swift
│ ├── Router.swift
│ └── TransitionType.swift
├── Repositories
│ ├── RepositoriesInteractor.swift
│ ├── RepositoriesPresenter.swift
│ ├── RepositoriesTableViewCell.swift
│ ├── RepositoriesViewController.swift
│ └── RepositoriesWireframe.swift
└── Setting
│ ├── SettingInteractor.swift
│ ├── SettingPresenter.swift
│ ├── SettingTableViewCell.swift
│ ├── SettingViewController.swift
│ └── SettingWireframe.swift
├── Resources
├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── btn_setting.imageset
│ │ ├── Contents.json
│ │ ├── btn_setting.png
│ │ ├── btn_setting@2x.png
│ │ └── btn_setting@3x.png
│ ├── img_fork.imageset
│ │ ├── Contents.json
│ │ ├── img_fork.png
│ │ ├── img_fork@2x.png
│ │ └── img_fork@3x.png
│ └── img_star.imageset
│ │ ├── Contents.json
│ │ ├── img_star.png
│ │ ├── img_star@2x.png
│ │ └── img_star@3x.png
├── Base.lproj
│ └── LaunchScreen.storyboard
└── Info.plist
├── Service
├── GitHubService.swift
├── GitHubServiceType.swift
└── ServiceResult.swift
└── Utility
├── Cell+TableViewCellType.swift
├── Data+Decode.swift
├── UIColor+BaseColor.swift
├── UIView+LayoutAnchor.swift
└── UIView+SubView.swift
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 |
3 | build/
4 | DerivedData/
5 |
6 | *.pbxuser
7 | *.mode1v3
8 |
9 | */xcuserdata
10 | *.xcuserstate
11 | !*.xcodeproj/project.pbxproj
12 |
13 | *.swp
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Giftbot
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 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MVC-Code.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 52E9D8BE1F7BD22D00424760
16 |
17 | primary
18 |
19 |
20 | 52E9D8D21F7BD22D00424760
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | setupKeyWindow()
18 | return true
19 | }
20 |
21 | private func setupKeyWindow() {
22 | window = UIWindow(frame: UIScreen.main.bounds)
23 | let serviceSetting = ServiceSetting.decode()
24 | let repositoriesViewController = RepositoriesViewController(serviceSetting: serviceSetting)
25 | window?.rootViewController = UINavigationController(rootViewController: repositoriesViewController)
26 | window?.makeKeyAndVisible()
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Model/Repository.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Repository.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: Repository
12 |
13 | struct Repository: Decodable {
14 | let fullName: String
15 | let description: String?
16 | let starCount: Int
17 | let forkCount: Int
18 | let url: String
19 |
20 | enum CodingKeys: String, CodingKey {
21 | case fullName = "full_name"
22 | case description = "description"
23 | case starCount = "stargazers_count"
24 | case forkCount = "forks_count"
25 | case url = "html_url"
26 | }
27 | }
28 |
29 | // MARK: Repositories
30 |
31 | struct Repositories: Decodable {
32 | let items: [Repository]
33 | enum CodingKeys: String, CodingKey {
34 | case items
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Module/Base/BaseView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseView.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol ViewType: class {
12 | associatedtype ViewController: ViewControllerType
13 | weak var vc: ViewController! { get }
14 | init(controlBy viewController: ViewController)
15 | }
16 |
17 | class BaseView: UIView, ViewType {
18 |
19 | // MARK: Properties
20 |
21 | weak var vc: ViewController!
22 |
23 | // MARK: Initialize
24 |
25 | required init(controlBy viewController: ViewController) {
26 | vc = viewController
27 | super.init(frame: UIScreen.main.bounds)
28 | setupUI()
29 | setupBinding()
30 | }
31 |
32 | required init?(coder aDecoder: NSCoder) {
33 | fatalError("init(coder:) has not been implemented")
34 | }
35 |
36 | func setupUI() {
37 | // Override
38 | }
39 |
40 | func setupBinding() {
41 | // Override
42 | }
43 |
44 | // MARK: Deinit
45 |
46 | deinit {
47 | // print("\(self) has deinitialized")
48 | }
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Module/Base/BaseViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol ViewControllerType: class {
12 | }
13 |
14 | class BaseViewController: UIViewController, ViewControllerType {
15 |
16 | // MARK: Initialize
17 |
18 | init() {
19 | super.init(nibName: nil, bundle: nil)
20 | }
21 |
22 | required init?(coder aDecoder: NSCoder) {
23 | fatalError("init(coder:) has not been implemented")
24 | }
25 |
26 | // MARK: Deinit
27 |
28 | deinit {
29 | // print("\(self) has deinitialized")
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Module/Setting/SettingTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingTableViewCell.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 2..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class SettingTableViewCell: UITableViewCell {
12 |
13 | // MARK: Initialize
14 |
15 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
16 | super.init(style: style, reuseIdentifier: reuseIdentifier)
17 | selectionStyle = .none
18 | }
19 |
20 | required init?(coder aDecoder: NSCoder) {
21 | fatalError("init(coder:) has not been implemented")
22 | }
23 |
24 | // MARK: Configure Selection
25 |
26 | override func setSelected(_ selected: Bool, animated: Bool) {
27 | super.setSelected(selected, animated: animated)
28 | if selected {
29 | accessoryType = .checkmark
30 | textLabel?.font = .boldSystemFont(ofSize: 14)
31 | textLabel?.textColor = .mainColor
32 | } else {
33 | accessoryType = .none
34 | textLabel?.font = .systemFont(ofSize: 13)
35 | textLabel?.textColor = .darkGray
36 | }
37 | }
38 |
39 | // MARK: Cell Contents
40 |
41 | func setTitleText(_ title: String) {
42 | textLabel?.text = title
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "btn_setting.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "btn_setting@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "btn_setting@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_fork.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_fork@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_fork@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_star.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_star@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_star@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Code/MVC-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Service/GitHubServiceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GitHubServiceType.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 14..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol GitHubServiceType {
12 | func fetchGitHubRepositories(
13 | by setting: ServiceSetting,
14 | completion: @escaping (Result<[Repository]>) -> ()
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Service/ServiceResult.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceResult.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum Result {
12 | case success(T)
13 | case error(Error)
14 | }
15 |
16 | enum ServiceError: Error {
17 | case unknown
18 | case urlTransformFailed
19 | case requestFailed(response: URLResponse, data: Data?)
20 | }
21 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Utility/Cell+TableViewCellType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cell+TableViewCellType.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 11. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol TableViewCellType {
12 | static var identifier: String { get }
13 | }
14 |
15 | extension UITableViewCell: TableViewCellType {
16 | static var identifier: String { return String(describing: self.self) }
17 | }
18 |
19 | extension UITableView {
20 | func register(
21 | cell: Cell.Type,
22 | forCellReuseIdentifier reuseIdentifier: String = Cell.identifier
23 | ) where Cell: UITableViewCell {
24 | register(cell, forCellReuseIdentifier: reuseIdentifier)
25 | }
26 |
27 | func dequeue(_ reusableCell: Cell.Type) -> Cell? where Cell: UITableViewCell {
28 | return dequeueReusableCell(withIdentifier: reusableCell.identifier) as? Cell
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Utility/Data+Decode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data+Decode.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 25..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | func decode(_ type: T.Type, decoder: JSONDecoder? = nil) throws -> T where T: Decodable {
13 | let decoder = decoder ?? JSONDecoder()
14 | return try decoder.decode(type, from: self)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Utility/UIColor+BaseColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | static var mainColor: UIColor { return UIColor(red: 0, green: 0.44, blue: 1, alpha: 1) }
13 | }
14 |
--------------------------------------------------------------------------------
/MVC-Code/MVC-Code/Utility/UIView+SubView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 | func addSubviews(_ views: [UIView]) {
13 | for view in views {
14 | addSubview(view)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MVC-Storyboard.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 52E9D8F91F7EB0AF00424760
16 |
17 | primary
18 |
19 |
20 | 52E9D90D1F7EB0AF00424760
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MVC-Storyboard
4 | //
5 | // Created by giftbot on 2017. 9. 30..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Model/Repository.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Repository.swift
3 | // MVC-Storyboard
4 | //
5 | // Created by giftbot on 2017. 10. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | struct Repository: Decodable {
12 | let fullName: String
13 | let description: String?
14 | let starCount: Int
15 | let forkCount: Int
16 | let url: String
17 |
18 | enum CodingKeys: String, CodingKey {
19 | case fullName = "full_name"
20 | case description = "description"
21 | case starCount = "stargazers_count"
22 | case forkCount = "forks_count"
23 | case url = "html_url"
24 | }
25 | }
26 |
27 | struct Repositories: Decodable {
28 | let items: [Repository]
29 | enum CodingKeys: String, CodingKey {
30 | case items
31 | }
32 | }
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Module/Base/BaseViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseViewController: UIViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | setupUI()
16 | }
17 |
18 | func setupUI() {
19 | // Override
20 | }
21 |
22 | override func didReceiveMemoryWarning() {
23 | // print("\(self) did Receive Memory Warning")
24 | }
25 |
26 | deinit {
27 | // print("\(self) has deinitialized")
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Module/Repositories/RepositoriesTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RepositoriesTableViewCell.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class RepositoriesTableViewCell: UITableViewCell {
12 |
13 | // MARK: Properties
14 |
15 | @IBOutlet private var nameLabel: UILabel!
16 | @IBOutlet private var descLabel: UILabel!
17 | @IBOutlet private var starLabel: UILabel!
18 | @IBOutlet private var forkLabel: UILabel!
19 |
20 | // MARK: Configure Cell
21 |
22 | func configureWith(name: String, description: String?, star: Int, fork: Int) {
23 | nameLabel.text = name
24 | descLabel.text = description ?? ""
25 | starLabel.text = String(describing: star)
26 | forkLabel.text = String(describing: fork)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Module/Setting/SettingTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingTableViewCell.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 2..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class SettingTableViewCell: UITableViewCell {
12 |
13 | // MARK: Configure Selection
14 |
15 | override func setSelected(_ selected: Bool, animated: Bool) {
16 | super.setSelected(selected, animated: animated)
17 | if selected {
18 | accessoryType = .checkmark
19 | textLabel?.font = .boldSystemFont(ofSize: 14)
20 | textLabel?.textColor = UIColor(red: 0, green: 0.44, blue: 1, alpha: 1)
21 | } else {
22 | accessoryType = .none
23 | textLabel?.font = .systemFont(ofSize: 13)
24 | textLabel?.textColor = .darkGray
25 | }
26 | }
27 |
28 | func setTitleText(_ title: String) {
29 | textLabel?.text = title
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "btn_setting.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "btn_setting@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "btn_setting@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_fork.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_fork@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_fork@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_star.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_star@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_star@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVC-Storyboard/MVC-Storyboard/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Service/ServiceResult.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceResult.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum Result {
12 | case success(T)
13 | case error(Error)
14 | }
15 |
16 | enum ServiceError: Error {
17 | case unknown
18 | case urlTransformFailed
19 | case requestFailed(response: URLResponse, data: Data?)
20 | }
21 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Utility/Cell+TableViewCellType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cell+TableViewCellType.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 11. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol TableViewCellType {
12 | static var identifier: String { get }
13 | }
14 |
15 | extension UITableViewCell: TableViewCellType {
16 | static var identifier: String { return String(describing: self.self) }
17 | }
18 |
19 | extension UITableView {
20 | func dequeue(
21 | _ reusableCell: Cell.Type,
22 | for indexPath: IndexPath
23 | ) -> Cell where Cell: UITableViewCell {
24 | return dequeueReusableCell(withIdentifier: reusableCell.identifier, for: indexPath) as! Cell
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Utility/Data+Decode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data+Decode.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 25..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | func decode(_ type: T.Type, decoder: JSONDecoder? = nil) throws -> T where T: Decodable {
13 | let decoder = decoder ?? JSONDecoder()
14 | return try decoder.decode(type, from: self)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Utility/UIColor+BaseColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | static var mainColor: UIColor { return UIColor(red: 0, green: 0.44, blue: 1, alpha: 1) }
13 | }
14 |
--------------------------------------------------------------------------------
/MVC-Storyboard/MVC-Storyboard/Utility/UIStoryboard+Instantiate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIStoryboard+CreateWith.swift
3 | // MVC-Storyboard
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIStoryboard {
12 | func instantiateViewController(ofType type: T.Type) -> T {
13 | return instantiateViewController(withIdentifier: String(describing: type)) as! T
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MVP-Code.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 52D8DA151F86B37500BB1575
16 |
17 | primary
18 |
19 |
20 | 52D8DA291F86B37600BB1575
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | setupKeyWindow()
18 | return true
19 | }
20 |
21 | private func setupKeyWindow() {
22 | window = UIWindow(frame: UIScreen.main.bounds)
23 | let repositoriesPresenter = RepositoriesPresenter(serviceSetting: ServiceSetting.decode())
24 | let repositoriesViewController = RepositoriesViewController(presenter: repositoriesPresenter)
25 | window?.rootViewController = UINavigationController(rootViewController: repositoriesViewController)
26 | window?.makeKeyAndVisible()
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Model/Repository.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Repository.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: Repository
12 |
13 | struct Repository: Decodable {
14 | let fullName: String
15 | let description: String?
16 | let starCount: Int
17 | let forkCount: Int
18 | let url: String
19 |
20 | enum CodingKeys: String, CodingKey {
21 | case fullName = "full_name"
22 | case description = "description"
23 | case starCount = "stargazers_count"
24 | case forkCount = "forks_count"
25 | case url = "html_url"
26 | }
27 | }
28 |
29 | // MARK: Repositories
30 |
31 | struct Repositories: Decodable {
32 | let items: [Repository]
33 | enum CodingKeys: String, CodingKey {
34 | case items
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Module/Base/BasePresenterType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseView.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol PresenterType: class {
12 | func onViewDidLoad()
13 | }
14 |
15 | extension PresenterType {
16 | func onViewDidLoad() { }
17 | }
18 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Module/Base/BaseViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | // MARK: - BaseView Protocol
12 |
13 | protocol ViewType: class {
14 | }
15 |
16 | // MARK: - BaseView Controller
17 |
18 | class BaseViewController: UIViewController {
19 |
20 | // MARK: Initialize
21 |
22 | override func viewDidLoad() {
23 | super.viewDidLoad()
24 | setupUI()
25 | setupBinding()
26 | }
27 |
28 | func setupUI() {
29 | // Override
30 | }
31 |
32 | func setupBinding() {
33 | // Override
34 | }
35 |
36 | // MARK: Memory Warning & Deinit
37 |
38 | override func didReceiveMemoryWarning() {
39 | // print("\(self) did Receive Memory Warning")
40 | }
41 |
42 | deinit {
43 | // print("\(self) has deinitialized")
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Module/Setting/SettingTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingTableViewCell.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 2..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol SettingCellType {
12 | func setTitleText(_ title: String)
13 | }
14 |
15 | final class SettingTableViewCell: UITableViewCell, SettingCellType {
16 |
17 | // MARK: - Initialize
18 |
19 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
20 | super.init(style: style, reuseIdentifier: reuseIdentifier)
21 | selectionStyle = .none
22 | }
23 |
24 | required init?(coder aDecoder: NSCoder) {
25 | fatalError("init(coder:) has not been implemented")
26 | }
27 |
28 | // MARK: - Configure Selection
29 |
30 | override func setSelected(_ selected: Bool, animated: Bool) {
31 | super.setSelected(selected, animated: animated)
32 | if selected {
33 | accessoryType = .checkmark
34 | textLabel?.font = .boldSystemFont(ofSize: 14)
35 | textLabel?.textColor = .mainColor
36 | } else {
37 | accessoryType = .none
38 | textLabel?.font = .systemFont(ofSize: 13)
39 | textLabel?.textColor = .darkGray
40 | }
41 | }
42 |
43 | // MARK: - Cell Contents
44 |
45 | func setTitleText(_ title: String) {
46 | textLabel?.text = title
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "btn_setting.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "btn_setting@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "btn_setting@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_fork.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_fork@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_fork@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_star.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_star@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_star@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVP-Code/MVP-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Service/GitHubServiceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GitHubServiceType.swift
3 | // MVP-Code
4 | //
5 | // Created by giftbot on 2017. 10. 14..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol GitHubServiceType {
12 | func fetchGitHubRepositories(
13 | by setting: ServiceSetting,
14 | completion: @escaping (Result<[Repository]>) -> ()
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Service/ServiceResult.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceResult.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum Result {
12 | case success(T)
13 | case error(Error)
14 | }
15 |
16 | enum ServiceError: Error {
17 | case unknown
18 | case urlTransformFailed
19 | case requestFailed(response: URLResponse, data: Data?)
20 | }
21 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Utility/Cell+TableViewCellType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cell+TableViewCellType.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 11. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol TableViewCellType {
12 | static var identifier: String { get }
13 | }
14 |
15 | extension UITableViewCell: TableViewCellType {
16 | static var identifier: String { return String(describing: self.self) }
17 | }
18 |
19 | extension UITableView {
20 | func register(
21 | cell: Cell.Type,
22 | forCellReuseIdentifier reuseIdentifier: String = Cell.identifier
23 | ) where Cell: UITableViewCell {
24 | register(cell, forCellReuseIdentifier: reuseIdentifier)
25 | }
26 |
27 | func dequeue(_ reusableCell: Cell.Type) -> Cell? where Cell: UITableViewCell {
28 | return dequeueReusableCell(withIdentifier: reusableCell.identifier) as? Cell
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Utility/Data+Decode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data+Decode.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 25..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | func decode(_ type: T.Type, decoder: JSONDecoder? = nil) throws -> T where T: Decodable {
13 | let decoder = decoder ?? JSONDecoder()
14 | return try decoder.decode(type, from: self)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Utility/UIColor+BaseColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | static var mainColor: UIColor { return UIColor(red: 0, green: 0.44, blue: 1, alpha: 1) }
13 | }
14 |
--------------------------------------------------------------------------------
/MVP-Code/MVP-Code/Utility/UIView+SubView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 | func addSubviews(_ views: [UIView]) {
13 | for view in views {
14 | addSubview(view)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MVVM-Rx.xcscheme
8 |
9 | orderHint
10 | 5
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 24..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | setupKeyWindow()
18 | return true
19 | }
20 |
21 | private func setupKeyWindow() {
22 | window = UIWindow(frame: UIScreen.main.bounds)
23 | let repositoriesViewModel = RepositoriesViewModel(serviceSetting: ServiceSetting.decode())
24 | let repositoriesView = RepositoriesViewController.create(with: repositoriesViewModel)
25 | let navigationController = UINavigationController(rootViewController: repositoriesView)
26 | window?.rootViewController = navigationController
27 | window?.makeKeyAndVisible()
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Model/Repository.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Repository.swift
3 | // sss
4 | //
5 | // Created by giftbot on 2017. 10. 17..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: Repository
12 |
13 | struct Repository: Decodable {
14 | let fullName: String
15 | let description: String?
16 | let starCount: Int
17 | let forkCount: Int
18 | let url: String
19 |
20 | enum CodingKeys: String, CodingKey {
21 | case fullName = "full_name"
22 | case description = "description"
23 | case starCount = "stargazers_count"
24 | case forkCount = "forks_count"
25 | case url = "html_url"
26 | }
27 | }
28 |
29 | // MARK: Repositories
30 |
31 | struct Repositories: Decodable {
32 | let items: [Repository]
33 | enum CodingKeys: String, CodingKey {
34 | case items
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Module/Base/ViewModelType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewModelType.swift
3 | // sss
4 | //
5 | // Created by giftbot on 2017. 10. 17..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol ViewModelType {
12 | }
13 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Module/Base/ViewType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.swift
3 | // sss
4 | //
5 | // Created by giftbot on 2017. 10. 17..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import RxSwift
11 |
12 | // MARK: - BaseView Protocol
13 |
14 | protocol ViewType: class {
15 | associatedtype ViewModelType
16 | var viewModel: ViewModelType! { get set }
17 | var disposeBag: DisposeBag! { get set }
18 | func setupUI()
19 | func setupEventBinding()
20 | func setupUIBinding()
21 | }
22 |
23 | extension ViewType where Self: UIViewController {
24 | static func create(with viewModel: ViewModelType) -> Self {
25 | let `self` = Self()
26 | self.viewModel = viewModel
27 | self.disposeBag = DisposeBag()
28 | self.loadViewIfNeeded()
29 | self.setupUI()
30 | self.setupEventBinding()
31 | self.setupUIBinding()
32 | return self
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Module/Setting/SettingTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingTableViewCell.swift
3 | // sss
4 | //
5 | // Created by giftbot on 2017. 10. 17..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class SettingTableViewCell: UITableViewCell {
12 |
13 | // MARK: - Initialize
14 |
15 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
16 | super.init(style: style, reuseIdentifier: reuseIdentifier)
17 | selectionStyle = .none
18 | }
19 |
20 | required init?(coder aDecoder: NSCoder) {
21 | fatalError("init(coder:) has not been implemented")
22 | }
23 |
24 | // MARK: - Configure Selection
25 |
26 | override func setSelected(_ selected: Bool, animated: Bool) {
27 | super.setSelected(selected, animated: animated)
28 | if selected {
29 | accessoryType = .checkmark
30 | textLabel?.font = .boldSystemFont(ofSize: 14)
31 | textLabel?.textColor = .mainColor
32 | } else {
33 | accessoryType = .none
34 | textLabel?.font = .systemFont(ofSize: 13)
35 | textLabel?.textColor = .darkGray
36 | }
37 | }
38 |
39 | // MARK: - Cell Contents
40 |
41 | func setTitleText(_ title: String) {
42 | textLabel?.text = title
43 | }
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "btn_setting.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "btn_setting@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "btn_setting@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_fork.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_fork@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_fork@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_star.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_star@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_star@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/MVVM-Rx/MVVM-Rx/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 |
33 | UISupportedInterfaceOrientations~ipad
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationPortraitUpsideDown
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Service/GitHubService.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GitHubService.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import RxCocoa
10 | import RxSwift
11 |
12 | struct GitHubService: GitHubServiceType {
13 |
14 | // MARK: Properties
15 |
16 | private let session: URLSession
17 |
18 | // MARK: Initialize
19 |
20 | init(session: URLSession = URLSession.shared) {
21 | self.session = session
22 | }
23 |
24 | // MARK: DataTask
25 |
26 | func fetchGitHubRepositories(by setting: ServiceSetting) -> Single<[Repository]> {
27 | let baseUrl = "https://api.github.com/search/repositories?q="
28 | let language = "language:\(setting.language)"
29 | let userID = setting.userID == .all ? "" : "+user:\(setting.userID)"
30 | let sortType = "&sort=\(setting.sortType)"
31 |
32 | guard let url = URL(string: baseUrl + language + userID + sortType) else {
33 | return .error(ServiceError.urlTransformFailed)
34 | }
35 |
36 | return session.rx.dataTask(request: URLRequest(url: url))
37 | .map { data throws in
38 | let repositories = try data.decode(Repositories.self)
39 | return repositories.items
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Service/GitHubServiceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GitHubServiceType.swift
3 | // MVP-Code
4 | //
5 | // Created by giftbot on 2017. 10. 14..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import RxSwift
10 |
11 | protocol GitHubServiceType {
12 | func fetchGitHubRepositories(by setting: ServiceSetting) -> Single<[Repository]>
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Service/ServiceResult.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceResult.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum ServiceError: Error {
12 | case unknown
13 | case urlTransformFailed
14 | case requestFailed(response: HTTPURLResponse, data: Data?)
15 | }
16 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Utility/Cell+TableViewCellType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cell+TableViewCellType.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 11. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol TableViewCellType {
12 | static var identifier: String { get }
13 | }
14 |
15 | extension UITableViewCell: TableViewCellType {
16 | static var identifier: String { return String(describing: self.self) }
17 | }
18 |
19 | extension UITableView {
20 | func register(
21 | cell: Cell.Type,
22 | forCellReuseIdentifier reuseIdentifier: String = Cell.identifier
23 | ) where Cell: UITableViewCell {
24 | register(cell, forCellReuseIdentifier: reuseIdentifier)
25 | }
26 |
27 | func dequeue(_ reusableCell: Cell.Type) -> Cell? where Cell: UITableViewCell {
28 | return dequeueReusableCell(withIdentifier: reusableCell.identifier) as? Cell
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Utility/Data+Decode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data+Decode.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 25..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | func decode(_ type: T.Type, decoder: JSONDecoder? = nil) throws -> T where T: Decodable {
13 | let decoder = decoder ?? JSONDecoder()
14 | return try decoder.decode(type, from: self)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Utility/UIColor+BaseColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | static var mainColor: UIColor { return UIColor(red: 0, green: 0.44, blue: 1, alpha: 1) }
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/MVVM-Rx/Utility/UIView+SubView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 | func addSubviews(_ views: [UIView]) {
13 | for view in views {
14 | addSubview(view)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MVVM-Rx/Podfile:
--------------------------------------------------------------------------------
1 | target 'MVVM-Rx' do
2 | use_frameworks!
3 |
4 | # Pods for MVVM-Rx
5 | pod 'RxSwift', '~> 4.0'
6 | pod 'RxCocoa', '~> 4.0'
7 | pod 'RxDataSources', '~> 3.0'
8 |
9 | end
10 |
--------------------------------------------------------------------------------
/MVVM-Rx/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Differentiator (3.0.1)
3 | - RxCocoa (4.0.0):
4 | - RxSwift (~> 4.0)
5 | - RxDataSources (3.0.1):
6 | - Differentiator (~> 3.0)
7 | - RxCocoa (~> 4.0)
8 | - RxSwift (~> 4.0)
9 | - RxSwift (4.0.0)
10 |
11 | DEPENDENCIES:
12 | - RxCocoa (~> 4.0)
13 | - RxDataSources (~> 3.0)
14 | - RxSwift (~> 4.0)
15 |
16 | SPEC CHECKSUMS:
17 | Differentiator: ffe513ce1ea4e7198b89fac94d6e281c673055a9
18 | RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e
19 | RxDataSources: 098b7e62b6316313b14d6bf594e3f4f4f62a238a
20 | RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334
21 |
22 | PODFILE CHECKSUM: 72987b59851434325a771bf954f003f7915c4ed7
23 |
24 | COCOAPODS: 1.3.1
25 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 RxSwift Community
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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/AnimatableSectionModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimatableSectionModel.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/10/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct AnimatableSectionModel {
12 | public var model: Section
13 | public var items: [Item]
14 |
15 | public init(model: Section, items: [ItemType]) {
16 | self.model = model
17 | self.items = items
18 | }
19 |
20 | }
21 |
22 | extension AnimatableSectionModel
23 | : AnimatableSectionModelType {
24 | public typealias Item = ItemType
25 | public typealias Identity = Section.Identity
26 |
27 | public var identity: Section.Identity {
28 | return model.identity
29 | }
30 |
31 | public init(original: AnimatableSectionModel, items: [Item]) {
32 | self.model = original.model
33 | self.items = items
34 | }
35 |
36 | public var hashValue: Int {
37 | return self.model.identity.hashValue
38 | }
39 | }
40 |
41 |
42 | extension AnimatableSectionModel
43 | : CustomStringConvertible {
44 |
45 | public var description: String {
46 | return "HashableSectionModel(model: \"\(self.model)\", items: \(items))"
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/AnimatableSectionModelType+ItemPath.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimatableSectionModelType+ItemPath.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/9/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Array where Element: AnimatableSectionModelType {
12 | subscript(index: ItemPath) -> Element.Item {
13 | return self[index.sectionIndex].items[index.itemIndex]
14 | }
15 | }
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/AnimatableSectionModelType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimatableSectionModelType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/6/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public protocol AnimatableSectionModelType
12 | : SectionModelType
13 | , IdentifiableType where Item: IdentifiableType, Item: Equatable {
14 | }
15 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/IdentifiableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IdentifiableType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/6/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public protocol IdentifiableType {
12 | associatedtype Identity: Hashable
13 |
14 | var identity : Identity { get }
15 | }
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/IdentifiableValue.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IdentifiableValue.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/7/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct IdentifiableValue {
12 | public let value: Value
13 | }
14 |
15 | extension IdentifiableValue
16 | : IdentifiableType {
17 |
18 | public typealias Identity = Value
19 |
20 | public var identity : Identity {
21 | return value
22 | }
23 | }
24 |
25 | extension IdentifiableValue
26 | : Equatable
27 | , CustomStringConvertible
28 | , CustomDebugStringConvertible {
29 |
30 | public var description: String {
31 | return "\(value)"
32 | }
33 |
34 | public var debugDescription: String {
35 | return "\(value)"
36 | }
37 | }
38 |
39 | public func == (lhs: IdentifiableValue, rhs: IdentifiableValue) -> Bool {
40 | return lhs.value == rhs.value
41 | }
42 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/ItemPath.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ItemPath.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/9/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct ItemPath {
12 | public let sectionIndex: Int
13 | public let itemIndex: Int
14 |
15 | public init(sectionIndex: Int, itemIndex: Int) {
16 | self.sectionIndex = sectionIndex
17 | self.itemIndex = itemIndex
18 | }
19 | }
20 |
21 | extension ItemPath : Equatable {
22 |
23 | }
24 |
25 | public func == (lhs: ItemPath, rhs: ItemPath) -> Bool {
26 | return lhs.sectionIndex == rhs.sectionIndex && lhs.itemIndex == rhs.itemIndex
27 | }
28 |
29 | extension ItemPath: Hashable {
30 |
31 | public var hashValue: Int {
32 | return sectionIndex.byteSwapped.hashValue ^ itemIndex.hashValue
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/Optional+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Optional+Extensions.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/8/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Optional {
12 | func unwrap() throws -> Wrapped {
13 | if let unwrapped = self {
14 | return unwrapped
15 | }
16 | else {
17 | debugFatalError("Error during unwrapping optional")
18 | throw DifferentiatorError.unwrappingOptional
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/SectionModel.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SectionModel.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 6/16/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public struct SectionModel {
12 | public var model: Section
13 | public var items: [Item]
14 |
15 | public init(model: Section, items: [Item]) {
16 | self.model = model
17 | self.items = items
18 | }
19 | }
20 |
21 | extension SectionModel
22 | : SectionModelType {
23 | public typealias Identity = Section
24 | public typealias Item = ItemType
25 |
26 | public var identity: Section {
27 | return model
28 | }
29 | }
30 |
31 | extension SectionModel
32 | : CustomStringConvertible {
33 |
34 | public var description: String {
35 | return "\(self.model) > \(items)"
36 | }
37 | }
38 |
39 | extension SectionModel {
40 | public init(original: SectionModel, items: [Item]) {
41 | self.model = original.model
42 | self.items = items
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/SectionModelType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SectionModelType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 6/28/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public protocol SectionModelType {
12 | associatedtype Item
13 |
14 | var items: [Item] { get }
15 |
16 | init(original: Self, items: [Item])
17 | }
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Differentiator/Sources/Differentiator/Utilities.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Utilities.swift
3 | // RxDataSources
4 | //
5 | // Created by muukii on 8/2/17.
6 | // Copyright © 2017 kzaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum DifferentiatorError : Error {
12 | case unwrappingOptional
13 | case preconditionFailed(message: String)
14 | }
15 |
16 | func precondition(_ condition: Bool, _ message: @autoclosure() -> String) throws -> () {
17 | if condition {
18 | return
19 | }
20 | debugFatalError("Precondition failed")
21 |
22 | throw DifferentiatorError.preconditionFailed(message: message())
23 | }
24 |
25 | func debugFatalError(_ error: Error) {
26 | debugFatalError("\(error)")
27 | }
28 |
29 | func debugFatalError(_ message: String) {
30 | #if DEBUG
31 | fatalError(message)
32 | #else
33 | print(message)
34 | #endif
35 | }
36 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Differentiator (3.0.1)
3 | - RxCocoa (4.0.0):
4 | - RxSwift (~> 4.0)
5 | - RxDataSources (3.0.1):
6 | - Differentiator (~> 3.0)
7 | - RxCocoa (~> 4.0)
8 | - RxSwift (~> 4.0)
9 | - RxSwift (4.0.0)
10 |
11 | DEPENDENCIES:
12 | - RxCocoa (~> 4.0)
13 | - RxDataSources (~> 3.0)
14 | - RxSwift (~> 4.0)
15 |
16 | SPEC CHECKSUMS:
17 | Differentiator: ffe513ce1ea4e7198b89fac94d6e281c673055a9
18 | RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e
19 | RxDataSources: 098b7e62b6316313b14d6bf594e3f4f4f62a238a
20 | RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334
21 |
22 | PODFILE CHECKSUM: 72987b59851434325a771bf954f003f7915c4ed7
23 |
24 | COCOAPODS: 1.3.1
25 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Pods.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Differentiator.xcscheme
8 |
9 | isShown
10 |
11 | orderHint
12 | 0
13 |
14 | Pods-MVVM-Rx.xcscheme
15 |
16 | isShown
17 |
18 | orderHint
19 | 1
20 |
21 | RxCocoa.xcscheme
22 |
23 | isShown
24 |
25 | orderHint
26 | 2
27 |
28 | RxDataSources.xcscheme
29 |
30 | isShown
31 |
32 | orderHint
33 | 3
34 |
35 | RxSwift.xcscheme
36 |
37 | isShown
38 |
39 | orderHint
40 | 4
41 |
42 |
43 | SuppressBuildableAutocreation
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/LICENSE.md:
--------------------------------------------------------------------------------
1 | **The MIT License**
2 | **Copyright © 2015 Krunoslav Zaher**
3 | **All rights reserved.**
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/Platform/DataStructures/InfiniteSequence.swift:
--------------------------------------------------------------------------------
1 | //
2 | // InfiniteSequence.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 6/13/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Sequence that repeats `repeatedValue` infinite number of times.
10 | struct InfiniteSequence : Sequence {
11 | typealias Element = E
12 | typealias Iterator = AnyIterator
13 |
14 | private let _repeatedValue: E
15 |
16 | init(repeatedValue: E) {
17 | _repeatedValue = repeatedValue
18 | }
19 |
20 | func makeIterator() -> Iterator {
21 | let repeatedValue = _repeatedValue
22 | return AnyIterator {
23 | return repeatedValue
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/Platform/DispatchQueue+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DispatchQueue+Extensions.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 10/22/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Dispatch
10 |
11 | extension DispatchQueue {
12 | private static var token: DispatchSpecificKey<()> = {
13 | let key = DispatchSpecificKey<()>()
14 | DispatchQueue.main.setSpecific(key: key, value: ())
15 | return key
16 | }()
17 |
18 | static var isMain: Bool {
19 | return DispatchQueue.getSpecific(key: token) != nil
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/Platform/RecursiveLock.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RecursiveLock.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 12/18/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import class Foundation.NSRecursiveLock
10 |
11 | #if TRACE_RESOURCES
12 | class RecursiveLock: NSRecursiveLock {
13 | override init() {
14 | _ = Resources.incrementTotal()
15 | super.init()
16 | }
17 |
18 | override func lock() {
19 | super.lock()
20 | _ = Resources.incrementTotal()
21 | }
22 |
23 | override func unlock() {
24 | super.unlock()
25 | _ = Resources.decrementTotal()
26 | }
27 |
28 | deinit {
29 | _ = Resources.decrementTotal()
30 | }
31 | }
32 | #else
33 | typealias RecursiveLock = NSRecursiveLock
34 | #endif
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Common/NSLayoutConstraint+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 12/6/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !os(Linux)
10 |
11 | #if os(macOS)
12 | import Cocoa
13 | #else
14 | import UIKit
15 | #endif
16 |
17 | #if !RX_NO_MODULE
18 | import RxSwift
19 | #endif
20 |
21 | #if os(iOS) || os(macOS) || os(tvOS)
22 | extension Reactive where Base: NSLayoutConstraint {
23 | /// Bindable sink for `constant` property.
24 | public var constant: Binder {
25 | return Binder(self.base) { constraint, constant in
26 | constraint.constant = constant
27 | }
28 | }
29 |
30 | /// Bindable sink for `active` property.
31 | @available(iOS 8, OSX 10.10, *)
32 | public var active: Binder {
33 | return Binder(self.base) { constraint, value in
34 | constraint.isActive = value
35 | }
36 | }
37 | }
38 |
39 | #endif
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Common/RxTarget.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTarget.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 7/12/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import class Foundation.NSObject
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 |
15 | class RxTarget : NSObject
16 | , Disposable {
17 |
18 | private var retainSelf: RxTarget?
19 |
20 | override init() {
21 | super.init()
22 | self.retainSelf = self
23 |
24 | #if TRACE_RESOURCES
25 | _ = Resources.incrementTotal()
26 | #endif
27 |
28 | #if DEBUG
29 | MainScheduler.ensureExecutingOnScheduler()
30 | #endif
31 | }
32 |
33 | func dispose() {
34 | #if DEBUG
35 | MainScheduler.ensureExecutingOnScheduler()
36 | #endif
37 | self.retainSelf = nil
38 | }
39 |
40 | #if TRACE_RESOURCES
41 | deinit {
42 | _ = Resources.decrementTotal()
43 | }
44 | #endif
45 | }
46 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Common/SectionedViewDataSourceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SectionedViewDataSourceType.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 1/10/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import struct Foundation.IndexPath
10 |
11 | /// Data source with access to underlying sectioned model.
12 | public protocol SectionedViewDataSourceType {
13 | /// Returns model at index path.
14 | ///
15 | /// In case data source doesn't contain any sections when this method is being called, `RxCocoaError.ItemsNotYetBound(object: self)` is thrown.
16 |
17 | /// - parameter indexPath: Model index path
18 | /// - returns: Model at index path.
19 | func model(at indexPath: IndexPath) throws -> Any
20 | }
21 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Foundation/KVORepresentable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // KVORepresentable.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 11/14/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Type that is KVO representable (KVO mechanism can be used to observe it).
10 | public protocol KVORepresentable {
11 | /// Associated KVO type.
12 | associatedtype KVOType
13 |
14 | /// Constructs `Self` using KVO value.
15 | init?(KVOValue: KVOType)
16 | }
17 |
18 | extension KVORepresentable {
19 | /// Initializes `KVORepresentable` with optional value.
20 | init?(KVOValue: KVOType?) {
21 | guard let KVOValue = KVOValue else {
22 | return nil
23 | }
24 |
25 | self.init(KVOValue: KVOValue)
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Foundation/Logging.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Logging.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 4/3/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import struct Foundation.URLRequest
10 |
11 | /// Simple logging settings for RxCocoa library.
12 | public struct Logging {
13 | public typealias LogURLRequest = (URLRequest) -> Bool
14 |
15 | /// Log URL requests to standard output in curl format.
16 | public static var URLRequests: LogURLRequest = { _ in
17 | #if DEBUG
18 | return true
19 | #else
20 | return false
21 | #endif
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Foundation/NotificationCenter+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NotificationCenter+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 5/2/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import class Foundation.NotificationCenter
10 | import struct Foundation.Notification
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: NotificationCenter {
17 | /**
18 | Transforms notifications posted to notification center to observable sequence of notifications.
19 |
20 | - parameter name: Optional name used to filter notifications.
21 | - parameter object: Optional object used to filter notifications.
22 | - returns: Observable sequence of posted notifications.
23 | */
24 | public func notification(_ name: Notification.Name?, object: AnyObject? = nil) -> Observable {
25 | return Observable.create { [weak object] observer in
26 | let nsObserver = self.base.addObserver(forName: name, object: object, queue: nil) { notification in
27 | observer.on(.next(notification))
28 | }
29 |
30 | return Disposables.create {
31 | self.base.removeObserver(nsObserver)
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Runtime/_RX.m:
--------------------------------------------------------------------------------
1 | //
2 | // _RX.m
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 7/12/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #import "include/_RX.h"
10 |
11 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Runtime/include/RxCocoaRuntime.h:
--------------------------------------------------------------------------------
1 | //
2 | // RxCocoaRuntime.h
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 2/21/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "_RX.h"
11 | #import "_RXDelegateProxy.h"
12 | #import "_RXKVOObserver.h"
13 | #import "_RXObjCRuntime.h"
14 |
15 | //! Project version number for RxCocoa.
16 | FOUNDATION_EXPORT double RxCocoaVersionNumber;
17 |
18 | //! Project version string for RxCocoa.
19 | FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[];
20 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Runtime/include/_RXDelegateProxy.h:
--------------------------------------------------------------------------------
1 | //
2 | // _RXDelegateProxy.h
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 7/4/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface _RXDelegateProxy : NSObject
14 |
15 | @property (nonatomic, weak, readonly) id _forwardToDelegate;
16 |
17 | -(void)_setForwardToDelegate:(id __nullable)forwardToDelegate retainDelegate:(BOOL)retainDelegate NS_SWIFT_NAME(_setForwardToDelegate(_:retainDelegate:)) ;
18 |
19 | -(BOOL)hasWiredImplementationForSelector:(SEL)selector;
20 | -(BOOL)voidDelegateMethodsContain:(SEL)selector;
21 |
22 | -(void)_sentMessage:(SEL)selector withArguments:(NSArray*)arguments;
23 | -(void)_methodInvoked:(SEL)selector withArguments:(NSArray*)arguments;
24 |
25 | @end
26 |
27 | NS_ASSUME_NONNULL_END
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Runtime/include/_RXKVOObserver.h:
--------------------------------------------------------------------------------
1 | //
2 | // _RXKVOObserver.h
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 7/11/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | ################################################################################
13 | This file is part of RX private API
14 | ################################################################################
15 | */
16 |
17 | // Exists because if written in Swift, reading unowned is disabled during dealloc process
18 | @interface _RXKVOObserver : NSObject
19 |
20 | -(instancetype)initWithTarget:(id)target
21 | retainTarget:(BOOL)retainTarget
22 | keyPath:(NSString*)keyPath
23 | options:(NSKeyValueObservingOptions)options
24 | callback:(void (^)(id))callback;
25 |
26 | -(void)dispose;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/RxCocoa.h:
--------------------------------------------------------------------------------
1 | //
2 | // RxCocoa.h
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 2/21/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "_RX.h"
11 | #import "_RXDelegateProxy.h"
12 | #import "_RXKVOObserver.h"
13 | #import "_RXObjCRuntime.h"
14 |
15 | //! Project version number for RxCocoa.
16 | FOUNDATION_EXPORT double RxCocoaVersionNumber;
17 |
18 | //! Project version string for RxCocoa.
19 | FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[];
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/BehaviorRelay.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BehaviorRelay.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 10/7/17.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | /// BehaviorRelay is a wrapper for `BehaviorSubject`.
14 | ///
15 | /// Unlike `BehaviorSubject` it can't terminate with error or completed.
16 | public final class BehaviorRelay: ObservableType {
17 | public typealias E = Element
18 |
19 | private let _subject: BehaviorSubject
20 |
21 | // Accepts `event` and emits it to subscribers
22 | public func accept(_ event: Element) {
23 | _subject.onNext(event)
24 | }
25 |
26 | /// Current value of behavior subject
27 | public var value: Element {
28 | // this try! is ok because subject can't error out or be disposed
29 | return try! _subject.value()
30 | }
31 |
32 | /// Initializes variable with initial value.
33 | public init(value: Element) {
34 | _subject = BehaviorSubject(value: value)
35 | }
36 |
37 | /// Subscribes observer
38 | public func subscribe(_ observer: O) -> Disposable where O.E == E {
39 | return _subject.subscribe(observer)
40 | }
41 |
42 | /// - returns: Canonical interface for push style sequence
43 | public func asObservable() -> Observable {
44 | return _subject.asObservable()
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/Driver/BehaviorRelay+Driver.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BehaviorRelay+Driver.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 10/7/17.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | extension BehaviorRelay {
14 | /// Converts `BehaviorRelay` to `Driver`.
15 | ///
16 | /// - returns: Observable sequence.
17 | public func asDriver() -> Driver {
18 | let source = self.asObservable()
19 | .observeOn(DriverSharingStrategy.scheduler)
20 | return SharedSequence(source)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlEvent+Driver.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ControlEvent+Driver.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 9/19/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | extension ControlEvent {
14 | /// Converts `ControlEvent` to `Driver` trait.
15 | ///
16 | /// `ControlEvent` already can't fail, so no special case needs to be handled.
17 | public func asDriver() -> Driver {
18 | return self.asDriver { (error) -> Driver in
19 | #if DEBUG
20 | rxFatalError("Somehow driver received error from a source that shouldn't fail.")
21 | #else
22 | return Driver.empty()
23 | #endif
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/Driver/ControlProperty+Driver.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ControlProperty+Driver.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 9/19/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | extension ControlProperty {
14 | /// Converts `ControlProperty` to `Driver` trait.
15 | ///
16 | /// `ControlProperty` already can't fail, so no special case needs to be handled.
17 | public func asDriver() -> Driver {
18 | return self.asDriver { (error) -> Driver in
19 | #if DEBUG
20 | rxFatalError("Somehow driver received error from a source that shouldn't fail.")
21 | #else
22 | return Driver.empty()
23 | #endif
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/PublishRelay.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PublishRelay.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 3/28/15.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | /// PublishRelay is a wrapper for `PublishSubject`.
14 | ///
15 | /// Unlike `PublishSubject` it can't terminate with error or completed.
16 | public final class PublishRelay: ObservableType {
17 | public typealias E = Element
18 |
19 | private let _subject: PublishSubject
20 |
21 | // Accepts `event` and emits it to subscribers
22 | public func accept(_ event: Element) {
23 | _subject.onNext(event)
24 | }
25 |
26 | /// Initializes variable with initial value.
27 | public init() {
28 | _subject = PublishSubject()
29 | }
30 |
31 | /// Subscribes observer
32 | public func subscribe(_ observer: O) -> Disposable where O.E == E {
33 | return _subject.subscribe(observer)
34 | }
35 |
36 | /// - returns: Canonical interface for push style sequence
37 | public func asObservable() -> Observable {
38 | return _subject.asObservable()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/Traits/Signal/PublishRelay+Signal.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PublishRelay+Signal.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 12/28/15.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if !RX_NO_MODULE
10 | import RxSwift
11 | #endif
12 |
13 | extension PublishRelay {
14 | /// Converts `PublishRelay` to `Signal`.
15 | ///
16 | /// - returns: Observable sequence.
17 | public func asSignal() -> Signal {
18 | let source = self.asObservable()
19 | .observeOn(SignalSharingStrategy.scheduler)
20 | return SharedSequence(source)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Events/ItemEvents.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ItemEvents.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 6/20/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import UIKit
11 |
12 | public typealias ItemMovedEvent = (sourceIndex: IndexPath, destinationIndex: IndexPath)
13 | public typealias WillDisplayCellEvent = (cell: UITableViewCell, indexPath: IndexPath)
14 | public typealias DidEndDisplayingCellEvent = (cell: UITableViewCell, indexPath: IndexPath)
15 | #endif
16 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxCollectionViewDataSourceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxCollectionViewDataSourceType.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 6/29/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | /// Marks data source as `UICollectionView` reactive data source enabling it to be used with one of the `bindTo` methods.
17 | public protocol RxCollectionViewDataSourceType /*: UICollectionViewDataSource*/ {
18 |
19 | /// Type of elements that can be bound to collection view.
20 | associatedtype Element
21 |
22 | /// New observable sequence event observed.
23 | ///
24 | /// - parameter collectionView: Bound collection view.
25 | /// - parameter observedEvent: Event
26 | func collectionView(_ collectionView: UICollectionView, observedEvent: Event) -> Void
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxPickerViewDataSourceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxPickerViewDataSourceType.swift
3 | // RxCocoa
4 | //
5 | // Created by Sergey Shulga on 05/07/2017.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | /// Marks data source as `UIPickerView` reactive data source enabling it to be used with one of the `bindTo` methods.
17 | public protocol RxPickerViewDataSourceType {
18 | /// Type of elements that can be bound to picker view.
19 | associatedtype Element
20 |
21 | /// New observable sequence event observed.
22 | ///
23 | /// - parameter pickerView: Bound picker view.
24 | /// - parameter observedEvent: Event
25 | func pickerView(_ pickerView: UIPickerView, observedEvent: Event)
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Protocols/RxTableViewDataSourceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTableViewDataSourceType.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 6/26/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | /// Marks data source as `UITableView` reactive data source enabling it to be used with one of the `bindTo` methods.
17 | public protocol RxTableViewDataSourceType /*: UITableViewDataSource*/ {
18 |
19 | /// Type of elements that can be bound to table view.
20 | associatedtype Element
21 |
22 | /// New observable sequence event observed.
23 | ///
24 | /// - parameter tableView: Bound table view.
25 | /// - parameter observedEvent: Event
26 | func tableView(_ tableView: UITableView, observedEvent: Event) -> Void
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxCollectionViewDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxCollectionViewDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 6/29/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | /// For more information take a look at `DelegateProxyType`.
17 | open class RxCollectionViewDelegateProxy
18 | : RxScrollViewDelegateProxy
19 | , UICollectionViewDelegate
20 | , UICollectionViewDelegateFlowLayout {
21 |
22 | /// Typed parent object.
23 | public weak private(set) var collectionView: UICollectionView?
24 |
25 | /// Initializes `RxCollectionViewDelegateProxy`
26 | ///
27 | /// - parameter collectionView: Parent object for delegate proxy.
28 | public init(collectionView: UICollectionView) {
29 | self.collectionView = collectionView
30 | super.init(scrollView: collectionView)
31 | }
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxPickerViewDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxPickerViewDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Segii Shulga on 5/12/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension UIPickerView: HasDelegate {
17 | public typealias Delegate = UIPickerViewDelegate
18 | }
19 |
20 | open class RxPickerViewDelegateProxy
21 | : DelegateProxy
22 | , DelegateProxyType
23 | , UIPickerViewDelegate {
24 |
25 | /// Typed parent object.
26 | public weak private(set) var pickerView: UIPickerView?
27 |
28 | /// - parameter pickerView: Parent object for delegate proxy.
29 | public init(pickerView: ParentObject) {
30 | self.pickerView = pickerView
31 | super.init(parentObject: pickerView, delegateProxy: RxPickerViewDelegateProxy.self)
32 | }
33 |
34 | // Register known implementationss
35 | public static func registerKnownImplementations() {
36 | self.register { RxPickerViewDelegateProxy(pickerView: $0) }
37 | }
38 | }
39 | #endif
40 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchBarDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxSearchBarDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 7/4/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension UISearchBar: HasDelegate {
17 | public typealias Delegate = UISearchBarDelegate
18 | }
19 |
20 | /// For more information take a look at `DelegateProxyType`.
21 | open class RxSearchBarDelegateProxy
22 | : DelegateProxy
23 | , DelegateProxyType
24 | , UISearchBarDelegate {
25 |
26 | /// Typed parent object.
27 | public weak private(set) var searchBar: UISearchBar?
28 |
29 | /// - parameter searchBar: Parent object for delegate proxy.
30 | public init(searchBar: ParentObject) {
31 | self.searchBar = searchBar
32 | super.init(parentObject: searchBar, delegateProxy: RxSearchBarDelegateProxy.self)
33 | }
34 |
35 | // Register known implementations
36 | public static func registerKnownImplementations() {
37 | self.register { RxSearchBarDelegateProxy(searchBar: $0) }
38 | }
39 | }
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxSearchControllerDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxSearchControllerDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Segii Shulga on 3/17/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension UISearchController: HasDelegate {
17 | public typealias Delegate = UISearchControllerDelegate
18 | }
19 |
20 | /// For more information take a look at `DelegateProxyType`.
21 | @available(iOS 8.0, *)
22 | open class RxSearchControllerDelegateProxy
23 | : DelegateProxy
24 | , DelegateProxyType
25 | , UISearchControllerDelegate {
26 |
27 | /// Typed parent object.
28 | public weak private(set) var searchController: UISearchController?
29 |
30 | /// - parameter searchController: Parent object for delegate proxy.
31 | public init(searchController: UISearchController) {
32 | self.searchController = searchController
33 | super.init(parentObject: searchController, delegateProxy: RxSearchControllerDelegateProxy.self)
34 | }
35 |
36 | // Register known implementations
37 | public static func registerKnownImplementations() {
38 | self.register { RxSearchControllerDelegateProxy(searchController: $0) }
39 | }
40 | }
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTabBarControllerDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTabBarControllerDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Yusuke Kita on 2016/12/07.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension UITabBarController: HasDelegate {
17 | public typealias Delegate = UITabBarControllerDelegate
18 | }
19 |
20 | /// For more information take a look at `DelegateProxyType`.
21 | open class RxTabBarControllerDelegateProxy
22 | : DelegateProxy
23 | , DelegateProxyType
24 | , UITabBarControllerDelegate {
25 |
26 | /// Typed parent object.
27 | public weak private(set) var tabBar: UITabBarController?
28 |
29 | /// - parameter tabBar: Parent object for delegate proxy.
30 | public init(tabBar: ParentObject) {
31 | self.tabBar = tabBar
32 | super.init(parentObject: tabBar, delegateProxy: RxTabBarControllerDelegateProxy.self)
33 | }
34 |
35 | // Register known implementations
36 | public static func registerKnownImplementations() {
37 | self.register { RxTabBarControllerDelegateProxy(tabBar: $0) }
38 | }
39 | }
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTableViewDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTableViewDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 6/15/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | /// For more information take a look at `DelegateProxyType`.
17 | open class RxTableViewDelegateProxy
18 | : RxScrollViewDelegateProxy
19 | , UITableViewDelegate {
20 |
21 | /// Typed parent object.
22 | public weak private(set) var tableView: UITableView?
23 |
24 | /// - parameter tableView: Parent object for delegate proxy.
25 | public init(tableView: UITableView) {
26 | self.tableView = tableView
27 | super.init(scrollView: tableView)
28 | }
29 |
30 | }
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxTextStorageDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTextStorageDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Segii Shulga on 12/30/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension NSTextStorage: HasDelegate {
17 | public typealias Delegate = NSTextStorageDelegate
18 | }
19 |
20 | open class RxTextStorageDelegateProxy
21 | : DelegateProxy
22 | , DelegateProxyType
23 | , NSTextStorageDelegate {
24 |
25 | /// Typed parent object.
26 | public weak private(set) var textStorage: NSTextStorage?
27 |
28 | /// - parameter textStorage: Parent object for delegate proxy.
29 | public init(textStorage: NSTextStorage) {
30 | self.textStorage = textStorage
31 | super.init(parentObject: textStorage, delegateProxy: RxTextStorageDelegateProxy.self)
32 | }
33 |
34 | // Register known implementations
35 | public static func registerKnownImplementations() {
36 | self.register { RxTextStorageDelegateProxy(textStorage: $0) }
37 | }
38 | }
39 | #endif
40 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/Proxies/RxWebViewDelegateProxy.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxWebViewDelegateProxy.swift
3 | // RxCocoa
4 | //
5 | // Created by Andrew Breckenridge on 9/26/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension UIWebView: HasDelegate {
17 | public typealias Delegate = UIWebViewDelegate
18 | }
19 |
20 | open class RxWebViewDelegateProxy
21 | : DelegateProxy
22 | , DelegateProxyType
23 | , UIWebViewDelegate {
24 |
25 | /// Typed parent object.
26 | public weak private(set) var webView: UIWebView?
27 |
28 | /// - parameter webView: Parent object for delegate proxy.
29 | public init(webView: ParentObject) {
30 | self.webView = webView
31 | super.init(parentObject: webView, delegateProxy: RxWebViewDelegateProxy.self)
32 | }
33 |
34 | // Register known implementations
35 | public static func registerKnownImplementations() {
36 | self.register { RxWebViewDelegateProxy(webView: $0) }
37 | }
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIActivityIndicatorView+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIActivityIndicatorView+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Ivan Persidskiy on 02/12/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIActivityIndicatorView {
17 |
18 | /// Bindable sink for `startAnimating()`, `stopAnimating()` methods.
19 | public var isAnimating: Binder {
20 | return Binder(self.base) { activityIndicator, active in
21 | if active {
22 | activityIndicator.startAnimating()
23 | } else {
24 | activityIndicator.stopAnimating()
25 | }
26 | }
27 | }
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIAlertAction+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIAlertAction+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Andrew Breckenridge on 5/7/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 |
13 | #if !RX_NO_MODULE
14 | import RxSwift
15 | #endif
16 |
17 | extension Reactive where Base: UIAlertAction {
18 |
19 | /// Bindable sink for `enabled` property.
20 | public var isEnabled: Binder {
21 | return Binder(self.base) { alertAction, value in
22 | alertAction.isEnabled = value
23 | }
24 | }
25 |
26 | }
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIApplication+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIApplication+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Mads Bøgeskov on 18/01/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIApplication {
17 |
18 | /// Bindable sink for `networkActivityIndicatorVisible`.
19 | public var isNetworkActivityIndicatorVisible: Binder {
20 | return Binder(self.base) { application, active in
21 | application.isNetworkActivityIndicatorVisible = active
22 | }
23 | }
24 | }
25 | #endif
26 |
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIDatePicker+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIDatePicker+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Daniel Tartaglia on 5/31/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UIDatePicker {
17 | /// Reactive wrapper for `date` property.
18 | public var date: ControlProperty {
19 | return value
20 | }
21 |
22 | /// Reactive wrapper for `date` property.
23 | public var value: ControlProperty {
24 | return base.rx.controlPropertyWithDefaultEvents(
25 | getter: { datePicker in
26 | datePicker.date
27 | }, setter: { datePicker, value in
28 | datePicker.date = value
29 | }
30 | )
31 | }
32 |
33 | /// Reactive wrapper for `countDownDuration` property.
34 | public var countDownDuration: ControlProperty {
35 | return base.rx.controlPropertyWithDefaultEvents(
36 | getter: { datePicker in
37 | datePicker.countDownDuration
38 | }, setter: { datePicker, value in
39 | datePicker.countDownDuration = value
40 | }
41 | )
42 | }
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIImageView+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIImageView+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 4/1/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UIImageView {
17 |
18 | /// Bindable sink for `image` property.
19 | public var image: Binder {
20 | return Binder(base) { imageView, image in
21 | imageView.image = image
22 | }
23 | }
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UILabel+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UILabel+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 4/1/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UILabel {
17 |
18 | /// Bindable sink for `text` property.
19 | public var text: Binder {
20 | return Binder(self.base) { label, text in
21 | label.text = text
22 | }
23 | }
24 |
25 | /// Bindable sink for `attributedText` property.
26 | public var attributedText: Binder {
27 | return Binder(self.base) { label, text in
28 | label.attributedText = text
29 | }
30 | }
31 |
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UINavigationItem+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UINavigationItem+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by kumapo on 2016/05/09.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UINavigationItem {
17 |
18 | /// Bindable sink for `title` property.
19 | public var title: Binder {
20 | return Binder(self.base) { navigationItem, text in
21 | navigationItem.title = text
22 | }
23 | }
24 |
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIPageControl+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIPageControl+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Francesco Puntillo on 14/04/2016.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UIPageControl {
17 |
18 | /// Bindable sink for `currentPage` property.
19 | public var currentPage: Binder {
20 | return Binder(self.base) { controller, page in
21 | controller.currentPage = page
22 | }
23 | }
24 |
25 | /// Bindable sink for `numberOfPages` property.
26 | public var numberOfPages: Binder {
27 | return Binder(self.base) { controller, page in
28 | controller.numberOfPages = page
29 | }
30 | }
31 |
32 | }
33 |
34 | #endif
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIProgressView+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIProgressView+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Samuel Bae on 2/27/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UIProgressView {
17 |
18 | /// Bindable sink for `progress` property
19 | public var progress: Binder {
20 | return Binder(self.base) { progressView, progress in
21 | progressView.progress = progress
22 | }
23 | }
24 |
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIRefreshControl+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIRefreshControl+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Yosuke Ishikawa on 1/31/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIRefreshControl {
17 | /// Bindable sink for `beginRefreshing()`, `endRefreshing()` methods.
18 | public var isRefreshing: Binder {
19 | return Binder(self.base) { refreshControl, refresh in
20 | if refresh {
21 | refreshControl.beginRefreshing()
22 | } else {
23 | refreshControl.endRefreshing()
24 | }
25 | }
26 | }
27 |
28 | }
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UISegmentedControl+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISegmentedControl+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Carlos García on 8/7/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 |
17 | extension Reactive where Base: UISegmentedControl {
18 | /// Reactive wrapper for `selectedSegmentIndex` property.
19 | public var selectedSegmentIndex: ControlProperty {
20 | return value
21 | }
22 |
23 | /// Reactive wrapper for `selectedSegmentIndex` property.
24 | public var value: ControlProperty {
25 | return base.rx.controlPropertyWithDefaultEvents(
26 | getter: { segmentedControl in
27 | segmentedControl.selectedSegmentIndex
28 | }, setter: { segmentedControl, value in
29 | segmentedControl.selectedSegmentIndex = value
30 | }
31 | )
32 | }
33 |
34 | }
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UISlider+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISlider+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Alexander van der Werff on 28/05/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | #if !RX_NO_MODULE
12 | import RxSwift
13 | #endif
14 | import UIKit
15 |
16 | extension Reactive where Base: UISlider {
17 |
18 | /// Reactive wrapper for `value` property.
19 | public var value: ControlProperty {
20 | return base.rx.controlPropertyWithDefaultEvents(
21 | getter: { slider in
22 | slider.value
23 | }, setter: { slider, value in
24 | slider.value = value
25 | }
26 | )
27 | }
28 |
29 | }
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIStepper+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIStepper+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Yuta ToKoRo on 9/1/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIStepper {
17 |
18 | /// Reactive wrapper for `value` property.
19 | public var value: ControlProperty {
20 | return base.rx.controlPropertyWithDefaultEvents(
21 | getter: { stepper in
22 | stepper.value
23 | }, setter: { stepper, value in
24 | stepper.value = value
25 | }
26 | )
27 | }
28 |
29 | }
30 |
31 | #endif
32 |
33 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UISwitch+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UISwitch+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Carlos García on 8/7/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 |
17 | extension Reactive where Base: UISwitch {
18 |
19 | /// Reactive wrapper for `isOn` property.
20 | public var isOn: ControlProperty {
21 | return value
22 | }
23 |
24 | /**
25 | Reactive wrapper for `isOn` property.
26 |
27 | **⚠️ Versions prior to iOS 10.2 were leaking `UISwitch`s, so on those versions
28 | underlying observable sequence won't complete when nothing holds a strong reference
29 | to UISwitch.⚠️**
30 | */
31 | public var value: ControlProperty {
32 | return base.rx.controlPropertyWithDefaultEvents(
33 | getter: { uiSwitch in
34 | uiSwitch.isOn
35 | }, setter: { uiSwitch, value in
36 | uiSwitch.isOn = value
37 | }
38 | )
39 | }
40 |
41 | }
42 |
43 | #endif
44 |
45 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UITabBarItem+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UITabBarItem+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Mateusz Derks on 04/03/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UITabBarItem {
17 |
18 | /// Bindable sink for `badgeValue` property.
19 | public var badgeValue: Binder {
20 | return Binder(self.base) { tabBarItem, badgeValue in
21 | tabBarItem.badgeValue = badgeValue
22 | }
23 | }
24 |
25 | }
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIView+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Krunoslav Zaher on 12/6/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 |
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIView {
17 | /// Bindable sink for `hidden` property.
18 | public var isHidden: Binder {
19 | return Binder(self.base) { view, hidden in
20 | view.isHidden = hidden
21 | }
22 | }
23 |
24 | /// Bindable sink for `alpha` property.
25 | public var alpha: Binder {
26 | return Binder(self.base) { view, alpha in
27 | view.alpha = alpha
28 | }
29 | }
30 |
31 | /// Bindable sink for `isUserInteractionEnabled` property.
32 | public var isUserInteractionEnabled: Binder {
33 | return Binder(self.base) { view, userInteractionEnabled in
34 | view.isUserInteractionEnabled = userInteractionEnabled
35 | }
36 | }
37 |
38 | }
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxCocoa/RxCocoa/iOS/UIViewController+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+Rx.swift
3 | // RxCocoa
4 | //
5 | // Created by Kyle Fuller on 27/05/2016.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import UIKit
11 |
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | #endif
15 |
16 | extension Reactive where Base: UIViewController {
17 |
18 | /// Bindable sink for `title`.
19 | public var title: Binder {
20 | return Binder(self.base) { viewController, title in
21 | viewController.title = title
22 | }
23 | }
24 |
25 | }
26 | #endif
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 RxSwift Community
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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/AnimationConfiguration.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimationConfiguration.swift
3 | // RxDataSources
4 | //
5 | // Created by Esteban Torres on 5/2/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import Foundation
11 | import UIKit
12 |
13 | /**
14 | Exposes custom animation styles for insertion, deletion and reloading behavior.
15 | */
16 | public struct AnimationConfiguration {
17 | public let insertAnimation: UITableViewRowAnimation
18 | public let reloadAnimation: UITableViewRowAnimation
19 | public let deleteAnimation: UITableViewRowAnimation
20 |
21 | public init(insertAnimation: UITableViewRowAnimation = .automatic,
22 | reloadAnimation: UITableViewRowAnimation = .automatic,
23 | deleteAnimation: UITableViewRowAnimation = .automatic) {
24 | self.insertAnimation = insertAnimation
25 | self.reloadAnimation = reloadAnimation
26 | self.deleteAnimation = deleteAnimation
27 | }
28 | }
29 | #endif
30 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/Array+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Array+Extensions.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 4/26/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import Foundation
11 |
12 | extension Array where Element: SectionModelType {
13 | mutating func moveFromSourceIndexPath(_ sourceIndexPath: IndexPath, destinationIndexPath: IndexPath) {
14 | let sourceSection = self[sourceIndexPath.section]
15 | var sourceItems = sourceSection.items
16 |
17 | let sourceItem = sourceItems.remove(at: sourceIndexPath.item)
18 |
19 | let sourceSectionNew = Element(original: sourceSection, items: sourceItems)
20 | self[sourceIndexPath.section] = sourceSectionNew
21 |
22 | let destinationSection = self[destinationIndexPath.section]
23 | var destinationItems = destinationSection.items
24 | destinationItems.insert(sourceItem, at: destinationIndexPath.item)
25 |
26 | self[destinationIndexPath.section] = Element(original: destinationSection, items: destinationItems)
27 | }
28 | }
29 | #endif
30 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/DataSources.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DataSources.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 1/8/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | @_exported import Differentiator
12 |
13 | enum RxDataSourceError : Error {
14 | case preconditionFailed(message: String)
15 | }
16 |
17 | func rxPrecondition(_ condition: Bool, _ message: @autoclosure() -> String) throws -> () {
18 | if condition {
19 | return
20 | }
21 | rxDebugFatalError("Precondition failed")
22 |
23 | throw RxDataSourceError.preconditionFailed(message: message())
24 | }
25 |
26 | func rxDebugFatalError(_ error: Error) {
27 | rxDebugFatalError("\(error)")
28 | }
29 |
30 | func rxDebugFatalError(_ message: String) {
31 | #if DEBUG
32 | fatalError(message)
33 | #else
34 | print(message)
35 | #endif
36 | }
37 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/Deprecated.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Deprecated.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 10/8/17.
6 | // Copyright © 2017 kzaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | extension CollectionViewSectionedDataSource {
11 | @available(*, deprecated, renamed: "configureSupplementaryView")
12 | public var supplementaryViewFactory: ConfigureSupplementaryView {
13 | get {
14 | return self.configureSupplementaryView
15 | }
16 | set {
17 | self.configureSupplementaryView = newValue
18 | }
19 | }
20 | }
21 | #endif
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/FloatingPointType+IdentifiableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // FloatingPointType+IdentifiableType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 7/4/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension FloatingPoint {
12 | typealias identity = Self
13 |
14 | public var identity: Self {
15 | return self
16 | }
17 | }
18 |
19 | extension Float : IdentifiableType {
20 |
21 | }
22 |
23 | extension Double : IdentifiableType {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/IntegerType+IdentifiableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IntegerType+IdentifiableType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 7/4/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension BinaryInteger {
12 | typealias identity = Self
13 |
14 | public var identity: Self {
15 | return self
16 | }
17 | }
18 |
19 | extension Int : IdentifiableType {
20 |
21 | }
22 |
23 | extension Int8 : IdentifiableType {
24 |
25 | }
26 |
27 | extension Int16 : IdentifiableType {
28 |
29 | }
30 |
31 | extension Int32 : IdentifiableType {
32 |
33 | }
34 |
35 | extension Int64 : IdentifiableType {
36 |
37 | }
38 |
39 |
40 | extension UInt : IdentifiableType {
41 |
42 | }
43 |
44 | extension UInt8 : IdentifiableType {
45 |
46 | }
47 |
48 | extension UInt16 : IdentifiableType {
49 |
50 | }
51 |
52 | extension UInt32 : IdentifiableType {
53 |
54 | }
55 |
56 | extension UInt64 : IdentifiableType {
57 |
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/RxCollectionViewSectionedReloadDataSource.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxCollectionViewSectionedReloadDataSource.swift
3 | // RxExample
4 | //
5 | // Created by Krunoslav Zaher on 7/2/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import Foundation
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | import RxCocoa
15 | #endif
16 | import Differentiator
17 |
18 | open class RxCollectionViewSectionedReloadDataSource
19 | : CollectionViewSectionedDataSource
20 | , RxCollectionViewDataSourceType {
21 |
22 | public typealias Element = [S]
23 |
24 | open func collectionView(_ collectionView: UICollectionView, observedEvent: Event) {
25 | Binder(self) { dataSource, element in
26 | #if DEBUG
27 | self._dataSourceBound = true
28 | #endif
29 | dataSource.setSections(element)
30 | collectionView.reloadData()
31 | collectionView.collectionViewLayout.invalidateLayout()
32 | }.on(observedEvent)
33 | }
34 | }
35 | #endif
36 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/RxTableViewSectionedReloadDataSource.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxTableViewSectionedReloadDataSource.swift
3 | // RxExample
4 | //
5 | // Created by Krunoslav Zaher on 6/27/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | #if os(iOS) || os(tvOS)
10 | import Foundation
11 | import UIKit
12 | #if !RX_NO_MODULE
13 | import RxSwift
14 | import RxCocoa
15 | #endif
16 | import Differentiator
17 |
18 | open class RxTableViewSectionedReloadDataSource
19 | : TableViewSectionedDataSource
20 | , RxTableViewDataSourceType {
21 | public typealias Element = [S]
22 |
23 | open func tableView(_ tableView: UITableView, observedEvent: Event) {
24 | Binder(self) { dataSource, element in
25 | #if DEBUG
26 | self._dataSourceBound = true
27 | #endif
28 | dataSource.setSections(element)
29 | tableView.reloadData()
30 | }.on(observedEvent)
31 | }
32 | }
33 | #endif
34 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/String+IdentifiableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+IdentifiableType.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 7/4/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension String : IdentifiableType {
12 | public typealias Identity = String
13 |
14 | public var identity: String {
15 | return self
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxDataSources/Sources/RxDataSources/ViewTransition.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewTransition.swift
3 | // RxDataSources
4 | //
5 | // Created by Krunoslav Zaher on 10/22/17.
6 | // Copyright © 2017 kzaher. All rights reserved.
7 | //
8 |
9 | /// Transition between two view states
10 | public enum ViewTransition {
11 | /// animated transition
12 | case animated
13 | /// refresh view without animations
14 | case reload
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/LICENSE.md:
--------------------------------------------------------------------------------
1 | **The MIT License**
2 | **Copyright © 2015 Krunoslav Zaher**
3 | **All rights reserved.**
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift:
--------------------------------------------------------------------------------
1 | //
2 | // InfiniteSequence.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 6/13/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Sequence that repeats `repeatedValue` infinite number of times.
10 | struct InfiniteSequence : Sequence {
11 | typealias Element = E
12 | typealias Iterator = AnyIterator
13 |
14 | private let _repeatedValue: E
15 |
16 | init(repeatedValue: E) {
17 | _repeatedValue = repeatedValue
18 | }
19 |
20 | func makeIterator() -> Iterator {
21 | let repeatedValue = _repeatedValue
22 | return AnyIterator {
23 | return repeatedValue
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DispatchQueue+Extensions.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 10/22/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Dispatch
10 |
11 | extension DispatchQueue {
12 | private static var token: DispatchSpecificKey<()> = {
13 | let key = DispatchSpecificKey<()>()
14 | DispatchQueue.main.setSpecific(key: key, value: ())
15 | return key
16 | }()
17 |
18 | static var isMain: Bool {
19 | return DispatchQueue.getSpecific(key: token) != nil
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/Platform/RecursiveLock.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RecursiveLock.swift
3 | // Platform
4 | //
5 | // Created by Krunoslav Zaher on 12/18/16.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import class Foundation.NSRecursiveLock
10 |
11 | #if TRACE_RESOURCES
12 | class RecursiveLock: NSRecursiveLock {
13 | override init() {
14 | _ = Resources.incrementTotal()
15 | super.init()
16 | }
17 |
18 | override func lock() {
19 | super.lock()
20 | _ = Resources.incrementTotal()
21 | }
22 |
23 | override func unlock() {
24 | super.unlock()
25 | _ = Resources.decrementTotal()
26 | }
27 |
28 | deinit {
29 | _ = Resources.decrementTotal()
30 | }
31 | }
32 | #else
33 | typealias RecursiveLock = NSRecursiveLock
34 | #endif
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Cancelable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cancelable.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 3/12/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Represents disposable resource with state tracking.
10 | public protocol Cancelable : Disposable {
11 | /// Was resource disposed.
12 | var isDisposed: Bool { get }
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Concurrency/Lock.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Lock.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 3/31/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol Lock {
10 | func lock()
11 | func unlock()
12 | }
13 |
14 | // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html
15 | typealias SpinLock = RecursiveLock
16 |
17 | extension RecursiveLock : Lock {
18 | @inline(__always)
19 | final func performLocked(_ action: () -> Void) {
20 | lock(); defer { unlock() }
21 | action()
22 | }
23 |
24 | @inline(__always)
25 | final func calculateLocked(_ action: () -> T) -> T {
26 | lock(); defer { unlock() }
27 | return action()
28 | }
29 |
30 | @inline(__always)
31 | final func calculateLockedOrFail(_ action: () throws -> T) throws -> T {
32 | lock(); defer { unlock() }
33 | let result = try action()
34 | return result
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LockOwnerType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 10/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol LockOwnerType : class, Lock {
10 | var _lock: RecursiveLock { get }
11 | }
12 |
13 | extension LockOwnerType {
14 | func lock() {
15 | _lock.lock()
16 | }
17 |
18 | func unlock() {
19 | _lock.unlock()
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SynchronizedDisposeType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 10/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol SynchronizedDisposeType : class, Disposable, Lock {
10 | func _synchronized_dispose()
11 | }
12 |
13 | extension SynchronizedDisposeType {
14 | func synchronizedDispose() {
15 | lock(); defer { unlock() }
16 | _synchronized_dispose()
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SynchronizedOnType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 10/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol SynchronizedOnType : class, ObserverType, Lock {
10 | func _synchronized_on(_ event: Event)
11 | }
12 |
13 | extension SynchronizedOnType {
14 | func synchronizedOn(_ event: Event) {
15 | lock(); defer { unlock() }
16 | _synchronized_on(event)
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SynchronizedUnsubscribeType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 10/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol SynchronizedUnsubscribeType : class {
10 | associatedtype DisposeKey
11 |
12 | func synchronizedUnsubscribe(_ disposeKey: DisposeKey)
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/ConnectableObservableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ConnectableObservableType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 3/1/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /**
10 | Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence.
11 | */
12 | public protocol ConnectableObservableType : ObservableType {
13 | /**
14 | Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established.
15 |
16 | - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence.
17 | */
18 | func connect() -> Disposable
19 | }
20 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Disposable.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/8/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Respresents a disposable resource.
10 | public protocol Disposable {
11 | /// Dispose resource.
12 | func dispose()
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BooleanDisposable.swift
3 | // RxSwift
4 | //
5 | // Created by Junior B. on 10/29/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Represents a disposable resource that can be checked for disposal status.
10 | public final class BooleanDisposable : Cancelable {
11 |
12 | internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true)
13 | private var _isDisposed = false
14 |
15 | /// Initializes a new instance of the `BooleanDisposable` class
16 | public init() {
17 | }
18 |
19 | /// Initializes a new instance of the `BooleanDisposable` class with given value
20 | public init(isDisposed: Bool) {
21 | self._isDisposed = isDisposed
22 | }
23 |
24 | /// - returns: Was resource disposed.
25 | public var isDisposed: Bool {
26 | return _isDisposed
27 | }
28 |
29 | /// Sets the status to disposed, which can be observer through the `isDisposed` property.
30 | public func dispose() {
31 | _isDisposed = true
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposables/Disposables.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Disposables.swift
3 | // RxSwift
4 | //
5 | // Created by Mohsen Ramezanpoor on 01/08/2016.
6 | // Copyright © 2016 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// A collection of utility methods for common disposable operations.
10 | public struct Disposables {
11 | private init() {}
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DisposeBase.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 4/4/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Base class for all disposables.
10 | public class DisposeBase {
11 | init() {
12 | #if TRACE_RESOURCES
13 | let _ = Resources.incrementTotal()
14 | #endif
15 | }
16 |
17 | deinit {
18 | #if TRACE_RESOURCES
19 | let _ = Resources.decrementTotal()
20 | #endif
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NopDisposable.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/15/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Represents a disposable that does nothing on disposal.
10 | ///
11 | /// Nop = No Operation
12 | fileprivate struct NopDisposable : Disposable {
13 |
14 | fileprivate static let noOp: Disposable = NopDisposable()
15 |
16 | fileprivate init() {
17 |
18 | }
19 |
20 | /// Does nothing.
21 | public func dispose() {
22 | }
23 | }
24 |
25 | extension Disposables {
26 | /**
27 | Creates a disposable that does nothing on disposal.
28 | */
29 | static public func create() -> Disposable {
30 | return NopDisposable.noOp
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SubscriptionDisposable.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 10/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | struct SubscriptionDisposable : Disposable {
10 | private let _key: T.DisposeKey
11 | private weak var _owner: T?
12 |
13 | init(owner: T, key: T.DisposeKey) {
14 | _owner = owner
15 | _key = key
16 | }
17 |
18 | func dispose() {
19 | _owner?.synchronizedUnsubscribe(_key)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift:
--------------------------------------------------------------------------------
1 | //
2 | // String+Rx.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 12/25/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | extension String {
10 | /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)`
11 | func lastIndexOf(_ character: Character) -> Index? {
12 | var index = endIndex
13 | while index > startIndex {
14 | index = self.index(before: index)
15 | if self[index] == character {
16 | return index
17 | }
18 | }
19 |
20 | return nil
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/GroupedObservable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GroupedObservable.swift
3 | // RxSwift
4 | //
5 | // Created by Tomi Koskinen on 01/12/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Represents an observable sequence of elements that have a common key.
10 | public struct GroupedObservable : ObservableType {
11 | public typealias E = Element
12 |
13 | /// Gets the common key.
14 | public let key: Key
15 |
16 | private let source: Observable
17 |
18 | /// Initializes grouped observable sequence with key and source observable sequence.
19 | ///
20 | /// - parameter key: Grouped observable sequence key
21 | /// - parameter source: Observable sequence that represents sequence of elements for the key
22 | /// - returns: Grouped observable sequence of elements for the specific key
23 | public init(key: Key, source: Observable) {
24 | self.key = key
25 | self.source = source
26 | }
27 |
28 | /// Subscribes `observer` to receive events for this sequence.
29 | public func subscribe(_ observer: O) -> Disposable where O.E == E {
30 | return self.source.subscribe(observer)
31 | }
32 |
33 | /// Converts `self` to `Observable` sequence.
34 | public func asObservable() -> Observable {
35 | return source
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Observable.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/8/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// A type-erased `ObservableType`.
10 | ///
11 | /// It represents a push style sequence.
12 | public class Observable : ObservableType {
13 | /// Type of elements in sequence.
14 | public typealias E = Element
15 |
16 | init() {
17 | #if TRACE_RESOURCES
18 | let _ = Resources.incrementTotal()
19 | #endif
20 | }
21 |
22 | public func subscribe(_ observer: O) -> Disposable where O.E == E {
23 | rxAbstractMethod()
24 | }
25 |
26 | public func asObservable() -> Observable {
27 | return self
28 | }
29 |
30 | deinit {
31 | #if TRACE_RESOURCES
32 | let _ = Resources.decrementTotal()
33 | #endif
34 | }
35 |
36 | // this is kind of ugly I know :(
37 | // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯
38 |
39 | /// Optimizations for map operator
40 | internal func composeMap(_ transform: @escaping (Element) throws -> R) -> Observable {
41 | return _map(source: self, transform: transform)
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObservableConvertibleType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 9/17/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Type that can be converted to observable sequence (`Observable`).
10 | public protocol ObservableConvertibleType {
11 | /// Type of elements in sequence.
12 | associatedtype E
13 |
14 | /// Converts `self` to `Observable` sequence.
15 | ///
16 | /// - returns: Observable sequence that represents `self`.
17 | func asObservable() -> Observable
18 | }
19 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observables/Empty.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Empty.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 8/30/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | extension ObservableType {
10 | /**
11 | Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message.
12 |
13 | - seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
14 |
15 | - returns: An observable sequence with no elements.
16 | */
17 | public static func empty() -> Observable {
18 | return EmptyProducer()
19 | }
20 | }
21 |
22 | final fileprivate class EmptyProducer : Producer {
23 | override func subscribe(_ observer: O) -> Disposable where O.E == Element {
24 | observer.on(.completed)
25 | return Disposables.create()
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observables/Error.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Error.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 8/30/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | extension ObservableType {
10 | /**
11 | Returns an observable sequence that terminates with an `error`.
12 |
13 | - seealso: [throw operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
14 |
15 | - returns: The observable sequence that terminates with specified error.
16 | */
17 | public static func error(_ error: Swift.Error) -> Observable {
18 | return ErrorProducer(error: error)
19 | }
20 | }
21 |
22 | final fileprivate class ErrorProducer : Producer {
23 | private let _error: Swift.Error
24 |
25 | init(error: Swift.Error) {
26 | _error = error
27 | }
28 |
29 | override func subscribe(_ observer: O) -> Disposable where O.E == Element {
30 | observer.on(.error(_error))
31 | return Disposables.create()
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observables/First.swift:
--------------------------------------------------------------------------------
1 | //
2 | // First.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 7/31/17.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | fileprivate final class FirstSink : Sink, ObserverType where O.E == Element? {
10 | typealias E = Element
11 | typealias Parent = First
12 |
13 | func on(_ event: Event) {
14 | switch event {
15 | case .next(let value):
16 | forwardOn(.next(value))
17 | forwardOn(.completed)
18 | dispose()
19 | case .error(let error):
20 | forwardOn(.error(error))
21 | dispose()
22 | case .completed:
23 | forwardOn(.next(nil))
24 | forwardOn(.completed)
25 | dispose()
26 | }
27 | }
28 | }
29 |
30 | final class First: Producer {
31 | fileprivate let _source: Observable
32 |
33 | init(source: Observable) {
34 | _source = source
35 | }
36 |
37 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element? {
38 | let sink = FirstSink(observer: observer, cancel: cancel)
39 | let subscription = _source.subscribe(sink)
40 | return (sink: sink, subscription: subscription)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observables/Never.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Never.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 8/30/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | extension ObservableType {
10 |
11 | /**
12 | Returns a non-terminating observable sequence, which can be used to denote an infinite duration.
13 |
14 | - seealso: [never operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html)
15 |
16 | - returns: An observable sequence whose observers will never get called.
17 | */
18 | public static func never() -> Observable {
19 | return NeverProducer()
20 | }
21 | }
22 |
23 | final fileprivate class NeverProducer : Producer {
24 | override func subscribe(_ observer: O) -> Disposable where O.E == Element {
25 | return Disposables.create()
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observables/StartWith.swift:
--------------------------------------------------------------------------------
1 | //
2 | // StartWith.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 4/6/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | extension ObservableType {
10 |
11 | /**
12 | Prepends a sequence of values to an observable sequence.
13 |
14 | - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html)
15 |
16 | - parameter elements: Elements to prepend to the specified sequence.
17 | - returns: The source sequence prepended with the specified values.
18 | */
19 | public func startWith(_ elements: E ...)
20 | -> Observable {
21 | return StartWith(source: self.asObservable(), elements: elements)
22 | }
23 | }
24 |
25 | final fileprivate class StartWith: Producer {
26 | let elements: [Element]
27 | let source: Observable
28 |
29 | init(source: Observable, elements: [Element]) {
30 | self.source = source
31 | self.elements = elements
32 | super.init()
33 | }
34 |
35 | override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element {
36 | for e in elements {
37 | observer.on(.next(e))
38 | }
39 |
40 | return (sink: Disposables.create(), subscription: source.subscribe(observer))
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/ObserverType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObserverType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/8/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Supports push-style iteration over an observable sequence.
10 | public protocol ObserverType {
11 | /// The type of elements in sequence that observer can observe.
12 | associatedtype E
13 |
14 | /// Notify observer about sequence event.
15 | ///
16 | /// - parameter event: Event that occurred.
17 | func on(_ event: Event)
18 | }
19 |
20 | /// Convenience API extensions to provide alternate next, error, completed events
21 | extension ObserverType {
22 |
23 | /// Convenience method equivalent to `on(.next(element: E))`
24 | ///
25 | /// - parameter element: Next element to send to observer(s)
26 | public func onNext(_ element: E) {
27 | on(.next(element))
28 | }
29 |
30 | /// Convenience method equivalent to `on(.completed)`
31 | public func onCompleted() {
32 | on(.completed)
33 | }
34 |
35 | /// Convenience method equivalent to `on(.error(Swift.Error))`
36 | /// - parameter error: Swift.Error to send to observer(s)
37 | public func onError(_ error: Swift.Error) {
38 | on(.error(error))
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnonymousObserver.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/8/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | final class AnonymousObserver : ObserverBase {
10 | typealias Element = ElementType
11 |
12 | typealias EventHandler = (Event) -> Void
13 |
14 | private let _eventHandler : EventHandler
15 |
16 | init(_ eventHandler: @escaping EventHandler) {
17 | #if TRACE_RESOURCES
18 | let _ = Resources.incrementTotal()
19 | #endif
20 | _eventHandler = eventHandler
21 | }
22 |
23 | override func onCore(_ event: Event) {
24 | return _eventHandler(event)
25 | }
26 |
27 | #if TRACE_RESOURCES
28 | deinit {
29 | let _ = Resources.decrementTotal()
30 | }
31 | #endif
32 | }
33 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ObserverBase.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 2/15/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | class ObserverBase : Disposable, ObserverType {
10 | typealias E = ElementType
11 |
12 | private var _isStopped: AtomicInt = 0
13 |
14 | func on(_ event: Event) {
15 | switch event {
16 | case .next:
17 | if _isStopped == 0 {
18 | onCore(event)
19 | }
20 | case .error, .completed:
21 | if AtomicCompareAndSwap(0, 1, &_isStopped) {
22 | onCore(event)
23 | }
24 | }
25 | }
26 |
27 | func onCore(_ event: Event) {
28 | rxAbstractMethod()
29 | }
30 |
31 | func dispose() {
32 | _ = AtomicCompareAndSwap(0, 1, &_isStopped)
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/RxMutableBox.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RxMutableBox.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 5/22/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Creates mutable reference wrapper for any type.
10 | final class RxMutableBox : CustomDebugStringConvertible {
11 | /// Wrapped value
12 | var value : T
13 |
14 | /// Creates reference wrapper for `value`.
15 | ///
16 | /// - parameter value: Value to wrap.
17 | init (_ value: T) {
18 | self.value = value
19 | }
20 | }
21 |
22 | extension RxMutableBox {
23 | /// - returns: Box description.
24 | var debugDescription: String {
25 | return "MutatingBox(\(self.value))"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HistoricalScheduler.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 12/27/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import struct Foundation.Date
10 |
11 | /// Provides a virtual time scheduler that uses `Date` for absolute time and `NSTimeInterval` for relative time.
12 | public class HistoricalScheduler : VirtualTimeScheduler {
13 |
14 | /**
15 | Creates a new historical scheduler with initial clock value.
16 |
17 | - parameter initialClock: Initial value for virtual clock.
18 | */
19 | public init(initialClock: RxTime = Date(timeIntervalSince1970: 0)) {
20 | super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter())
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // InvocableScheduledItem.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 11/7/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | struct InvocableScheduledItem : InvocableType {
10 |
11 | let _invocable: I
12 | let _state: I.Value
13 |
14 | init(invocable: I, state: I.Value) {
15 | _invocable = invocable
16 | _state = state
17 | }
18 |
19 | func invoke() {
20 | _invocable.invoke(_state)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // InvocableType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 11/7/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol InvocableType {
10 | func invoke()
11 | }
12 |
13 | protocol InvocableWithValueType {
14 | associatedtype Value
15 |
16 | func invoke(_ value: Value)
17 | }
18 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ScheduledItem.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 9/2/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | struct ScheduledItem
10 | : ScheduledItemType
11 | , InvocableType {
12 | typealias Action = (T) -> Disposable
13 |
14 | private let _action: Action
15 | private let _state: T
16 |
17 | private let _disposable = SingleAssignmentDisposable()
18 |
19 | var isDisposed: Bool {
20 | return _disposable.isDisposed
21 | }
22 |
23 | init(action: @escaping Action, state: T) {
24 | _action = action
25 | _state = state
26 | }
27 |
28 | func invoke() {
29 | _disposable.setDisposable(_action(_state))
30 | }
31 |
32 | func dispose() {
33 | _disposable.dispose()
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ScheduledItemType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 11/7/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | protocol ScheduledItemType
10 | : Cancelable
11 | , InvocableType {
12 | func invoke()
13 | }
14 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SubjectType.swift
3 | // RxSwift
4 | //
5 | // Created by Krunoslav Zaher on 3/1/15.
6 | // Copyright © 2015 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | /// Represents an object that is both an observable sequence as well as an observer.
10 | public protocol SubjectType : ObservableType {
11 | /// The type of the observer that represents this subject.
12 | ///
13 | /// Usually this type is type of subject itself, but it doesn't have to be.
14 | associatedtype SubjectObserverType : ObserverType
15 |
16 | /// Returns observer interface for subject.
17 | ///
18 | /// - returns: Observer interface for subject.
19 | func asObserver() -> SubjectObserverType
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/RxSwift/RxSwift/SwiftSupport/SwiftSupport.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftSupport.swift
3 | // RxSwift
4 | //
5 | // Created by Volodymyr Gorbenko on 3/6/17.
6 | // Copyright © 2017 Krunoslav Zaher. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | #if swift(>=4.0)
12 | typealias IntMax = Int64
13 | public typealias RxAbstractInteger = FixedWidthInteger
14 |
15 | extension SignedInteger {
16 | func toIntMax() -> IntMax {
17 | return IntMax(self)
18 | }
19 | }
20 | #else
21 | public typealias RxAbstractInteger = SignedInteger
22 |
23 | extension Array {
24 | public mutating func swapAt(_ i: Int, _ j: Int) {
25 | swap(&self[i], &self[j])
26 | }
27 | }
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Differentiator-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Differentiator : NSObject
3 | @end
4 | @implementation PodsDummy_Differentiator
5 | @end
6 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Differentiator-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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Differentiator-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 DifferentiatorVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char DifferentiatorVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Differentiator.modulemap:
--------------------------------------------------------------------------------
1 | framework module Differentiator {
2 | umbrella header "Differentiator-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Differentiator.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Differentiator
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}/Differentiator
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Differentiator/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/Pods-MVVM-Rx-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_MVVM_Rx : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_MVVM_Rx
5 | @end
6 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/Pods-MVVM-Rx-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_MVVM_RxVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_MVVM_RxVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/Pods-MVVM-Rx.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Differentiator" "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa" "$PODS_CONFIGURATION_BUILD_DIR/RxDataSources" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift"
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/Differentiator/Differentiator.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa/RxCocoa.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxDataSources/RxDataSources.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Differentiator" -framework "RxCocoa" -framework "RxDataSources" -framework "RxSwift"
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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/Pods-MVVM-Rx.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_MVVM_Rx {
2 | umbrella header "Pods-MVVM-Rx-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/Pods-MVVM-Rx/Pods-MVVM-Rx.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Differentiator" "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa" "$PODS_CONFIGURATION_BUILD_DIR/RxDataSources" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift"
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/Differentiator/Differentiator.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa/RxCocoa.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxDataSources/RxDataSources.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/RxSwift/RxSwift.framework/Headers"
6 | OTHER_LDFLAGS = $(inherited) -framework "Differentiator" -framework "RxCocoa" -framework "RxDataSources" -framework "RxSwift"
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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/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 | 4.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/RxCocoa-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_RxCocoa : NSObject
3 | @end
4 | @implementation PodsDummy_RxCocoa
5 | @end
6 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/RxCocoa-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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/RxCocoa-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 "RxCocoa.h"
14 | #import "RxCocoaRuntime.h"
15 | #import "_RX.h"
16 | #import "_RXDelegateProxy.h"
17 | #import "_RXKVOObserver.h"
18 | #import "_RXObjCRuntime.h"
19 |
20 | FOUNDATION_EXPORT double RxCocoaVersionNumber;
21 | FOUNDATION_EXPORT const unsigned char RxCocoaVersionString[];
22 |
23 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/RxCocoa.modulemap:
--------------------------------------------------------------------------------
1 | framework module RxCocoa {
2 | umbrella header "RxCocoa-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxCocoa/RxCocoa.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/RxCocoa
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/RxSwift"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
5 | OTHER_SWIFT_FLAGS = $(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}/RxCocoa
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.1
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/RxDataSources-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_RxDataSources : NSObject
3 | @end
4 | @implementation PodsDummy_RxDataSources
5 | @end
6 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/RxDataSources-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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/RxDataSources-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 RxDataSourcesVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char RxDataSourcesVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/RxDataSources.modulemap:
--------------------------------------------------------------------------------
1 | framework module RxDataSources {
2 | umbrella header "RxDataSources-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxDataSources/RxDataSources.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/RxDataSources
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Differentiator" "$PODS_CONFIGURATION_BUILD_DIR/RxCocoa" "$PODS_CONFIGURATION_BUILD_DIR/RxSwift"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
5 | OTHER_SWIFT_FLAGS = $(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}/RxDataSources
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/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 | 4.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/RxSwift-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_RxSwift : NSObject
3 | @end
4 | @implementation PodsDummy_RxSwift
5 | @end
6 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/RxSwift-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 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/RxSwift-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 RxSwiftVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char RxSwiftVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/RxSwift.modulemap:
--------------------------------------------------------------------------------
1 | framework module RxSwift {
2 | umbrella header "RxSwift-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/MVVM-Rx/Pods/Target Support Files/RxSwift/RxSwift.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/RxSwift
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}/RxSwift
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # iOS-Architecture-Sample
2 | iOS Architecture Design Pattern Sample Code (MVC, MVP, MVVM, VIPER)
3 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code.xcodeproj/xcuserdata/giftbot.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | VIPER-Code.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 5295B67C1F8BE34000743434
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // VIPER-Code
4 | //
5 | // Created by giftbot on 2017. 10. 10..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | setupAppWireframe()
18 | return true
19 | }
20 |
21 | private func setupAppWireframe() {
22 | window = UIWindow(frame: UIScreen.main.bounds)
23 | let setting = ServiceSetting.decode()
24 | let repositoriesView = RepositoriesWireframe.createModule(serviceSetting: setting)
25 | AppWireframe.shared.setupKeyWindow(window!, viewController: repositoriesView)
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/AppWireframe.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppWireframe.swift
3 | // VIPER-Code
4 | //
5 | // Created by giftbot on 2017. 10. 16..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class AppWireframe: BaseWireframe {
12 | static let shared = AppWireframe()
13 | private override init() { }
14 |
15 | weak var window: UIWindow!
16 |
17 | func setupKeyWindow(_ window: UIWindow, viewController: UIViewController) {
18 | self.window = window
19 | let navigationController = UINavigationController(rootViewController: viewController)
20 | show(navigationController, with: .root(window: window))
21 | window.makeKeyAndVisible()
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Model/Repository.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Repository.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 9. 27..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | // MARK: Repository
12 |
13 | struct Repository: Decodable {
14 | let fullName: String
15 | let description: String?
16 | let starCount: Int
17 | let forkCount: Int
18 | let url: String
19 |
20 | enum CodingKeys: String, CodingKey {
21 | case fullName = "full_name"
22 | case description = "description"
23 | case starCount = "stargazers_count"
24 | case forkCount = "forks_count"
25 | case url = "html_url"
26 | }
27 | }
28 |
29 | // MARK: Repositories
30 |
31 | struct Repositories: Decodable {
32 | let items: [Repository]
33 | enum CodingKeys: String, CodingKey {
34 | case items
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Base/BasePresenter.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BasePresenter.swift
3 | // VIPER-Code
4 | //
5 | // Created by giftbot on 2017. 10. 12..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol BasePresenterProtocol: class {
12 | func onViewDidLoad()
13 | }
14 |
15 | extension BasePresenterProtocol {
16 | func onViewDidLoad() { }
17 | }
18 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Base/BaseViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.swift
3 | // VIPER-Code
4 | //
5 | // Created by giftbot on 2017. 10. 10..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class BaseViewController: UIViewController {
12 |
13 | // MARK: Initialize
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 | setupUI()
18 | setupBinding()
19 | }
20 |
21 | func setupUI() {
22 | // Override
23 | }
24 |
25 | func setupBinding() {
26 | // Override
27 | }
28 |
29 | // MARK: Memory Warning & Deinit
30 |
31 | override func didReceiveMemoryWarning() {
32 | // print("\(self) did Receive Memory Warning")
33 | }
34 |
35 | deinit {
36 | // print("\(self) has deinitialized")
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Base/Router.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Router.swift
3 | // NewViperTest
4 | //
5 | // Created by giftbot on 2017. 10. 15..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | enum Router {
12 | enum Repositories {
13 | case editSetting(_: ServiceSetting, completion: (ServiceSetting)->())
14 | case repository(url: URL)
15 | case alert(title: String, message: String)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Base/TransitionType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TransitionType.swift
3 | // NewViperTest
4 | //
5 | // Created by giftbot on 2017. 10. 15..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | enum TransitionType {
12 | case root(window: UIWindow)
13 | case push
14 | case present(from: UIViewController)
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Setting/SettingTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingTableViewCell.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 2..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol SettingCellType {
12 | func setTitleText(_ title: String)
13 | }
14 |
15 | // MARK: - Class Implementation
16 |
17 | final class SettingTableViewCell: UITableViewCell, SettingCellType {
18 |
19 | // MARK: Initialize
20 |
21 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
22 | super.init(style: style, reuseIdentifier: reuseIdentifier)
23 | selectionStyle = .none
24 | }
25 |
26 | required init?(coder aDecoder: NSCoder) {
27 | fatalError("init(coder:) has not been implemented")
28 | }
29 |
30 | // MARK: Configure Selection
31 |
32 | override func setSelected(_ selected: Bool, animated: Bool) {
33 | super.setSelected(selected, animated: animated)
34 | if selected {
35 | accessoryType = .checkmark
36 | textLabel?.font = .boldSystemFont(ofSize: 14)
37 | textLabel?.textColor = .mainColor
38 | } else {
39 | accessoryType = .none
40 | textLabel?.font = .systemFont(ofSize: 13)
41 | textLabel?.textColor = .darkGray
42 | }
43 | }
44 |
45 | // MARK: Cell Contents
46 |
47 | func setTitleText(_ title: String) {
48 | textLabel?.text = title
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Module/Setting/SettingWireframe.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SettingWireframe.swift
3 | // VIPER-Code
4 | //
5 | // Created giftbot on 2017. 10. 15..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol SettingWireframeProtocol: class {
12 | // Presenter -> Wireframe
13 | func popViewController(animated: Bool)
14 | }
15 |
16 | // MARK: - Class Implementation
17 |
18 | final class SettingWireframe: BaseWireframe, SettingWireframeProtocol {
19 |
20 | static func createModule(
21 | serviceSetting: ServiceSetting,
22 | completion: @escaping (ServiceSetting) -> ()
23 | ) -> SettingViewController {
24 | let view = SettingViewController()
25 | let wireframe = SettingWireframe()
26 | let interactor = SettingInteractor(serviceSetting: serviceSetting)
27 | let presenter = SettingPresenter(view: view, wireframe: wireframe, interactor: interactor, completion: completion)
28 |
29 | view.presenter = presenter
30 | wireframe.view = view
31 | interactor.presenter = presenter
32 |
33 | return view
34 | }
35 |
36 | func popViewController(animated: Bool) {
37 | pop(animated: true)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "btn_setting.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "btn_setting@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "btn_setting@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@2x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/btn_setting.imageset/btn_setting@3x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_fork.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_fork@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_fork@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@2x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_fork.imageset/img_fork@3x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "img_star.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "img_star@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "img_star@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star@2x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/giftbott/iOS-Architecture-Sample/8d28cbb4f04fc840f39648a397cccc660ec909a5/VIPER-Code/VIPER-Code/Resources/Assets.xcassets/img_star.imageset/img_star@3x.png
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 |
33 | UISupportedInterfaceOrientations~ipad
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationPortraitUpsideDown
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Service/GitHubServiceType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GitHubServiceType.swift
3 | // VIPER-Code
4 | //
5 | // Created by giftbot on 2017. 10. 15..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol GitHubServiceType {
12 | func fetchGitHubRepositories(
13 | by setting: ServiceSetting,
14 | completion: @escaping (Result<[Repository]>) -> ()
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Service/ServiceResult.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceResult.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 3..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | enum Result {
12 | case success(T)
13 | case error(Error)
14 | }
15 |
16 | enum ServiceError: Error {
17 | case unknown
18 | case urlTransformFailed
19 | case requestFailed(response: URLResponse, data: Data?)
20 | }
21 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Utility/Cell+TableViewCellType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Cell+TableViewCellType.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 11. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | protocol TableViewCellType {
12 | static var identifier: String { get }
13 | }
14 |
15 | extension UITableViewCell: TableViewCellType {
16 | static var identifier: String { return String(describing: self.self) }
17 | }
18 |
19 | extension UITableView {
20 | func register(
21 | cell: Cell.Type,
22 | forCellReuseIdentifier reuseIdentifier: String = Cell.identifier
23 | ) where Cell: UITableViewCell {
24 | register(cell, forCellReuseIdentifier: reuseIdentifier)
25 | }
26 |
27 | func dequeue(_ reusableCell: Cell.Type) -> Cell? where Cell: UITableViewCell {
28 | return dequeueReusableCell(withIdentifier: reusableCell.identifier) as? Cell
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Utility/Data+Decode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Data+Decode.swift
3 | // MVVM-Rx
4 | //
5 | // Created by giftbot on 2017. 10. 25..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | extension Data {
12 | func decode(_ type: T.Type, decoder: JSONDecoder? = nil) throws -> T where T: Decodable {
13 | let decoder = decoder ?? JSONDecoder()
14 | return try decoder.decode(type, from: self)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Utility/UIColor+BaseColor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIColorExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 4..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIColor {
12 | static var mainColor: UIColor { return UIColor(red: 0, green: 0.44, blue: 1, alpha: 1) }
13 | }
14 |
--------------------------------------------------------------------------------
/VIPER-Code/VIPER-Code/Utility/UIView+SubView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewExtensions.swift
3 | // MVC-Code
4 | //
5 | // Created by giftbot on 2017. 10. 1..
6 | // Copyright © 2017년 giftbot. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | extension UIView {
12 | func addSubviews(_ views: [UIView]) {
13 | for view in views {
14 | addSubview(view)
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
| | | | | | | | |