Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Archive, Setting, Profile Edit 레이아웃 구현 및 서버 연결 #68

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 98 additions & 34 deletions MEEW-Client/MEEW-Client.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "ic_check_empty.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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "icn_down.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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "img_character_nothing.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.
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
31 changes: 19 additions & 12 deletions MEEW-Client/MEEW-Client/Global/Resources/Images/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@
import Foundation
import UIKit

struct ImageLiterals{

struct checkIcon{
static let redCheckIcon = UIImage(named: "icn_check_red")!
static let orangeCheckIcon = UIImage(named: "icn_check_orange")!
static let yellowCheckIcon = UIImage(named: "icn_check_yellow")!
static let blueCheckIcon = UIImage(named: "icn_check_blue")!
static let pinkCheckIcon = UIImage(named: "icn_check_pink")!
static let purpleCheckIcon = UIImage(named: "icn_check_purple")!
static let greenCheckIcon = UIImage(named: "icn_check_green")!
static let lightpinkCheckIcon = UIImage(named: "icn_check_lightpink")!
}
struct ImageLiterals {

struct checkIcon {
static let redCheckIcon = UIImage(named: "icn_check_red")!
static let orangeCheckIcon = UIImage(named: "icn_check_orange")!
static let yellowCheckIcon = UIImage(named: "icn_check_yellow")!
static let blueCheckIcon = UIImage(named: "icn_check_blue")!
static let pinkCheckIcon = UIImage(named: "icn_check_pink")!
static let purpleCheckIcon = UIImage(named: "icn_check_purple")!
static let greenCheckIcon = UIImage(named: "icn_check_green")!
static let lightpinkCheckIcon = UIImage(named: "icn_check_lightpink")!
}

static let imageCharacterNothing = UIImage(named: "img_character_nothing")!
static let imageCharacterToday = UIImage(named: "img_character_today")!
static let settingIcon = UIImage(named: "icn_setting")!
static let icnCheckEmpty = UIImage(named: "ic_check_empty")!
static let icnArrowDown = UIImage(named: "icn_down")!
static let icnClose = UIImage(named: "icClose")!
}
6 changes: 0 additions & 6 deletions MEEW-Client/MEEW-Client/Global/Supports/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let _ = (scene as? UIWindowScene) else { return }
if let windowScene = scene as? UIWindowScene {


let window = UIWindow(windowScene: scene as! UIWindowScene)
window.rootViewController = TabbarViewController()
self.window = window
Expand Down
2 changes: 0 additions & 2 deletions MEEW-Client/MEEW-Client/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>ko_KR</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ enum APIConstants {
//MARK: - SelectURL
static let readCharacterURL = baseURL + "/personality/list"
}

extension APIConstants {
//MARK: - ArchiveURL
static let recentArchiveURL = baseURL + "/personality/recent"
static let allArchiveURL = baseURL + "/personality/all"
static let archiveForDateURL = baseURL + "/personality/date"
}
121 changes: 121 additions & 0 deletions MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//
// ArchiveTVC.swift
// MEEW-Client
//
// Created by taekki on 2022/08/18.
//

import UIKit

import SnapKit
import Then
import Kingfisher

final class ArchiveTVC: UITableViewCell {

private lazy var characterImageView = UIImageView().then {
$0.contentMode = .scaleAspectFill
$0.image = ImageLiterals.imageCharacterToday
}

private let progressView = ArchiveLevelProgressView()

private let characterNameLabel = UILabel().then {
$0.text = "캐릭터 이름입니다."
$0.textColor = .white
$0.font = .body1
}

private let timeLabel = UILabel().then {
$0.text = "YYYY.MM.DD"
$0.textColor = .grey400
$0.font = UIFont(name: "SpoqaHanSansNeo-Medium", size: 10.0)!
}

private let lineView = UIView().then {
$0.backgroundColor = .grey500
}

private lazy var dateFormatter = DateFormatter().then {
$0.dateFormat = "YYYY.MM.dd"
$0.locale = Locale(identifier: "ko_KR")
$0.timeZone = TimeZone(identifier: "ko_KR")
}

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

configureUI()
configureLayout()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
super.init(coder: coder)
}


// MARK: - Configure Functions

func configureUI() {
backgroundColor = .clear
selectionStyle = .none
progressView.layer.cornerRadius = 8
}

func configureLayout() {
contentView.addSubviews([characterImageView, progressView, characterNameLabel, timeLabel, lineView])

characterImageView.snp.makeConstraints {
$0.width.height.equalTo(100)
$0.leading.equalToSuperview().inset(25)
$0.top.equalToSuperview().inset(10)
}

progressView.snp.makeConstraints {
$0.leading.equalTo(characterImageView.snp.trailing).offset(10)
$0.top.equalToSuperview().inset(50)
$0.width.equalTo(88)
$0.height.equalTo(22)
}

characterNameLabel.snp.makeConstraints {
$0.top.equalTo(progressView.snp.bottom).offset(8)
$0.leading.equalTo(progressView)
}

timeLabel.snp.makeConstraints {
$0.top.equalToSuperview().inset(8)
$0.trailing.equalToSuperview().inset(27)
}

lineView.snp.makeConstraints {
$0.top.equalTo(characterImageView.snp.bottom).offset(12)
$0.height.equalTo(0.5)
$0.leading.trailing.equalToSuperview().inset(20)
$0.bottom.lessThanOrEqualToSuperview()
}
}

func configure(_ data: Recent?) {
let df = DateFormatter()
df.dateFormat = "YYYY-MM-dd'T'hh:mm:ss.sss'Z'"
guard let date = df.date(from: data?.date ?? "") else { return }
guard let imgURL = data?.imgURL else { return }

characterNameLabel.text = data?.name
timeLabel.text = dateFormatter.string(from: date)
characterImageView.kf.setImage(with: URL(string: imgURL))
}

func configure(withAll data: All?) {
let df = DateFormatter()
df.dateFormat = "YYYY-MM-dd'T'hh:mm:ss.sss'Z'"
guard let date = df.date(from: data?.date ?? "") else { return }
guard let imgURL = data?.imgURL else { return }

characterNameLabel.text = data?.name
timeLabel.text = dateFormatter.string(from: date)
characterImageView.kf.setImage(with: URL(string: imgURL))
}
}
70 changes: 70 additions & 0 deletions MEEW-Client/MEEW-Client/Screens/Archive/Cell/ArchiveTodoTVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//
// ArchiveTodoTVC.swift
// MEEW-Client
//
// Created by taekki on 2022/08/25.
//

import UIKit

import SnapKit
import Then

final class ArchiveTodoTVC: UITableViewCell {


private let checkImageView = UIImageView()
private let todoLabel = UILabel()

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

configureUI()
configureLayout()
}

@available(*, unavailable)
required init?(coder: NSCoder) {
super.init(coder: coder)
}


// MARK: - Configure Functions

func configureUI() {
backgroundColor = .clear
selectionStyle = .none

checkImageView.do {
$0.image = ImageLiterals.icnCheckEmpty
$0.contentMode = .scaleAspectFill
}

todoLabel.do {
$0.text = "평소 먹지 않은 메뉴 시키기"
$0.textColor = .white
$0.font = UIFont(name: "SpoqaHanSansNeo-Regular", size: 14.0)!
}
}

func configureLayout() {
contentView.addSubviews([checkImageView, todoLabel])

checkImageView.snp.makeConstraints {
$0.leading.equalToSuperview().inset(16)
$0.size.equalTo(24)
$0.centerY.equalToSuperview()
}

todoLabel.snp.makeConstraints {
$0.leading.equalTo(checkImageView.snp.trailing).offset(8)
$0.centerY.equalTo(checkImageView.snp.centerY)
$0.trailing.equalToSuperview().inset(16)
}
}

func configure(_ data: SpecificTask?) {
todoLabel.text = data?.content
}
}

Loading