Created
February 28, 2019 09:52
-
-
Save alvaroroyo/92841466186ed19e80bfde5a6098a053 to your computer and use it in GitHub Desktop.
This file contains 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 | |
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