Skip to content

Commit

Permalink
Merge pull request #285 from APP-iOS5th/Feat/ImportPhoto
Browse files Browse the repository at this point in the history
Feat/import photo
  • Loading branch information
ksiomng authored Jan 7, 2025
2 parents 9747ebf + a1b8b7b commit c7c5ec8
Show file tree
Hide file tree
Showing 15 changed files with 543 additions and 540 deletions.
56 changes: 46 additions & 10 deletions Kabinett.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@
53FC6B862C90207400E7D9A8 /* ContentRectangleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FC6B852C90207400E7D9A8 /* ContentRectangleView.swift */; };
53FC6B882C9020C100E7D9A8 /* Extension+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FC6B872C9020C100E7D9A8 /* Extension+String.swift */; };
53FC6B8A2C90221600E7D9A8 /* LetterHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FC6B892C90221600E7D9A8 /* LetterHelper.swift */; };
573EE1F42D2BA4DF00978283 /* FontMenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573EE1F32D2BA4DF00978283 /* FontMenuView.swift */; };
573EE1F62D2BA50300978283 /* MiniTabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573EE1F52D2BA50300978283 /* MiniTabBarView.swift */; };
573EE1F82D2BA55B00978283 /* CustomTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573EE1F72D2BA55B00978283 /* CustomTextEditor.swift */; };
57485D3B2C772332000601BF /* ContentWriteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57485D3A2C772332000601BF /* ContentWriteView.swift */; };
5753E0A02CE1AB8200ACC007 /* WriteLetterEnvelopeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5753E09F2CE1AB8200ACC007 /* WriteLetterEnvelopeCell.swift */; };
577156F32C74624C00E21162 /* SourceHanSerifK-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 577156F22C74624C00E21162 /* SourceHanSerifK-Bold.otf */; };
577156F52C7462E300E21162 /* MaruBuriot-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 577156F42C7462E300E21162 /* MaruBuriot-Bold.otf */; };
577156F72C746A7C00E21162 /* MaruBuriot-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 577156F62C746A7C00E21162 /* MaruBuriot-Regular.otf */; };
577156FD2C7584E000E21162 /* NavigationBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577156FC2C7584E000E21162 /* NavigationBarView.swift */; };
577157012C75D73700E21162 /* Extension+UIApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577157002C75D73700E21162 /* Extension+UIApplication.swift */; };
577157032C75D7C300E21162 /* StationerySelectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED9CDD2C73698B00A4312C /* StationerySelectionViewModel.swift */; };
577157052C75DD9900E21162 /* Writer.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA58F172C69DB1300A7C569 /* Writer.swift */; };
Expand All @@ -66,12 +68,15 @@
57966BA02C7EC452008D650B /* SelectionTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57966B9F2C7EC452008D650B /* SelectionTabView.swift */; };
57966BA42C7FF739008D650B /* PreviewLetterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57966BA32C7FF738008D650B /* PreviewLetterView.swift */; };
57966BA62C81FD98008D650B /* PreviewLetterViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57966BA52C81FD98008D650B /* PreviewLetterViewModel.swift */; };
579E35FB2D2BB0B300F92A87 /* StationeryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579E35FA2D2BB0B300F92A87 /* StationeryCell.swift */; };
579E35FD2D2BB0FA00F92A87 /* EnvelopeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579E35FC2D2BB0FA00F92A87 /* EnvelopeCell.swift */; };
579E35FF2D2BB11400F92A87 /* StampCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579E35FE2D2BB11400F92A87 /* StampCell.swift */; };
57A014FE2CA57E7100580883 /* NanumMyeongjo.otf in Resources */ = {isa = PBXBuildFile; fileRef = 57A014FD2CA57E7100580883 /* NanumMyeongjo.otf */; };
57C35C672CCA02130083A346 /* FontUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57C35C662CCA02130083A346 /* FontUtility.swift */; };
57EBE5B02C69E5F2003ECD7F /* UserSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57EBE5AF2C69E5F2003ECD7F /* UserSelectionView.swift */; };
57EBE5B92C6B399C003ECD7F /* StationerySelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57EBE5B82C6B399C003ECD7F /* StationerySelectionView.swift */; };
57ED94FA2C84AFAC00A6F187 /* LetterWriteModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED94F92C84AFAC00A6F187 /* LetterWriteModel.swift */; };
57ED9CD52C70E4A400A4312C /* FontSelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED9CD42C70E4A400A4312C /* FontSelectionView.swift */; };
57ED9CD52C70E4A400A4312C /* OpenSourceLicenseModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED9CD42C70E4A400A4312C /* OpenSourceLicenseModalView.swift */; };
57ED9CD72C72C8C900A4312C /* UserSelectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED9CD62C72C8C900A4312C /* UserSelectionViewModel.swift */; };
57ED9CDA2C733D5300A4312C /* FontSelectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57ED9CD92C733D5300A4312C /* FontSelectionViewModel.swift */; };
57ED9CE02C73749800A4312C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 57ED9CDF2C73749800A4312C /* Assets.xcassets */; };
Expand Down Expand Up @@ -193,12 +198,14 @@
53FC6B852C90207400E7D9A8 /* ContentRectangleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentRectangleView.swift; sourceTree = "<group>"; };
53FC6B872C9020C100E7D9A8 /* Extension+String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+String.swift"; sourceTree = "<group>"; };
53FC6B892C90221600E7D9A8 /* LetterHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LetterHelper.swift; sourceTree = "<group>"; };
573EE1F32D2BA4DF00978283 /* FontMenuView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontMenuView.swift; sourceTree = "<group>"; };
573EE1F52D2BA50300978283 /* MiniTabBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiniTabBarView.swift; sourceTree = "<group>"; };
573EE1F72D2BA55B00978283 /* CustomTextEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextEditor.swift; sourceTree = "<group>"; };
57485D3A2C772332000601BF /* ContentWriteView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentWriteView.swift; sourceTree = "<group>"; };
5753E09F2CE1AB8200ACC007 /* WriteLetterEnvelopeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WriteLetterEnvelopeCell.swift; sourceTree = "<group>"; };
577156F22C74624C00E21162 /* SourceHanSerifK-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceHanSerifK-Bold.otf"; sourceTree = "<group>"; };
577156F42C7462E300E21162 /* MaruBuriot-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "MaruBuriot-Bold.otf"; sourceTree = "<group>"; };
577156F62C746A7C00E21162 /* MaruBuriot-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "MaruBuriot-Regular.otf"; sourceTree = "<group>"; };
577156FC2C7584E000E21162 /* NavigationBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarView.swift; sourceTree = "<group>"; };
577157002C75D73700E21162 /* Extension+UIApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+UIApplication.swift"; sourceTree = "<group>"; };
5771570A2C77071300E21162 /* ContentWriteViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentWriteViewModel.swift; sourceTree = "<group>"; };
577C86722C8B8D5700EAB1BE /* Extension+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Extension+View.swift"; sourceTree = "<group>"; };
Expand All @@ -209,12 +216,15 @@
57966B9F2C7EC452008D650B /* SelectionTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectionTabView.swift; sourceTree = "<group>"; };
57966BA32C7FF738008D650B /* PreviewLetterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewLetterView.swift; sourceTree = "<group>"; };
57966BA52C81FD98008D650B /* PreviewLetterViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewLetterViewModel.swift; sourceTree = "<group>"; };
579E35FA2D2BB0B300F92A87 /* StationeryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StationeryCell.swift; sourceTree = "<group>"; };
579E35FC2D2BB0FA00F92A87 /* EnvelopeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvelopeCell.swift; sourceTree = "<group>"; };
579E35FE2D2BB11400F92A87 /* StampCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StampCell.swift; sourceTree = "<group>"; };
57A014FD2CA57E7100580883 /* NanumMyeongjo.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = NanumMyeongjo.otf; sourceTree = "<group>"; };
57C35C662CCA02130083A346 /* FontUtility.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = FontUtility.swift; path = ../../../../FontUtility.swift; sourceTree = "<group>"; };
57EBE5AF2C69E5F2003ECD7F /* UserSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSelectionView.swift; sourceTree = "<group>"; };
57EBE5B82C6B399C003ECD7F /* StationerySelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StationerySelectionView.swift; sourceTree = "<group>"; };
57ED94F92C84AFAC00A6F187 /* LetterWriteModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LetterWriteModel.swift; path = Kabinett/Presentation/ViewModel/WriteLetter/LetterWriteModel.swift; sourceTree = SOURCE_ROOT; };
57ED9CD42C70E4A400A4312C /* FontSelectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSelectionView.swift; sourceTree = "<group>"; };
57ED9CD42C70E4A400A4312C /* OpenSourceLicenseModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenSourceLicenseModalView.swift; sourceTree = "<group>"; };
57ED9CD62C72C8C900A4312C /* UserSelectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSelectionViewModel.swift; sourceTree = "<group>"; };
57ED9CD92C733D5300A4312C /* FontSelectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontSelectionViewModel.swift; sourceTree = "<group>"; };
57ED9CDD2C73698B00A4312C /* StationerySelectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StationerySelectionViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -365,6 +375,29 @@
path = Extension;
sourceTree = "<group>";
};
579E35F82D2BAE0300F92A87 /* Components */ = {
isa = PBXGroup;
children = (
57ED9CD42C70E4A400A4312C /* OpenSourceLicenseModalView.swift */,
57966B9F2C7EC452008D650B /* SelectionTabView.swift */,
573EE1F32D2BA4DF00978283 /* FontMenuView.swift */,
573EE1F52D2BA50300978283 /* MiniTabBarView.swift */,
573EE1F72D2BA55B00978283 /* CustomTextEditor.swift */,
);
path = Components;
sourceTree = "<group>";
};
579E35F92D2BB09700F92A87 /* Cells */ = {
isa = PBXGroup;
children = (
5753E09F2CE1AB8200ACC007 /* WriteLetterEnvelopeCell.swift */,
579E35FA2D2BB0B300F92A87 /* StationeryCell.swift */,
579E35FC2D2BB0FA00F92A87 /* EnvelopeCell.swift */,
579E35FE2D2BB11400F92A87 /* StampCell.swift */,
);
path = Cells;
sourceTree = "<group>";
};
57ED9CE12C7375AC00A4312C /* Font */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -547,12 +580,10 @@
8366B6F32C65ECE60021FAE0 /* WriteLetter */ = {
isa = PBXGroup;
children = (
5753E09F2CE1AB8200ACC007 /* WriteLetterEnvelopeCell.swift */,
577156FC2C7584E000E21162 /* NavigationBarView.swift */,
57966B9F2C7EC452008D650B /* SelectionTabView.swift */,
579E35F92D2BB09700F92A87 /* Cells */,
579E35F82D2BAE0300F92A87 /* Components */,
57EBE5AF2C69E5F2003ECD7F /* UserSelectionView.swift */,
57EBE5B82C6B399C003ECD7F /* StationerySelectionView.swift */,
57ED9CD42C70E4A400A4312C /* FontSelectionView.swift */,
57485D3A2C772332000601BF /* ContentWriteView.swift */,
57966B972C7D574E008D650B /* EnvelopeStampSelectionView.swift */,
57966BA32C7FF738008D650B /* PreviewLetterView.swift */,
Expand Down Expand Up @@ -965,9 +996,10 @@
AFA75B272D013F8900DA418F /* FirestoreLetterWriteManager.swift in Sources */,
577157052C75DD9900E21162 /* Writer.swift in Sources */,
04DEC0FE2C7EDB1100D289EA /* KabinettNumberFormatter.swift in Sources */,
573EE1F42D2BA4DF00978283 /* FontMenuView.swift in Sources */,
83F0D6872C7072DB001B8733 /* FirestoreWriterManager.swift in Sources */,
579E35FD2D2BB0FA00F92A87 /* EnvelopeCell.swift in Sources */,
53FC6B842C90204D00E7D9A8 /* CloseButtonView.swift in Sources */,
577156FD2C7584E000E21162 /* NavigationBarView.swift in Sources */,
835684412CE0A43600120EC8 /* InjectionKey.swift in Sources */,
5300DA4E2C7EC2F9005F22EB /* LetterView.swift in Sources */,
53FC6B862C90207400E7D9A8 /* ContentRectangleView.swift in Sources */,
Expand All @@ -976,7 +1008,7 @@
57ED9CDA2C733D5300A4312C /* FontSelectionViewModel.swift in Sources */,
577157032C75D7C300E21162 /* StationerySelectionViewModel.swift in Sources */,
AF9B18FA2C894B7100F3E446 /* DefaultLetterBoxUseCase.swift in Sources */,
57ED9CD52C70E4A400A4312C /* FontSelectionView.swift in Sources */,
57ED9CD52C70E4A400A4312C /* OpenSourceLicenseModalView.swift in Sources */,
7F397C552C7DF20C00388645 /* ImportDialog.swift in Sources */,
7F7868562C7B14220083D204 /* HorizontalPadding.swift in Sources */,
8356843F2CE0A43600120EC8 /* DIContainer.swift in Sources */,
Expand All @@ -989,12 +1021,14 @@
534C67B72C7FF85700F0C175 /* LetterContentView.swift in Sources */,
7FCAE2BA2C73102900228FA7 /* ImageDetailView.swift in Sources */,
04DEC0E72C6C6C7300D289EA /* ProfileView.swift in Sources */,
573EE1F62D2BA50300978283 /* MiniTabBarView.swift in Sources */,
53A482DA2C6C6F2D00F00A9A /* LetterBoxCell.swift in Sources */,
5358E0792CE1EC7E0089C59F /* PhotoDetailView.swift in Sources */,
53A482D42C6B4E8600F00A9A /* LetterBoxView.swift in Sources */,
530C765A2C7638D9007E09C6 /* LetterBoxViewModel.swift in Sources */,
5359618D2C7488DD0031E181 /* TransparentBlurView.swift in Sources */,
57C35C672CCA02130083A346 /* FontUtility.swift in Sources */,
579E35FF2D2BB11400F92A87 /* StampCell.swift in Sources */,
8356843E2CE0A43600120EC8 /* UseCaseKeys.swift in Sources */,
538150512C8AD5FB007B1E5A /* LayoutHelper.swift in Sources */,
535961912C74F5870031E181 /* CalendarView.swift in Sources */,
Expand Down Expand Up @@ -1045,6 +1079,7 @@
57966BA42C7FF739008D650B /* PreviewLetterView.swift in Sources */,
04DEC0DD2C6A3AD600D289EA /* SignUpView.swift in Sources */,
7F6CE9E22C6E25500074568E /* CameraViewModel.swift in Sources */,
573EE1F82D2BA55B00978283 /* CustomTextEditor.swift in Sources */,
7FCAE2BC2C73157C00228FA7 /* LetterWritingView.swift in Sources */,
7F6CE9C22C6B33DD0074568E /* OptionOverlay.swift in Sources */,
57966B9C2C7D8DAF008D650B /* EnvelopeStampSelectionViewModel.swift in Sources */,
Expand All @@ -1062,6 +1097,7 @@
53A99EA72C8190B600896AAC /* SearchBarView.swift in Sources */,
577157012C75D73700E21162 /* Extension+UIApplication.swift in Sources */,
83D9C8E52C830C7600EF2684 /* DefaultSignUpUseCase.swift in Sources */,
579E35FB2D2BB0B300F92A87 /* StationeryCell.swift in Sources */,
832C72672C71CF7B0071E8D0 /* SignUpUseCase.swift in Sources */,
04DEC0EB2C6C87B500D289EA /* AccountSettingsView.swift in Sources */,
);
Expand Down
68 changes: 68 additions & 0 deletions Kabinett/Presentation/View/WriteLetter/Cells/EnvelopeCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// EnvelopeCell.swift
// Kabinett
//
// Created by Song Kim on 1/6/25.
//

import SwiftUI
import Kingfisher

struct EnvelopeCell: View {
@Binding var letterContent: LetterWriteModel
@Binding var envelopeImageUrl: String
@ObservedObject var viewModel: EnvelopeStampSelectionViewModel

var body: some View {
ZStack {
Color(.background).ignoresSafeArea()

VStack {
List {
ForEach(0..<viewModel.envelopeNumberOfRows, id: \.self) { rowIndex in
HStack {
ForEach(0..<2, id: \.self) { columnIndex in
let index = viewModel.envelopeIndex(row: rowIndex, column: columnIndex)

if index < viewModel.envelopes.count {
ZStack(alignment: .topTrailing) {
KFImage(URL(string: viewModel.envelopes[index]))
.placeholder {
ProgressView()
}
.resizable()
.aspectRatio(9/4, contentMode: .fit)
.padding(10)
.shadow(color: Color(.primary300), radius: 5, x: 3, y: 3)
.onTapGesture {
viewModel.envelopeSelectStationery(coordinates: (rowIndex, columnIndex))
envelopeImageUrl = viewModel.envelopes[index]
letterContent.envelopeImageUrlString = viewModel.envelopes[index]
}

if viewModel.isEnvelopeSelected(coordinates: (rowIndex, columnIndex)) {
Image("checked")
.resizable()
.frame(width: 27, height: 27)
.padding([.top, .trailing], 20)
.onAppear {
letterContent.envelopeImageUrlString = viewModel.envelopes[viewModel.envelopeIndex(row: rowIndex, column: columnIndex)]
}
}
}
}
}
}
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.listRowInsets(EdgeInsets())
.padding(.top, 10)
}
}
.listStyle(.plain)
.padding(.leading, -10)
.padding(.trailing, -5)
}
}
}
}
Loading

0 comments on commit c7c5ec8

Please sign in to comment.