2023-04-11 19:21:52 +02:00
|
|
|
//
|
|
|
|
// LocationsListViewController.swift
|
|
|
|
// Locations
|
|
|
|
//
|
|
|
|
// Created by Javier Cicchelli on 08/04/2023.
|
|
|
|
// Copyright © 2023 Röck+Cöde. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Core
|
|
|
|
import UIKit
|
|
|
|
|
2023-04-11 23:34:07 +02:00
|
|
|
class LocationsListViewController: BaseViewController {
|
2023-04-11 19:21:52 +02:00
|
|
|
|
|
|
|
// MARK: Properties
|
|
|
|
|
2023-04-11 23:34:07 +02:00
|
|
|
var viewModel: LocationsListViewModeling
|
2023-04-11 19:21:52 +02:00
|
|
|
|
|
|
|
// MARK: Initialisers
|
|
|
|
|
2023-04-11 23:34:07 +02:00
|
|
|
init(viewModel: LocationsListViewModeling) {
|
2023-04-11 19:21:52 +02:00
|
|
|
self.viewModel = viewModel
|
|
|
|
|
2023-04-11 23:34:07 +02:00
|
|
|
super.init()
|
2023-04-11 19:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
|
|
|
fatalError("init(coder:) has not been implemented")
|
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: UIViewController
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
|
super.viewDidLoad()
|
|
|
|
|
2023-04-11 21:36:16 +02:00
|
|
|
navigationItem.rightBarButtonItem = UIBarButtonItem(
|
|
|
|
title: "Add",
|
|
|
|
style: .plain,
|
|
|
|
target: self,
|
|
|
|
action: #selector(addLocationPressed)
|
|
|
|
)
|
2023-04-11 19:21:52 +02:00
|
|
|
title = "Locations"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-04-11 21:36:16 +02:00
|
|
|
|
|
|
|
// MARK: - Helpers
|
|
|
|
|
|
|
|
private extension LocationsListViewController {
|
2023-04-11 23:34:07 +02:00
|
|
|
|
|
|
|
// MARK: Functions
|
|
|
|
|
2023-04-11 21:36:16 +02:00
|
|
|
@objc func addLocationPressed() {
|
2023-04-11 23:34:07 +02:00
|
|
|
viewModel.openAddLocation()
|
2023-04-11 21:36:16 +02:00
|
|
|
}
|
2023-04-11 23:34:07 +02:00
|
|
|
|
2023-04-11 21:36:16 +02:00
|
|
|
}
|