Skip to content

Commit

Permalink
Fix: OptionOverlay Binding 문제 해결을 위해 StateObject를 State로 변경, ImagePic…
Browse files Browse the repository at this point in the history
…kerViewModel fetchCurrentWriter 수정
  • Loading branch information
JeongWo committed Sep 5, 2024
1 parent e58c9fd commit 5af36a9
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"originHash" : "bc240f009e1fa45c62a841709821f40ecac7be19de79cf2a8db25e79d8ea121b",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version" : "1.2024011602.0"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "21fe1af9be463a359aaf8d96789ef73fc3760d09",
"version" : "11.0.1"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "9118aca998dbe2ceac45d64b21a91c6376928df7",
"version" : "11.1.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "07a2f57d147d2bf368a0d2dcb5579ff082d9e44f",
"version" : "11.1.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
"version" : "10.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb",
"version" : "8.0.2"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "f56d8fc3162de9a498377c7b6cea43431f4f5083",
"version" : "1.65.1"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "2d12673670417654f08f5f90fdd62926dc3a2648",
"version" : "100.0.0"
}
},
{
"identity" : "kingfisher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/onevcat/Kingfisher.git",
"state" : {
"revision" : "2ef543ee21d63734e1c004ad6c870255e8716c50",
"version" : "7.12.0"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "edb6ed4919f7756157fe02f2552b7e3850a538e5",
"version" : "1.28.1"
}
}
],
"version" : 3
}
30 changes: 15 additions & 15 deletions Kabinett/Application/KabinettApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ import FirebaseFirestore
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// FirebaseApp.configure()
//// Uncomment these blocks to use Firebase Emulator Suite
// #if DEBUG
// // Firebase Authenticate Emulator
// Auth.auth().useEmulator(withHost:"localhost", port:9099)
//
// // Firebase Storage Emulator
// Storage.storage().useEmulator(withHost: "localhost", port: 9199)
//
// // Firebaes Firestore Emulator
// let settings = Firestore.firestore().settings
// settings.host = "localhost:8080"
// settings.isSSLEnabled = false
// Firestore.firestore().settings = settings
// #endif
FirebaseApp.configure()
// Uncomment these blocks to use Firebase Emulator Suite
#if DEBUG
// Firebase Authenticate Emulator
Auth.auth().useEmulator(withHost:"localhost", port:9099)

// Firebase Storage Emulator
Storage.storage().useEmulator(withHost: "localhost", port: 9199)

// Firebaes Firestore Emulator
let settings = Firestore.firestore().settings
settings.host = "localhost:8080"
settings.isSSLEnabled = false
Firestore.firestore().settings = settings
#endif

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@ import SwiftUI

struct OptionOverlay: View {
@EnvironmentObject var viewModel: CustomTabViewModel

@State private var letterContent = LetterWriteModel()
@State var letterContent = LetterWriteModel()

@State private var isWritingLetter = false

var body: some View {
ZStack {
Color.black.opacity(0.5)
.edgesIgnoringSafeArea(.all)
.onTapGesture {
withAnimation() {
withAnimation {
viewModel.hideOptions()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,17 @@ final class ImagePickerViewModel: ObservableObject {

@MainActor
func fetchCurrentWriter() async {
let result = await firebaseFirestoreManager.getCurrentWriter()
self.fromUser = result
self.fromUserName = result.name
self.userKabiNumber = String(format: "%06d", result.kabinettNumber)
self.fromUserId = result.id
updateCurrentUser()
var letterContent = LetterWriteModel()
updateSelectedUser(&letterContent, selectedUserName: result.name)
let publisher = await firebaseFirestoreManager.getCurrentWriter()
for await result in publisher.values {
self.fromUser = result
self.fromUserName = result.name
self.userKabiNumber = String(format: "%06d", result.kabinettNumber)
self.fromUserId = result.id
updateCurrentUser()
var letterContent = LetterWriteModel()
updateSelectedUser(&letterContent, selectedUserName: result.name)
break
}
}

// MARK: - Image Loading
Expand Down

0 comments on commit 5af36a9

Please sign in to comment.