Skip to content
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
41 changes: 0 additions & 41 deletions RunLog/Project.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<string>$(API_KEY)</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>RunLog</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down Expand Up @@ -41,20 +43,6 @@
<string>Dark</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIAppFonts</key>
<array>
<string>NanumMyeongjo-Regular.ttf</string>
<string>RacingSansOne-Regular.ttf</string>
<string>Pretendard-Black.otf</string>
<string>Pretendard-Bold.otf</string>
<string>Pretendard-ExtraBold.otf</string>
<string>Pretendard-ExtraLight.otf</string>
<string>Pretendard-Light.otf</string>
<string>Pretendard-Medium.otf</string>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-SemiBold.otf</string>
<string>Pretendard-Thin.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down Expand Up @@ -92,12 +80,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string></string>
<key>UIImageName</key>
<string></string>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions RunLog/Projects/App/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.app(
name: Module.app.name,
organizationName: Module.organizationName,
infoPlist: .file(path: "InfoPlists/info.plist"),
Copy link
Member

Choose a reason for hiding this comment

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

P2) 추후에 config파일 등 넣게 되면, SupportingFile끼리 폴더링하고 그 안에서 infoplist 위치시키는 방향으로 가면 될 것 같습니다

dependencies: [
Module.inject,
Module.domain,
Module.data,
Module.presentation,
Module.util,
].map(\.project),
resources: .default
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//
// Created by 김도연 on 3/13/25.
//
import RLDomain
import RLData
import RLInject
Comment on lines +7 to +9
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

RLDesignSystem 모듈 import 누락으로 컴파일 오류 가능성

UIFont.registerFonts() 확장은 DesignSystem 모듈에서 정의된 것으로 보입니다.
해당 모듈을 re-export 하지 않는 한, 아래와 같이 명시적으로 임포트해 주세요.

 import RLDomain
 import RLData
 import RLInject
+import RLDesignSystem

Also applies to: 19-20

🤖 Prompt for AI Agents
In RunLog/Projects/App/Sources/AppDelegate.swift at lines 7-9 and also lines
19-20, the RLDesignSystem module is missing from the imports, which may cause
compile errors because UIFont.registerFonts() extension is defined there. Add an
explicit import statement for RLDesignSystem at the top of the file alongside
the existing imports to resolve this issue.


import UIKit

Expand All @@ -13,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
registerDependencies()

UIFont.registerFonts()
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//
// Created by 김도연 on 3/13/25.
//
import RLPresentation
import RLUtil

import UIKit

Expand Down
18 changes: 18 additions & 0 deletions RunLog/Projects/Data/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.framework(
name: Module.data.name,
organizationName: Module.organizationName,
infoPlist: .default,
dependencies: [
Module.inject.project,
Module.domain.project,
Module.util.project,
Copy link
Member

Choose a reason for hiding this comment

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

P0) domain이 util을 가지고 있으면 해당 모듈을 data 모듈에서 사용할 수 있는 걸로 알고 있습니다만 요거 한번 체크해서 graph 한번 다시 구조화해야할 것 같네용

.external(name: "Moya"),
.external(name: "CombineMoya"),
],
coreDataModels: [
.coreDataModel("Sources/DTOs/DTOs.xcdatamodeld")
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//
// Created by 신승재 on 3/18/25.
//
import RLDomain

import Foundation
import CoreData
Expand Down
33 changes: 33 additions & 0 deletions RunLog/Projects/Data/Sources/DataContainer/CoreDataContainer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// CoreDataContainer.swift
// RunLog
//
// Created by 신승재 on 3/20/25.
//

import CoreData

public final class CoreDataContainer {

public init() {}

lazy var persistentContainer: NSPersistentContainer = {
guard let modelURL = Bundle.module.url(forResource: "DTOs", withExtension: "momd"),
let model = NSManagedObjectModel(contentsOf: modelURL) else {
fatalError("Failed to load Core Data model named DTOs")
}

let container = NSPersistentContainer(name: "DTOs", managedObjectModel: model)
container.loadPersistentStores { _, error in
if let error = error as NSError? {
fatalError("Unresolved Core Data error: \(error), \(error.userInfo)")
}
}
return container
}()

public var context: NSManagedObjectContext {
return persistentContainer.viewContext
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
//
// Created by 김도연 on 3/19/25.
//
import RLDomain

import Foundation
import CoreData

final class AppConfigRepositoryImpl: AppConfigRepository {
public final class AppConfigRepositoryImpl: AppConfigRepository {
private let context: NSManagedObjectContext

init(context: NSManagedObjectContext) {
public init(context: NSManagedObjectContext) {
self.context = context
}

func createAppConfig(_ config: AppConfig) async throws {
public func createAppConfig(_ config: AppConfig) async throws {
// print("Impl: ", #function)

try await context.perform { [weak self] in
Expand All @@ -41,7 +42,7 @@ final class AppConfigRepositoryImpl: AppConfigRepository {
}
}

func readAppConfig() async throws -> AppConfig {
public func readAppConfig() async throws -> AppConfig {
// print("Impl: ", #function)

return try await context.perform { [weak self] in
Expand All @@ -65,7 +66,7 @@ final class AppConfigRepositoryImpl: AppConfigRepository {

}

func updateAppConfig(_ config: AppConfig) async throws {
public func updateAppConfig(_ config: AppConfig) async throws {
// print("Impl: ", #function)

return try await context.perform { [weak self] in
Expand Down Expand Up @@ -96,7 +97,7 @@ final class AppConfigRepositoryImpl: AppConfigRepository {
}
}

func deleteAppConfig() async throws {
public func deleteAppConfig() async throws {
// print("Impl: ", #function)

return try await context.perform { [weak self] in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
//
// Created by 신승재 on 3/18/25.
//

import RLDomain

import Foundation
import CoreData

final class DayLogRepositoryImpl: DayLogRepository {
public final class DayLogRepositoryImpl: DayLogRepository {

private let context: NSManagedObjectContext

init(context: NSManagedObjectContext) {
public init(context: NSManagedObjectContext) {
self.context = context
}

func createDayLog(_ dayLog: DayLog) async throws {
public func createDayLog(_ dayLog: DayLog) async throws {
print("Impl: ", #function)

try await context.perform {
Expand All @@ -29,7 +29,7 @@ final class DayLogRepositoryImpl: DayLogRepository {

let existing = try self.context.fetch(fetchRequest)
if !existing.isEmpty {
throw CoreDataError.modelAlreadyExist
throw DataError.modelAlreadyExist
}

let data = DataMapper.toDTO(dayLog, context: self.context)
Expand All @@ -38,7 +38,7 @@ final class DayLogRepositoryImpl: DayLogRepository {
}
}

func readDayLog(date: Date) async throws -> DayLog {
public func readDayLog(date: Date) async throws -> DayLog {
print("Impl: ", #function)

return try await context.perform {
Expand All @@ -49,17 +49,17 @@ final class DayLogRepositoryImpl: DayLogRepository {
)

guard let data = try self.context.fetch(fetchRequest).first else {
throw CoreDataError.modelNotFound
throw DataError.modelNotFound
}
guard let model = DataMapper.toEntity(data) else {
throw CoreDataError.conversionError
throw DataError.conversionError
}

return model
}
}

func readAllDayLogs() async throws -> [DayLog] {
public func readAllDayLogs() async throws -> [DayLog] {
print("Impl: ", #function)

return try await context.perform {
Expand All @@ -72,7 +72,7 @@ final class DayLogRepositoryImpl: DayLogRepository {
}
}

func updateDayLog(_ dayLog: DayLog) async throws {
public func updateDayLog(_ dayLog: DayLog) async throws {
print("Impl: ", #function)

try await context.perform {
Expand All @@ -83,7 +83,7 @@ final class DayLogRepositoryImpl: DayLogRepository {
)

guard let data = try self.context.fetch(fetchRequest).first else {
throw CoreDataError.modelNotFound
throw DataError.modelNotFound
}

data.trackImage = dayLog.trackImage
Expand All @@ -100,7 +100,7 @@ final class DayLogRepositoryImpl: DayLogRepository {
}
}

func deleteDayLog(date: Date) async throws {
public func deleteDayLog(date: Date) async throws {
print("Impl: ", #function)

try await context.perform {
Expand All @@ -111,7 +111,7 @@ final class DayLogRepositoryImpl: DayLogRepository {
)

guard let data = try self.context.fetch(fetchRequest).first else {
throw CoreDataError.modelNotFound
throw DataError.modelNotFound
}

self.context.delete(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ import CoreLocation


/// 사용자가 움직인 거리를 측정하는 매니저
final class DistanceManager {
public final class DistanceManager {

// MARK: - Singleton
static let shared = DistanceManager()
public static let shared = DistanceManager()
private init() {
bind()
}


// MARK: - Input
enum Input {
public enum Input {
case requestDistance(previous: CLLocation, current: CLLocation)
}
let input = PassthroughSubject<Input, Never>()
public let input = PassthroughSubject<Input, Never>()

// MARK: - Output
enum Output {
public enum Output {
case responseDistance(Double)
}
let output = PassthroughSubject<Output, Never>()
public let output = PassthroughSubject<Output, Never>()

// MARK: - Properties
private var cancellables = Set<AnyCancellable>()
Expand Down
Loading
Loading