Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add] floating button #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Binary file modified .DS_Store
Binary file not shown.
Binary file not shown.
Binary file added Cuckoo_swiftUI/.DS_Store
Binary file not shown.
Binary file added Cuckoo_swiftUI/Cuckoo/.DS_Store
Binary file not shown.
89 changes: 87 additions & 2 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
7A7F87A02AEF559E00F14B11 /* CuckooUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A7F879F2AEF559E00F14B11 /* CuckooUITestsLaunchTests.swift */; };
A82451F02AFE69A600EB4F54 /* AddMemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A82451EF2AFE69A600EB4F54 /* AddMemoView.swift */; };
A82451F22B09F2B300EB4F54 /* NavView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A82451F12B09F2B300EB4F54 /* NavView.swift */; };
<<<<<<< Updated upstream
A82451F42B09F4CE00EB4F54 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A82451F32B09F4CE00EB4F54 /* SettingsView.swift */; };
=======
A82451F62B1563B000EB4F54 /* AlarmView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A82451F52B1563B000EB4F54 /* AlarmView.swift */; };
>>>>>>> Stashed changes
A8BC238F2AFA013B00A2F87F /* MainContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8BC238E2AFA013B00A2F87F /* MainContainerView.swift */; };
A8BC23912AFA014B00A2F87F /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8BC23902AFA014B00A2F87F /* MainView.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -51,7 +55,11 @@
7A7F879F2AEF559E00F14B11 /* CuckooUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CuckooUITestsLaunchTests.swift; sourceTree = "<group>"; };
A82451EF2AFE69A600EB4F54 /* AddMemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddMemoView.swift; sourceTree = "<group>"; };
A82451F12B09F2B300EB4F54 /* NavView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavView.swift; sourceTree = "<group>"; };
<<<<<<< Updated upstream
A82451F32B09F4CE00EB4F54 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
=======
A82451F52B1563B000EB4F54 /* AlarmView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlarmView.swift; sourceTree = "<group>"; };
>>>>>>> Stashed changes
A8BC238E2AFA013B00A2F87F /* MainContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainContainerView.swift; sourceTree = "<group>"; };
A8BC23902AFA014B00A2F87F /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -81,6 +89,78 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
<<<<<<< Updated upstream
=======
00652D9D2B144047004C3345 /* SettingViews */ = {
isa = PBXGroup;
children = (
00652D952B143E70004C3345 /* SettingTagView.swift */,
00652D972B143E84004C3345 /* SettingView.swift */,
00652D992B143F73004C3345 /* SettingAlarmPeriodView.swift */,
00652D9B2B143FAE004C3345 /* SettingProfileView.swift */,
);
path = SettingViews;
sourceTree = "<group>";
};
00652D9E2B14408B004C3345 /* Components */ = {
isa = PBXGroup;
children = (
00A73E0E2B0C583900B59084 /* ViewComponents.swift */,
00652D9F2B1440BC004C3345 /* Dummy.swift */,
00652DA12B1443AB004C3345 /* functions.swift */,
);
path = Components;
sourceTree = "<group>";
};
00A73DF72B0C301200B59084 /* Views */ = {
isa = PBXGroup;
children = (
00652D9E2B14408B004C3345 /* Components */,
00652D9D2B144047004C3345 /* SettingViews */,
00A73E0C2B0C519100B59084 /* InitialViews */,
A8BC23902AFA014B00A2F87F /* MainView.swift */,
A82451EF2AFE69A600EB4F54 /* AddMemoView.swift */,
A8BC238E2AFA013B00A2F87F /* MainContainerView.swift */,
A82451F12B09F2B300EB4F54 /* NavView.swift */,
00652D932B143E51004C3345 /* MemoDetailView.swift */,
A82451F52B1563B000EB4F54 /* AlarmView.swift */,
);
path = Views;
sourceTree = "<group>";
};
00A73DF82B0C318600B59084 /* ViewModels */ = {
isa = PBXGroup;
children = (
00A73DFA2B0C31D700B59084 /* AddMemoViewModel.swift */,
00A73E022B0C35F300B59084 /* MainContainerViewModel.swift */,
);
path = ViewModels;
sourceTree = "<group>";
};
00A73DF92B0C319800B59084 /* Models */ = {
isa = PBXGroup;
children = (
00A73DFC2B0C323800B59084 /* Memo.swift */,
00A73DFE2B0C324200B59084 /* User.swift */,
00A73E002B0C35D300B59084 /* Tag.swift */,
00A73E042B0C37A600B59084 /* MemoRepository.swift */,
00A73E062B0C37CB00B59084 /* UserRepository.swift */,
00A73E082B0C37DC00B59084 /* TagRepository.swift */,
);
path = Models;
sourceTree = "<group>";
};
00A73E0C2B0C519100B59084 /* InitialViews */ = {
isa = PBXGroup;
children = (
00A73E0A2B0C40B700B59084 /* 1_Init_AddNameAndTagView.swift */,
00652D8F2B12E2DB004C3345 /* 2_Init_AddAlarmPresetView.swift */,
00652D912B12FA1A004C3345 /* 3_Init_AddInfoConfirmView.swift */,
);
path = InitialViews;
sourceTree = "<group>";
};
>>>>>>> Stashed changes
7A7F87762AEF559C00F14B11 = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -275,6 +355,11 @@
A82451F22B09F2B300EB4F54 /* NavView.swift in Sources */,
7A7F87852AEF559C00F14B11 /* ContentView.swift in Sources */,
A8BC23912AFA014B00A2F87F /* MainView.swift in Sources */,
<<<<<<< Updated upstream
=======
00652DA22B1443AB004C3345 /* functions.swift in Sources */,
A82451F62B1563B000EB4F54 /* AlarmView.swift in Sources */,
>>>>>>> Stashed changes
A82451F02AFE69A600EB4F54 /* AddMemoView.swift in Sources */,
A82451F42B09F4CE00EB4F54 /* SettingsView.swift in Sources */,
A8BC238F2AFA013B00A2F87F /* MainContainerView.swift in Sources */,
Expand Down Expand Up @@ -455,7 +540,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = softwarestudio2.Cuckoo;
PRODUCT_BUNDLE_IDENTIFIER = com.codershigh.hyu2023.Cuckoo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -484,7 +569,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = softwarestudio2.Cuckoo;
PRODUCT_BUNDLE_IDENTIFIER = com.codershigh.hyu2023.Cuckoo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Cuckoo_swiftUI/Cuckoo/Cuckoo/CuckooApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
struct CuckooApp: App {
var body: some Scene {
WindowGroup {
NavView()
MainView()
}
}
}
41 changes: 33 additions & 8 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo/MainContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,39 @@ import SwiftUI

struct MainContainerView: View {
let title: String
let details: [String]
let detail: String
let tag: String
let timeAgo: String
let memoURL: String
let imageName: String

var body: some View {
HStack {
VStack(alignment: .leading, spacing: 8) {
VStack(alignment: .leading, spacing: 5) {
Text(title)
.font(.headline)
.fontWeight(.bold)
ForEach(details, id: \.self) { detail in
Text(detail)
.font(.subheadline)
.font(.system(size:14, weight:.bold))
.frame(maxWidth: 133, alignment: .leading)
Text(detail)
.font(.system(size:12, weight: .regular))
.frame(maxWidth: 133,maxHeight: 60, alignment: .topLeading)
.foregroundColor(Color(red: 0.70, green: 0.70, blue: 0.70))
VStack(alignment: .leading, spacing: 0){
HStack(spacing:0){
Text(tag)
.font(.system(size: 8, weight:.light))
.foregroundColor(Color(red: 0.70, green: 0.70, blue: 0.70))
Text(timeAgo)
.font(.system(size: 8, weight:.light))
.foregroundColor(Color(red: 0.70, green: 0.70, blue: 0.70))
}
Text(memoURL)
.font(.system(size: 8, weight:.light))
.underline()
.foregroundColor(Color(red: 0.70, green: 0.70, blue: 0.70))
.frame(maxWidth:133, alignment:.leading)
}


}
Spacer()
Image(systemName: imageName)
Expand All @@ -36,6 +56,11 @@ struct MainContainerView: View {

struct Item {
let title: String
let details: [String]
let detail: String
let tag: String
let timeAgo: String
let memoURL: String
let imageName: String
}


55 changes: 42 additions & 13 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ struct MainView: View {
@State private var text = "Initial Text"
@State private var isEditing = false
@State private var isPresentingMemoSheet = false
@State private var isPresentingSettingSheet = false
@State private var newMemoTitle = ""
@State private var newMemoDetails = ""



//메모들을 위한 item
Expand Down Expand Up @@ -56,7 +58,7 @@ struct MainView: View {
Text("\(itemCount)개의 메모")
.frame(width:110)
.padding([.leading],10)

}

}
Expand All @@ -67,23 +69,26 @@ struct MainView: View {
.resizable()
.foregroundColor(.gray)
.frame(width: 30, height: 30)

}
Menu {
Button("Cancel", action: {})
Button("Add Memo", action: {
isPresentingMemoSheet.toggle()
})
Button("Settings", action: {
self.isPresentingSettingSheet.toggle()
})
} label: {
Image(systemName: "ellipsis")
.frame(width:100)
.padding([.leading],65)
.padding([.trailing],0)
}
.sheet(isPresented: $isPresentingSettingSheet) {
// Memo entry view
SettingsView()
}
.sheet(isPresented: $isPresentingMemoSheet) {
// Memo entry view
AddMemoView()
}
// Memo entry view
AddMemoView()
}
}
Section{
List{
Expand Down Expand Up @@ -114,10 +119,29 @@ struct MainView: View {
.padding(.bottom, 16)
}
}
}
.tabItem {
Image(systemName: "1.circle")
Text("Main")
.overlay(
// Floating Action Button
Button(action: {
// Add your button action here
isPresentingMemoSheet.toggle()
}) {
Image(systemName: "pencil")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 30, height: 30)
.foregroundColor(.white)
.padding()
}
.background(Color.gray)
.clipShape(Circle())
.padding()
.padding(.bottom, 16) // Adjust the bottom padding as needed
, alignment: .bottomTrailing
)
// .tabItem {
// Image(systemName: "1.circle")
// Text("Main")
// }
}
}
}
Expand All @@ -127,3 +151,8 @@ struct MainView_PreViews: PreviewProvider {
MainView()
}
}


#Preview {
MainView()
}
54 changes: 27 additions & 27 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo/NavView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
// Created by 장동우 on 2023/11/19.
//

import SwiftUI

struct NavView: View {
//@Binding var showMenu: Bool
var body: some View {
TabView {
MainView()
.tabItem {
Image(systemName: "1.circle")
Text("Main")
}

AddMemoView()
.tabItem {
Image(systemName: "2.circle")
Text("ADD")
}

SettingsView()
.tabItem {
Image(systemName: "3.circle")
Text("Final")
}
}
}
}

//import SwiftUI
//
//struct NavView: View {
// //@Binding var showMenu: Bool
// var body: some View {
// TabView {
// MainView()
// .tabItem {
// Image(systemName: "1.circle")
// Text("Main")
// }
//
// AddMemoView()
// .tabItem {
// Image(systemName: "2.circle")
// Text("ADD")
// }
//
// SettingsView()
// .tabItem {
// Image(systemName: "3.circle")
// Text("Final")
// }
// }
// }
//}
//
8 changes: 4 additions & 4 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ struct SettingsView: View {
Text("Settings View")
.font(.largeTitle)
}
.tabItem {
Image(systemName: "3.circle")
Text("Settings")
}
// .tabItem {
// Image(systemName: "3.circle")
// Text("Settings")
// }
}
}

Expand Down
18 changes: 18 additions & 0 deletions Cuckoo_swiftUI/Cuckoo/Cuckoo/Views/AlarmView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// AlarmView.swift
// Cuckoo
//
// Created by 장동우 on 2023/11/28.
//

import SwiftUI

struct AlarmView: View {
var body: some View {
Text("AlarmALARMAlarmALARMAlarmALARMAlarmALARMAlarmALARMAlarmALARM")
}
}

#Preview {
AlarmView()
}
Loading