-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [FEAT] CollectionView Profile View Layout 설정 완료#9
- Loading branch information
1 parent
56e083a
commit 5f572c3
Showing
16 changed files
with
475 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(){ | ||
|
||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
*/ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
48
HousLab_iOS/HousLab_iOS/EuiJin/ProfileSubCollectionViewCell.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
Oops, something went wrong.