Skip to content

Instantly share code, notes, and snippets.

@gokselkoksal
Last active April 19, 2018 22:43
Show Gist options
  • Select an option

  • Save gokselkoksal/560b4cb53ee474ac1e38e0850fbbbb95 to your computer and use it in GitHub Desktop.

Select an option

Save gokselkoksal/560b4cb53ee474ac1e38e0850fbbbb95 to your computer and use it in GitHub Desktop.

Revisions

  1. gokselkoksal revised this gist Apr 19, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion BlurringTheLines-MVVM-1.swift
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ protocol MovieListView: MovieListViewModelDelegate {
    func updateWithMovies(_ movies: [Movie])
    func didTapOnReload()
    func didTapOnMovie(at index: Int)
    func pushDetailView(for movie: Movie)
    func showDetailView(for movie: Movie)
    }

    protocol MovieListViewModelDelegate: class {
  2. gokselkoksal created this gist Apr 19, 2018.
    17 changes: 17 additions & 0 deletions BlurringTheLines-MVVM-1.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    protocol MovieListView: MovieListViewModelDelegate {
    private var viewModel: MovieListViewModel
    func updateWithMovies(_ movies: [Movie])
    func didTapOnReload()
    func didTapOnMovie(at index: Int)
    func pushDetailView(for movie: Movie)
    }

    protocol MovieListViewModelDelegate: class {
    func viewModelDidUpdate(_ model: MovieListViewModel)
    }

    protocol MovieListViewModel {
    weak var delegate: MovieListViewModelDelegate? { get set }
    var movies: [Movie] { get }
    func fetchMovies()
    }