This file contains hidden or 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
private let dataSource = RxTableViewSectionedReloadDataSource<RepoSectionModel>( | |
configureCell: { _, tableView, indexPath, model in | |
guard | |
let cell = tableView.dequeueReusableCell( | |
withIdentifier: "\(RepoTableViewCell.self)", | |
for: indexPath | |
) as? RepoTableViewCell | |
else { | |
return UITableViewCell() | |
} |
This file contains hidden or 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
// MARK: - public | |
extension RepoTableViewCell { | |
func configCell(repo: Repo) { | |
self.titleLabel.text = repo.fullName | |
self.subTitleLabel.text = repo.description | |
} | |
} |
This file contains hidden or 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
// | |
// ViewController.swift | |
// GithubSearch_VIPER | |
// | |
// Created by 융융 on 2021/02/27. | |
// | |
import UIKit | |
import SnapKit |
This file contains hidden or 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
// | |
// RepoTableViewCell.swift | |
// GithubSearch_VIPER | |
// | |
// Created by 융융 on 2021/03/28. | |
// | |
import UIKit | |
final class RepoTableViewCell: UITableViewCell { |
This file contains hidden or 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
override func viewDidLoad() { | |
super.viewDidLoad() | |
GithubService() | |
.searchRepos(with: "rxSwift") | |
.compactMap { $0 } | |
.subscribe(onNext: { repos in | |
for repo in repos { | |
print(repo.fullName) | |
} |
This file contains hidden or 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
// | |
// GithubService.swift | |
// GithubSearch_VIPER | |
// | |
// Created by 융융 on 2021/02/28. | |
// | |
import RxSwift | |
import Alamofire | |
import SwiftyJSON |
This file contains hidden or 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
// | |
// Repo.swift | |
// GithubSearch_VIPER | |
// | |
// Created by 융융 on 2021/02/28. | |
// | |
import Foundation | |
import ObjectMapper |
This file contains hidden or 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
// appDelegate.swift or SceneDelegate.swift | |
guard let windowScene = (scene as? UIWindowScene) else { return } | |
self.window = UIWindow(frame: windowScene.coordinateSpace.bounds) | |
self.window?.windowScene = windowScene | |
let viewController = SearchRouter.createModule() | |
let navigationController = UINavigationController(rootViewController: viewController) | |
self.window?.rootViewController = navigationController | |
self.window?.makeKeyAndVisible() |
This file contains hidden or 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
import UIKit | |
import SnapKit | |
import Then | |
final class SearchView: UIViewController { | |
var presenter: SearchPresenterProtocol? | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains hidden or 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
import UIKit | |
final class SearchRouter { } | |
extension SearchRouter: SearchRouterProtocol { | |
static func createModule() -> SearchView { | |
let view = SearchView() | |
let presenter = SearchPresenter() | |
let interactor = SearchInteractor() | |
let router = SearchRouter() |
NewerOlder