Skip to content

Commit

Permalink
[Feat/#29] FooterView 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe0929 committed Jan 8, 2024
1 parent ef9d471 commit efa4ffe
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
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
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 @@ -8,8 +8,22 @@
import SwiftUI

struct AppAddButtonView: View {

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

var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
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))
}
}

Expand Down

0 comments on commit efa4ffe

Please sign in to comment.