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 | |
open class SegmentedViewController: UIViewController { | |
public private(set) var selectedViewControllerIndex = 0 | |
// MARK: - Public variables | |
/// List of ViewControllers. View Controller Titles are used as segment titles. | |
public var items = [UIViewController]() { |
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 | |
open class MovieListFetcherViewController: UIViewController { | |
// MARK: - Variables | |
public var movieStore = MovieStore.shared | |
private let listController = ListViewController() | |
public var endpoint: Endpoint = .nowPlaying { | |
didSet { |
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 | |
open class MovieListCoordinator: UIViewController { | |
// MARK: - Variables | |
let segmentedController = SegmentedViewController() | |
let topMovieFetcherViewController = MovieListFetcherViewController() | |
let nowPlayingMovieFetcherViewController = MovieListFetcherViewController() | |
let popularMovieFetcherViewController = MovieListFetcherViewController() | |
let upcomingMovieFetcherViewController = MovieListFetcherViewController() |
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 | |
open class ErrorViewController: UIViewController { | |
// MARK: - Variables | |
public let errorLabel = UILabel() | |
// MARK: - Lifecycle |
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 | |
open class LoadingViewController: UIViewController { | |
// MARK: - Variables | |
public let activityIndicator = UIActivityIndicatorView(style: .gray) | |
// MARK: - Lifecycle | |
open override func 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 | |
open class ListStateViewController: UIViewController { | |
public enum State { | |
case loading | |
case list([Listable]) | |
case empty(String) | |
case error(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
import UIKit | |
open class MovieListFetcherViewController: UIViewController { | |
// MARK: - Variables | |
public let listStateController = ListStateViewController() | |
public let movieStore = MovieStore.shared | |
public var endpoint: Endpoint = .nowPlaying { |
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 PlaygroundSupport | |
import UIKit | |
@testable import MVCMovieInfoFramework | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
NSSetUncaughtExceptionHandler { exception in | |
print("💥 Exception thrown: \(exception)") | |
} |
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 | |
open class MovieSearchFetcherViewController: UIViewController { | |
var service: MovieService = MovieStore.shared | |
// MARK: - Variables | |
private let listStateViewController = ListStateViewController() | |
private let searchController = UISearchController(searchResultsController: nil) |
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 | |
open class MovieSearchViewController: UIViewController, UISearchResultsUpdating { | |
var service: MovieService = MovieStore.shared | |
// MARK: - Variables | |
private let movieSearchFetcherViewController = MovieSearchFetcherViewController() | |
private let searchController = UISearchController(searchResultsController: nil) |