-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from 87kangsw/release/2.2.0
Release - 2.2.0
- Loading branch information
Showing
74 changed files
with
834 additions
and
5,560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
${PODS_ROOT}/FirebaseCrashlytics/run | ||
${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
import AuthenticationServices | ||
import Foundation | ||
|
||
import Firebase | ||
import FirebaseAuth | ||
import RxSwift | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
GitTime/Sources/Utils/Extensions/Rx/UICollectionView+Rx.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// UICollectionView+Rx.swift | ||
// GitTime | ||
// | ||
// Created by 강성욱 on 2023/07/16. | ||
// | ||
|
||
import UIKit | ||
|
||
import RxCocoa | ||
import RxDataSources | ||
import RxSwift | ||
|
||
extension Reactive where Base: UICollectionView { | ||
func itemSelected<S>(dataSource: CollectionViewSectionedDataSource<S>) -> ControlEvent<S.Item> { | ||
let source = self.itemSelected.map { indexPath in | ||
dataSource[indexPath] | ||
} | ||
return ControlEvent(events: source) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
// | ||
// Created by Jörn Schoppe on 28.10.17. | ||
// | ||
|
||
import UIKit | ||
|
||
import RxSwift | ||
import RxCocoa | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# ReusableKit | ||
|
||
![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg) | ||
[![CocoaPods](http://img.shields.io/cocoapods/v/ReusableKit.svg)](https://cocoapods.org/pods/ReusableKit) | ||
[![Build Status](https://travis-ci.org/devxoul/ReusableKit.svg)](https://travis-ci.org/devxoul/ReusableKit) | ||
[![Codecov](https://img.shields.io/codecov/c/github/devxoul/ReusableKit.svg)](https://codecov.io/gh/devxoul/ReusableKit) | ||
|
||
Generic reusables for Cocoa. Currently supports `UITableView` and `UICollectionView`. | ||
|
||
## At a Glance | ||
|
||
#### Before 🤢 | ||
|
||
```swift | ||
collectionView.register(UserCell.self, forCellWithReuseIdentifier: "userCell") | ||
collectionView.dequeueReusableCell(withReuseIdentifier: "userCell", for: indexPath) as! UserCell | ||
``` | ||
|
||
1. A hard-coded string identifier can cause a human error. | ||
2. A force downcasting should be avoided. | ||
|
||
#### After 😊 | ||
|
||
```swift | ||
let reusableUserCell = ReusableCell<UserCell>() | ||
collectionView.register(reusableUserCell) | ||
collectionView.dequeue(reusableUserCell) // UserCell | ||
``` | ||
|
||
1. A string identifier is generated automatically using UUID and stored in the struct. | ||
2. A generic can ensure the type of the dequeued cell statically. | ||
|
||
## Example Usage | ||
|
||
It is recommended to define reusable types as a static constants in an `enum` or a `struct`. | ||
|
||
#### UITableView | ||
|
||
```swift | ||
// 1. define | ||
enum Reusable { | ||
static let headerView = ReusableCell<SectionHeaderView>() | ||
static let userCell = ReusableCell<UserCell>() | ||
} | ||
|
||
// 2. register | ||
tableView.register(Reusable.headerView) | ||
tableView.register(Reusable.userCell) | ||
|
||
// 3. dequeue | ||
tableView.dequeue(Reusable.headerView, for: indexPath) | ||
tableView.dequeue(Reusable.userCell, for: indexPath) | ||
``` | ||
|
||
#### UICollectionView | ||
|
||
```swift | ||
// 1. define | ||
enum Reusable { | ||
static let headerView = ReusableCell<SectionHeaderView>() | ||
static let photoCell = ReusableCell<PhotoCell>() | ||
} | ||
|
||
// 2. register | ||
collection.register(Reusable.headerView, kind: .header) | ||
collection.register(Reusable.photoCell) | ||
|
||
// 3. dequeue | ||
collection.dequeue(Reusable.headerView, kind: .header, for: indexPath) | ||
collection.dequeue(Reusable.photoCell, for: indexPath) | ||
``` | ||
|
||
#### RxSwift Extension | ||
|
||
ReusableKit supports a RxSwift extension. | ||
|
||
```swift | ||
users // Observable<[String]> | ||
.bind(to: collectionView.rx.items(Reusable.userCell)) { i, user, cell in | ||
cell.user = user | ||
} | ||
``` | ||
|
||
## Contrubiting | ||
|
||
Pull requests are welcomed 💖 | ||
|
||
In order to create Xcode project, run: | ||
|
||
```console | ||
$ swift package generate-xcodeproj | ||
``` | ||
|
||
## Installation | ||
|
||
- **For iOS 8+ projects** with [CocoaPods](https://cocoapods.org): | ||
|
||
```ruby | ||
pod 'ReusableKit' | ||
pod 'ReusableKit/RxSwift' # with RxSwift extension | ||
``` | ||
|
||
## License | ||
|
||
**ReusableKit** is under MIT license. See the [LICENSE](LICENSE) file for more info. |
Oops, something went wrong.