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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum ModulePath {
// MARK: FeatureModule
public extension ModulePath {
enum Presentations: String, CaseIterable {
case Presentation
case Alarm


public static let name: String = "Presentation"
Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let project = Project.makeAppModule(
settings: .appMainSetting,
scripts: [],
dependencies: [
.Presentation(implements: .Presentation)
.Presentation(implements: .Alarm)
],
sources: ["Sources/**"],
resources: ["Resources/**"],
Expand Down
474 changes: 88 additions & 386 deletions Projects/App/WakeyAlarm.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Projects/Domain/Domain/Domain.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
/* Begin PBXBuildFile section */
0E8570F207423AB0E744B1B3 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4B3C081FA4B23D203E149E /* Base.swift */; };
2A6169851FA8215E1FB9DECB /* Test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D005705864AA025B4B6D141 /* Test.swift */; };
2BA613835C724718C71AC731 /* Weekday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F417B97879FC8858005B8A0 /* Weekday.swift */; };
503922CDB2BB007408A1F1A8 /* Alarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8351B60BD8F815B552BAE88B /* Alarm.swift */; };
51F04A09FA761C021A367BD2 /* Weekday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F417B97879FC8858005B8A0 /* Weekday.swift */; };
75DA96A1D875440E6150574F /* Weekday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F417B97879FC8858005B8A0 /* Weekday.swift */; };
871DF765285A91BB052FA3B2 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4B3C081FA4B23D203E149E /* Base.swift */; };
88CDA10498BDB9F509565513 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4B3C081FA4B23D203E149E /* Base.swift */; };
B8F25B1BB1F44811F46AD5E5 /* Weekday.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F417B97879FC8858005B8A0 /* Weekday.swift */; };
DE8E53007A58D972AC68F24E /* Alarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8351B60BD8F815B552BAE88B /* Alarm.swift */; };
EA587A92A5855CD22A768352 /* Domain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD49F277B86481D3D105FAC8 /* Domain.framework */; };
F373BEF266644BC9586F6D54 /* Alarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8351B60BD8F815B552BAE88B /* Alarm.swift */; };
F7724D9391AAFFCE71D42C3E /* Alarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8351B60BD8F815B552BAE88B /* Alarm.swift */; };
FC32589B45C89EF248BAA967 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F4B3C081FA4B23D203E149E /* Base.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -81,10 +89,12 @@
/* Begin PBXFileReference section */
0AE9BAEDDF5D25247BED1FCD /* Domain_Debug.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Domain_Debug.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2F2831DAE4A3A6EFEDCFFB97 /* DomainTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DomainTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2F417B97879FC8858005B8A0 /* Weekday.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weekday.swift; sourceTree = "<group>"; };
5694FB2C899ACBAA155A76FA /* Domain-Stage-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Domain-Stage-Info.plist"; sourceTree = "<group>"; };
6F4B3C081FA4B23D203E149E /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = "<group>"; };
75CE88A21049076913ABA3B1 /* DomainTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "DomainTests-Info.plist"; sourceTree = "<group>"; };
7D005705864AA025B4B6D141 /* Test.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Test.swift; sourceTree = "<group>"; };
8351B60BD8F815B552BAE88B /* Alarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alarm.swift; sourceTree = "<group>"; };
90DE8A3D89255F8F54119CAD /* Domain_Stage.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Domain_Stage.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A50EA664C7E56B2ADB77ECCE /* Domain-Debug-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Domain-Debug-Info.plist"; sourceTree = "<group>"; };
BD15A37E85BAE3A36B2CE72C /* Domain-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Domain-Info.plist"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -156,6 +166,7 @@
28B694539E22431DAF52B883 /* Sources */ = {
isa = PBXGroup;
children = (
CF4E8210A1D8B7A147B27DF7 /* Model */,
6F4B3C081FA4B23D203E149E /* Base.swift */,
);
path = Sources;
Expand Down Expand Up @@ -199,6 +210,15 @@
path = InfoPlists;
sourceTree = "<group>";
};
CF4E8210A1D8B7A147B27DF7 /* Model */ = {
isa = PBXGroup;
children = (
8351B60BD8F815B552BAE88B /* Alarm.swift */,
2F417B97879FC8858005B8A0 /* Weekday.swift */,
);
path = Model;
sourceTree = "<group>";
};
F6F8111D5B2DEF7372E8C847 /* Sources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -387,6 +407,8 @@
buildActionMask = 2147483647;
files = (
0E8570F207423AB0E744B1B3 /* Base.swift in Sources */,
F7724D9391AAFFCE71D42C3E /* Alarm.swift in Sources */,
B8F25B1BB1F44811F46AD5E5 /* Weekday.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -395,6 +417,8 @@
buildActionMask = 2147483647;
files = (
871DF765285A91BB052FA3B2 /* Base.swift in Sources */,
F373BEF266644BC9586F6D54 /* Alarm.swift in Sources */,
51F04A09FA761C021A367BD2 /* Weekday.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -411,6 +435,8 @@
buildActionMask = 2147483647;
files = (
FC32589B45C89EF248BAA967 /* Base.swift in Sources */,
DE8E53007A58D972AC68F24E /* Alarm.swift in Sources */,
2BA613835C724718C71AC731 /* Weekday.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -419,6 +445,8 @@
buildActionMask = 2147483647;
files = (
88CDA10498BDB9F509565513 /* Base.swift in Sources */,
503922CDB2BB007408A1F1A8 /* Alarm.swift in Sources */,
75DA96A1D875440E6150574F /* Weekday.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
37 changes: 37 additions & 0 deletions Projects/Domain/Domain/Sources/Model/Alarm.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Alarm.swift
// Domain
//
// Created by 김민희 on 11/4/25.
//

import Foundation

public struct Alarm {
public var id: UUID = UUID()
public var title: String
public var time: Date
public var isEnabled: Bool
public var repeatDays: [Weekday]

public init(id: UUID, title: String, time: Date, isEnabled: Bool, repeatDays: [Weekday]) {
self.id = id
self.title = title
self.time = time
self.isEnabled = isEnabled
self.repeatDays = repeatDays
}

public var formattedTime: (String, String) {
let formatter = DateFormatter()
formatter.dateFormat = "h:mm a"
formatter.locale = Locale(identifier: "en_US_POSIX")
Copy link
Collaborator

Choose a reason for hiding this comment

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

local 이유 알 수있을까요 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오전, 오후를 나타내는 방식이 locale에 따라 달라져서 고정시키려고 사용했습니다
고정시키지 않으면 미국: 3:15 PM, 한국: 오후 3:15 이런식으로 사용자 기기 설정에 따라 다르게 나타날 수 있습니다.

let full = formatter.string(from: time)
let parts = full.split(separator: " ")
if parts.count == 2 {
return (String(parts[0]), String(parts[1]))
} else {
return (full, "")
}
}
}
20 changes: 20 additions & 0 deletions Projects/Domain/Domain/Sources/Model/Weekday.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Weekday.swift
// Domain
//
// Created by 김민희 on 11/4/25.
//

import Foundation

public enum Weekday: String {
case sunday = "일"
case monday = "월"
case tuesday = "화"
case wednesday = "수"
case thursday = "목"
case friday = "금"
case saturday = "토"

public var id: String { self.rawValue }
}
Loading
Loading