Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/iOS/feat#226'
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Dec 7, 2023
2 parents 4723e92 + 7153470 commit a73f4d0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Scenes/Map/MapInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class MapInteractor: NSObject, MapBusinessLogic, MapDataStore {
let posts = await worker?.fetchPosts(latitude: coordinate.latitude,
longitude: coordinate.longitude)
guard let posts else { return [] }
self.posts = posts.map { .init(member: $0.member, board: $0.board, tag: $0.tag) }
self.posts = posts.map { .init(member: $0.member, board: $0.board, tag: $0.tags) }
let response = Models.FetchPosts.Response(posts: posts)
await MainActor.run {
presenter?.presentFetchedPosts(with: response)
Expand All @@ -77,7 +77,7 @@ final class MapInteractor: NSObject, MapBusinessLogic, MapDataStore {
Task {
let posts = await worker?.fetchPosts(latitude: latitude, longitude: longitude)
guard let posts else { return [] }
self.posts = posts.map { .init(member: $0.member, board: $0.board, tag: $0.tag) }
self.posts = posts.map { .init(member: $0.member, board: $0.board, tag: $0.tags) }
let response = Models.FetchPosts.Response(posts: posts)
await MainActor.run {
presenter?.presentFetchedPosts(with: response)
Expand Down
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Scenes/Map/MapModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ enum MapModels {
struct Post {
let member: Member
let board: Board
let tag: [String]
let thumnailImageData: Data
let tags: [String]
let thumbnailImageData: Data
}

struct DisplayedPost: Hashable {
Expand Down
2 changes: 1 addition & 1 deletion iOS/Layover/Layover/Scenes/Map/MapPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class MapPresenter: MapPresentationLogic {
.map { post -> Models.DisplayedPost? in
if let videoURL = post.board.videoURL {
return .init(boardID: post.board.identifier,
thumbnailImageData: post.thumnailImageData,
thumbnailImageData: post.thumbnailImageData,
videoURL: videoURL,
latitude: post.board.latitude,
longitude: post.board.longitude)
Expand Down
6 changes: 3 additions & 3 deletions iOS/Layover/Layover/Scenes/Map/MapWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ final class MapWorker: MapWorkerProtocol {
let response = try await provider.request(with: endPoint)
guard let data = response.data else { return nil }
let posts = try await data.concurrentMap { postDTO -> Models.Post in
let thumnailImageData = try await self.provider.request(url: postDTO.board.videoThumbnailURL)
let thumbnailImageData = try await self.provider.request(url: postDTO.board.videoThumbnailURL)
return .init(member: postDTO.member.toDomain(),
board: postDTO.board.toDomain(),
tag: postDTO.tag,
thumnailImageData: thumnailImageData)
tags: postDTO.tag,
thumbnailImageData: thumbnailImageData)
}
return posts
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD
do {
let image = try await generator.image(at: .zero).image
await MainActor.run {
presenter?.presentThumnailImage(with: Models.FetchThumbnail.Response(thumnailImage: image))
presenter?.presentThumbnailImage(with: Models.FetchThumbnail.Response(thumbnailImage: image))
}
return true
} catch let error {
Expand Down
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Scenes/UploadPost/UploadPostModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ enum UploadPostModels {

}
struct Response {
let thumnailImage: CGImage
let thumbnailImage: CGImage
}
struct ViewModel {
let thumnailImage: UIImage
let thumbnailImage: UIImage
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

protocol UploadPostPresentationLogic {
func presentTags(with response: UploadPostModels.FetchTags.Response)
func presentThumnailImage(with response: UploadPostModels.FetchThumbnail.Response)
func presentThumbnailImage(with response: UploadPostModels.FetchThumbnail.Response)
func presentCurrentAddress(with response: UploadPostModels.FetchCurrentAddress.Response)
func presentUploadButton(with response: UploadPostModels.CanUploadPost.Response)
// func presentUploadProgress(with response: UploadPostModels.UploadPost.Response)
Expand All @@ -27,9 +27,9 @@ final class UploadPostPresenter: UploadPostPresentationLogic {
viewController?.displayTags(viewModel: Models.FetchTags.ViewModel(tags: response.tags))
}

func presentThumnailImage(with response: UploadPostModels.FetchThumbnail.Response) {
let image = UIImage(cgImage: response.thumnailImage)
viewController?.displayThumbnail(viewModel: Models.FetchThumbnail.ViewModel(thumnailImage: image))
func presentThumbnailImage(with response: UploadPostModels.FetchThumbnail.Response) {
let image = UIImage(cgImage: response.thumbnailImage)
viewController?.displayThumbnail(viewModel: Models.FetchThumbnail.ViewModel(thumbnailImage: image))
}

func presentCurrentAddress(with response: UploadPostModels.FetchCurrentAddress.Response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ extension UploadPostViewController: UploadPostDisplayLogic {
}

func displayThumbnail(viewModel: UploadPostModels.FetchThumbnail.ViewModel) {
thumbnailImageView.image = viewModel.thumnailImage
thumbnailImageView.image = viewModel.thumbnailImage
}

func displayCurrentAddress(viewModel: UploadPostModels.FetchCurrentAddress.ViewModel) {
Expand Down

0 comments on commit a73f4d0

Please sign in to comment.