Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
67b513b
[Fix] #134 - 수정한 내용 바로 반영되게 수정
lee-yeonwoo2 May 10, 2023
b21b8e2
[Feat] #134- UI구현
lee-yeonwoo2 May 10, 2023
87ce7c9
[Feat] #134 - 편집모드 구현
lee-yeonwoo2 May 10, 2023
5c524f5
[Fix] #134 - LintError 수정
lee-yeonwoo2 May 10, 2023
98a9d6f
Merge remote-tracking branch 'origin/#134-보관함편집기능구현' into #134-보관함편집기능구현
lee-yeonwoo2 May 10, 2023
ef78878
[Feat] #134 - 삭제확인팝업창 연결
lee-yeonwoo2 May 12, 2023
cd1c350
[Feat] #134 - collectionview로 슬라이드배너구현
lee-yeonwoo2 May 12, 2023
da8536c
[Feat] #134 - pagecontrol 추가
lee-yeonwoo2 May 12, 2023
9b62861
[Feat] #134 - 코스 삭제 후 해당 뷰 pop
lee-yeonwoo2 May 13, 2023
59e9985
[Feat] #134- delete 함수 구현
lee-yeonwoo2 May 15, 2023
efef823
[Feat] #134 - 업로드한 코스 UI 수정
lee-yeonwoo2 May 15, 2023
dbd70a3
[Feat] #134 - 업로드한 코스 delete API 연결
lee-yeonwoo2 May 16, 2023
77b8ad9
[Feat] #134 - 업로드한 코스 선택셀 취소 표시 추가
lee-yeonwoo2 May 17, 2023
b02a930
[Feat] #134 - 코드 리팩토링 및 자잘한 수정사항 반영
lee-yeonwoo2 May 17, 2023
605b627
[Feat] #134 - 삭제하기 버튼 눌렀을 때 동작 수정
lee-yeonwoo2 May 17, 2023
be18402
[Feat] #134 - 코스 발견 뷰 수정
lee-yeonwoo2 May 17, 2023
80d110e
[Fix] #134 - 불필요한 코드 제거
lee-yeonwoo2 May 17, 2023
de87f19
[Fix] #134 - 버튼 delegate 부분 수정
lee-yeonwoo2 May 17, 2023
b39ab5a
[Fix] #134 - 삭제하기 버튼 조건부로 변경
lee-yeonwoo2 May 17, 2023
e32fc84
[Feat] #134 - 삭제하기 버튼 애니메이션 추가
lee-yeonwoo2 May 17, 2023
798a39d
[Fix] #134 - 린트에러수정 및 공백 제거
lee-yeonwoo2 May 17, 2023
6a3b276
[Fix] #134 - 불필요한 이미지 제거
lee-yeonwoo2 May 17, 2023
39bb71d
[Merge] git pull develop
lee-yeonwoo2 May 18, 2023
a459f0c
git pull develop
lee-yeonwoo2 May 18, 2023
68795d0
[Fix] #134- conflict 해결
lee-yeonwoo2 May 19, 2023
9b84e12
[Fix] #134 - 린트에러 해결
lee-yeonwoo2 May 19, 2023
8a48403
Merge remote-tracking branch 'origin/#134-보관함편집기능구현' into #134-보관함편집기능구현
lee-yeonwoo2 May 19, 2023
ede326e
[Fix] #134 - 코드 리뷰 반영
lee-yeonwoo2 May 19, 2023
d17eb16
[Fix] #134 - 코스발견 엠티뷰 연결
lee-yeonwoo2 May 19, 2023
9824919
[Fix] #134 - 업로드한 코스 셀 선택 UI 수정
lee-yeonwoo2 May 19, 2023
bb19d22
[Fix] #134 - UploadedCourseInfoVC TabBar 숨기기
lee-yeonwoo2 May 19, 2023
2eb9e1c
[Fix] #134 - comment 반영
lee-yeonwoo2 May 19, 2023
11b4ef8
[Fix] #134 - 팝업창 오류 수정
lee-yeonwoo2 May 19, 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
6 changes: 3 additions & 3 deletions Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ enum ImageLiterals {
static var icLogoCircle: UIImage { .load(named: "ic_logo_circle") }
static var icMore: UIImage { .load(named: "ic_more") }
static var icPlus: UIImage { .load(named: "ic_plus") }
static var icFrameEdit: UIImage {
.load(named: "ic_frame_edit")
}

// img
static var imgBackground: UIImage { .load(named: "img_background") }
Expand Down Expand Up @@ -74,6 +71,9 @@ enum ImageLiterals {
static var imgSpaceship: UIImage { .load(named: "img_spaceship") }
static var imgAppIcon: UIImage { .load(named: "img_app_icon") }
static var imgAd: UIImage { .load(named: "img_ad") }
static var imgBanner1: UIImage { .load(named: "img_banner1") }
static var imgBanner2: UIImage { .load(named: "img_banner2") }
static var imgBanner3: UIImage { .load(named: "img_banner3") }
static var imgAppleLogin: UIImage { .load(named: "img_apple_login")}
static var imgKakaoLogin: UIImage { .load(named: "img_kakao_login")}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"images" : [
{
"filename" : "Frame 2064.png",
"filename" : "ios 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Frame 2064@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Frame 2064@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
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,21 @@
{
"images" : [
{
"filename" : "ios 2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ios 3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"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.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ enum PublicCourseRouter {
case getUploadedCourseDetail(publicCourseId: Int)
case getUploadedCourseInfo
case updatePublicCourse(publicCourseId: Int, editCourseRequestDto: EditCourseRequestDto)
case deleteUploadedCourse(publicCourseIdList: [Int])
}

extension PublicCourseRouter: TargetType {
Expand All @@ -38,6 +39,8 @@ extension PublicCourseRouter: TargetType {
return "/public-course/user"
case .updatePublicCourse(let publicCourseId, _):
return "/public-course/\(publicCourseId)"
case .deleteUploadedCourse:
return "/public-course"
}
}

Expand All @@ -49,6 +52,8 @@ extension PublicCourseRouter: TargetType {
return .post
case .updatePublicCourse:
return .patch
case .deleteUploadedCourse:
return .put
}
}

Expand All @@ -66,6 +71,8 @@ extension PublicCourseRouter: TargetType {
return .requestParameters(parameters: try param.asParameter(), encoding: JSONEncoding.default)
} catch {
fatalError("Encoding 실패")}
case .deleteUploadedCourse(let publicCourseIdList):
return .requestParameters(parameters: ["publicCourseIdList": publicCourseIdList], encoding: JSONEncoding.default)
case .getCourseData, .getUploadedCourseDetail, .getUploadedCourseInfo:
return .requestPlain
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ extension CourseDetailVC {
let editAction = UIAlertAction(title: "수정하기", style: .default, handler: {(_: UIAlertAction!) in
self.navigationController?.pushViewController(courseEditVC, animated: false)
})
let deleteVC = RNAlertVC(description: "코스를 정말로 삭제하시겠어요?")
deleteVC.rightButtonTapAction = { [weak self] in
deleteVC.dismiss(animated: false)
let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기")
deleteAlertVC.rightButtonTapAction = { [weak self] in
deleteAlertVC.dismiss(animated: false)
self?.deleteCourse()
}
deleteVC.modalPresentationStyle = .overFullScreen
deleteAlertVC.modalPresentationStyle = .overFullScreen
let deleteAction = UIAlertAction(title: "삭제하기", style: .destructive, handler: {(_: UIAlertAction!) in
self.present(deleteVC, animated: false, completion: nil)})
self.present(deleteAlertVC, animated: false, completion: nil)})
[ editAction, deleteAction, cancelAction].forEach { editAlertController.addAction($0) }
present(editAlertController, animated: false, completion: nil)
} else {
Expand Down Expand Up @@ -204,7 +204,7 @@ extension CourseDetailVC {
self.uploadedCourseDetailModel = model
self.mapImageView.setImage(with: model.publicCourse.image)
self.profileImageView.image = GoalRewardInfoModel.stampNameImageDictionary[model.user.image]
self.profileNameLabel.text = model.user.nickname
self.profileNameLabel.text = model.user.nickname
self.runningLevelLabel.text = "Lv. \(model.user.level)"
self.courseTitleLabel.text = model.publicCourse.title
self.isMyCourse = model.user.isNowUser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by YEONOO on 2023/05/06.
//


import UIKit

import SnapKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,33 @@ import Then

class AdImageCollectionViewCell: UICollectionViewCell {

// MARK: - collectionview

private lazy var bannerCollectionView: UICollectionView = {
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView.backgroundColor = .clear
collectionView.translatesAutoresizingMaskIntoConstraints = false
collectionView.isScrollEnabled = false
collectionView.showsVerticalScrollIndicator = false
return collectionView
}()
// MARK: - Constants

final let collectionViewInset = UIEdgeInsets(top: 28, left: 16, bottom: 28, right: 16)

// MARK: - UI Components
private let adImageView = UIImageView().then {
$0.image = ImageLiterals.imgAd
}
var imgBanners: [UIImage] = [ImageLiterals.imgBanner1, ImageLiterals.imgBanner2, ImageLiterals.imgBanner3]
var currentPage: Int = 0

private var pageControl = UIPageControl()
// MARK: - Life cycle
override init(frame: CGRect) {
super.init(frame: frame)
layout()
setDelegate()
startBannerSlide()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
Expand All @@ -28,14 +47,108 @@ class AdImageCollectionViewCell: UICollectionViewCell {
// MARK: - Extensions

extension AdImageCollectionViewCell {
private func setDelegate() {
bannerCollectionView.delegate = self
bannerCollectionView.dataSource = self
bannerCollectionView.isPagingEnabled = true
bannerCollectionView.showsHorizontalScrollIndicator = false
bannerCollectionView.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "BannerCell")
}
func startBannerSlide() {

// 초기 페이지 설정
currentPage = imgBanners.count

// 제스처 인식기 추가
let swipeLeftGesture = UISwipeGestureRecognizer(target: self, action: #selector(handleSwipeGesture(_:)))
swipeLeftGesture.direction = .left
bannerCollectionView.addGestureRecognizer(swipeLeftGesture)

let swipeRightGesture = UISwipeGestureRecognizer(target: self, action: #selector(handleSwipeGesture(_:)))
swipeRightGesture.direction = .right
bannerCollectionView.addGestureRecognizer(swipeRightGesture)
Comment on lines +62 to +69
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

콜렉션뷰로 배너를 만들었는데 또 UISwipeGestureRecognizer를 추가한 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

자동으로 넘어가는 배너인지 모르고 수동으로 하려다가.. 뭔가 미는 제스쳐를 추가해야 할 것 같아서 했는데 배너는 자동으로 넘어가게 다 수정해야합니다


// 페이지 컨트롤 설정
pageControl.currentPage = 0
pageControl.numberOfPages = imgBanners.count
pageControl.pageIndicatorTintColor = .lightGray // 페이지를 암시하는 동그란 점의 색상
pageControl.currentPageIndicatorTintColor = .white
}

@objc func handleSwipeGesture(_ gesture: UISwipeGestureRecognizer) {
// 배너를 스와이프하여 수동으로 슬라이드
if gesture.direction == .left {
currentPage += 1
} else if gesture.direction == .right {
currentPage -= 1
}
// 첫 번째 배너에서 이전으로 스와이프하면 마지막 배너로 이동
if currentPage < 0 {
currentPage = imgBanners.count * 2 - 1
}

// 마지막 배너에서 다음으로 스와이프하면 첫 번째 배너로 이동
if currentPage >= imgBanners.count * 2 {
currentPage = 0
}

let indexPath = IndexPath(item: currentPage, section: 0)
bannerCollectionView.scrollToItem(at: indexPath, at: .centeredHorizontally, animated: true)

updatePageControl()
}

// 페이지 컨트롤 업데이트
func updatePageControl() {
let currentIndex = currentPage % imgBanners.count
pageControl.currentPage = currentIndex
}

// MARK: - Layout Helpers

func layout() {
contentView.backgroundColor = .clear
contentView.addSubview(adImageView)
adImageView.snp.makeConstraints { make in
contentView.addSubview(bannerCollectionView)
contentView.addSubview(pageControl)
bannerCollectionView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
pageControl.snp.makeConstraints { make in
make.centerX.equalTo(self)
make.bottom.equalTo(bannerCollectionView.snp.bottom)
}
}
}

// MARK: - UICollectionViewDelegate, UICollectionViewDataSource

extension AdImageCollectionViewCell: UICollectionViewDelegate, UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return imgBanners.count*3
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = bannerCollectionView.dequeueReusableCell(withReuseIdentifier: "BannerCell", for: indexPath)

// 배너 이미지 설정
let imageIndex = indexPath.item % imgBanners.count
let imageView = UIImageView(frame: cell.contentView.bounds)
imageView.image = imgBanners[imageIndex]
imageView.contentMode = .scaleAspectFill
imageView.clipsToBounds = true
cell.contentView.addSubviews(imageView)
return cell
}
}

// MARK: - UICollectionViewDelegateFlowLayout

extension AdImageCollectionViewCell: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return self.frame.size
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Then

class MapCollectionViewCell: UICollectionViewCell {


// MARK: - collectionview

private lazy var mapCollectionView: UICollectionView = {
Expand All @@ -38,7 +39,6 @@ class MapCollectionViewCell: UICollectionViewCell {
layout()
register()
setDelegate()
layout()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class TitleCollectionViewCell: UICollectionViewCell {

private let mainLabel: UILabel = {
let label = UILabel()
label.text = "코스 추천"
label.text = "이런 코스 어때요?"
label.font = UIFont.h4
label.textColor = UIColor.g1
return label
}()
private let subLabel: UILabel = {
let label = UILabel()
label.text = "새로운 코스를 발견해나가요"
label.text = "상쾌한 하루를 시작하게 만들어주는 러닝코스"
label.font = UIFont.b6
label.textColor = UIColor.g1
return label
Expand Down
Loading