Skip to content

Commit

Permalink
[feat/#10] โœจ Add Subscribe Youtuber Conatiner
Browse files Browse the repository at this point in the history
##### ์ œ๋ชฉ์€ ์ตœ๋Œ€ 50 ๊ธ€์ž๊นŒ์ง€๋งŒ ์ž…๋ ฅ ############## -> |

# ๋ณธ๋ฌธ์€ ์œ„์— ์ž‘์„ฑ
######## ๋ณธ๋ฌธ์€ ํ•œ ์ค„์— ์ตœ๋Œ€ 72 ๊ธ€์ž๊นŒ์ง€๋งŒ ์ž…๋ ฅ ########################### -> |

# ๊ผฌ๋ฆฟ๋ง์€ ์•„๋ž˜์— ์ž‘์„ฑ: ex) #์ด์Šˆ ๋ฒˆํ˜ธ

# --- COMMIT END ---
# <ํƒ€์ž…> ๋ฆฌ์ŠคํŠธ
# feat       sparkles               : ๊ธฐ๋Šฅ(์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ)
# fix        beetle                 : ๋ฒ„๊ทธ(๋ฒ„๊ทธ ์ˆ˜์ •)
# refactor   hammer                 : refacetor ๋ฆฌํŒฉํ† ๋ง
# style      art                    : ์Šคํƒ€์ผ( ์ฝ”๋“œ ํ˜•์‹ ๋ณ€๊ฒฝ, ๋กœ์ง ๋ณ€๊ฒฝ ์—†์Œ)
# doc        pencil                 : ๋ฌธ์„œ(๋ฌธ์„œ ์ถ”๊ฐ€, ์ˆ˜์ •, ์‚ญ์ œ)
# test       white_check_mark       : ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€
# chore      moyai                  : ๊ธฐํƒ€ ๋ณ€๊ฒฝ์‚ฌํ•ญ
# ------------------
#     ์ œ๋ชฉ ์ฒซ ๊ธ€์ž๋ฅผ ๋Œ€๋ฌธ์ž๋กœ
#     ์ œ๋ชฉ์€ ๋ช…๋ น๋ฌธ์œผ๋กœ
#     ์ œ๋ชฉ ๋์— ๋งˆ์นจํ‘œ(.) ๊ธˆ์ง€
#     ์ œ๋ชฉ๊ณผ ๋ณธ๋ฌธ์„ ํ•œ ์ค„ ๋„์›Œ ๋ถ„๋ฆฌํ•˜๊ธฐ
#     ๋ณธ๋ฌธ์€ "์–ด๋–ป๊ฒŒ" ๋ณด๋‹ค "๋ฌด์—‡์„", "์™œ"๋ฅผ ์„ค๋ช…ํ•œ๋‹ค.
#     ๋ณธ๋ฌธ์— ์—ฌ๋Ÿฌ์ค„์˜ ๋ฉ”์‹œ์ง€๋ฅผ ์ž‘์„ฑํ•  ๋• "-"๋กœ ๊ตฌ๋ถ„
# ------------------
  • Loading branch information
i-colours-u committed Oct 28, 2021
1 parent c3f6906 commit e8ba6f1
Show file tree
Hide file tree
Showing 18 changed files with 654 additions and 39 deletions.
104 changes: 94 additions & 10 deletions sopt_29th_Assignment/sopt_29th_Assignment.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
FD9D458D272A6455006C108F /* VideoDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D458C272A6455006C108F /* VideoDataModel.swift */; };
FD9D4590272A6F91006C108F /* CustomTableViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D458F272A6F91006C108F /* CustomTableViewDataSource.swift */; };
FD9D4593272A74AF006C108F /* CustomCollectionViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D4592272A74AF006C108F /* CustomCollectionViewDataSource.swift */; };
FD9D4595272A820F006C108F /* CustomTableViewSectionDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D4594272A820F006C108F /* CustomTableViewSectionDataSource.swift */; };
FD9D459B272A8DF9006C108F /* SubscribeVideoTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D4599272A8DF9006C108F /* SubscribeVideoTVC.swift */; };
FD9D459C272A8DF9006C108F /* SubscribeVideoTVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = FD9D459A272A8DF9006C108F /* SubscribeVideoTVC.xib */; };
FD9D45A0272A97C0006C108F /* calculateDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D459F272A97C0006C108F /* calculateDate.swift */; };
FD9D45A3272AA508006C108F /* UITableViewRegistable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D45A2272AA508006C108F /* UITableViewRegistable.swift */; };
FD9D45A8272AAC24006C108F /* MainHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = FD9D45A7272AAC24006C108F /* MainHeaderView.xib */; };
FD9D45AA272AAC2D006C108F /* MainHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D45A9272AAC2D006C108F /* MainHeaderView.swift */; };
FD9D45AC272AAE8B006C108F /* SubscribeYoutuberContainerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = FD9D45AB272AAE8B006C108F /* SubscribeYoutuberContainerView.xib */; };
FD9D45AE272AAEB6006C108F /* SubscribeYoutuberContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D45AD272AAEB6006C108F /* SubscribeYoutuberContainerView.swift */; };
FD9D45B5272AAFA1006C108F /* SubscribeYoutuberCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD9D45B3272AAFA1006C108F /* SubscribeYoutuberCVC.swift */; };
FD9D45B6272AAFA1006C108F /* SubscribeYoutuberCVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = FD9D45B4272AAFA1006C108F /* SubscribeYoutuberCVC.xib */; };
FDCD39E0271C50490072AB10 /* Presentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDCD39DF271C50490072AB10 /* Presentable.swift */; };
FDCD39E2271C50650072AB10 /* CoordinatorFinishOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDCD39E1271C50650072AB10 /* CoordinatorFinishOutput.swift */; };
FDCD39E4271C507A0072AB10 /* BaseControllable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDCD39E3271C507A0072AB10 /* BaseControllable.swift */; };
Expand Down Expand Up @@ -103,6 +114,17 @@
FD9D458C272A6455006C108F /* VideoDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoDataModel.swift; sourceTree = "<group>"; };
FD9D458F272A6F91006C108F /* CustomTableViewDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTableViewDataSource.swift; sourceTree = "<group>"; };
FD9D4592272A74AF006C108F /* CustomCollectionViewDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCollectionViewDataSource.swift; sourceTree = "<group>"; };
FD9D4594272A820F006C108F /* CustomTableViewSectionDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTableViewSectionDataSource.swift; sourceTree = "<group>"; };
FD9D4599272A8DF9006C108F /* SubscribeVideoTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscribeVideoTVC.swift; sourceTree = "<group>"; };
FD9D459A272A8DF9006C108F /* SubscribeVideoTVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SubscribeVideoTVC.xib; sourceTree = "<group>"; };
FD9D459F272A97C0006C108F /* calculateDate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = calculateDate.swift; sourceTree = "<group>"; };
FD9D45A2272AA508006C108F /* UITableViewRegistable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITableViewRegistable.swift; sourceTree = "<group>"; };
FD9D45A7272AAC24006C108F /* MainHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainHeaderView.xib; sourceTree = "<group>"; };
FD9D45A9272AAC2D006C108F /* MainHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainHeaderView.swift; sourceTree = "<group>"; };
FD9D45AB272AAE8B006C108F /* SubscribeYoutuberContainerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SubscribeYoutuberContainerView.xib; sourceTree = "<group>"; };
FD9D45AD272AAEB6006C108F /* SubscribeYoutuberContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscribeYoutuberContainerView.swift; sourceTree = "<group>"; };
FD9D45B3272AAFA1006C108F /* SubscribeYoutuberCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscribeYoutuberCVC.swift; sourceTree = "<group>"; };
FD9D45B4272AAFA1006C108F /* SubscribeYoutuberCVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SubscribeYoutuberCVC.xib; sourceTree = "<group>"; };
FDCD39DF271C50490072AB10 /* Presentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presentable.swift; sourceTree = "<group>"; };
FDCD39E1271C50650072AB10 /* CoordinatorFinishOutput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoordinatorFinishOutput.swift; sourceTree = "<group>"; };
FDCD39E3271C507A0072AB10 /* BaseControllable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseControllable.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -176,19 +198,10 @@
name = Frameworks;
sourceTree = "<group>";
};
FD081E772729E214001C8FAA /* Common */ = {
isa = PBXGroup;
children = (
FD9D4591272A74A0006C108F /* CollectionView */,
FD9D458E272A6F35006C108F /* TableView */,
);
path = Common;
sourceTree = "<group>";
};
FD5B934827104B3700BE2364 /* Screens */ = {
isa = PBXGroup;
children = (
FD081E772729E214001C8FAA /* Common */,
FD9D45A5272AABF0006C108F /* CommonViews */,
FDCD3A06271C7C130072AB10 /* Library */,
FDCD3A05271C7C0C0072AB10 /* Subscribe */,
FDCD3A04271C7BFE0072AB10 /* Writing */,
Expand All @@ -204,6 +217,7 @@
FD5B934927104B5E00BE2364 /* Global */ = {
isa = PBXGroup;
children = (
FD9D45A1272AA4F1006C108F /* Protocols */,
FD9D4581272A5E60006C108F /* Models */,
FD5B93752710637E00BE2364 /* UIComponents */,
FD5B93602710559800BE2364 /* Storyboards */,
Expand Down Expand Up @@ -232,6 +246,7 @@
FD5B935127104F4900BE2364 /* calculateTopInset.swift */,
FD5B93862710841B00BE2364 /* addToolbar.swift */,
FDCD39FB271C6B260072AB10 /* Logged + UserDefaults.swift */,
FD9D459F272A97C0006C108F /* calculateDate.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -311,6 +326,8 @@
FD5B93752710637E00BE2364 /* UIComponents */ = {
isa = PBXGroup;
children = (
FD9D4591272A74A0006C108F /* CollectionView */,
FD9D458E272A6F35006C108F /* TableView */,
FD5B9376271063A500BE2364 /* CustomInputTextField.swift */,
FD5B937D27106CB500BE2364 /* CustomBlueButton.swift */,
);
Expand Down Expand Up @@ -340,6 +357,7 @@
isa = PBXGroup;
children = (
FD9D458F272A6F91006C108F /* CustomTableViewDataSource.swift */,
FD9D4594272A820F006C108F /* CustomTableViewSectionDataSource.swift */,
);
path = TableView;
sourceTree = "<group>";
Expand All @@ -352,6 +370,58 @@
path = CollectionView;
sourceTree = "<group>";
};
FD9D4598272A8DD5006C108F /* Video */ = {
isa = PBXGroup;
children = (
FD9D4599272A8DF9006C108F /* SubscribeVideoTVC.swift */,
FD9D459A272A8DF9006C108F /* SubscribeVideoTVC.xib */,
);
path = Video;
sourceTree = "<group>";
};
FD9D459D272A9202006C108F /* Filter */ = {
isa = PBXGroup;
children = (
);
path = Filter;
sourceTree = "<group>";
};
FD9D459E272A9206006C108F /* Youtuber */ = {
isa = PBXGroup;
children = (
FD9D45AB272AAE8B006C108F /* SubscribeYoutuberContainerView.xib */,
FD9D45AD272AAEB6006C108F /* SubscribeYoutuberContainerView.swift */,
FD9D45B3272AAFA1006C108F /* SubscribeYoutuberCVC.swift */,
FD9D45B4272AAFA1006C108F /* SubscribeYoutuberCVC.xib */,
);
path = Youtuber;
sourceTree = "<group>";
};
FD9D45A1272AA4F1006C108F /* Protocols */ = {
isa = PBXGroup;
children = (
FD9D45A2272AA508006C108F /* UITableViewRegistable.swift */,
);
path = Protocols;
sourceTree = "<group>";
};
FD9D45A5272AABF0006C108F /* CommonViews */ = {
isa = PBXGroup;
children = (
FD9D45A6272AABFE006C108F /* Header */,
);
path = CommonViews;
sourceTree = "<group>";
};
FD9D45A6272AABFE006C108F /* Header */ = {
isa = PBXGroup;
children = (
FD9D45A7272AAC24006C108F /* MainHeaderView.xib */,
FD9D45A9272AAC2D006C108F /* MainHeaderView.swift */,
);
path = Header;
sourceTree = "<group>";
};
FDCD39DD271C4E7B0072AB10 /* Coordinator */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -456,6 +526,9 @@
FDCD3A05271C7C0C0072AB10 /* Subscribe */ = {
isa = PBXGroup;
children = (
FD9D459E272A9206006C108F /* Youtuber */,
FD9D459D272A9202006C108F /* Filter */,
FD9D4598272A8DD5006C108F /* Video */,
FDCD3A0D271C7C430072AB10 /* SubscribeVC.swift */,
FDCD3A1B271C85370072AB10 /* Subscribe.storyboard */,
);
Expand Down Expand Up @@ -562,13 +635,17 @@
files = (
FD5B936F2710609E00BE2364 /* Account.storyboard in Resources */,
FDCD3A18271C851A0072AB10 /* Writing.storyboard in Resources */,
FD9D459C272A8DF9006C108F /* SubscribeVideoTVC.xib in Resources */,
FD5B93792710674800BE2364 /* Assets.xcassets in Resources */,
FDCD3A1A271C852B0072AB10 /* Shorts.storyboard in Resources */,
FD5B93782710670500BE2364 /* Main.storyboard in Resources */,
FD9D45A8272AAC24006C108F /* MainHeaderView.xib in Resources */,
FDCD3A1C271C85370072AB10 /* Subscribe.storyboard in Resources */,
FDCD3A1E271C85450072AB10 /* Library.storyboard in Resources */,
FDCD3A22271C85750072AB10 /* MainTab.storyboard in Resources */,
FD9D45AC272AAE8B006C108F /* SubscribeYoutuberContainerView.xib in Resources */,
FDCD3A16271C850B0072AB10 /* Home.storyboard in Resources */,
FD9D45B6272AAFA1006C108F /* SubscribeYoutuberCVC.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -639,12 +716,15 @@
FD5B938027106DBD00BE2364 /* ColorLiterals.swift in Sources */,
FDCD39E2271C50650072AB10 /* CoordinatorFinishOutput.swift in Sources */,
FDCD39FE271C773B0072AB10 /* MainTabCoordinator.swift in Sources */,
FD9D459B272A8DF9006C108F /* SubscribeVideoTVC.swift in Sources */,
FD5B93822710741B00BE2364 /* StringLiterals.swift in Sources */,
FDCD3A30271CAFD60072AB10 /* MainNavigationController.swift in Sources */,
FDCD3A2A271C874F0072AB10 /* SubscribeCoordinator.swift in Sources */,
FDCD39E0271C50490072AB10 /* Presentable.swift in Sources */,
FDCD39EE271C58CD0072AB10 /* BaseCoordinator.swift in Sources */,
FD9D4595272A820F006C108F /* CustomTableViewSectionDataSource.swift in Sources */,
FD5B9377271063A500BE2364 /* CustomInputTextField.swift in Sources */,
FD9D45B5272AAFA1006C108F /* SubscribeYoutuberCVC.swift in Sources */,
FDD7A6BD270AB1BC0099F245 /* ViewController.swift in Sources */,
FDCD3A01271C78EB0072AB10 /* MainTabBarController.swift in Sources */,
FDCD3A0C271C7C390072AB10 /* WritingVC.swift in Sources */,
Expand All @@ -659,6 +739,7 @@
FD5B9362271055A100BE2364 /* Storyboards.swift in Sources */,
FDD7A6B9270AB1BC0099F245 /* AppDelegate.swift in Sources */,
FD9D4589272A5F78006C108F /* YoutuberDataModel.swift in Sources */,
FD9D45AA272AAC2D006C108F /* MainHeaderView.swift in Sources */,
FD5B937C271067E300BE2364 /* addPadding + UITextField.swift in Sources */,
FDCD3A32271CB03E0072AB10 /* UIColor + Extension.swift in Sources */,
FD5B935F2710557200BE2364 /* controllerFromStoryboard + UIViewController.swift in Sources */,
Expand All @@ -668,9 +749,12 @@
FD5B934E27104DC700BE2364 /* makeVibrate.swift in Sources */,
FDCD3A2E271C8DD20072AB10 /* SceneDelegate.swift in Sources */,
FD9D458D272A6455006C108F /* VideoDataModel.swift in Sources */,
FD9D45A3272AA508006C108F /* UITableViewRegistable.swift in Sources */,
FD9D45AE272AAEB6006C108F /* SubscribeYoutuberContainerView.swift in Sources */,
FDCD39EB271C543D0072AB10 /* CoordinatorFactory.swift in Sources */,
FD9D4587272A5F69006C108F /* SubscribeDataModel.swift in Sources */,
FD5B93872710841B00BE2364 /* addToolbar.swift in Sources */,
FD9D45A0272A97C0006C108F /* calculateDate.swift in Sources */,
FDCD39E4271C507A0072AB10 /* BaseControllable.swift in Sources */,
FDCD3A28271C873C0072AB10 /* WritingCoordinator.swift in Sources */,
FD5B938527107DD000BE2364 /* ImageLiterals.swift in Sources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,57 @@ extension SubscribeDataModel{
title: "1์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : iOS ์ปดํฌ๋„ŒํŠธ ์ดํ•ด, Xcode ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•, View ํ™”๋ฉด์ „ํ™˜",
url: "https://www.youtube.com/",
viewCount: 423,
time: "2021-09-04",
time: "2021-09-02 12:00:13",
youtuber: SOPT),

Video(thumbnailImage: ImageLiterals.Subscribe.Video.thumbnail,
idx: 101,
title: "2์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : AutoLayout, StackView, TabBarController",
url: "https://www.youtube.com/",
viewCount: 5123,
time: "2021-09-11",
time: "2021-09-09 12:00:13",
youtuber: SOPT),

Video(thumbnailImage: ImageLiterals.Subscribe.Video.thumbnail,
idx: 102,
title: "3์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : ScrollView, Delegate Pattern, TableView, CollectionView",
url: "https://www.youtube.com/",
viewCount: 423,
time: "2021-09-18",
time: "2021-09-16 12:00:13",
youtuber: SOPT),

Video(thumbnailImage: ImageLiterals.Subscribe.Video.thumbnail,
idx: 103,
title: "4์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : Cocoapods & Networking, REST API",
url: "https://www.youtube.com/",
viewCount: 423,
time: "2021-09-25",
time: "2021-09-23 12:00:13",
youtuber: SOPT),

Video(thumbnailImage: ImageLiterals.Subscribe.Video.thumbnail,
idx: 104,
title: "7์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : Animation๊ณผ ์ œ์Šค์ณ, ๋ฐ์ดํ„ฐ ์ „๋‹ฌ ์‹ฌํ™” ",
url: "https://www.youtube.com/",
viewCount: 423,
time: "2021-10-02",
time: "2021-09-30 12:00:13",
youtuber: SOPT),

Video(thumbnailImage: ImageLiterals.Subscribe.Video.thumbnail,
idx: 105,
title: "8์ฐจ iOS ์„ธ๋ฏธ๋‚˜ : 8์ฐจ ์„ธ๋ฏธ๋‚˜ ์ž์ œํœด๊ฐ•ํ•˜์‹œ์ฃ ! ์— ํ‹ฐ๊ฐ€์ž!",
url: "https://www.youtube.com/",
viewCount: 423,
time: "2021-10-09",
time: "2021-10-05 12:00:13",
youtuber: SOPT),
].sorted(by: { $0.idx < $1.idx })
}
}



}
extension SubscribeDataModel.Video: CustomStringConvertible {
public var description: String {
return "\(youtuber.name) ใƒป ์กฐํšŒ์ˆ˜ \(viewCount)ํšŒ ใƒป \(calculatePastTime(date: time))"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// UITableViewRegistable.swift
// sopt_29th_Assignment
//
// Created by ์†ก์ง€ํ›ˆ on 2021/10/28.
//

import UIKit

protocol UITableViewRegisterable {

static var isFromNib: Bool { get }
static func register(target: UITableView)
}

extension UITableViewRegisterable where Self: UITableViewCell {

static func register(target: UITableView) {
if self.isFromNib {
target.register(UINib(nibName: Self.className, bundle: nil), forCellReuseIdentifier: Self.className)
} else {
target.register(Self.self, forCellReuseIdentifier: Self.className)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

public class CustomCollectionViewDataSource<T>: NSObject, UICollectionViewDataSource,
public class CustomCollectionViewListDataSource<T>: NSObject, UICollectionViewDataSource,
UICollectionViewDelegate,
UICollectionViewDelegateFlowLayout{
let items: [T]
Expand Down Expand Up @@ -67,11 +67,11 @@ public class CustomCollectionViewDataSource<T>: NSObject, UICollectionViewDataSo
}

public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return self.lineSpacing
return self.interItemSpacing
}

public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return self.interItemSpacing
return self.lineSpacing
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import UIKit

public class CustomTableViewDataSource<T>: NSObject, UITableViewDataSource, UITableViewDelegate {
public class CustomTableViewListDataSource<T>: NSObject, UITableViewDataSource, UITableViewDelegate {
let items: [T]
let cellFactory: (T) -> UITableViewCell
public var onItemSelected: (T) -> Void = { _ in }
public var onItemSelected: (T,IndexPath) -> Void = { _,index in }

public init(items: [T], cellFactory: @escaping (T) -> UITableViewCell) {
self.items = items
Expand All @@ -36,6 +36,6 @@ public class CustomTableViewDataSource<T>: NSObject, UITableViewDataSource, UITa
// MARK: UITableViewDelegate

public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
self.onItemSelected(item(at: indexPath))
self.onItemSelected(item(at: indexPath), indexPath)
}
}
Loading

0 comments on commit e8ba6f1

Please sign in to comment.