Skip to content

Commit

Permalink
[FEAT][#35] 어드민 > 회원관리 > 출석 탭 GUI 구현
Browse files Browse the repository at this point in the history
- 회원탭의 검색창은 우선 빼고 구현(ㅎㅎ)
- 출석목록 cell 구현
  • Loading branch information
tngusmiso committed Feb 25, 2023
1 parent e409075 commit 3861203
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 0 deletions.
4 changes: 4 additions & 0 deletions momoIOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
3A72A20729A9E19300F2716A /* AddSessionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A72A20629A9E19300F2716A /* AddSessionView.swift */; };
3A75FC10298827BE00B36A46 /* MainAttendanceCodeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A75FC0F298827BE00B36A46 /* MainAttendanceCodeCell.swift */; };
3A8BDEF329AA6D66005CF633 /* MemberListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8BDEF229AA6D66005CF633 /* MemberListCell.swift */; };
3A8BDEF529AA7B74005CF633 /* AttendanceListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8BDEF429AA7B74005CF633 /* AttendanceListCell.swift */; };
3A8E2DDF2997697E00D5476A /* AttendanceCodeDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8E2DDE2997697E00D5476A /* AttendanceCodeDetailViewController.swift */; };
3A8FC29929A9EFEF000B9315 /* MemberManagementViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8FC29829A9EFEF000B9315 /* MemberManagementViewController.swift */; };
3A8FC29D29A9F31D000B9315 /* MemberListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8FC29C29A9F31D000B9315 /* MemberListViewController.swift */; };
Expand Down Expand Up @@ -77,6 +78,7 @@
3A72A20629A9E19300F2716A /* AddSessionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddSessionView.swift; sourceTree = "<group>"; };
3A75FC0F298827BE00B36A46 /* MainAttendanceCodeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAttendanceCodeCell.swift; sourceTree = "<group>"; };
3A8BDEF229AA6D66005CF633 /* MemberListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberListCell.swift; sourceTree = "<group>"; };
3A8BDEF429AA7B74005CF633 /* AttendanceListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttendanceListCell.swift; sourceTree = "<group>"; };
3A8E2DDE2997697E00D5476A /* AttendanceCodeDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttendanceCodeDetailViewController.swift; sourceTree = "<group>"; };
3A8FC29829A9EFEF000B9315 /* MemberManagementViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberManagementViewController.swift; sourceTree = "<group>"; };
3A8FC29C29A9F31D000B9315 /* MemberListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemberListViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -161,6 +163,7 @@
isa = PBXGroup;
children = (
3A8BDEF229AA6D66005CF633 /* MemberListCell.swift */,
3A8BDEF429AA7B74005CF633 /* AttendanceListCell.swift */,
);
path = Cells;
sourceTree = "<group>";
Expand Down Expand Up @@ -554,6 +557,7 @@
BF04086F2987E70200F1129B /* CheckSecurityCodeController.swift in Sources */,
E8D5C3F32984FC23003D1AD0 /* SceneDelegate.swift in Sources */,
3A75FC10298827BE00B36A46 /* MainAttendanceCodeCell.swift in Sources */,
3A8BDEF529AA7B74005CF633 /* AttendanceListCell.swift in Sources */,
E83238F1298506A000DC83C2 /* MainViewController.swift in Sources */,
BF998900298BB0D3005723C7 /* InputMemberInfoController.swift in Sources */,
BF0408632987B3AA00F1129B /* LoginController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,77 @@
import UIKit

final class AttendanceListViewController: UIViewController {
private let sortLabel: UILabel = UILabel()
private let addMemberButton: UIButton = UIButton()
private let resetAllButton: UIButton = UIButton()
private let tableView: UITableView = UITableView()

override func viewDidLoad() {
super.viewDidLoad()
self.setupViews()
self.setupLayout()
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

self.navigationController?.setNavigationBarHidden(true, animated: true)
}

private func setupViews() {
self.view.backgroundColor = .white

self.sortLabel.text = "이름순"
self.sortLabel.font = .body16
self.sortLabel.textColor = .gray800

self.addMemberButton.setTitle("회원등록", font: .body16, color: .gray500)
self.addMemberButton.configurate(padding: 0)
self.resetAllButton.setTitle("전체 초기화", font: .body16, color: .gray500)
self.resetAllButton.configurate(padding: 0)

self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.backgroundColor = .white
self.tableView.register(AttendanceListCell.self, forCellReuseIdentifier: AttendanceListCell.identifier)
}

private func setupLayout() {
self.view.addSubviews(self.sortLabel, self.addMemberButton, self.resetAllButton, self.tableView)

self.sortLabel.snp.makeConstraints { make in
make.top.leading.equalToSuperview().inset(24)
}

self.resetAllButton.snp.makeConstraints { make in
make.centerY.equalTo(self.sortLabel)
make.trailing.equalToSuperview().inset(24)
}

self.addMemberButton.snp.makeConstraints { make in
make.centerY.equalTo(self.sortLabel)
make.trailing.equalTo(self.resetAllButton.snp.leading).offset(-13)
}

self.tableView.snp.makeConstraints { make in
make.top.equalTo(self.sortLabel.snp.bottom).offset(16)
make.horizontalEdges.bottom.equalToSuperview()
}
}
}

extension AttendanceListViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 20
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: AttendanceListCell.identifier) as? AttendanceListCell else { return UITableViewCell() }

return cell
}
}

extension AttendanceListViewController: UITableViewDelegate {

}
84 changes: 84 additions & 0 deletions momoIOS/AdminSide/MemberManagement/Cells/AttendanceListCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// AttendanceListCell.swift
// momoIOS
//
// Created by 임수현 on 2023/02/26.
//

import UIKit
import SnapKit

final class AttendanceListCell: UITableViewCell {
static let identifier = "AttendanceListCell"

private let nameLabel: UILabel = UILabel()
private let generationLabel: UILabel = UILabel()
private let jobLabel: UILabel = UILabel()
private let disableButton: UIButton = UIButton()

// MARK: - Initializer
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: Self.identifier)

self.selectionStyle = .none
self.setupViews()
self.setupLayout()
}

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

// MARK: - Setup
private func setupViews() {
self.nameLabel.text = "홍길동"
self.nameLabel.font = .body16
self.nameLabel.textColor = .gray800

self.generationLabel.text = "22기"
self.generationLabel.font = .body16
self.generationLabel.textColor = .gray800

self.jobLabel.text = "Developer"
self.jobLabel.font = .body16
self.jobLabel.textColor = .gray800

self.disableButton.setTitle("비활성화", font: .tag1, color: .gray800)
self.disableButton.configurate(bgColor: .white, strokeColor: .gray500, strokeWidth: 1, cornerRadius: 6, padding: 0)
}

// MARK: - Layout
private func setupLayout() {
self.contentView.addSubviews(self.nameLabel, self.generationLabel, self.jobLabel, self.disableButton)

self.contentView.snp.makeConstraints { make in
make.width.equalToSuperview()
make.height.equalTo(56)
}

self.nameLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().inset(24)
}

self.generationLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().inset(92)
make.leading.greaterThanOrEqualTo(self.nameLabel.snp.trailing).offset(12)
}

self.jobLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().inset(141)
make.leading.greaterThanOrEqualTo(self.generationLabel.snp.trailing).offset(12)
}

self.disableButton.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.greaterThanOrEqualTo(self.jobLabel.snp.trailing).offset(12)
make.trailing.equalToSuperview().inset(24)
make.width.equalTo(57)
make.height.equalTo(28)
}
}
}

0 comments on commit 3861203

Please sign in to comment.