Last active
April 19, 2019 10:37
-
-
Save sarojraut/b6e252d8803517521a044cf637abbc20 to your computer and use it in GitHub Desktop.
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 | |
| protocol PostDetailsPresentationLogic | |
| { | |
| func presentPosts(response: [PostDetails.Post.Response]) | |
| } | |
| class PostDetailsPresenter: PostDetailsPresentationLogic | |
| { | |
| weak var viewController: PostDetailsDisplayLogic? | |
| // MARK: Do something | |
| func presentPosts(response: [PostDetails.Post.Response]) | |
| { | |
| var posts:[PostFieldsViewModel] = [] | |
| for value in response{ | |
| let model = PostFieldsViewModel(userImageUrl: value.id?.description ?? "" , title: value.title ?? "" , description: value.body ?? "" ) | |
| posts.append(model) | |
| } | |
| viewController?.displayPosts(viewModel: posts) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment