Skip to content

Commit

Permalink
Merge pull request #86 from 87kangsw/release/2.2.0
Browse files Browse the repository at this point in the history
Release - 2.2.0
  • Loading branch information
87kangsw authored Jul 16, 2023
2 parents dad6a2c + 51ffa1c commit c2b1599
Show file tree
Hide file tree
Showing 74 changed files with 834 additions and 5,560 deletions.
2 changes: 1 addition & 1 deletion BuildScripts/FirebaseCrashlytics.sh
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
9 changes: 3 additions & 6 deletions GitTime/Sources/CompositionRoot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@

import UIKit

import Bagel
import Firebase
import Kingfisher
import Pure
import RxCocoa
import RxDataSources
import RxMoya
import RxOptional
import RxSwift
import SwiftyBeaver
import Toaster
import URLNavigator
import SnapKit

let log = SwiftyBeaver.self

Expand Down Expand Up @@ -139,9 +138,7 @@ final class CompositionRoot {
let console = ConsoleDestination()
console.minLevel = .verbose
log.addDestination(console)

// Bagel
Bagel.start()

#endif
}

Expand Down
3 changes: 3 additions & 0 deletions GitTime/Sources/Network/AppStoreAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import Moya
import RxMoya
import RxSwift

enum AppStoreAPI {
Expand Down
3 changes: 3 additions & 0 deletions GitTime/Sources/Network/GitHubAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import Moya
import RxMoya
import RxSwift

enum GitHubAPI {
Expand Down
3 changes: 3 additions & 0 deletions GitTime/Sources/Network/GitHubLoginAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import Moya
import RxMoya
import RxSwift

enum GitHubLoginAPI {
Expand Down
5 changes: 4 additions & 1 deletion GitTime/Sources/Network/GitTimeCralwerAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import RxSwift
import Foundation

import Moya
import RxMoya
import RxSwift

enum GitTimeCrawlerAPI {
case trendingRepositories(language: String?, period: String?, spokenLanguage: String?)
Expand Down
4 changes: 4 additions & 0 deletions GitTime/Sources/Network/GitTimeProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation
import UIKit

import Moya
import RxMoya
import RxSwift
import Toaster

Expand Down
3 changes: 3 additions & 0 deletions GitTime/Sources/Network/Plugins/AuthPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import Moya
import RxMoya

struct AuthPlugin: PluginType {

Expand Down
40 changes: 0 additions & 40 deletions GitTime/Sources/Protocols/CellType.swift

This file was deleted.

45 changes: 0 additions & 45 deletions GitTime/Sources/Sections/SearchResultsSection.swift

This file was deleted.

2 changes: 2 additions & 0 deletions GitTime/Sources/Services/ActivityService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import RxSwift

protocol ActivityServiceType {
Expand Down
1 change: 1 addition & 0 deletions GitTime/Sources/Services/AuthService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import AuthenticationServices
import Foundation

import Firebase
import FirebaseAuth
import RxSwift

Expand Down
2 changes: 2 additions & 0 deletions GitTime/Sources/Services/FollowService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import Foundation

import RxSwift

protocol FollowServiceType: AnyObject {
Expand Down
6 changes: 5 additions & 1 deletion GitTime/Sources/Services/GitTimeCrawlerService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import RxSwift
import Foundation
import UIKit

import Moya
import RxMoya
import RxSwift

protocol GitTimeCrawlerServiceType: AnyObject {
func fetchTrendingRepositories(language: String?, period: String?, spokenLanguage: String?) -> Observable<[TrendRepo]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// https://gist.github.com/RyogaK/41f55c88250d5882f0e7d10240c4c866

import Foundation
import UIKit

import RxSwift

protocol RxAlertActionType {
Expand Down
22 changes: 22 additions & 0 deletions GitTime/Sources/Utils/Extensions/Rx/UICollectionView+Rx.swift
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)
}
}

2 changes: 2 additions & 0 deletions GitTime/Sources/Utils/Extensions/Rx/UITableView+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2019 KanzDevelop. All rights reserved.
//

import UIKit

import RxCocoa
import RxDataSources
import RxSwift
Expand Down
3 changes: 3 additions & 0 deletions GitTime/Sources/Utils/Extensions/Rx/UIViewController+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// Created by Jörn Schoppe on 28.10.17.
//

import UIKit

import RxSwift
import RxCocoa

Expand Down
105 changes: 105 additions & 0 deletions GitTime/Sources/Utils/External/ReusableKit/README.md
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.
Loading

0 comments on commit c2b1599

Please sign in to comment.