Skip to content

Commit

Permalink
♻️ Made classes final where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-sarda committed May 8, 2021
1 parent 012e34a commit 2a7db97
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ViteMaDose/Networking/BaseAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protocol BaseAPIServiceProvider: AnyObject {
func fetchStats(completion: @escaping (Result<Stats, Error>) -> Void)
}

class BaseAPIService: BaseAPIServiceProvider {
final class BaseAPIService: BaseAPIServiceProvider {
let provider: MoyaProvider<BaseAPI>

init(provider: MoyaProvider<BaseAPI> = MoyaProvider<BaseAPI>(plugins: [CachePolicyPlugin()])) {
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Networking/GeoAPIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protocol GeoAPIServiceProvider: AnyObject {
func fetchCities(byName name: String, completion: @escaping (Cities) -> Void)
}

class GeoAPIService: GeoAPIServiceProvider {
final class GeoAPIService: GeoAPIServiceProvider {
let provider: MoyaProvider<GeoAPI>

init(provider: MoyaProvider<GeoAPI> = MoyaProvider<GeoAPI>()) {
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/ViewModels/Home/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protocol HomeViewModelDelegate: AnyObject {
func reloadTableView(with headingCells: [HomeCell], andStatsCells statsCells: [HomeCell])
}

class HomeViewModel {
final class HomeViewModel {
private let apiService: BaseAPIServiceProvider
private let userDefaults: UserDefaults
weak var delegate: HomeViewModelDelegate?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protocol LocationSearchViewModelDelegate: AnyObject {

// MARK: - LocationSearchViewModel

class LocationSearchViewModel: LocationSearchViewModelProvider {
final class LocationSearchViewModel: LocationSearchViewModelProvider {
private let geoAPIService: GeoAPIServiceProvider
private let userDefaults: UserDefaults
weak var delegate: LocationSearchViewModelDelegate?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct CentresSortOptionsCellViewData: CentresSortOptionsCellViewDataProvider, H
let sortOption: CentresListSortOption
}

class CentresSortOptionsCell: UITableViewCell {
final class CentresSortOptionsCell: UITableViewCell {
@IBOutlet private var sortSegmentedControl: UISegmentedControl!
var sortSegmentedControlHandler: ((Int) -> Void)?

Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Views/CentresList/Cells/CentresStatsCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct CentresStatsCellViewData: CentresStatsCellViewDataProvider, Hashable {
let allCentresCount: Int
}

class CentresStatsCell: UITableViewCell {
final class CentresStatsCell: UITableViewCell {

@IBOutlet var availableCentresCountLabel: UILabel!
@IBOutlet var availableCentresDescriptionLabel: UILabel!
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Views/CentresList/Cells/CentresTitleCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class CentresTitleCell: HomeTitleCell {
final class CentresTitleCell: HomeTitleCell {
private enum Constant {
static let titleFont: UIFont = .rounded(ofSize: 26, weight: .bold)
static let titleColor: UIColor = .label
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Views/Home/Footer/HomePartnersFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class HomePartnersFooterView: UIView {
final class HomePartnersFooterView: UIView {

@IBOutlet private var titleLabel: UILabel!
@IBOutlet private var logo1ImageView: UIImageView!
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Views/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SafariServices
import FirebaseAnalytics
import Haptica

class HomeViewController: UIViewController, Storyboarded {
final class HomeViewController: UIViewController, Storyboarded {
@IBOutlet private var tableView: UITableView!

private typealias Snapshot = NSDiffableDataSourceSnapshot<HomeSection, HomeCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class LocationSearchHeaderView: UIView {
final class LocationSearchHeaderView: UIView {
@IBOutlet private var titleLabel: UILabel!
@IBOutlet private(set) weak var searchBar: UISearchBar!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protocol LocationSearchViewControllerDelegate: AnyObject {
func didSelect(location: LocationSearchResult)
}

class LocationSearchViewController: UIViewController, Storyboarded {
final class LocationSearchViewController: UIViewController, Storyboarded {
@IBOutlet private var tableView: UITableView!
weak var delegate: LocationSearchViewControllerDelegate?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import UIKit
import WebKit

class MaintenanceViewController: UIViewController {
final class MaintenanceViewController: UIViewController {
let maintenanceUrl: URL?
lazy var webView: WKWebView = {
let webView = WKWebView(frame: view.bounds)
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDoseTests/Networking/BaseAPIServiceMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum BaseAPIErrorMock: Error {
case unknown
}

class BaseAPIServiceMock: BaseAPIServiceProvider {
final class BaseAPIServiceMock: BaseAPIServiceProvider {
var provider: MoyaProvider<BaseAPI> = MoyaProvider<BaseAPI>()

var fetchVaccinationCentresResult: Result<VaccinationCentres, Error>?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation
@testable import ViteMaDose

class HomeViewModelDelegateSpy: HomeViewModelDelegate {
final class HomeViewModelDelegateSpy: HomeViewModelDelegate {
var updateLoadingState: (isLoading: Bool, isEmpty: Bool)?
func updateLoadingState(isLoading: Bool, isEmpty: Bool) {
updateLoadingState = (isLoading, isEmpty)
Expand Down

0 comments on commit 2a7db97

Please sign in to comment.