Skip to content

Commit

Permalink
Merge pull request #158 from boostcampwm2023/iOS/epic/SpotScene
Browse files Browse the repository at this point in the history
[iOS] Spot Scene 적용
  • Loading branch information
SwiftyJunnos authored Nov 30, 2023
2 parents 059828d + 2c4ab6f commit cc13c34
Show file tree
Hide file tree
Showing 82 changed files with 3,883 additions and 841 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

31 changes: 30 additions & 1 deletion iOS/Features/JourneyList/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ private extension String {

static let package = "FeatureJourneyList"

var fromRootPath: String {
return "../../" + self
}

}

private enum Target {
Expand All @@ -17,6 +21,15 @@ private enum Target {

}

private enum Dependency {

static let msUIKit = "MSUIKit"
static let msCacheStorage = "MSCacheStorage"
static let msCoreKit = "MSCoreKit"
static let msData = "MSData"

}

// MARK: - Package

let package = Package(
Expand All @@ -28,7 +41,23 @@ let package = Package(
.library(name: Target.journeyList,
targets: [Target.journeyList])
],
dependencies: [
.package(name: Dependency.msUIKit,
path: Dependency.msUIKit.fromRootPath),
.package(name: Dependency.msCoreKit,
path: Dependency.msCoreKit.fromRootPath),
.package(name: Dependency.msData,
path: Dependency.msData.fromRootPath)
],
targets: [
.target(name: Target.journeyList)
.target(name: Target.journeyList,
dependencies: [
.product(name: Dependency.msUIKit,
package: Dependency.msUIKit),
.product(name: Dependency.msCacheStorage,
package: Dependency.msCoreKit),
.product(name: Dependency.msData,
package: Dependency.msData)
])
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// DTOConvertor.swift
// JourneyList
//
// Created by 이창준 on 2023.11.27.
//

import MSData

extension Journey {

init(dto: JourneyDTO) {
self.id = dto.id
self.location = dto.location
self.date = dto.metaData.date
self.spots = dto.spots.map { Spot(dto: $0) }
self.song = Song(dto: dto.song)
}

}

extension Spot {

init(dto: ResponsibleSpotDTO) {
self.photoURLs = dto.photoURLs
}

}

extension Song {

init(dto: SongDTO) {
self.title = dto.title
self.artist = dto.artist
}

}
44 changes: 44 additions & 0 deletions iOS/Features/JourneyList/Sources/JourneyList/Model/Journey.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// Journey.swift
// JourneyList
//
// Created by 이창준 on 11/23/23.
//

import Foundation

struct Journey: Hashable, Decodable {

// MARK: - Properties

let id: UUID
let location: String
let date: Date
let spots: [Spot]
let song: Song

// MARK: - Initializer

init(id: UUID = UUID(), location: String, date: Date, spots: [Spot], song: Song) {
self.id = id
self.location = location
self.date = date
self.spots = spots
self.song = song
}

}

// MARK: - Hashable

extension Journey {

static func == (lhs: Journey, rhs: Journey) -> Bool {
return lhs.id == rhs.id
}

func hash(into hasher: inout Hasher) {
hasher.combine(self.id)
}

}
15 changes: 15 additions & 0 deletions iOS/Features/JourneyList/Sources/JourneyList/Model/Song.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Song.swift
// JourneyList
//
// Created by 이창준 on 2023.11.27.
//

import Foundation

struct Song: Decodable {

let artist: String
let title: String

}
14 changes: 14 additions & 0 deletions iOS/Features/JourneyList/Sources/JourneyList/Model/Spot.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Spot.swift
// JourneyList
//
// Created by 이창준 on 11/23/23.
//

import Foundation

struct Spot: Decodable {

let photoURLs: [String]

}
Loading

0 comments on commit cc13c34

Please sign in to comment.