Skip to content

Commit

Permalink
Merge pull request #32 from Team-HMH/feat/#29-ChallengView-Footer
Browse files Browse the repository at this point in the history
Feat [#29] 나의 챌린지 뷰 Footer Button 완성
  • Loading branch information
Zoe0929 authored Jan 8, 2024
2 parents 4a843ab + 9b21796 commit 098bc51
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 73 deletions.
16 changes: 16 additions & 0 deletions HMH_iOS/HMH_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
174AF4982B447CF100450D07 /* ChanllengeModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174AF4972B447CF100450D07 /* ChanllengeModels.swift */; };
174AF49A2B447CFB00450D07 /* ChanllengeViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174AF4992B447CFB00450D07 /* ChanllengeViews.swift */; };
174AF49C2B447D0700450D07 /* ChallengeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174AF49B2B447D0700450D07 /* ChallengeViewController.swift */; };
364C4E712B4BC9780015729C /* AppAddButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 364C4E702B4BC9780015729C /* AppAddButtonView.swift */; };
364C4E732B4BF27C0015729C /* AppAddCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 364C4E722B4BF27C0015729C /* AppAddCollectionReusableView.swift */; };
3666C84D2B45F41300564874 /* HMHAppSelectButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3666C84C2B45F41300564874 /* HMHAppSelectButtonView.swift */; };
3666C8552B45F47600564874 /* DeviceActivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3666C8542B45F47600564874 /* DeviceActivity.framework */; };
3666C8582B45F47600564874 /* DeviceActivityMonitorExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3666C8572B45F47600564874 /* DeviceActivityMonitorExtension.swift */; };
Expand Down Expand Up @@ -170,6 +172,8 @@
174AF4972B447CF100450D07 /* ChanllengeModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChanllengeModels.swift; sourceTree = "<group>"; };
174AF4992B447CFB00450D07 /* ChanllengeViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChanllengeViews.swift; sourceTree = "<group>"; };
174AF49B2B447D0700450D07 /* ChallengeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChallengeViewController.swift; sourceTree = "<group>"; };
364C4E702B4BC9780015729C /* AppAddButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppAddButtonView.swift; sourceTree = "<group>"; };
364C4E722B4BF27C0015729C /* AppAddCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppAddCollectionReusableView.swift; sourceTree = "<group>"; };
3666C84C2B45F41300564874 /* HMHAppSelectButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HMHAppSelectButtonView.swift; sourceTree = "<group>"; };
3666C8522B45F47600564874 /* DeviceMonitor.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = DeviceMonitor.appex; sourceTree = BUILT_PRODUCTS_DIR; };
3666C8542B45F47600564874 /* DeviceActivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DeviceActivity.framework; path = System/Library/Frameworks/DeviceActivity.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -557,6 +561,7 @@
174AF4872B447ADF00450D07 /* Models */,
174AF4862B447AD800450D07 /* Views */,
174AF4852B447AC500450D07 /* ViewControllers */,
364C4E6F2B4BC95E0015729C /* SwiftUIView */,
);
path = Challenge;
sourceTree = "<group>";
Expand Down Expand Up @@ -641,6 +646,14 @@
path = Cells;
sourceTree = "<group>";
};
364C4E6F2B4BC95E0015729C /* SwiftUIView */ = {
isa = PBXGroup;
children = (
364C4E702B4BC9780015729C /* AppAddButtonView.swift */,
);
path = SwiftUIView;
sourceTree = "<group>";
};
3666C8492B45F37900564874 /* SwiftUIView */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -711,6 +724,7 @@
3666C8A02B485CC800564874 /* TitleCollectionReusableView.swift */,
36E05FE32B487911005B633E /* GrayBackgroundView.swift */,
36E05FE52B48825A005B633E /* AppCollectionReusableView.swift */,
364C4E722B4BF27C0015729C /* AppAddCollectionReusableView.swift */,
);
path = HeaderFooterView;
sourceTree = "<group>";
Expand Down Expand Up @@ -914,10 +928,12 @@
36A3D9BC2B3EBD2D007EA272 /* UIScreen+.swift in Sources */,
0B50F9CD2B369813000C5046 /* SceneDelegate.swift in Sources */,
36A3D9B42B3EBBED007EA272 /* UIStackView+.swift in Sources */,
364C4E712B4BC9780015729C /* AppAddButtonView.swift in Sources */,
174AF4962B447CE700450D07 /* ChanllengeCells.swift in Sources */,
17314F832B486BEC0089A551 /* AlertViewController.swift in Sources */,
0B8A89B32B369EF700688BA6 /* A.swift in Sources */,
0BC0EBD22B493B6B003EF5D4 /* OnboardingProgressView.swift in Sources */,
364C4E732B4BF27C0015729C /* AppAddCollectionReusableView.swift in Sources */,
17314F7F2B485E150089A551 /* CustomAlertButton.swift in Sources */,
36A3D9BA2B3EBC65007EA272 /* UIButton+.swift in Sources */,
3666C88F2B471C5800564874 /* TabBarController.swift in Sources */,
Expand Down
4 changes: 4 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/Literal/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ enum ImageLiterals {
static var icMyPage: UIImage { .load(named: "mypageDisabled") }
static var icMyPageSelected: UIImage { .load(named: "mypageEnabled") }
}

enum Challenge {
static var icPlus: UIImage { .load(named: "Minus_XL") }
}
}

1 change: 1 addition & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum StringLiteral {
static var titleHeaderViewId = "TitleSectionHeader"
static var appListHeaderViewId = "AppSectionHeader"
static var backgroundViewId = "GrayBackground"
static var appAddFooterViewID = "appAddFooter"
}
}
enum AlertButton {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Minus_XL.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ final class AppListCollectionViewCell: UICollectionViewCell {

override init(frame: CGRect) {
super.init(frame: frame)

setUI()
configureContentView()
}

required init?(coder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// AppAddCollectionReusableView.swift
// HMH_iOS
//
// Created by 지희의 MAC on 1/8/24.
//

import UIKit
import SwiftUI

import SnapKit
import Then

class AppAddCollectionReusableView: UICollectionReusableView {

static let identifier = "AppAddCollectionReusableView"
var hostingController: UIHostingController<AppAddButtonView>?

private lazy var contentViewController : UIHostingController<some View> = {
let model = BlockingApplicationModel.shared
let hostingController = UIHostingController(
rootView: AppAddButtonView()
.environmentObject(model)
)
return hostingController
}()


override init(frame: CGRect) {
super.init(frame: frame)
setUI()
configureView()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setUI(){
setHierarchy()
setConstraints()
}

private func setHierarchy() {
self.addSubviews(contentViewController.view)
}

private func setConstraints() {
contentViewController.view.snp.makeConstraints {
$0.verticalEdges.equalToSuperview()
$0.horizontalEdges.equalToSuperview().inset(20)
}
}

private func configureView() {
contentViewController.view.backgroundColor = .clear
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class GrayBackgroundView: UICollectionReusableView {
private func setConstraints() {
grayBackgroundView.snp.makeConstraints {
$0.leading.trailing.bottom.equalToSuperview()
$0.top.equalToSuperview().offset(-100)
$0.top.equalToSuperview().offset(-200)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// AppAddButtonView.swift
// HMH_iOS
//
// Created by 지희의 MAC on 1/8/24.
//

import SwiftUI

struct AppAddButtonView: View {

@EnvironmentObject var model: BlockingApplicationModel
@State var isPresented = false

var body: some View {
ZStack {
Color(uiColor: .clear)
RoundedRectangle(cornerRadius: 6)
.fill(Color(uiColor: .gray8))
Button(action: { isPresented.toggle() }) {
Image(uiImage: ImageLiterals.Challenge.icPlus)
}
.frame(width: 335, height: 68)
.familyActivityPicker(isPresented: $isPresented, selection: $model.newSelection)
}
.background(Color(.clear))
}
}

#Preview {
AppAddButtonView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class ChallengeViewController: UIViewController {
isBackButton: false,
isTitleLabel: true,
isPointImage: true,
isBackGroundGray: true,
titleText: StringLiteral.Challenge.NavigationBarTitle)
private let challengeView = ChallengeView()

Expand All @@ -39,8 +40,7 @@ final class ChallengeViewController: UIViewController {

private func setConstraints() {
navigationBar.snp.makeConstraints {
$0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
$0.height.equalTo(63.adjustedHeight)
$0.top.leading.trailing.equalToSuperview()
}
}

Expand Down
Loading

0 comments on commit 098bc51

Please sign in to comment.