Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ba88b2f
탭 바 연결 수정 및 View의 배경색상 설정
jakkujakku Aug 29, 2023
8200224
Git Convention 내용 반영
jakkujakku Aug 29, 2023
f716405
[FEAT]: feature/DiaryList-Page 브랜치 생성
jakkujakku Aug 29, 2023
6e8bbbc
[FEAT]: feature/home-Page 브런치 병합
jakkujakku Aug 29, 2023
86bb7de
[STYLE]: 콜렉션뷰 레이아웃 코드 변경
jakkujakku Aug 29, 2023
91697bb
[STYLE]: 코드 수정 없음
jakkujakku Aug 30, 2023
5765151
[FEAT]: Snapkit 패키지 추가가
jakkujakku Aug 30, 2023
c36bda3
[CONFLICT]: 병합 시 충돌 해결
jakkujakku Aug 30, 2023
29e09f6
[STYLE]: 코드 레이아웃 Snapkit으로 변경
jakkujakku Aug 30, 2023
42e2248
[FEAT]: 프로그래스바 & 콜렉션뷰 추가
jakkujakku Aug 30, 2023
46195f1
[FEAT]: Diary-Progress-Page 브런치 생성
jakkujakku Aug 30, 2023
52e45b5
[FEAT]: DiaryProgressCell 생성
jakkujakku Aug 30, 2023
681413b
[STYLE]: 작업 내역 저장
jakkujakku Aug 30, 2023
70454b6
FEAT]: 프로그래스바 UI 구현
jakkujakku Aug 30, 2023
2a6ba11
[STYLE]: 코드 수정이 없음
jakkujakku Aug 30, 2023
a796400
[MERGE] : 병합
jakkujakku Aug 30, 2023
1472db4
[MERGE] : 병합
jakkujakku Aug 30, 2023
dcef2d0
[MERGE] : 병합
jakkujakku Aug 30, 2023
1431699
[STYLE]: 탭바컨트롤러 아이콘표현 코드 포맷 변경
jakkujakku Aug 30, 2023
510df13
[MERGE] : 병합
jakkujakku Aug 30, 2023
c4faefa
[STYLE]: 코드 수정이 없음
jakkujakku Aug 30, 2023
bdf3c91
[FIX] 병합 오류 해결 중
jakkujakku Aug 30, 2023
5225cac
Update project.pbxproj
jakkujakku Aug 30, 2023
40a991b
[FIX] : Git Pull Merge Conflict 해결
jakkujakku Aug 30, 2023
8930679
[FEAT] : feature/Progress-List-Page 브런치 생성
jakkujakku Aug 31, 2023
a06054b
[FEAT] : DiaryListViewController -> ProgressListViewController 네비게이션 …
jakkujakku Aug 31, 2023
cd6d5b9
[FEAT]: ProgressListCell 생성 기능 추가
jakkujakku Aug 31, 2023
59834cd
[FEAT]: ProgressTageCell 생성 & 기능 구현
jakkujakku Aug 31, 2023
4e1582c
[FEAT]: DiaryProgressViewController -> ProgressListViewController 네비게…
jakkujakku Aug 31, 2023
e09690a
[FEAT]: Snapkit 패키지 추가가
jakkujakku Aug 30, 2023
7666d25
[MERGE]: Develop 병합
jakkujakku Aug 31, 2023
2fce643
[MERGE]: Develop 병합
jakkujakku Aug 31, 2023
a7953ad
Merge remote-tracking branch 'refs/remotes/origin/develop'
pinocchio22 Aug 31, 2023
63972b7
[MERGE] feature/DiaryCalendar 병합
pinocchio22 Aug 31, 2023
f601827
[FEAT]: *.pbxproj Avoid Merge Conflict 추가
jakkujakku Sep 1, 2023
1da1b00
[STYLE]: Nslayout 코드 -> Snapkit으로 변경
jakkujakku Sep 1, 2023
a873dd0
[FEAT]: 파이어베이스 임포트
jakkujakku Sep 1, 2023
116ea1b
[FEAT]: 파이어베이스 연동 확인
jakkujakku Sep 1, 2023
99fc0d1
[MERGE]: Feature/NewDiaryVC 병합
jakkujakku Sep 1, 2023
616ba0c
[REMOVE]: DirayCalenderViewController 삭제
jakkujakku Sep 1, 2023
5ca7289
[FEAT] : created FirestoreManager
pinocchio22 Sep 1, 2023
df2518c
[MERGE]: feature/firebase-operation 병합
jakkujakku Sep 3, 2023
f0fce3f
[MERGE]: feature/firebase-operation 병합
jakkujakku Sep 3, 2023
7ad9dba
[STYLE]: 변경 사항 없음
jakkujakku Sep 3, 2023
6aa6062
[FEAT]: Alamofire 설치
jakkujakku Sep 3, 2023
5b47ec8
[MERGE]: Feature/NewDiaryVC 병합
jakkujakku Sep 3, 2023
87a31ab
[FIX]: MERGE Conflict 해결 중
jakkujakku Sep 3, 2023
8c5cc14
[FIX]: MERGE Conflict 해결완료
jakkujakku Sep 3, 2023
27dea00
[MERGE] : merge firestoremanager to develop
pinocchio22 Sep 1, 2023
11defa4
[MERGE] : UploadFirebase to develop
pinocchio22 Sep 4, 2023
003cca4
[FIX]NewDiaryVC 날씨 ui 레이아웃 수정
zzangzzangguy Sep 4, 2023
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
Prev Previous commit
Next Next commit
[STYLE]: 작업 내역 저장
  • Loading branch information
jakkujakku committed Aug 30, 2023
commit 681413b1b1b6ca7486db62431066b5da575368a0
4 changes: 4 additions & 0 deletions DiaryApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
4E6138B02A9EEF50003A2B37 /* SnapKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4E6138AF2A9EEF50003A2B37 /* SnapKit */; };
4E6138B22A9F2664003A2B37 /* DiaryListThumbnailCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E6138B12A9F2664003A2B37 /* DiaryListThumbnailCell.swift */; };
4E6138B42A9F4E87003A2B37 /* DiaryProgressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E6138B32A9F4E87003A2B37 /* DiaryProgressCell.swift */; };
4E6138B62A9F56E0003A2B37 /* CircleProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E6138B52A9F56E0003A2B37 /* CircleProgressBar.swift */; };
4E98A38F2A9CA57B003052D3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E98A38E2A9CA57B003052D3 /* AppDelegate.swift */; };
4E98A3912A9CA57B003052D3 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E98A3902A9CA57B003052D3 /* SceneDelegate.swift */; };
4E98A3932A9CA57B003052D3 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E98A3922A9CA57B003052D3 /* TabBarController.swift */; };
Expand Down Expand Up @@ -40,6 +41,7 @@
4E15508A2A9E0DF500C8A500 /* CustomLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomLabel.swift; sourceTree = "<group>"; };
4E6138B12A9F2664003A2B37 /* DiaryListThumbnailCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryListThumbnailCell.swift; sourceTree = "<group>"; };
4E6138B32A9F4E87003A2B37 /* DiaryProgressCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryProgressCell.swift; sourceTree = "<group>"; };
4E6138B52A9F56E0003A2B37 /* CircleProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CircleProgressBar.swift; sourceTree = "<group>"; };
4E98A38B2A9CA57B003052D3 /* DiaryApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DiaryApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
4E98A38E2A9CA57B003052D3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4E98A3902A9CA57B003052D3 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -148,6 +150,7 @@
4E98A3C02A9CCFB8003052D3 /* CustomImageView.swift */,
4E1550882A9E0C6500C8A500 /* CustomStackView.swift */,
4E15508A2A9E0DF500C8A500 /* CustomLabel.swift */,
4E6138B52A9F56E0003A2B37 /* CircleProgressBar.swift */,
4E1550852A9E0BBB00C8A500 /* Cells */,
);
path = Views;
Expand Down Expand Up @@ -243,6 +246,7 @@
4E98A3932A9CA57B003052D3 /* TabBarController.swift in Sources */,
4E98A38F2A9CA57B003052D3 /* AppDelegate.swift in Sources */,
4E98A3912A9CA57B003052D3 /* SceneDelegate.swift in Sources */,
4E6138B62A9F56E0003A2B37 /* CircleProgressBar.swift in Sources */,
4E98A3A32A9CA634003052D3 /* HomeViewController.swift in Sources */,
4E98A3B22A9CA781003052D3 /* DiaryCalenderViewController.swift in Sources */,
4E6138B22A9F2664003A2B37 /* DiaryListThumbnailCell.swift in Sources */,
Expand Down
67 changes: 65 additions & 2 deletions DiaryApp/Controllers/DiaryProgressViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,86 @@
// Created by (^ㅗ^)7 iMac on 2023/08/28.
//

import SnapKit
import UIKit

class DiaryProgressViewController: UIViewController {
private let collectionView = CustomCollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout())

// private let collectionViewFlowLayout: UICollectionViewFlowLayout = {
// let layout = UICollectionViewFlowLayout()
// layout.scrollDirection = .vertical
// layout.itemSize = Const.itemSize
// layout.minimumLineSpacing = Const.itemSpacing
// layout.minimumInteritemSpacing = 0
// return layout
// }()

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemBackground
setupUI()
configureCollectionView()
}

private func setupUI() {
view.addSubview(collectionView)

collectionView.snp.makeConstraints { make in
make.top.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide)
}
}

private func configureCollectionView() {
collectionView.register(DiaryProgressCell.self, forCellWithReuseIdentifier: DiaryProgressCell.identifier)
collectionView.dataSource = self
collectionView.delegate = self

collectionView.isScrollEnabled = true
collectionView.showsHorizontalScrollIndicator = false
collectionView.showsVerticalScrollIndicator = true
collectionView.backgroundColor = .clear
collectionView.clipsToBounds = true
collectionView.isPagingEnabled = false
collectionView.contentInsetAdjustmentBehavior = .never
collectionView.contentInset = Const.collectionViewContentInset
collectionView.decelerationRate = .fast

if let flowlayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout {
flowlayout.estimatedItemSize = .zero
}
// collectionView.collectionViewLayout = collectionViewFlowLayout
}
}

extension DiaryProgressViewController: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 10
return 15
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
return UICollectionViewCell()
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: DiaryProgressCell.identifier, for: indexPath) as? DiaryProgressCell else { return UICollectionViewCell() }

cell.backgroundColor = .systemPink
return cell
}
}

extension DiaryProgressViewController: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let interItemSpacing: CGFloat = 10
let padding: CGFloat = 16
let width = (collectionView.bounds.width - interItemSpacing * 2 - padding * 2) / 2
print("### \(width)")
let height = width
return CGSize(width: width, height: height)
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 10
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 10
}
}
33 changes: 31 additions & 2 deletions DiaryApp/Views/Cells/DiaryProgressCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@
// Created by (^ㅗ^)7 iMac on 2023/08/30.
//

import Cocoa
import SnapKit
import UIKit

final class DiaryProgressCell: UICollectionViewCell {}
final class DiaryProgressCell: UICollectionViewCell {
static let identifier = "DiaryProgressCell"

lazy var circularProgressBarView = CircleProgressBar(frame: .zero)
lazy var percentLabel = CustomLabel(frame: .zero)

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

func setUpCircularProgressBarView() {
circularProgressBarView.translatesAutoresizingMaskIntoConstraints = false

circularProgressBarView.center = contentView.center
circularProgressBarView.progressAnimation(duration: 30)
percentLabel.text = "100%"

contentView.addSubview(circularProgressBarView)
circularProgressBarView.snp.makeConstraints { make in
make.centerX.centerY.equalTo(contentView)
}
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
61 changes: 61 additions & 0 deletions DiaryApp/Views/CircleProgressBar.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// CircleProgressBar.swift
// DiaryApp
//
// Created by (^ㅗ^)7 iMac on 2023/08/30.
//

import SnapKit
import UIKit

final class CircleProgressBar: UIView {
private var circleLayer = CAShapeLayer()
private var progressLayer = CAShapeLayer()
private var startPoint = CGFloat(-Double.pi / 2)
private var endPoint = CGFloat(3 * Double.pi / 2)

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

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func createCircularPath() {
let circularPath = UIBezierPath(arcCenter: CGPoint(x: frame.size.width / 2.0, y: frame.size.height / 2.0), radius: 80, startAngle: startPoint, endAngle: endPoint, clockwise: true)
// circleLayer path defined to circularPath
circleLayer.path = circularPath.cgPath
// ui edits
circleLayer.fillColor = UIColor.clear.cgColor
circleLayer.lineCap = .round
circleLayer.lineWidth = 20.0
circleLayer.strokeEnd = 1.0
circleLayer.strokeColor = UIColor.systemGray6.cgColor
// added circleLayer to layer
layer.addSublayer(circleLayer)
// progressLayer path defined to circularPath
progressLayer.path = circularPath.cgPath
// ui edits
progressLayer.fillColor = UIColor.clear.cgColor
progressLayer.lineCap = .round
progressLayer.lineWidth = 10.0
progressLayer.strokeEnd = 0
progressLayer.strokeColor = UIColor.systemOrange.cgColor
// added progressLayer to layer
layer.addSublayer(progressLayer)
}

func progressAnimation(duration: TimeInterval) {
// created circularProgressAnimation with keyPath
let circularProgressAnimation = CABasicAnimation(keyPath: "strokeEnd")
// set the end time
circularProgressAnimation.duration = 30
circularProgressAnimation.toValue = 10.0
circularProgressAnimation.fillMode = .forwards
circularProgressAnimation.isRemovedOnCompletion = false
progressLayer.add(circularProgressAnimation, forKey: "progressAnim")
}
}