Skip to content

Commit

Permalink
Add extensions for easily using RxSwift
Browse files Browse the repository at this point in the history
  • Loading branch information
tokijh committed Aug 14, 2018
1 parent 5c03614 commit 8216671
Show file tree
Hide file tree
Showing 18 changed files with 542 additions and 1 deletion.
19 changes: 19 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2018 tokijh <tokijh@naver.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
14 changes: 14 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'RxSwiftExtensions' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

# Pods for RxSwiftExtensions
pod 'RxSwift', '~> 4.0'
pod 'RxCocoa', '~> 4.0'
pod 'RxOptional', '~> 3.5'
pod 'RxSwiftDo', '~> 1.1'

end
32 changes: 32 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PODS:
- RxCocoa (4.2.0):
- RxSwift (~> 4.0)
- RxOptional (3.5.0):
- RxCocoa (~> 4.0)
- RxSwift (~> 4.0)
- RxSwift (4.2.0)
- RxSwiftDo (1.1):
- RxSwift (>= 4.0.0)

DEPENDENCIES:
- RxCocoa (~> 4.0)
- RxOptional (~> 3.5)
- RxSwift (~> 4.0)
- RxSwiftDo (~> 1.1)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- RxCocoa
- RxOptional
- RxSwift
- RxSwiftDo

SPEC CHECKSUMS:
RxCocoa: 0b54909c902e1e581212a03e690bbd94032d8baa
RxOptional: bd32ff8ca9df4177683d56ffeb618a9d4d5d5cad
RxSwift: 99e10317ddfcc7fbe01356aafd118fde4a0be104
RxSwiftDo: d51f6cf99b6e4f8c00534cf99c44007d7361158d

PODFILE CHECKSUM: 0282ece30a6498815b1454b022eb4e7987987e51

COCOAPODS: 1.5.2
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# RxSwiftExtensions

[![Swift 4.2](https://img.shields.io/badge/swift-4.2-orange.svg?style=flat)](https://swift.org)

Frequently used extensoins in RxSwift

## Functions
- Swift
- KVO
- [x] `observe(keyPath: KeyPath)`
- [x] `observeWeakly(keyPath: KeyPath)`
- UIKit
- UIView
- [x] `bounds: Observable<CGRect>`
- [x] `center: Observable<CGPoint>`
- UILabel
- [x] `textColor: Observable<UIColor?>`
- UITextView
- [x] `textColor: Observable<UIColor?>`
- UIScrollView
- [x] `contentSize: Observable<CGSize>`
- [x] `scrollableVertical: Observable<Bool>`
- [x] `scrollableHorizontal: Observable<Bool>`
- UITableView
- [x] `register(cell: UITableViewCell.self)`
- [x] `register(nibCell: UITableViewCell.self)`
- [x] `register(cell: UITableViewHeaderFooterView.self)`
- [x] `register(nibCell: UITableViewHeaderFooterView.self)`
- [x] `dequeue(UITableViewCell.self, indexPath: IndexPath)`
- [x] `dequeue(UITableViewHeaderFooterView.self, indexPath: IndexPath)`
- UITableViewCell
- [x] `Identifier: String`
- UITableViewHeaderFooterView
- [x] `Identifier: String`
- UICollectionView
- [x] `register(cell: UICollectionViewCell.self)`
- [x] `register(nibCell: UICollectionViewCell.self)`
- [x] `register(cell: UICollectionReusableView.self, forSupplementaryViewOfKind kind: String)`
- [x] `register(nibCell: UICollectionReusableView.self, forSupplementaryViewOfKind kind: String)`
- [x] `dequeue(UICollectionViewCell.self, for indexPath: IndexPath)`
- [x] `dequeue(UICollectionViewCell.self, ofKind kind: String, for indexPath: IndexPath)`
- UICollectionReusableView
- [x] `Identifier: String`

## Author
[tokijh](https://github.com/tokijh)

## License
RxSwiftExtensions is available under the MIT License See the [LICENSE](LICENSE) file for more info.

168 changes: 168 additions & 0 deletions RxSwiftExtensions.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,79 @@
objects = {

/* Begin PBXBuildFile section */
9D51BCE16115BA46A8CE054B /* Pods_RxSwiftExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F85474B07AB3A7EF690DA26 /* Pods_RxSwiftExtensions.framework */; };
CDB5A7172122DD6A001DB39B /* RxSwiftExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = CDB5A7152122DD6A001DB39B /* RxSwiftExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; };
CDB5A7332122DDD4001DB39B /* KVO.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A71F2122DDD4001DB39B /* KVO.swift */; };
CDB5A7342122DDD4001DB39B /* UIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7232122DDD4001DB39B /* UIView.swift */; };
CDB5A7352122DDD4001DB39B /* UIScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7252122DDD4001DB39B /* UIScrollView.swift */; };
CDB5A7362122DDD4001DB39B /* UILabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7272122DDD4001DB39B /* UILabel.swift */; };
CDB5A7372122DDD4001DB39B /* UITextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7292122DDD4001DB39B /* UITextView.swift */; };
CDB5A7382122DDD4001DB39B /* CollectionViewCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A72B2122DDD4001DB39B /* CollectionViewCellType.swift */; };
CDB5A7392122DDD4001DB39B /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A72C2122DDD4001DB39B /* UICollectionView.swift */; };
CDB5A73A2122DDD4001DB39B /* UICollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A72D2122DDD4001DB39B /* UICollectionReusableView.swift */; };
CDB5A73B2122DDD4001DB39B /* UITableViewHeaderFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A72F2122DDD4001DB39B /* UITableViewHeaderFooterView.swift */; };
CDB5A73C2122DDD4001DB39B /* UITableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7302122DDD4001DB39B /* UITableView.swift */; };
CDB5A73D2122DDD4001DB39B /* UITableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7312122DDD4001DB39B /* UITableViewCell.swift */; };
CDB5A73E2122DDD4001DB39B /* TableViewCellType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB5A7322122DDD4001DB39B /* TableViewCellType.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
2F85474B07AB3A7EF690DA26 /* Pods_RxSwiftExtensions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RxSwiftExtensions.framework; sourceTree = BUILT_PRODUCTS_DIR; };
52DEE5AAECDF48D200F246BA /* Pods-RxSwiftExtensions.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxSwiftExtensions.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxSwiftExtensions/Pods-RxSwiftExtensions.release.xcconfig"; sourceTree = "<group>"; };
574C6916EBC97E1CA06977B3 /* Pods-RxSwiftExtensions.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxSwiftExtensions.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxSwiftExtensions/Pods-RxSwiftExtensions.debug.xcconfig"; sourceTree = "<group>"; };
CDB5A7122122DD6A001DB39B /* RxSwiftExtensions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwiftExtensions.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CDB5A7152122DD6A001DB39B /* RxSwiftExtensions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RxSwiftExtensions.h; sourceTree = "<group>"; };
CDB5A7162122DD6A001DB39B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CDB5A71F2122DDD4001DB39B /* KVO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KVO.swift; sourceTree = "<group>"; };
CDB5A7232122DDD4001DB39B /* UIView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIView.swift; sourceTree = "<group>"; };
CDB5A7252122DDD4001DB39B /* UIScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIScrollView.swift; sourceTree = "<group>"; };
CDB5A7272122DDD4001DB39B /* UILabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UILabel.swift; sourceTree = "<group>"; };
CDB5A7292122DDD4001DB39B /* UITextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITextView.swift; sourceTree = "<group>"; };
CDB5A72B2122DDD4001DB39B /* CollectionViewCellType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewCellType.swift; sourceTree = "<group>"; };
CDB5A72C2122DDD4001DB39B /* UICollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICollectionView.swift; sourceTree = "<group>"; };
CDB5A72D2122DDD4001DB39B /* UICollectionReusableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICollectionReusableView.swift; sourceTree = "<group>"; };
CDB5A72F2122DDD4001DB39B /* UITableViewHeaderFooterView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableViewHeaderFooterView.swift; sourceTree = "<group>"; };
CDB5A7302122DDD4001DB39B /* UITableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableView.swift; sourceTree = "<group>"; };
CDB5A7312122DDD4001DB39B /* UITableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableViewCell.swift; sourceTree = "<group>"; };
CDB5A7322122DDD4001DB39B /* TableViewCellType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCellType.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
CDB5A70E2122DD6A001DB39B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9D51BCE16115BA46A8CE054B /* Pods_RxSwiftExtensions.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
374C07B007F1FFA01F593FFE /* Frameworks */ = {
isa = PBXGroup;
children = (
2F85474B07AB3A7EF690DA26 /* Pods_RxSwiftExtensions.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
BB81239F23571EC335CB9DF9 /* Pods */ = {
isa = PBXGroup;
children = (
574C6916EBC97E1CA06977B3 /* Pods-RxSwiftExtensions.debug.xcconfig */,
52DEE5AAECDF48D200F246BA /* Pods-RxSwiftExtensions.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
CDB5A7082122DD6A001DB39B = {
isa = PBXGroup;
children = (
CDB5A7142122DD6A001DB39B /* RxSwiftExtensions */,
CDB5A7132122DD6A001DB39B /* Products */,
BB81239F23571EC335CB9DF9 /* Pods */,
374C07B007F1FFA01F593FFE /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -48,10 +96,94 @@
children = (
CDB5A7152122DD6A001DB39B /* RxSwiftExtensions.h */,
CDB5A7162122DD6A001DB39B /* Info.plist */,
CDB5A71D2122DDD4001DB39B /* Swift */,
CDB5A7212122DDD4001DB39B /* UIKit */,
);
path = RxSwiftExtensions;
sourceTree = "<group>";
};
CDB5A71D2122DDD4001DB39B /* Swift */ = {
isa = PBXGroup;
children = (
CDB5A71E2122DDD4001DB39B /* KVO */,
);
path = Swift;
sourceTree = "<group>";
};
CDB5A71E2122DDD4001DB39B /* KVO */ = {
isa = PBXGroup;
children = (
CDB5A71F2122DDD4001DB39B /* KVO.swift */,
);
path = KVO;
sourceTree = "<group>";
};
CDB5A7212122DDD4001DB39B /* UIKit */ = {
isa = PBXGroup;
children = (
CDB5A7222122DDD4001DB39B /* UIView */,
);
path = UIKit;
sourceTree = "<group>";
};
CDB5A7222122DDD4001DB39B /* UIView */ = {
isa = PBXGroup;
children = (
CDB5A7232122DDD4001DB39B /* UIView.swift */,
CDB5A7242122DDD4001DB39B /* UIScrollView */,
CDB5A7262122DDD4001DB39B /* UILabel */,
CDB5A7282122DDD4001DB39B /* UITextView */,
CDB5A72A2122DDD4001DB39B /* UICollectionView */,
CDB5A72E2122DDD4001DB39B /* UITableView */,
);
path = UIView;
sourceTree = "<group>";
};
CDB5A7242122DDD4001DB39B /* UIScrollView */ = {
isa = PBXGroup;
children = (
CDB5A7252122DDD4001DB39B /* UIScrollView.swift */,
);
path = UIScrollView;
sourceTree = "<group>";
};
CDB5A7262122DDD4001DB39B /* UILabel */ = {
isa = PBXGroup;
children = (
CDB5A7272122DDD4001DB39B /* UILabel.swift */,
);
path = UILabel;
sourceTree = "<group>";
};
CDB5A7282122DDD4001DB39B /* UITextView */ = {
isa = PBXGroup;
children = (
CDB5A7292122DDD4001DB39B /* UITextView.swift */,
);
path = UITextView;
sourceTree = "<group>";
};
CDB5A72A2122DDD4001DB39B /* UICollectionView */ = {
isa = PBXGroup;
children = (
CDB5A72B2122DDD4001DB39B /* CollectionViewCellType.swift */,
CDB5A72C2122DDD4001DB39B /* UICollectionView.swift */,
CDB5A72D2122DDD4001DB39B /* UICollectionReusableView.swift */,
);
path = UICollectionView;
sourceTree = "<group>";
};
CDB5A72E2122DDD4001DB39B /* UITableView */ = {
isa = PBXGroup;
children = (
CDB5A72F2122DDD4001DB39B /* UITableViewHeaderFooterView.swift */,
CDB5A7302122DDD4001DB39B /* UITableView.swift */,
CDB5A7312122DDD4001DB39B /* UITableViewCell.swift */,
CDB5A7322122DDD4001DB39B /* TableViewCellType.swift */,
);
path = UITableView;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand All @@ -70,6 +202,7 @@
isa = PBXNativeTarget;
buildConfigurationList = CDB5A71A2122DD6A001DB39B /* Build configuration list for PBXNativeTarget "RxSwiftExtensions" */;
buildPhases = (
71414AECE6B2AB14D31998A8 /* [CP] Check Pods Manifest.lock */,
CDB5A70D2122DD6A001DB39B /* Sources */,
CDB5A70E2122DD6A001DB39B /* Frameworks */,
CDB5A70F2122DD6A001DB39B /* Headers */,
Expand Down Expand Up @@ -125,11 +258,44 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
71414AECE6B2AB14D31998A8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RxSwiftExtensions-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
CDB5A70D2122DD6A001DB39B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
CDB5A7352122DDD4001DB39B /* UIScrollView.swift in Sources */,
CDB5A73B2122DDD4001DB39B /* UITableViewHeaderFooterView.swift in Sources */,
CDB5A73A2122DDD4001DB39B /* UICollectionReusableView.swift in Sources */,
CDB5A7342122DDD4001DB39B /* UIView.swift in Sources */,
CDB5A7392122DDD4001DB39B /* UICollectionView.swift in Sources */,
CDB5A73D2122DDD4001DB39B /* UITableViewCell.swift in Sources */,
CDB5A7372122DDD4001DB39B /* UITextView.swift in Sources */,
CDB5A73E2122DDD4001DB39B /* TableViewCellType.swift in Sources */,
CDB5A7362122DDD4001DB39B /* UILabel.swift in Sources */,
CDB5A73C2122DDD4001DB39B /* UITableView.swift in Sources */,
CDB5A7382122DDD4001DB39B /* CollectionViewCellType.swift in Sources */,
CDB5A7332122DDD4001DB39B /* KVO.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -258,6 +424,7 @@
};
CDB5A71B2122DD6A001DB39B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 574C6916EBC97E1CA06977B3 /* Pods-RxSwiftExtensions.debug.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -283,6 +450,7 @@
};
CDB5A71C2122DD6A001DB39B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 52DEE5AAECDF48D200F246BA /* Pods-RxSwiftExtensions.release.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
Expand Down
2 changes: 1 addition & 1 deletion RxSwiftExtensions/RxSwiftExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RxSwiftExtensions.h
// RxSwiftExtensions
//
// Created by Joonghyun-Yoon on 2018. 8. 14..
// Created by tokijh on 2018. 8. 14..
// Copyright © 2018년 tokijh. All rights reserved.
//

Expand Down
Loading

0 comments on commit 8216671

Please sign in to comment.