From 21a4dbe1dc705da8069934d3f3fbda0e7e6298c1 Mon Sep 17 00:00:00 2001 From: anyukyung <1018dbrud@gmail.com> Date: Tue, 19 Dec 2023 18:18:56 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=EC=A7=80=EB=8F=84=20?= =?UTF-8?q?=EC=85=80=20=EC=BB=A4=EC=8A=A4=ED=85=80=20=EB=A6=AC=EC=86=8C?= =?UTF-8?q?=EC=8A=A4=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenes/Map/Views/MapCarouselCollectionViewCell.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/iOS/Layover/Layover/Scenes/Map/Views/MapCarouselCollectionViewCell.swift b/iOS/Layover/Layover/Scenes/Map/Views/MapCarouselCollectionViewCell.swift index 5fb4243..408fb55 100644 --- a/iOS/Layover/Layover/Scenes/Map/Views/MapCarouselCollectionViewCell.swift +++ b/iOS/Layover/Layover/Scenes/Map/Views/MapCarouselCollectionViewCell.swift @@ -48,7 +48,9 @@ final class MapCarouselCollectionViewCell: UICollectionViewCell { spinner.stopAnimating() loopingPlayerView.disable() loopingPlayerView.prepareVideo(with: url, - timeRange: CMTimeRange(start: .zero, duration: CMTime(value: 1800, timescale: 600))) + assetResourceLoaderDelegate: HLSAssetResourceLoaderDelegate(resourceLoader: HLSSliceResourceLoader()), + loopStart: .zero, + duration: 3.0) loopingPlayerView.player?.isMuted = true } From baf12db1689f100aafd9f6266b77dc2bd737469d Mon Sep 17 00:00:00 2001 From: anyukyung <1018dbrud@gmail.com> Date: Tue, 19 Dec 2023 19:43:49 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20=EC=A7=80=EB=8F=84=20?= =?UTF-8?q?=EC=85=80=20black=20screen=20flash=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Layover/Scenes/Map/MapViewController.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift index d656e8e..e4cdfd3 100644 --- a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift +++ b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift @@ -173,12 +173,12 @@ final class MapViewController: BaseViewController { let distanceFromCenter = abs((item.center.x - offset.x) - environment.container.contentSize.width / 2.0) let scale = max(maximumZoomScale - (distanceFromCenter / containerWidth), minumumZoomScale) item.transform = CGAffineTransform(scaleX: scale, y: scale) - let cell = self?.carouselCollectionView.cellForItem(at: item.indexPath) as? MapCarouselCollectionViewCell - if scale >= maximumZoomScale * 0.9 { - cell?.play() + guard let cell = self?.carouselCollectionView.cellForItem(at: item.indexPath) as? MapCarouselCollectionViewCell else { return } + if scale >= 0.9 { + cell.play() self?.selectAnnotation(at: item.indexPath) } else { - cell?.pause() + cell.pause() } } } @@ -197,7 +197,6 @@ final class MapViewController: BaseViewController { carouselCollectionViewHeight.constant = isSelected ? 151 : 0 UIView.animate(withDuration: 0.3) { annotationView.transform = isSelected ? CGAffineTransform(scaleX: 1.3, y: 1.3) : .identity - self.view.layoutIfNeeded() } } @@ -256,7 +255,7 @@ extension MapViewController: MKMapViewDelegate { if let annotaion = annotation as? LOAnnotation { // 선택된 pin 정보와 datasource를 비교해 selected item을 찾음 let snapshot = carouselDatasource.snapshot() - guard let selectedItemIdentifiers = carouselDatasource.snapshot().itemIdentifiers.filter({ post in + guard let selectedItemIdentifiers = snapshot.itemIdentifiers.filter({ post in return post.boardID == annotaion.boardID }).first else { return } guard let section = snapshot.sectionIdentifier(containingItem: selectedItemIdentifiers), From d8217ae52a60a28c32383b587260403702b9dd54 Mon Sep 17 00:00:00 2001 From: anyukyung <1018dbrud@gmail.com> Date: Wed, 20 Dec 2023 23:15:38 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20=ED=8E=98=EC=9D=B4=EC=A7=95?= =?UTF-8?q?=20continuous=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20?= =?UTF-8?q?=ED=95=80=20=EC=84=A0=ED=83=9D=EC=8B=9C=20=EC=98=81=EC=83=81=20?= =?UTF-8?q?=EC=9E=AC=EC=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Layover/Layover/Scenes/Map/MapViewController.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift index e4cdfd3..64e4a8c 100644 --- a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift +++ b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift @@ -161,7 +161,7 @@ final class MapViewController: BaseViewController { let maximumZoomScale: CGFloat = 1.0 let inset = (screenSize.width - screenSize.width * groupWidthDimension) / 2 let section: NSCollectionLayoutSection = .makeCarouselSection(groupWidthDimension: groupWidthDimension) - section.orthogonalScrollingBehavior = .groupPagingCentered + section.orthogonalScrollingBehavior = .continuous section.interGroupSpacing = 0 section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: inset, @@ -174,8 +174,7 @@ final class MapViewController: BaseViewController { let scale = max(maximumZoomScale - (distanceFromCenter / containerWidth), minumumZoomScale) item.transform = CGAffineTransform(scaleX: scale, y: scale) guard let cell = self?.carouselCollectionView.cellForItem(at: item.indexPath) as? MapCarouselCollectionViewCell else { return } - if scale >= 0.9 { - cell.play() + if scale >= maximumZoomScale * 0.9 { self?.selectAnnotation(at: item.indexPath) } else { cell.pause() @@ -261,9 +260,12 @@ extension MapViewController: MKMapViewDelegate { guard let section = snapshot.sectionIdentifier(containingItem: selectedItemIdentifiers), let itemIndex = snapshot.indexOfItem(selectedItemIdentifiers), let sectionIndex = snapshot.indexOfSection(section) else { return } - carouselCollectionView.scrollToItem(at: IndexPath(item: itemIndex, section: sectionIndex), + let indexPath = IndexPath(item: itemIndex, section: sectionIndex) + carouselCollectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: false) + guard let cell = carouselCollectionView.cellForItem(at: indexPath) as? MapCarouselCollectionViewCell else { return } + cell.play() } } From 81bbae87f651c766a554b9f9cfaf47ef73077bc9 Mon Sep 17 00:00:00 2001 From: kong <1018dbrud@gmail.com> Date: Wed, 10 Jan 2024 22:41:24 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20=ED=8E=98=EC=9D=B4=EC=A7=95?= =?UTF-8?q?=20groupPaging=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iOS/Layover/Layover/Scenes/Map/MapViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift index 64e4a8c..6e7f7ea 100644 --- a/iOS/Layover/Layover/Scenes/Map/MapViewController.swift +++ b/iOS/Layover/Layover/Scenes/Map/MapViewController.swift @@ -161,7 +161,7 @@ final class MapViewController: BaseViewController { let maximumZoomScale: CGFloat = 1.0 let inset = (screenSize.width - screenSize.width * groupWidthDimension) / 2 let section: NSCollectionLayoutSection = .makeCarouselSection(groupWidthDimension: groupWidthDimension) - section.orthogonalScrollingBehavior = .continuous + section.orthogonalScrollingBehavior = .groupPaging section.interGroupSpacing = 0 section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: inset,