Skip to content

Commit

Permalink
✨ [FEAT] CollectionView Profile View Layout 설정 완료#9
Browse files Browse the repository at this point in the history
  • Loading branch information
SuwonPabby committed Jul 7, 2022
1 parent 56e083a commit 5f572c3
Show file tree
Hide file tree
Showing 16 changed files with 475 additions and 2 deletions.
36 changes: 36 additions & 0 deletions HousLab_iOS/HousLab_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@

/* Begin PBXBuildFile section */
7713C62B2872F26C00F674BF /* Inject in Frameworks */ = {isa = PBXBuildFile; productRef = 7713C62A2872F26C00F674BF /* Inject */; };
9B875C3B287495270084F660 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B875C3A287495270084F660 /* ProfileViewController.swift */; };
9B875C3D287496840084F660 /* ProfileSubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B875C3C287496840084F660 /* ProfileSubView.swift */; };
9B875C3F287496970084F660 /* GraphSubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B875C3E287496970084F660 /* GraphSubView.swift */; };
9B875C41287496A80084F660 /* GraphEmptySubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B875C40287496A80084F660 /* GraphEmptySubView.swift */; };
9B875C43287496C50084F660 /* BedgeSubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B875C42287496C50084F660 /* BedgeSubView.swift */; };
9BC992C52875D1C000E7E895 /* Preview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC992C42875D1C000E7E895 /* Preview.swift */; };
9BC992C72875FFA300E7E895 /* ProfileSubCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC992C62875FFA300E7E895 /* ProfileSubCollectionViewCell.swift */; };
9BF2CF5B28758B38001AA51C /* UIViewFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BF2CF5A28758B38001AA51C /* UIViewFormat.swift */; };
9BF2CF5D28758E95001AA51C /* EuiJinBaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BF2CF5C28758E95001AA51C /* EuiJinBaseView.swift */; };
B5B5C11D2872E3DB00FC5134 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = B5B5C11C2872E3DB00FC5134 /* SnapKit */; };
B5B5C1202872E43E00FC5134 /* Then in Frameworks */ = {isa = PBXBuildFile; productRef = B5B5C11F2872E43E00FC5134 /* Then */; };
B85302A628728F6300F06234 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85302A528728F6300F06234 /* AppDelegate.swift */; };
Expand All @@ -22,6 +31,15 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
9B875C3A287495270084F660 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewController.swift; sourceTree = "<group>"; };
9B875C3C287496840084F660 /* ProfileSubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSubView.swift; sourceTree = "<group>"; };
9B875C3E287496970084F660 /* GraphSubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphSubView.swift; sourceTree = "<group>"; };
9B875C40287496A80084F660 /* GraphEmptySubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphEmptySubView.swift; sourceTree = "<group>"; };
9B875C42287496C50084F660 /* BedgeSubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BedgeSubView.swift; sourceTree = "<group>"; };
9BC992C42875D1C000E7E895 /* Preview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preview.swift; sourceTree = "<group>"; };
9BC992C62875FFA300E7E895 /* ProfileSubCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileSubCollectionViewCell.swift; sourceTree = "<group>"; };
9BF2CF5A28758B38001AA51C /* UIViewFormat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewFormat.swift; sourceTree = "<group>"; };
9BF2CF5C28758E95001AA51C /* EuiJinBaseView.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = EuiJinBaseView.swift; sourceTree = "<group>"; tabWidth = 2; };
B85302A228728F6300F06234 /* HousLab_iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HousLab_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
B85302A528728F6300F06234 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
B85302A728728F6300F06234 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -99,6 +117,15 @@
isa = PBXGroup;
children = (
B85302C22872A1F900F06234 /* EuiJinViewController.swift */,
9BC992C42875D1C000E7E895 /* Preview.swift */,
9BF2CF5C28758E95001AA51C /* EuiJinBaseView.swift */,
9BF2CF5A28758B38001AA51C /* UIViewFormat.swift */,
9B875C3A287495270084F660 /* ProfileViewController.swift */,
9BC992C62875FFA300E7E895 /* ProfileSubCollectionViewCell.swift */,
9B875C3C287496840084F660 /* ProfileSubView.swift */,
9B875C3E287496970084F660 /* GraphSubView.swift */,
9B875C40287496A80084F660 /* GraphEmptySubView.swift */,
9B875C42287496C50084F660 /* BedgeSubView.swift */,
);
path = EuiJin;
sourceTree = "<group>";
Expand Down Expand Up @@ -218,13 +245,22 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9B875C3B287495270084F660 /* ProfileViewController.swift in Sources */,
9B875C43287496C50084F660 /* BedgeSubView.swift in Sources */,
B85302C52872A1FF00F06234 /* MinJaeViewController.swift in Sources */,
B85302AA28728F6300F06234 /* ViewController.swift in Sources */,
B85302C72872A20600F06234 /* JiHyeonViewController.swift in Sources */,
9BF2CF5B28758B38001AA51C /* UIViewFormat.swift in Sources */,
B85302C12872A1EC00F06234 /* HoseViewController.swift in Sources */,
9BC992C52875D1C000E7E895 /* Preview.swift in Sources */,
B85302A628728F6300F06234 /* AppDelegate.swift in Sources */,
9B875C3F287496970084F660 /* GraphSubView.swift in Sources */,
9B875C3D287496840084F660 /* ProfileSubView.swift in Sources */,
B85302C32872A1F900F06234 /* EuiJinViewController.swift in Sources */,
9BF2CF5D28758E95001AA51C /* EuiJinBaseView.swift in Sources */,
B85302A828728F6300F06234 /* SceneDelegate.swift in Sources */,
9BC992C72875FFA300E7E895 /* ProfileSubCollectionViewCell.swift in Sources */,
9B875C41287496A80084F660 /* GraphEmptySubView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
20 changes: 20 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/BedgeSubView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// BedgeSubView.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/06.
//

import UIKit

class BedgeSubView: UIView {

/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/

}
46 changes: 46 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/EuiJinBaseView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// BaseView.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/06.
//

import UIKit
import SnapKit
import SwiftUI
import Then


class EuiJinBaseView: UIView {

//MARK: Initializer

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

setUp()
configureUI()
setConstraints()
}

required init?(coder: NSCoder){
fatalError("init(coder:) has nor been implemented")
}

//MARK: Methods

func setUp(){

}

func configureUI(){
self.backgroundColor = .white
}

func setConstraints(){

}

}


51 changes: 50 additions & 1 deletion HousLab_iOS/HousLab_iOS/EuiJin/EuiJinViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,53 @@
// Created by 김지현 on 2022/07/04.
//

import Foundation
import UIKit
import SwiftUI


class EuiJinBaseViewController : UIViewController {

//MARK: - Life Cycle

override func viewDidLoad() {
super.viewDidLoad()
setUp()
configureUI()
setConstraints()
}


//MARK: Methods

func setUp(){

}

func configureUI(){

}

func setConstraints(){

}

}

#if DEBUG
extension EuiJinBaseViewController {
private struct Preview: UIViewControllerRepresentable {
let viewController: UIViewController

func makeUIViewController(context: Context) -> UIViewController {
return viewController
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
}
}

func toPreview() -> some View {
Preview(viewController: self)
}
}
#endif
20 changes: 20 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/GraphEmptySubView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// GraphEmptySubView.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/06.
//

import UIKit

class GraphEmptySubView: UIView {

/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/

}
20 changes: 20 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/GraphSubView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// GraphSubView.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/06.
//

import UIKit

class GraphSubView: UIView {

/*
// Only override draw() if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
override func draw(_ rect: CGRect) {
// Drawing code
}
*/

}
33 changes: 33 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/Preview.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import UIKit
#if canImport(SwiftUI) && DEBUG
import SwiftUI
@available(iOS 13.0, *)
struct UIViewPreview<View: UIView>: UIViewRepresentable {
let view: View
init(_ builder: @escaping () -> View) {
view = builder()
}
// MARK: - UIViewRepresentable
func makeUIView(context: Context) -> UIView {
return view
}
func updateUIView(_ view: UIView, context: Context) {
view.setContentHuggingPriority(.defaultHigh, for: .horizontal)
view.setContentHuggingPriority(.defaultHigh, for: .vertical)
}
}
@available(iOS 13.0, *)
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
let viewController: ViewController
init(_ builder: @escaping () -> ViewController) {
viewController = builder()
}
// MARK: - UIViewControllerRepresentable
func makeUIViewController(context: Context) -> ViewController {
viewController
}
func updateUIViewController(_ uiViewController: ViewController, context: UIViewControllerRepresentableContext<UIViewControllerPreview<ViewController>>) {
return
}
}
#endif
48 changes: 48 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/ProfileSubCollectionViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// DemoCell.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/07.
//

import UIKit

class ProfileSubCollectionViewCell: UICollectionViewCell {

static var identifier = "ProfileSubCollectionViewCell"


//MARK: - Properties

let tempLabel = UILabel().then{
$0.text = "Temp"
}

//MARK: - Override Methods

override init(frame: CGRect){
super.init(frame: frame)
configureUI()
setConstraints()
}

required init?(coder: NSCoder){
fatalError("init(coder:) has not been implemented")
}

//MARK: - Private Methods

private func configureUI(){
self.backgroundColor = .green
[tempLabel].forEach {self.addSubview($0)}
}

private func setConstraints(){
tempLabel.snp.makeConstraints{make in
make.top.equalTo(self.safeAreaLayoutGuide)
make.centerY.equalToSuperview()
}
}


}
62 changes: 62 additions & 0 deletions HousLab_iOS/HousLab_iOS/EuiJin/ProfileSubView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//
// ProfileSubView.swift
// HousLab_iOS
//
// Created by 이의진 on 2022/07/06.
//

import UIKit
import SwiftUI

class ProfileSubView: EuiJinBaseView {

var profileImage = UIImageView().then {
$0.image = UIImage(named: "Group 6995")
}

var userName = UILabel().then{
$0.text = "최인영"
$0.textColor = .black
$0.font = .systemFont(ofSize: 20)
}

var userJob = UILabel().then{
$0.text = "대학생"
$0.textColor = .red
$0.font = .systemFont(ofSize: 13)
}

var stateMessage = UILabel().then{
$0.text = "낮에 자고 밤에 일하는 부엉.."
$0.textColor = .darkGray
$0.font = .systemFont(ofSize: 13)
}

override func setUp(){

}

override func configureUI() {
self.backgroundColor = .white
[profileImage, userName, userJob, stateMessage].forEach {self.addSubview($0)}
}

override func setConstraints() {
profileImage.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().offset(20)

}

userName.snp.makeConstraints { make in
make.centerY.equalToSuperview().offset(-25)
make.leading.equalTo(profileImage.snp.trailing).offset(20)
}

}

}




Loading

0 comments on commit 5f572c3

Please sign in to comment.