Skip to content

Commit

Permalink
[#73] 잡버그 fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
00yhsp committed Feb 18, 2024
1 parent 11e39cd commit 93a41ac
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 139 deletions.
4 changes: 4 additions & 0 deletions Spon-us.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
DF5AB1542B8228CC0061F421 /* MakeReportViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5AB1532B8228CC0061F421 /* MakeReportViewModel.swift */; };
DF5AB1572B8266D90061F421 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DF5AB1562B8266D90061F421 /* GoogleService-Info.plist */; };
DF5AB1592B826ABB0061F421 /* CompanyPostView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5AB1582B826ABB0061F421 /* CompanyPostView.swift */; };
DF5AB15B2B827BAB0061F421 /* ReportViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5AB15A2B827BAB0061F421 /* ReportViewModel.swift */; };
DF5B7E922B7FA430001C009C /* PortfolioOfferViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5B7E912B7FA430001C009C /* PortfolioOfferViewModel.swift */; };
DF5B7E942B808DF1001C009C /* EditAnnouncementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5B7E932B808DF0001C009C /* EditAnnouncementViewModel.swift */; };
DF5B7E962B809257001C009C /* EditAnnouncementModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF5B7E952B809257001C009C /* EditAnnouncementModel.swift */; };
Expand Down Expand Up @@ -231,6 +232,7 @@
DF5AB1532B8228CC0061F421 /* MakeReportViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MakeReportViewModel.swift; sourceTree = "<group>"; };
DF5AB1562B8266D90061F421 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
DF5AB1582B826ABB0061F421 /* CompanyPostView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompanyPostView.swift; sourceTree = "<group>"; };
DF5AB15A2B827BAB0061F421 /* ReportViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportViewModel.swift; sourceTree = "<group>"; };
DF5B7E912B7FA430001C009C /* PortfolioOfferViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PortfolioOfferViewModel.swift; sourceTree = "<group>"; };
DF5B7E932B808DF0001C009C /* EditAnnouncementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditAnnouncementViewModel.swift; sourceTree = "<group>"; };
DF5B7E952B809257001C009C /* EditAnnouncementModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditAnnouncementModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -646,6 +648,7 @@
DF5B7E932B808DF0001C009C /* EditAnnouncementViewModel.swift */,
DF5B7E952B809257001C009C /* EditAnnouncementModel.swift */,
DF5AB1532B8228CC0061F421 /* MakeReportViewModel.swift */,
DF5AB15A2B827BAB0061F421 /* ReportViewModel.swift */,
);
path = Portfolio;
sourceTree = "<group>";
Expand Down Expand Up @@ -838,6 +841,7 @@
1031EC7C2B68B9F20016655B /* AnnouncementView.swift in Sources */,
106720022B5835FA00493354 /* SendOfferView.swift in Sources */,
3B81BCB22B622EBF0067E9CB /* StoreKitManager.swift in Sources */,
DF5AB15B2B827BAB0061F421 /* ReportViewModel.swift in Sources */,
10C8AC612B5C340D00B40547 /* SendOfferPostView.swift in Sources */,
807BF83F2B51BCD400A659B9 /* SearchView.swift in Sources */,
806AF86A2B79DBD0008F7F62 /* CategoryModel.swift in Sources */,
Expand Down
6 changes: 3 additions & 3 deletions Spon-us/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import PhotosUI
struct ContentView: View {
@AppStorage("loginAccount") var isLoggedIn: String?
@State private var selectedTab: Int = 0

var body: some View {
TabView(selection: $selectedTab) {
HomeView()
Expand All @@ -31,15 +31,15 @@ struct ContentView: View {
.font(.English18)
}
.tag(1)

CategoryView()
.tabItem {
Image(selectedTab == 2 ? "ic_discovery_check" : "ic_discovery")
Text("CATEGORY")
.font(.English18)
}
.tag(2)

MyView(rootIsActive: .constant(false))
.tabItem {
Image(selectedTab == 3 ? "ic_mypage_check" : "ic_mypage")
Expand Down
6 changes: 6 additions & 0 deletions Spon-us/Helper/Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,9 @@ final class AuthInterceptor: RequestInterceptor {
}
}
}

extension UIApplication {
func endEditing() {
sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
1 change: 1 addition & 0 deletions Spon-us/Model/MyPage/MyOrganizationViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class MyOrganizationViewModel: ObservableObject {
self.myOrganization = myOrganizationResponse.content
print(myOrganizationResponse)
} catch {
print(try! response.mapJSON())
print("Error parsing response: \(error)")
}

Expand Down
2 changes: 1 addition & 1 deletion Spon-us/Model/MyPage/OrganizationModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct OrganizationResponse: Codable {
let location: String?
let description: String?
// let imageUrl: String?
let imageUrl: String
let imageUrl: String?
let organizationType: String
// let suborganizationType: String
let suborganizationType: String?
Expand Down
39 changes: 39 additions & 0 deletions Spon-us/Model/Portfolio/ReportViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// ReportViewModel.swift
// Spon-us
//
// Created by 박현수 on 2/19/24.
//

import Foundation

// 최상위 응답 객체
struct ReportResponseModel: Codable {
let statusCode: String
let message: String
let content: ReportContent
}

// 'content' 필드 내용
struct ReportContent: Codable {
let id: Int
let writerId: Int
let title: String
let content: String
let reportImages: [ReportImage]
let reportAttachments: [ReportAttachment]
}

// 'reportImages' 배열 내의 객체
struct ReportImage: Codable {
let id: Int
let name: String
let url: String
}

// 'reportAttachments' 배열 내의 객체
struct ReportAttachment: Codable {
let id: Int
let name: String
let url: String
}
2 changes: 1 addition & 1 deletion Spon-us/View/Category/CategoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ struct CategoryCell: View {
NavigationLink{SearchPostView(announcementId: categoryContent.id, selectedSaveButton: $isBookmarked)} label: {
VStack(spacing: 0){
HStack(alignment: .top, spacing: 0){

AsyncImageView(url: URL(string: categoryContent.mainImage.url))
.aspectRatio(contentMode: .fill)
.frame(width: 95, height: 95)
.clipped()
.padding(.trailing, 16)
Expand Down
3 changes: 3 additions & 0 deletions Spon-us/View/Post/NewPostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ struct NewPostView: View {
}
print("disappear")
}
.onTapGesture {
UIApplication.shared.endEditing()
}
}
}
#Preview {
Expand Down
2 changes: 1 addition & 1 deletion Spon-us/View/ReceivedOffer/EditPostView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ struct SponUsPostFileCell: View {
Text(text)

if (selectedURLsFile1.isEmpty && selectedURLsFile2.isEmpty && selectedURLsFile3.isEmpty) {
Image("ic_check")
Text("")
}
else{
Text("")
Expand Down
Loading

0 comments on commit 93a41ac

Please sign in to comment.