diff --git a/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate b/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate index 8e1844b..3811793 100644 Binary files a/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate and b/AcaMate.xcodeproj/project.xcworkspace/xcuserdata/tanine.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/AcaMate/1. View/12. Main/121. Button/CircleBtnView.swift b/AcaMate/1. View/12. Main/121. Button/CircleBtnView.swift index 25d9668..5c250a9 100644 --- a/AcaMate/1. View/12. Main/121. Button/CircleBtnView.swift +++ b/AcaMate/1. View/12. Main/121. Button/CircleBtnView.swift @@ -15,10 +15,18 @@ struct CircleBtnView: View { var body: some View { if let state = vm.btnStates[id] { - Button{ - guard let action = state.action else {return} - action() - } label: { + ZStack { + if state.isReverse { + Circle() + .foregroundStyle(state.backColor) + .frame(width: state.width, height: state.height) + .innerShadow(shape: Circle(), color: Color(.Text.black).opacity(0.75), blur: 8, x: 0, y: 4) + } else { + Circle() + .foregroundStyle(state.backColor) + .frame(width: state.width, height: state.height) + .shadow(color: Color(.Text.black).opacity(0.75), radius: 8, x: 4, y: 8) + } VStack(alignment: .center, spacing: 0) { if let image = state.image { image @@ -27,31 +35,21 @@ struct CircleBtnView: View { .foregroundStyle(state.foreColor) .frame(width: state.width/2, height: state.height/2) } -// if let title = state.title, let font = state.font { Text("\(title)") .font(font) .lineLimit(1) .minimumScaleFactor(0.5) .truncationMode(.tail) - .foregroundStyle(state.textColor) -// .padding() - } - } - .background { - if state.isReverse { - Circle() - .accentColor(state.backColor) - .frame(width: state.width, height: state.height) - .innerShadow(shape: Circle(), color: Color(.Text.black).opacity(0.75), blur: 8, x: 0, y: 4) - } else { - Circle() - .accentColor(state.backColor) - .frame(width: state.width, height: state.height) - .shadow(color: Color(.Text.black).opacity(0.75), radius: 8, x: 4, y: 8) + .foregroundStyle(state.foreColor) } } } + .frame(width: state.width, height: state.height) + .onTapGesture { + guard let action = state.action else {return} + action() + } } } } diff --git a/AcaMate/1. View/12. Main/BottomView.swift b/AcaMate/1. View/12. Main/BottomView.swift index c6cf8ce..4c6e182 100644 --- a/AcaMate/1. View/12. Main/BottomView.swift +++ b/AcaMate/1. View/12. Main/BottomView.swift @@ -29,11 +29,7 @@ struct BottomView: View { } } - // MARK: TO-DO - // 이거 패딩 제대로 안먹는거 이유 찾기 - .padding([.top],12) - .padding([.horizontal],24) -// .padding(EdgeInsets(top: 12, leading: 24, bottom: 0, trailing: 24)) + .padding(EdgeInsets(top: 12, leading: 24, bottom: 0, trailing: 24)) .background { Rectangle() @@ -48,7 +44,7 @@ struct BottomView: View { idList.enumerated().forEach { (index, id) in btnVM.btnStates[id] = ButtonState() - btnVM.setSize(for: id, newWidth: 48, newHeight: 48) + btnVM.setSize(for: id, newWidth: 52, newHeight: 52) btnVM.setText(for: id, newText: btnText[index], newFont: .nps(font: .bold, size: 6)) btnVM.setImage(for: id, newImage: btnImage[index]) diff --git a/AcaMate/1. View/12. Main/TopView.swift b/AcaMate/1. View/12. Main/TopView.swift index 0ba9352..cc72432 100644 --- a/AcaMate/1. View/12. Main/TopView.swift +++ b/AcaMate/1. View/12. Main/TopView.swift @@ -11,13 +11,12 @@ struct TopView: View { @StateObject var btnVM = ButtonViewModel() @State var titleName: String = "" - @State var changeLogo: Bool = false - @State var tailLogo: Bool = false @State private var leftBtnID = UUID() @State private var rightBtnID = UUID() - var myType: UserType = .Teacher + //MARK: - 변경 값 + var myType: UserType = .Student var body: some View { HStack(alignment: .center, spacing: 0) { @@ -36,6 +35,7 @@ struct TopView: View { .foregroundStyle(Color(.Text.detail)) .font(.nps(font: .bold, size: 20)) Spacer() + SimpleBtnView(vm: btnVM, id: rightBtnID) .padding(EdgeInsets(top: 12, leading: 12, bottom: 12, trailing: 24)) diff --git a/AcaMate/3. ViewModel/ButtonViewModel.swift b/AcaMate/3. ViewModel/ButtonViewModel.swift index 8dea48e..5658eeb 100644 --- a/AcaMate/3. ViewModel/ButtonViewModel.swift +++ b/AcaMate/3. ViewModel/ButtonViewModel.swift @@ -74,7 +74,11 @@ class ButtonViewModel: ObservableObject { func setIsReverse(for id: UUID, newValue: Bool){ var state = btnStates[id] ?? ButtonState() state.isReverse = newValue - state.backColor = newValue ? Color(.Second.light) : Color(.Normal.normal) + if state.isReverse { + state.backColor = Color(.Second.light) + } else { + state.backColor = Color(.Normal.normal) + } btnStates[id] = state objectWillChange.send() }