Skip to content

Instantly share code, notes, and snippets.

@MoralAlberto
Last active April 2, 2016 17:23
Show Gist options
  • Select an option

  • Save MoralAlberto/f43fe1840d5c030373f88ab914ca96bc to your computer and use it in GitHub Desktop.

Select an option

Save MoralAlberto/f43fe1840d5c030373f88ab914ca96bc to your computer and use it in GitHub Desktop.

Revisions

  1. MoralAlberto revised this gist Apr 2, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions HeroesCollectionViewModel.swift
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@

    //HeroesCollectionViewModel
    func marvelCharacter() {
    API.characters(pageSize, offset: offset)
    .throttle(2.0, onScheduler: QueueScheduler.mainQueueScheduler)
  2. MoralAlberto created this gist Apr 2, 2016.
    13 changes: 13 additions & 0 deletions HeroesCollectionViewModel.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    //HeroesCollectionViewModel
    func marvelCharacter() {
    API.characters(pageSize, offset: offset)
    .throttle(2.0, onScheduler: QueueScheduler.mainQueueScheduler)
    .on(failed: { error in
    // Handle Server Error
    })
    .startWithNext { [unowned self] characters in
    self.canReloadUI = true
    }
    }
    }