Skip to content

Commit

Permalink
[Feat] TeamSparker#122 - 완료 리스트 서버 연결 완료
Browse files Browse the repository at this point in the history
완료 리스트 서버 연결 완료
  • Loading branch information
L-j-h-c committed Jan 19, 2022
1 parent ef7e6bd commit 9639acb
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DoingStorageCVC: UICollectionViewCell {

func setUI() {
gradationUIView.setGradient(color1: UIColor.clear, color2: UIColor.black)
flakeImage.contentMode = .scaleAspectFit
flakeImage.contentMode = .center
}

func initCell(roomName: String,
Expand All @@ -37,9 +37,7 @@ class DoingStorageCVC: UICollectionViewCell {
let sparkFlake: SparkFlake = SparkFlake(leftDay: leftDay)

flakeImage.image = sparkFlake.sparkFlakeGoingStorage()

sparkCountLabel.text = String(sparkCount)

roomNameLabel.text = roomName

let startDate = startDate.split(separator: "-")
Expand Down
19 changes: 19 additions & 0 deletions Spark-iOS/Spark-iOS/Source/Cells/Storage/DoneStorageCVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import UIKit

class DoneStorageCVC: UICollectionViewCell {
@IBOutlet weak var gradationUIView: UIView!
@IBOutlet weak var thumbnailImage: UIImageView!
@IBOutlet weak var roomNameLabel: UILabel!
@IBOutlet weak var dateLabel: UILabel!
@IBOutlet weak var sparkCountLabel: UILabel!

override func awakeFromNib() {
super.awakeFromNib()
Expand All @@ -18,4 +22,19 @@ class DoneStorageCVC: UICollectionViewCell {
func setUI() {
gradationUIView.setGradient(color1: UIColor.clear, color2: UIColor.black)
}

func initCell(roomName: String,
thumbnail: String,
sparkCount: Int,
startDate: String,
endDate: String) {
sparkCountLabel.text = String(sparkCount)
roomNameLabel.text = roomName

let startDate = startDate.split(separator: "-")
let endDate = endDate.split(separator: "-")
dateLabel.text = "\(startDate[0]).\(startDate[1]).\(startDate[2]) - \(endDate[0]).\(endDate[1]).\(endDate[2])"

thumbnailImage.updateImage(thumbnail)
}
}
4 changes: 4 additions & 0 deletions Spark-iOS/Spark-iOS/Source/Cells/Storage/DoneStorageCVC.xib
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@
<constraint firstAttribute="top" secondItem="pDq-F4-Umy" secondAttribute="top" id="yql-gB-r7H"/>
</constraints>
<connections>
<outlet property="dateLabel" destination="Aj5-A6-BNH" id="4Cd-Gi-bcz"/>
<outlet property="gradationUIView" destination="zjs-TB-eup" id="Hg6-av-YQx"/>
<outlet property="roomNameLabel" destination="Yb6-ig-5g3" id="pV6-zw-pAx"/>
<outlet property="sparkCountLabel" destination="Lnz-ma-zbE" id="WcH-yx-21r"/>
<outlet property="thumbnailImage" destination="SMW-pe-rPY" id="umb-q7-gH1"/>
</connections>
<point key="canvasLocation" x="133" y="114"/>
</collectionViewCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import UIKit

class FailStorageCVC: UICollectionViewCell {
@IBOutlet weak var gradationUIView: UIView!

@IBOutlet weak var roomNameLabel: UILabel!
@IBOutlet weak var sparkCountLabel: UILabel!
@IBOutlet weak var dateLabel: UILabel!

override func awakeFromNib() {
super.awakeFromNib()
setUI()
Expand Down
3 changes: 3 additions & 0 deletions Spark-iOS/Spark-iOS/Source/Cells/Storage/FailStorageCVC.xib
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@
<constraint firstItem="ZTg-uK-7eu" firstAttribute="bottom" secondItem="Ej9-nc-oqb" secondAttribute="bottom" id="qyF-AM-FsW"/>
</constraints>
<connections>
<outlet property="dateLabel" destination="0lu-UT-RR9" id="VbR-Fj-VoN"/>
<outlet property="gradationUIView" destination="ZpD-q5-A5v" id="ynX-7X-vt3"/>
<outlet property="roomNameLabel" destination="ayp-qh-YU2" id="8OA-GT-d8Q"/>
<outlet property="sparkCountLabel" destination="ZLz-pW-Nr1" id="uic-tG-Ua4"/>
</connections>
<point key="canvasLocation" x="133" y="114"/>
</collectionViewCell>
Expand Down
2 changes: 1 addition & 1 deletion Spark-iOS/Spark-iOS/Source/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

window = UIWindow(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
let rootViewController = UIStoryboard(name: Const.Storyboard.Name.storage, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.storage)
let rootViewController = UIStoryboard(name: Const.Storyboard.Name.mainTabBar, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.mainTabBar)
window?.rootViewController = rootViewController
window?.makeKeyAndVisible()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class StorageVC: UIViewController {
let name = UICollectionView(frame: CGRect(x: 0, y: 197, width: 375, height: 520), collectionViewLayout: layout)
name.backgroundColor = .clear

name.indicatorStyle = .white
name.showsVerticalScrollIndicator = true

return name
}()

Expand All @@ -61,6 +64,9 @@ class StorageVC: UIViewController {
let name = UICollectionView(frame: CGRect(x: 0, y: 197, width: 375, height: 520), collectionViewLayout: layout)
name.backgroundColor = .clear

name.indicatorStyle = .white
name.showsVerticalScrollIndicator = true

return name
}()

Expand All @@ -74,6 +80,9 @@ class StorageVC: UIViewController {
let name = UICollectionView(frame: CGRect(x: 0, y: 197, width: 375, height: 520), collectionViewLayout: layout)
name.backgroundColor = .clear

name.indicatorStyle = .white
name.showsVerticalScrollIndicator = true

return name
}()

Expand Down Expand Up @@ -407,15 +416,30 @@ extension StorageVC: UICollectionViewDelegate, UICollectionViewDataSource {

guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.NibName.doingStorageCVC, for: indexPath) as? DoingStorageCVC else { return UICollectionViewCell() }

cell.initCell(roomName: onGoingRoomList[indexPath.row].roomName, leftDay: onGoingRoomList[indexPath.row].leftDay , thumbnail: onGoingRoomList[indexPath.row].thumbnail , sparkCount: onGoingRoomList[indexPath.row].totalReceivedSpark, startDate: onGoingRoomList[indexPath.row].startDate, endDate: onGoingRoomList[indexPath.row].endDate)
cell.initCell(roomName: onGoingRoomList[indexPath.row].roomName,
leftDay: onGoingRoomList[indexPath.row].leftDay,
thumbnail: onGoingRoomList[indexPath.row].thumbnail,
sparkCount: onGoingRoomList[indexPath.row].totalReceivedSpark,
startDate: onGoingRoomList[indexPath.row].startDate,
endDate: onGoingRoomList[indexPath.row].endDate)

return cell

case DoneCV:
guard let completeRoomList = completeRoomList else { return UICollectionViewCell()}

guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.NibName.doneStorageCVC, for: indexPath) as? DoneStorageCVC else { return UICollectionViewCell()}

cell.initCell(roomName: completeRoomList[indexPath.row].roomName,
thumbnail: completeRoomList[indexPath.row].thumbnail,
sparkCount: completeRoomList[indexPath.row].totalReceivedSpark,
startDate: completeRoomList[indexPath.row].startDate,
endDate: completeRoomList[indexPath.row].endDate)

return cell
default:
guard let completeRoomList = completeRoomList else { return UICollectionViewCell()}

guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.NibName.failStorageCVC, for: indexPath) as? FailStorageCVC else { return UICollectionViewCell() }

return cell
Expand Down

0 comments on commit 9639acb

Please sign in to comment.