diff --git a/Youtube_Clone/Youtube_Clone.xcodeproj/project.pbxproj b/Youtube_Clone/Youtube_Clone.xcodeproj/project.pbxproj index ca2a683..adc164a 100644 --- a/Youtube_Clone/Youtube_Clone.xcodeproj/project.pbxproj +++ b/Youtube_Clone/Youtube_Clone.xcodeproj/project.pbxproj @@ -34,6 +34,9 @@ 36A6022827100790002BBF40 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 36A6022627100790002BBF40 /* LaunchScreen.storyboard */; }; 36A60235271008C2002BBF40 /* Login.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 36A60234271008C2002BBF40 /* Login.storyboard */; }; 36A60237271008DE002BBF40 /* LoginVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36A60236271008DE002BBF40 /* LoginVC.swift */; }; + 36B69F862775DD7C00FEEAAE /* Detail.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 36B69F852775DD7C00FEEAAE /* Detail.storyboard */; }; + 36B69F892775DD9700FEEAAE /* DetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36B69F882775DD9700FEEAAE /* DetailVC.swift */; }; + 36B69F8B2775EBE400FEEAAE /* HomeDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36B69F8A2775EBE400FEEAAE /* HomeDataModel.swift */; }; 36F8F6C72721464E00092338 /* TabbarVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36F8F6C62721464E00092338 /* TabbarVC.swift */; }; 36F8F6CB272146DD00092338 /* HomeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36F8F6CA272146DD00092338 /* HomeVC.swift */; }; 36F8F6CF2721470D00092338 /* Home.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 36F8F6CE2721470D00092338 /* Home.storyboard */; }; @@ -79,6 +82,9 @@ 36A6022927100790002BBF40 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36A60234271008C2002BBF40 /* Login.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Login.storyboard; sourceTree = ""; }; 36A60236271008DE002BBF40 /* LoginVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginVC.swift; sourceTree = ""; }; + 36B69F852775DD7C00FEEAAE /* Detail.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Detail.storyboard; sourceTree = ""; }; + 36B69F882775DD9700FEEAAE /* DetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailVC.swift; sourceTree = ""; }; + 36B69F8A2775EBE400FEEAAE /* HomeDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeDataModel.swift; sourceTree = ""; }; 36F8F6C62721464E00092338 /* TabbarVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabbarVC.swift; sourceTree = ""; }; 36F8F6CA272146DD00092338 /* HomeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeVC.swift; sourceTree = ""; }; 36F8F6CE2721470D00092338 /* Home.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Home.storyboard; sourceTree = ""; }; @@ -186,6 +192,7 @@ isa = PBXGroup; children = ( 362F42FE273CF5BA0033E580 /* LoginDataModel.swift */, + 36B69F8A2775EBE400FEEAAE /* HomeDataModel.swift */, ); path = Models; sourceTree = ""; @@ -254,6 +261,7 @@ 36A60232271007FE002BBF40 /* VCs */ = { isa = PBXGroup; children = ( + 36B69F872775DD8900FEEAAE /* Detail */, 36F8F6E52722DDD700092338 /* Saves */, 36F8F6E42722DDCF00092338 /* Subscibe */, 36F8F6E32722DDCA00092338 /* Adds */, @@ -269,6 +277,7 @@ 36A6023327100812002BBF40 /* Storyboards */ = { isa = PBXGroup; children = ( + 36B69F842775DD6E00FEEAAE /* Detail */, 36F8F6DC2722DD8C00092338 /* Saves */, 36F8F6D92722DD7000092338 /* Subscribe */, 36F8F6D62722DD6000092338 /* Adds */, @@ -282,6 +291,22 @@ path = Storyboards; sourceTree = ""; }; + 36B69F842775DD6E00FEEAAE /* Detail */ = { + isa = PBXGroup; + children = ( + 36B69F852775DD7C00FEEAAE /* Detail.storyboard */, + ); + path = Detail; + sourceTree = ""; + }; + 36B69F872775DD8900FEEAAE /* Detail */ = { + isa = PBXGroup; + children = ( + 36B69F882775DD9700FEEAAE /* DetailVC.swift */, + ); + path = Detail; + sourceTree = ""; + }; 36F8F6C82721469C00092338 /* Home */ = { isa = PBXGroup; children = ( @@ -477,6 +502,7 @@ 36F8F6D12721482100092338 /* Tabbar.storyboard in Resources */, 36A602232710078F002BBF40 /* Main.storyboard in Resources */, 366D23F42710627600652491 /* Register.storyboard in Resources */, + 36B69F862775DD7C00FEEAAE /* Detail.storyboard in Resources */, 36631C11272C04F2001BEC5B /* VideoTVC.xib in Resources */, 36F8F6DB2722DD7E00092338 /* Subscribe.storyboard in Resources */, 366D23F827106D5300652491 /* CompleteLogin.storyboard in Resources */, @@ -538,6 +564,7 @@ 36631C01272BDF31001BEC5B /* UITableView++.swift in Sources */, 36631C04272BF533001BEC5B /* ShortsTVC.swift in Sources */, 36F8F6E72722DDE600092338 /* AddsVC.swift in Sources */, + 36B69F892775DD9700FEEAAE /* DetailVC.swift in Sources */, 366D23FA27106D6200652491 /* CompleteLoginVC.swift in Sources */, 362F4305273D0AC70033E580 /* RegisterService.swift in Sources */, 36F8F6C72721464E00092338 /* TabbarVC.swift in Sources */, @@ -552,6 +579,7 @@ 36F8F6E02722DDB100092338 /* ShortsVC.swift in Sources */, 362F4303273CFD530033E580 /* UIViewController++.swift in Sources */, 362F42FD273CF40E0033E580 /* Constants.swift in Sources */, + 36B69F8B2775EBE400FEEAAE /* HomeDataModel.swift in Sources */, 362F4301273CF9320033E580 /* LoginService.swift in Sources */, 366D23F62710628800652491 /* RegisterVC.swift in Sources */, 36F8F6E92722DDF800092338 /* SubscribeVC.swift in Sources */, diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/Contents.json b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/Contents.json new file mode 100644 index 0000000..51a2ece --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icn_dismissBtn.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icn_dismissBtn@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icn_dismissBtn@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn.png new file mode 100644 index 0000000..4cc4aea Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@2x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@2x.png new file mode 100644 index 0000000..b955ff9 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@2x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@3x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@3x.png new file mode 100644 index 0000000..40168c9 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_dismissBtn.imageset/icn_dismissBtn@3x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/Contents.json b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/Contents.json new file mode 100644 index 0000000..f63c269 --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "icn_expandBtn.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "icn_expandBtn@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "icn_expandBtn@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn.png new file mode 100644 index 0000000..b937d79 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@2x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@2x.png new file mode 100644 index 0000000..df491be Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@2x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@3x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@3x.png new file mode 100644 index 0000000..194b4c5 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/icn_expandBtn.imageset/icn_expandBtn@3x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/Contents.json b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/Contents.json new file mode 100644 index 0000000..098d8d8 --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "wesoptiOSPart.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "wesoptiOSPart@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "wesoptiOSPart@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart.png new file mode 100644 index 0000000..29a36bc Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@2x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@2x.png new file mode 100644 index 0000000..d11b055 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@2x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@3x.png b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@3x.png new file mode 100644 index 0000000..15c3784 Binary files /dev/null and b/Youtube_Clone/Youtube_Clone/Resource/Assets.xcassets/wesoptiOSPart.imageset/wesoptiOSPart@3x.png differ diff --git a/Youtube_Clone/Youtube_Clone/Resource/Storyboards/Detail/Detail.storyboard b/Youtube_Clone/Youtube_Clone/Resource/Storyboards/Detail/Detail.storyboard new file mode 100644 index 0000000..2c6b11a --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Resource/Storyboards/Detail/Detail.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Youtube_Clone/Youtube_Clone/Source/Models/HomeDataModel.swift b/Youtube_Clone/Youtube_Clone/Source/Models/HomeDataModel.swift new file mode 100644 index 0000000..90ee1f6 --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Source/Models/HomeDataModel.swift @@ -0,0 +1,14 @@ +// +// HomeDataModel.swift +// Youtube_Clone +// +// Created by 박익범 on 2021/12/24. +// + +import Foundation + +struct homeDataModel{ + var titleText: String + var detailText: String + var imageName: String +} diff --git a/Youtube_Clone/Youtube_Clone/Source/TVCs/VideoTVC.swift b/Youtube_Clone/Youtube_Clone/Source/TVCs/VideoTVC.swift index 6f56a06..aecb441 100644 --- a/Youtube_Clone/Youtube_Clone/Source/TVCs/VideoTVC.swift +++ b/Youtube_Clone/Youtube_Clone/Source/TVCs/VideoTVC.swift @@ -9,8 +9,19 @@ import UIKit import SnapKit import Then +protocol isImageViewClickedDelegate{ + func isImageViewClicked(title: String, detail: String, image: String) +} + + class VideoTVC: UITableViewCell { + var delegate: isImageViewClickedDelegate? + var title: String = "" + var subText: String = "" + var imageName: String = "" + + private let videoImageView = UIImageView().then{ $0.image = UIImage(named: "wesoptAndroidpart") } @@ -21,6 +32,8 @@ class VideoTVC: UITableViewCell { private let nameLabel = UILabel().then{ $0.text = "ㅇㅇ" $0.font = UIFont.systemFont(ofSize: 15) + $0.numberOfLines = 2 + $0.lineBreakMode = .byCharWrapping $0.textColor = UIColor.black } private let subLabel = UILabel().then{ @@ -32,6 +45,22 @@ class VideoTVC: UITableViewCell { $0.setBackgroundImage(UIImage(named: "moreMenuIcon"), for: .normal) } + func setData(titleText: String, detailText: String, image: String){ + nameLabel.text = titleText + title = titleText + subLabel.text = detailText + subText = detailText + videoImageView.image = UIImage(named: image) + imageName = image + } + + + @objc private func imageViewClicked(_ sender: UIImageView){ + print("눌림") + delegate?.isImageViewClicked(title: title, detail: subText, image: imageName) + } + + func setLayout(){ contentView.addsubViews([videoImageView, profileImageView,nameLabel,subLabel,moreButton]) @@ -53,10 +82,10 @@ class VideoTVC: UITableViewCell { $0.width.height.equalTo(26) } nameLabel.snp.makeConstraints{ - $0.top.equalTo(videoImageView.snp.bottom).offset(12) + $0.top.equalTo(profileImageView.snp.top).offset(0) $0.leading.equalTo(profileImageView.snp.trailing).offset(12) $0.trailing.equalTo(moreButton.snp.leading).offset(-19) - $0.height.equalTo(35) + $0.height.equalTo(50) } subLabel.snp.makeConstraints{ $0.top.equalTo(nameLabel.snp.bottom).offset(4) @@ -70,13 +99,16 @@ class VideoTVC: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() + self.selectionStyle = .none + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(imageViewClicked(_:))) + videoImageView.isUserInteractionEnabled = true + videoImageView.addGestureRecognizer(tapGesture) setLayout() // Initialization code } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) - // Configure the view for the selected state } diff --git a/Youtube_Clone/Youtube_Clone/Source/VCs/Detail/DetailVC.swift b/Youtube_Clone/Youtube_Clone/Source/VCs/Detail/DetailVC.swift new file mode 100644 index 0000000..58f657b --- /dev/null +++ b/Youtube_Clone/Youtube_Clone/Source/VCs/Detail/DetailVC.swift @@ -0,0 +1,88 @@ +// +// DetailVC.swift +// Youtube_Clone +// +// Created by 박익범 on 2021/12/24. +// + +import UIKit +import SnapKit +import Then + +class DetailVC: UIViewController { + + private let imageView = UIImageView().then{ + $0.image = UIImage(named: "wesoptAndroidpart") + } + + private let titleLabel = UILabel().then{ + $0.font = UIFont.systemFont(ofSize: 15, weight: .regular) + $0.textColor = UIColor.black + $0.lineBreakMode = .byCharWrapping + $0.numberOfLines = 2 + } + + private let detailLabel = UILabel().then{ + $0.font = UIFont.systemFont(ofSize: 13, weight: .regular) + $0.textColor = UIColor.systemGray + } + private let backButton = UIButton().then{ + $0.setBackgroundImage(UIImage(named: "icn_dismissBtn"), for: .normal) + $0.addTarget(self, action: #selector(dismissButtonClicked(_:)), for: .touchUpInside) + } + private let expandButton = UIButton().then{ + $0.setBackgroundImage(UIImage(named: "icn_expandBtn"), for: .normal) + } + + + func setData(title: String, detail: String, image: String){ + titleLabel.text = title + detailLabel.text = detail + imageView.image = UIImage(named: image) + } + + + func setLayout(){ + view.addsubViews([imageView, titleLabel, detailLabel, backButton, expandButton]) + + imageView.snp.makeConstraints{ + $0.leading.trailing.equalToSuperview().offset(0) + $0.top.equalToSuperview().offset(50) + $0.height.equalTo(212) + } + backButton.snp.makeConstraints{ + $0.leading.equalToSuperview().offset(0) + $0.top.equalToSuperview().offset(50) + $0.height.width.equalTo(48) + } + titleLabel.snp.makeConstraints{ + $0.top.equalTo(imageView.snp.bottom).offset(12) + $0.leading.equalToSuperview().offset(12) + $0.width.equalTo(270) + } + expandButton.snp.makeConstraints{ + $0.top.equalTo(imageView.snp.bottom).offset(12) + $0.trailing.equalToSuperview().offset(-7) + $0.width.height.equalTo(26) + } + detailLabel.snp.makeConstraints{ + $0.top.equalTo(titleLabel.snp.bottom).offset(4) + $0.leading.equalToSuperview().offset(12) + $0.width.equalTo(270) + } + } + + @objc private func dismissButtonClicked(_ sender: UIButton){ + self.dismiss(animated: true, completion: nil) + } + + + override func viewDidLoad() { + super.viewDidLoad() + setLayout() + } + + + + +} diff --git a/Youtube_Clone/Youtube_Clone/Source/VCs/Home/HomeVC.swift b/Youtube_Clone/Youtube_Clone/Source/VCs/Home/HomeVC.swift index c1c4bb0..0cb9c63 100644 --- a/Youtube_Clone/Youtube_Clone/Source/VCs/Home/HomeVC.swift +++ b/Youtube_Clone/Youtube_Clone/Source/VCs/Home/HomeVC.swift @@ -11,6 +11,10 @@ import Then class HomeVC: UIViewController { + var homeDataList: [homeDataModel] = [] + var selectTitle: String = "" + var selectSub: String = "" + private let tableView = UITableView().then{ $0.backgroundColor = UIColor.white $0.separatorStyle = .none @@ -41,15 +45,24 @@ class HomeVC: UIViewController { //MARK: ViewDidLoad override func viewDidLoad() { super.viewDidLoad() + dataInit() navigationController?.isNavigationBarHidden = true setHeaderViewLayout() tableViewLayout() } + func dataInit(){ + homeDataList.append(contentsOf: [ + homeDataModel(titleText: "1차 iOS 세미나 : iOS 컴포넌트 이해, Xcode 기본 사용법, View 화면전환", detailText: "WE SOPT ・조회수 100만회 ・ 3주 전", imageName: "wesoptiOSPart"), + homeDataModel(titleText: "2차 iOS 세미나 : AutoLayout,StackView,TabBarController", detailText: "WE SOPT ・조회수 100만회 ・ 3주 전", imageName: "wesoptiOSPart"), + homeDataModel(titleText: "3차 iOS 세미나 : ScrollView, Delegate Pattern, TableView, CollectionView", detailText: "WE SOPT ・조회수 100만회 ・ 3주 전", imageName: "wesoptDesignPart"), + homeDataModel(titleText: "4차 iOS 세미나 : Cocoapods & Networking, REST API", detailText: "WE SOPT ・조회수 100만회 ・ 3주 전", imageName: "wesoptServerPart"), + homeDataModel(titleText: "7차 iOS 세미나 : Animation과 제스쳐, 데이터 전달 심화", detailText: "WE SOPT ・조회수 100만회 ・ 3주 전", imageName: "wesoptPlanPart")]) + } + @objc private func profileButtonClicked(_ sender: UIButton){ guard let loginVC = UIStoryboard(name: "Login", bundle: nil).instantiateViewController(withIdentifier: "LoginVC") as? LoginVC else {return} self.navigationController?.pushViewController(loginVC, animated: true) - print("dd") } @@ -116,7 +129,7 @@ extension HomeVC: UITableViewDelegate{ extension HomeVC: UITableViewDataSource{ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 10 + return homeDataList.count + 1 } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { if(indexPath.row == 0){ @@ -133,14 +146,28 @@ extension HomeVC: UITableViewDataSource{ let cell = tableView.dequeueReusableCell(withIdentifier: "ShortsTVC") as! ShortsTVC let videoCell = tableView.dequeueReusableCell(withIdentifier: "VideoTVC") as! VideoTVC + videoCell.delegate = self + if(indexPath.row == 0){ cell.selectionStyle = .none return cell } else{ + videoCell.setData(titleText: homeDataList[indexPath.row-1].titleText, detailText: homeDataList[indexPath.row-1].detailText, image: homeDataList[indexPath.row-1].imageName) return videoCell } } } + +extension HomeVC: isImageViewClickedDelegate{ + func isImageViewClicked(title: String, detail: String, image: String) { + guard let detailVC = UIStoryboard(name: "Detail", bundle: nil).instantiateViewController(withIdentifier: "DetailVC") as? DetailVC else {return} + detailVC.setData(title: title, detail: detail, image: image) + detailVC.modalPresentationStyle = .overFullScreen + self.present(detailVC, animated: true, completion: nil) + } + + +}