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

feat: 재생화면 VIP 싸이클 적용 #146

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8dc9499
:sparkles: Toast class 구현
chopmozzi Nov 28, 2023
30e14f4
:recycle: 필요없는 코드 지우기
chopmozzi Nov 28, 2023
4a83716
:recycle: final 붙이기
chopmozzi Nov 28, 2023
adc5036
:sparkles: Playback Configurator 생성 및 적용
chopmozzi Nov 28, 2023
4a4f19d
:sparkles: VideoDTO 생성
chopmozzi Nov 28, 2023
82c1110
:recycle: video dto 수정
chopmozzi Nov 28, 2023
ac3b778
:sparkles: Playback ViewModel 생성
chopmozzi Nov 28, 2023
c4c49a7
:recycle: 재생화면 VIP Cycle 적용(홈에서)
chopmozzi Nov 28, 2023
057b567
:bug: 설정 탭 푸시 시 투명 배경 현상 수정
loinsir Nov 29, 2023
381fde8
:bug: 네비게이션 컨트롤러 중첩 버그 수정
loinsir Nov 29, 2023
4365dec
:sparkles: 초기 재생화면 재생 설정
chopmozzi Nov 29, 2023
bbe94b0
:sparkles: 재생화면 홈화면 VIP 연결
chopmozzi Nov 29, 2023
f422902
:bug: 실 기기에서 소리가 나지 않던 문제 수정
chopmozzi Nov 29, 2023
4989047
:sparkles: 재생화면 초기화면 세팅(홈에서 연결됐을 때)
chopmozzi Nov 29, 2023
1848ec7
:sparkles: 지도와 재생화면 연결
chopmozzi Nov 29, 2023
e3c2ac3
:sparkles: 무한 스크롤 VIP 연결
chopmozzi Nov 29, 2023
8475dbd
:recycle: 코드 정리
chopmozzi Nov 29, 2023
212f3c6
:sparkles: 다른 뷰로 이동 시 재생 바 사라지게 구현
chopmozzi Nov 29, 2023
3296d74
Merge remote-tracking branch 'refs/remotes/origin/iOS/dev'
chopmozzi Nov 29, 2023
109abbf
:sparkles: TagPlayList Scene UI 구현
loinsir Nov 29, 2023
9dbcdea
:recycle: Toast 수정
chopmozzi Nov 29, 2023
310fff5
:wrench: 테스트 코드 삭제
chopmozzi Nov 29, 2023
ce2a20d
:heavy_plus_sign: 태그 검색 더미 데이터 추가
loinsir Nov 29, 2023
980f5f5
:wrench: mock json 필드 수정
loinsir Nov 29, 2023
8316494
Merge pull request #143 from boostcampwm2023/iOS/bug#142
anyukyung Nov 29, 2023
50d6ce7
:heavy_plus_sign: 게시글 DTO 추가
loinsir Nov 29, 2023
cad4185
:sparkles: 태그 검색 뷰 VIP 사이클 구현
loinsir Nov 29, 2023
4001422
:sparkles: Sequence 비동기 extension 메서드 추가
loinsir Nov 30, 2023
e549eb8
:bug: provider data 리턴 타입 디코드 수정
loinsir Nov 30, 2023
3690025
:bento: 샘플 이미지 애셋 변경
loinsir Nov 30, 2023
ac24604
:recycle: 리뷰사항 반영
chopmozzi Nov 30, 2023
2aee1b7
:wrench: 데이터 전달 설정
loinsir Nov 30, 2023
f270691
Merge pull request #130 from boostcampwm2023/iOS/feat#129
anyukyung Nov 30, 2023
5bc5e8e
:wrench: 리뷰 반영 navigation title 표시 로직 수정
loinsir Nov 30, 2023
8ad694e
Merge pull request #149 from boostcampwm2023/iOS/feat#145
loinsir Nov 30, 2023
4c84266
Merge remote-tracking branch 'refs/remotes/origin/iOS/feat#122'
chopmozzi Nov 30, 2023
2b9ce5d
:wrench: 모델 수정
chopmozzi Nov 30, 2023
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
138 changes: 131 additions & 7 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions iOS/Layover/Layover/Extensions/Sequence+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// Sequence+.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

extension Sequence {
func asyncMap<T>(
_ transform: (Element) async throws -> T
) async rethrows -> [T] {
var values = [T]()

for element in self {
try await values.append(transform(element))
}

return values
}

func asyncCompactMap<T>(
_ transform: (Element) async throws -> T?
) async rethrows -> [T] {
var values = [T]()

for element in self {
if let value = try await transform(element) {
values.append(value)
}
}

return values
}

func concurrentMap<T>(
_ transform: @escaping (Element) async throws -> T
) async throws -> [T] {
let tasks = map { element in
Task {
try await transform(element)
}
}

return try await tasks.asyncMap { task in
try await task.value
}
}
}
19 changes: 19 additions & 0 deletions iOS/Layover/Layover/Models/Board.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// Board.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct Board: Hashable {
let identifier: Int
let title: String
let description: String?
let thumbnailImageURL: URL?
let videoURL: URL?
let latitude: Double?
let longitude: Double?
}
16 changes: 16 additions & 0 deletions iOS/Layover/Layover/Models/Member.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Member.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct Member: Hashable {
let identifier: Int
let username: String
let introduce: String
let profileImageURL: URL?
}
15 changes: 15 additions & 0 deletions iOS/Layover/Layover/Models/Post.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Post.swift
// Layover
//
// Created by 김인환 on 11/29/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct Post: Hashable {
let member: Member
let board: Board
let tag: [String]
}
37 changes: 37 additions & 0 deletions iOS/Layover/Layover/Network/DTOs/BoardDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// BoardDTO.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct BoardDTO: Decodable {
let id: Int
let url: String
let videoThumbnail: String
let latitude, longitude, title, content: String

enum CodingKeys: String, CodingKey {
case id
case url = "url"
case videoThumbnail = "video_thumbnail"
case latitude, longitude, title, content
}
}

extension BoardDTO {
func toDomain() -> Board {
return Board(
identifier: id,
title: title,
description: content,
thumbnailImageURL: URL(string: videoThumbnail),
videoURL: URL(string: url),
latitude: Double(latitude),
longitude: Double(longitude)
)
}
}
31 changes: 31 additions & 0 deletions iOS/Layover/Layover/Network/DTOs/MemberDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// MemberDTO.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct MemberDTO: Codable {
let id: Int
let username, introduce: String
let profileImageURL: String

enum CodingKeys: String, CodingKey {
case id, username, introduce
case profileImageURL = "profile_image_url"
}
}

extension MemberDTO {
func toDomain() -> Member {
return Member(
identifier: id,
username: username,
introduce: introduce,
profileImageURL: URL(string: profileImageURL)
)
}
}
25 changes: 25 additions & 0 deletions iOS/Layover/Layover/Network/DTOs/PostDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// PostDTO.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct PostDTO: Decodable {
let member: MemberDTO
let board: BoardDTO
let tag: [String]
}

extension PostDTO {
func toDomain() -> Post {
return Post(
member: member.toDomain(),
board: board.toDomain(),
tag: tag
)
}
}
26 changes: 26 additions & 0 deletions iOS/Layover/Layover/Network/DTOs/VideoDTO.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// VideoDTO.swift
// Layover
//
// Created by 황지웅 on 11/28/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

struct VideoDTO: Codable {
let title: String
let content: String
let location: String
let tags: [String]
// TODO: 프로필 완성되면 변경
let member: MemberDTO
let sdURL: URL
let hdURL: URL

enum CodingKeys: String, CodingKey {
case title, content, location, tags, member
case sdURL = "sd_url"
case hdURL = "hd_url"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// PostEndPointFactory.swift
// Layover
//
// Created by 김인환 on 11/30/23.
// Copyright © 2023 CodeBomber. All rights reserved.
//

import Foundation

protocol PostEndPointFactory {
func makeHomePostListEndPoint() -> EndPoint<Response<[PostDTO]>>
func makeTagSearchPostListEndPoint(by tag: String) -> EndPoint<Response<[PostDTO]>>
}

final class DefaultPostEndPointFactory: PostEndPointFactory {
func makeHomePostListEndPoint() -> EndPoint<Response<[PostDTO]>> {
return EndPoint(
path: "/board/home",
method: .GET
)
}

func makeTagSearchPostListEndPoint(by tag: String) -> EndPoint<Response<[PostDTO]>> {
var queryParameters = [String: String]()
queryParameters.updateValue(tag, forKey: "tag")

return EndPoint(
path: "/board/tag",
method: .GET,
queryParameters: queryParameters
)
}
}
79 changes: 79 additions & 0 deletions iOS/Layover/Layover/Network/Mock/MockData/PostList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"customCode": "SUCCESS",
"message": "요청이 성공적으로 처리되었습니다.",
"statusCode": 200,
"data": [
{
"member" : {
"id" : 1,
"username" : "loinsir",
"introduce" : "Hi, my name is hwani",
"profile_image_url" : "https://i.namu.wiki/i/HPFgEkrlX8wtU-agoxsqlzllzfJrcFkDSJYFQxdBHUNyjyZtUpS9zy-7-6lfz4ngzB-1wbLRyhIP4TmnwPwKJ0mUec5403r5TJnI3NZpsYJL6GEVQTmR52YoFGLMbaIe4aGSzh4B4InI9r2g0VV74g.svg"
},
"board" : {
"id" : 1,
"url" : "https://assets.afcdn.com/video49/20210722/v_645516.m3u8",
"video_thumbnail" : "https://think-note.com/wp-content/uploads/2023/07/eta_3.jpg",
"longitude" : "37.0532156213",
"latitude" : "127.060123123",
"title" : "최강 아이돌",
"content" : "게시글 설명"
},
"tag" : ["나도몰라요", "너도몰라요"]
},
{
"member" : {
"id" : 2,
"username" : "chopmozzi",
"introduce" : "Hi, my name is hwani",
"profile_image_url" : "https://m.segye.com/content/image/2023/03/15/20230315514234.jpg"
},
"board" : {
"id" : 2,
"url" : "https://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8",
"video_thumbnail" : "video_thumbnail_link",
"longitude" : "37.0532156213",
"latitude" : "127.060123123",
"title" : "프로듀스 101",
"content" : "게시글 설명"
},
"tag" : ["해시태그", "해시태그2"]
},
{
"member" : {
"id" : 3,
"username" : "anyukyung",
"introduce" : "Hi, my name is hwani",
"profile_image_url" : "https://images.khan.co.kr/article/2021/11/15/l_2021111502000877900178361.jpg"
},
"board" : {
"id" : 3,
"url" : "https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8",
"video_thumbnail" : "https://cdnimg.melon.co.kr/resource/image/cds/musicstory/imgUrl20210831030133473.jpg/melon/quality/90/optimize",
"longitude" : "37.0532156213",
"latitude" : "127.060123123",
"title" : "프로미스 나인",
"content" : "게시글 설명"
},
"tag" : ["해시태그1", "해시태그2"]
},
{
"member" : {
"id" : 4,
"username" : "layover",
"introduce" : "Hi, my name is hwani",
"profile_image_url" : "profile_image_link"
},
"board" : {
"id" : 4,
"url" : "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
"video_thumbnail" : "https://res.heraldm.com/content/image/2023/04/16/20230416000040_0.jpg",
"longitude" : "37.0532156213",
"latitude" : "127.060123123",
"title" : "아이즈원",
"content" : "게시글 설명2"
},
"tag" : ["해시태그1", "해시태그6"]
}
]
}
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Network/Provider/Provider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ class Provider: ProviderType {
func request(url: URL) async throws -> Data {
let (data, response) = try await session.data(from: url)
try self.checkStatusCode(of: response)
return try data.decode()
return data
}

func request(url: String) async throws -> Data {
guard let url = URL(string: url) else { throw NetworkError.components }
let (data, response) = try await session.data(from: url)
try self.checkStatusCode(of: response)
return try data.decode()
return data
}

private func checkStatusCode(of response: URLResponse) throws {
Expand Down
1 change: 1 addition & 0 deletions iOS/Layover/Layover/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extension SceneDelegate {
@objc private func routeToLoginViewController() {
guard let rootNavigationViewController = window?.rootViewController as? UINavigationController else { return }
// TODO: 세션이 만료되었습니다. Toast 띄우기
rootNavigationViewController.setNavigationBarHidden(false, animated: false)
rootNavigationViewController.setViewControllers([LoginViewController()], animated: true)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ final class EditProfileViewController: BaseViewController {
// MARK: - Methods

override func setUI() {
super.setUI()
self.title = "프로필 수정"
}

override func setConstraints() {
super.setConstraints()
view.addSubviews(profileImageView, editProfileImageButton, nicknameTextfield, nicknameAlertLabel, introduceTextfield,
introduceAlertLabel, nicknameAlertLabel, checkDuplicateNicknameButton, confirmButton)
view.subviews.forEach {
Expand Down
Loading