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
struct Launch: Codable, Equatable { | |
let id: String? | |
let name: String? | |
let details: String? | |
let date_utc: Date? | |
let upcoming: Bool? | |
let success: Bool? | |
let rocket: String? | |
init(id: String?, name: String?, details: String?, date_utc: Date?, upcoming: Bool?, success: Bool?, rocket: String?) { |
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
struct LaunchResponse: Codable, Equatable { | |
let docs: [Launch]? | |
} |
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
class LaunchListViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { | |
@IBOutlet var tableView: UITableView! | |
var viewModel: LaunchListViewModelType = LaunchListViewModel() | |
var disposeBag: DisposeBag! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
tableView.delegate = self |
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
protocol LaunchListViewModelType { | |
var launchViewModels: BehaviorRelay<[LaunchListTableViewCellViewModel]> { get } // 1 | |
var notifyError: BehaviorRelay<Error?> { get } // 2 | |
func fetchLaunchesWithQuery() // 3 | |
} | |
class LaunchListViewModel: LaunchListViewModelType { | |
let apiService: APIServiceProtocol // 4 | |
NewerOlder