Skip to content

Instantly share code, notes, and snippets.

@alvaroroyo
Created February 28, 2019 09:52
Show Gist options
  • Save alvaroroyo/92841466186ed19e80bfde5a6098a053 to your computer and use it in GitHub Desktop.
Save alvaroroyo/92841466186ed19e80bfde5a6098a053 to your computer and use it in GitHub Desktop.
import Foundation
import Alamofire
protocol PersonsInteractorInput: class {
func fetchPersons()
}
class PersonsInteractor: NSObject, PersonsInteractorInput {
let url = "https://www.example.com"
weak var output: PersonsInteractorOutput!
func fetchPersons() {
Alamofire.request(.GET, url).responseArray { (response: Response) in
let personsArray:[Person] = response.result.value!
self.output.personsFetched(personsArray!)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment