Created
March 28, 2021 06:11
-
-
Save kbw2204/564a604bcae4208bbb083596c31cacdc to your computer and use it in GitHub Desktop.
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 | |
import Then | |
import RxSwift | |
final class SearchView: UIViewController { | |
var presenter: SearchPresenterProtocol? | |
private let disposeBag = DisposeBag() | |
private let searchController = UISearchController().then { | |
$0.obscuresBackgroundDuringPresentation = false // 검색시 뷰 흐리지 않게 | |
$0.searchBar.placeholder = "Search repo" | |
} | |
private let tableView = UITableView().then { | |
$0.register(RepoTableViewCell.self, forCellReuseIdentifier: "\(RepoTableViewCell.self)") | |
$0.keyboardDismissMode = .onDrag | |
} | |
override func loadView() { | |
super.loadView() | |
self.view.addSubview(tableView) | |
} | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.setupConstraint() | |
self.initializeNavigation() | |
} | |
} | |
extension SearchView: SearchViewProtocol { | |
func display() { | |
} | |
} | |
// MARK: - private | |
extension SearchView { | |
private func setupConstraint() { | |
self.tableView.snp.makeConstraints { | |
$0.center.edges.equalToSuperview() | |
} | |
} | |
private func initializeNavigation() { | |
self.navigationItem.searchController = self.searchController | |
self.navigationItem.title = "✨ Github Search ✨" | |
self.navigationController?.navigationBar.prefersLargeTitles = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment