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 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 MovieFetcherViewController: UIViewController { | |
// MARK: - Variables | |
public var movieStore = MovieStore.shared | |
private let listController = ListViewController() | |
// 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 | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
window = UIWindow(frame: UIScreen.main.bounds) | |
window?.backgroundColor = UIColor.white | |
window?.makeKeyAndVisible() |
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
extension Movie: Listable { | |
private static let dateFormatter: DateFormatter = { | |
let formatter = DateFormatter() | |
formatter.dateStyle = .medium | |
formatter.timeStyle = .none | |
return formatter | |
}() | |
public var firstText: String { | |
return title |
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 | |
NSSetUncaughtExceptionHandler { exception in | |
print("💥 Exception thrown: \(exception)") | |
} | |
PlaygroundPage.current.needsIndefiniteExecution = true |
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 ImageWithFourLabelCell: UITableViewCell { | |
public let layout = ImageWithFourLabelView() | |
// MARK: - Lifecycle | |
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | |
super.init(style: style, reuseIdentifier: reuseIdentifier) |
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 | |
open class ImageWithFourLabelView: UIView { | |
// MARK: - Variables | |
private let horizontalStackView = UIStackView() | |
private let verticalStackView = UIStackView() |
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 Foundation | |
public protocol DataFetching { | |
func fetchData(url: URL, completion: @escaping (Data?, Error?) -> Void) | |
} | |
extension DataFetching { | |
public func fetchData(url: URL, completion: @escaping (Data?, Error?) -> Void) { | |
let session = URLSession.shared |
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 | |
public class DownloadImageView: UIImageView, DataFetching { | |
// MARK: - Variables | |
public var placeHolder: UIImage? | |
public var url: URL? { | |
didSet { |