Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 릴리즈 시 발생했던 버그들 수정 #363

Merged
merged 4 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions iOS/Layover/Layover/Scenes/Home/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ final class HomeViewController: BaseViewController {
section.interGroupSpacing = 13
section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 30, bottom: 0, trailing: 30)
section.orthogonalScrollingBehavior = .groupPagingCentered
section.orthogonalScrollingProperties.decelerationRate = .normal
section.orthogonalScrollingProperties.bounce = .never
if #available(iOS 17.0, *) {
section.orthogonalScrollingProperties.decelerationRate = .normal
section.orthogonalScrollingProperties.bounce = .never
}
Comment on lines +142 to +145
Copy link
Collaborator

@loinsir loinsir Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 미만에서는 어떻게 동작할까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안그래도 릴리즈 할 때 돌려봤는데 큰 차이는 없었습니다. 단지 저 기능이 동작하지는 않겠죠..?


section.visibleItemsInvalidationHandler = { items, offset, environment in
let containerWidth = environment.container.contentSize.width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {
}

func reportVideo(with request: PlaybackModels.ReportPlaybackVideo.Request) {
if request.indexPathRow < playbackVideoInfos.count { return }
if request.indexPathRow >= playbackVideoInfos.count { return }
boardID = playbackVideoInfos[request.indexPathRow].boardID
presenter?.presentReportVideo()
}
Expand Down
35 changes: 29 additions & 6 deletions iOS/Layover/Layover/Scenes/UploadPost/UploadPostInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD
var tags: [String]? = []
var videoAddress: Models.AddressInfo?
var currentAddress: Models.AddressInfo?
var addressType: Models.AddressType?

// MARK: - Object LifeCycle

Expand Down Expand Up @@ -98,7 +99,10 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD
return Models.AddressInfo(
administrativeArea: administrativeArea,
locality: locality,
subLocality: subLocality)
subLocality: subLocality,
latitude: location.coordinate.latitude,
longitude: location.coordinate.longitude
)
} catch {
os_log(.error, log: .data, "Failed to fetch Current Address with error: %@", error.localizedDescription)
return nil
Expand All @@ -120,7 +124,10 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD
return Models.AddressInfo(
administrativeArea: administrativeArea,
locality: locality,
subLocality: subLocality)
subLocality: subLocality,
latitude: videoLocation.latitude,
longitude: videoLocation.longitude
)
} catch {
os_log(.error, log: .data, "Failed to fetch Video Address with error: %@", error.localizedDescription)
return nil
Expand All @@ -136,15 +143,29 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD
guard let worker,
let videoURL,
let isMuted,
let coordinate = locationManager.getCurrentLocation()?.coordinate else { return }
let addressType
else { return }

var addressInfo: Models.AddressInfo?
switch addressType {
case .video:
if let videoAddress {
addressInfo = videoAddress
}
case .current:
if let currentAddress {
addressInfo = currentAddress
}
}
guard let addressInfo else { return }
Task {
if isMuted {
await exportVideoWithoutAudio(at: videoURL)
}
let uploadPostResponse = await worker.uploadPost(with: UploadPost(title: request.title,
content: request.content,
latitude: coordinate.latitude,
longitude: coordinate.longitude,
latitude: addressInfo.latitude,
longitude: addressInfo.longitude,
tag: request.tags,
videoURL: videoURL))
guard let boardID = uploadPostResponse?.id else { return }
Expand All @@ -160,15 +181,17 @@ final class UploadPostInteractor: NSObject, UploadPostBusinessLogic, UploadPostD

videoAddress = await videoAddressInfo
currentAddress = await currentAddressInfo
addressType = videoAddress != nil ? .video : .current

let response: Models.FetchCurrentAddress.Response = Models.FetchCurrentAddress.Response(addressInfo: [ videoAddress, currentAddress].compactMap { $0 })
let response: Models.FetchCurrentAddress.Response = Models.FetchCurrentAddress.Response(addressInfo: [videoAddress, currentAddress].compactMap { $0 })
await MainActor.run {
presenter?.presentCurrentAddress(with: response)
}
}

func selectAddress(with request: UploadPostModels.SelectAddress.Request) {
var response: Models.FetchCurrentAddress.Response
addressType = request.addressType
switch request.addressType {
case .video:
guard let videoAddress else { return }
Expand Down
2 changes: 2 additions & 0 deletions iOS/Layover/Layover/Scenes/UploadPost/UploadPostModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ enum UploadPostModels {
let administrativeArea: String?
let locality: String?
let subLocality: String?
let latitude: Double
let longitude: Double
}

enum AddressType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ class UploadPostPresenterTests: XCTestCase {
let response = Models.FetchCurrentAddress.Response(addressInfo: [Models.AddressInfo(
administrativeArea: nil,
locality: nil,
subLocality: nil)])
subLocality: nil,
latitude: 0,
longitude: 0
)])

// when
sut.presentCurrentAddress(with: response)
Expand Down
Loading