Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #33 from FooRun-EatDa/feature/matziptalk
Browse files Browse the repository at this point in the history
디자인생성🪄: #28 게시판 페이지 UI 수정사항 반영
  • Loading branch information
k-nh authored Apr 12, 2022
2 parents d89f022 + cae2136 commit 7e92c13
Show file tree
Hide file tree
Showing 21 changed files with 3,073 additions and 2,893 deletions.
793 changes: 402 additions & 391 deletions EatDa.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions EatDa/Assets.xcassets/Talk/default_gallery.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 26844.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [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.
23 changes: 23 additions & 0 deletions EatDa/Assets.xcassets/Talk/matzip_category.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Group 3233.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Group [email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Group [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.
23 changes: 23 additions & 0 deletions EatDa/Assets.xcassets/Talk/searchbar_left.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "search.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.
1 change: 1 addition & 0 deletions EatDa/Extensions/UIColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extension UIColor {

// MARK: SearchViewController
class var searchBarBackgroundColor: UIColor { UIColor(hex: 0xF2F2F2) }
class var searchBarTextColor: UIColor { UIColor(hex: 0xBDBDBD) }

// MARK: NoticeViewController
class var dateGrayColor: UIColor { UIColor(hex: 0xC4C4C4) }
Expand Down
74 changes: 74 additions & 0 deletions EatDa/Scenes/Common/WritePost/WritePostViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// WritePostViewController.swift
// EatDa
//
// Created by 김희진 on 2022/04/05.
//

import Foundation
import UIKit
import SnapKit

class WritePostViewController: UIViewController {

lazy var navView: UIView = {
let view = UIView()
return view
}()

lazy var navBackButton: UIButton = {
let button = UIButton()
button.setTitle("취소", for: .normal)
button.setTitleColor(UIColor.mainTextColor, for: .normal)
button.titleLabel?.font = UIFont.mySystemFont(ofSize: 15)
return button
}()

lazy var navTitle: UILabel = {
let label = UILabel()
label.text = "작성하기"
label.font = UIFont.myBoldSystemFont(ofSize: 15)
return label
}()


override func viewDidLoad() {
super.viewDidLoad()
navigationController?.isNavigationBarHidden = true
initUI()
}

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
hidesBottomBarWhenPushed = true
}

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

func initUI() {
view.addSubview(navView)
navView.snp.makeConstraints { make in
make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(40)
}

navView.addSubview(navTitle)
navTitle.snp.makeConstraints { make in
make.center.equalToSuperview()
}

navView.addSubview(navBackButton)
navBackButton.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(23)
make.centerY.equalToSuperview()
}
navBackButton.addTarget(self, action: #selector(didTouchBack(_:)), for: .touchUpInside)

}

@objc func didTouchBack(_ sender: UIButton){
navigationController?.popViewController(animated: true)
}
}
35 changes: 22 additions & 13 deletions EatDa/Scenes/Talk/BestBoardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SnapKit
class BestBoardViewController: UIViewController {

private lazy var tableView: UITableView = {
let view = UITableView()
let view = UITableView(frame: .zero, style: .grouped)
view.delegate = self
view.dataSource = self
view.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
Expand All @@ -33,19 +33,17 @@ class BestBoardViewController: UIViewController {

return button
}()


override func viewDidLoad() {
super.viewDidLoad()

tableView.register(BestBoardTVC.self, forCellReuseIdentifier: "BestBoardTVC")

[tableView, floatButton].forEach { view.addSubview($0) }

tableView.backgroundColor = .yellow
tableView.snp.makeConstraints {
$0.top.trailing.leading.bottom.equalToSuperview()
}
floatButton.addTarget(self, action: #selector(gotoWrite(_:)), for: .touchUpInside)
floatButton.snp.makeConstraints {
$0.trailing.equalToSuperview()
$0.bottom.equalToSuperview().inset(70)
Expand All @@ -55,39 +53,50 @@ class BestBoardViewController: UIViewController {
if #available(iOS 15, *) {
tableView.sectionHeaderTopPadding = 0
}

}

@objc func gotoWrite(_ sender: UIButton) {
let vc = WritePostViewController()
navigationController?.pushViewController(vc, animated: true)
}
}


extension BestBoardViewController: UITableViewDelegate, UITableViewDataSource {

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

guard let cell = tableView.dequeueReusableCell(withIdentifier: "BestBoardTVC", for: indexPath) as? BestBoardTVC else {
return UITableViewCell()
}
return cell
}

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 130
return UITableView.automaticDimension
}

func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 60
}

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?{

let view = UIView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 60))


let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.width, height: 63))
view.backgroundColor = .white
let sectionTitleImage = UIImageView()
sectionTitleImage.image = UIImage(named: "matzip_category")
view.addSubview(sectionTitleImage)
sectionTitleImage.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().offset(19)
}

return view
}

}
50 changes: 33 additions & 17 deletions EatDa/Scenes/Talk/Cell/BestBoardTVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ class BestBoardTVC: UITableViewCell {
let profileImage = UIImageView()
let profileName = UILabel()
let writtenAt = UILabel()
let reviewTitle = UILabel()
let reviewBody = UILabel()

let heartButton = UIButton()
let commentButton = UIButton()
let hasImageButton = UIImageView()

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {

super.init(style: style, reuseIdentifier: reuseIdentifier)

_ = [profileImage, profileName, writtenAt, reviewBody, heartButton, commentButton].map{ contentView.addSubview($0)}
_ = [profileImage, profileName, writtenAt, reviewTitle, reviewBody, heartButton, commentButton, hasImageButton].map{ contentView.addSubview($0)}

profileImage.image = UIImage(named: "menu_datail")
profileImage.layer.cornerRadius = 17.5
Expand All @@ -34,29 +36,48 @@ class BestBoardTVC: UITableViewCell {
$0.width.height.equalTo(35)
}

profileName.font = .boldSystemFont(ofSize: 14)
profileName.font = .mySystemFont(ofSize: 14)
profileName.textColor = UIColor.mainTextColor
profileName.text = "지원"
profileName.snp.makeConstraints {
$0.centerY.equalTo(profileImage)
$0.leading.equalTo(profileImage.snp.trailing).offset(13)
}

reviewTitle.font = .myBoldSystemFont(ofSize: 14)
reviewTitle.textColor = UIColor.mainTextColor
reviewTitle.numberOfLines = 0
reviewTitle.text = "안녕하세요 최지원입니다"
reviewTitle.snp.makeConstraints {
$0.top.equalTo(profileImage.snp.bottom).offset(10)
$0.leading.trailing.equalToSuperview().inset(22)
}


reviewBody.font = .myMediumSystemFont(ofSize: 14)
reviewBody.textColor = UIColor.mainTextColor
reviewBody.numberOfLines = 0
reviewBody.text = "경희대 앞에 짠 먹어보신 분 후기 부탁드려용!경희대 앞에 짠 먹어보신 분 후기 부탁드려용!"
reviewBody.snp.makeConstraints {
$0.top.equalTo(profileImage.snp.bottom).offset(10)
$0.top.equalTo(reviewTitle.snp.bottom).offset(6)
$0.leading.trailing.equalToSuperview().inset(22)
}

writtenAt.font = .mySystemFont(ofSize: 12)
writtenAt.textColor = UIColor.init(hex: 0xBABABC)
writtenAt.text = "2022.01.23"
writtenAt.snp.makeConstraints {
$0.top.equalTo(reviewBody.snp.bottom).offset(5)
$0.leading.equalToSuperview().offset(22)
$0.centerY.equalTo(profileName)
$0.leading.equalTo(profileName.snp.trailing).offset(10)
}

heartButton.setImage(UIImage(named: "small_heart"), for: .normal)
heartButton.setTitle(" 5", for: .normal)
heartButton.setTitleColor(.red, for: .normal)
heartButton.titleLabel?.font = .mySystemFont(ofSize: 13)
heartButton.snp.makeConstraints {
$0.top.equalTo(reviewBody.snp.bottom).offset(10)
$0.leading.equalToSuperview().inset(22)
$0.bottom.equalToSuperview().inset(13)
}

Expand All @@ -65,24 +86,19 @@ class BestBoardTVC: UITableViewCell {
commentButton.setTitleColor(UIColor.init(hex: 0x4AA2AD), for: .normal)
commentButton.titleLabel?.font = .mySystemFont(ofSize: 13)
commentButton.snp.makeConstraints {
$0.centerY.equalTo(writtenAt)
$0.trailing.equalToSuperview().inset(22)
$0.centerY.equalTo(heartButton)
$0.leading.equalTo(heartButton.snp.trailing).offset(10)
$0.bottom.equalToSuperview().inset(13)
}

heartButton.setImage(UIImage(named: "small_heart"), for: .normal)
heartButton.setTitle(" 5", for: .normal)
heartButton.setTitleColor(.red, for: .normal)
heartButton.titleLabel?.font = .mySystemFont(ofSize: 13)
heartButton.snp.makeConstraints {
$0.centerY.equalTo(writtenAt)
$0.trailing.equalTo(commentButton.snp.leading).offset(-13)

hasImageButton.image = UIImage(named: "default_gallery")
hasImageButton.snp.makeConstraints {
$0.trailing.equalToSuperview().inset(20)
$0.bottom.equalToSuperview().inset(13)
}


}


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

0 comments on commit 7e92c13

Please sign in to comment.