Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/16 week7 UI #17

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,87 @@
</objects>
<point key="canvasLocation" x="3281" y="102"/>
</scene>
<!--Home TapVC-->
<scene sceneID="DtH-ND-fri">
<objects>
<viewController storyboardIdentifier="HomeTapVC" id="MYa-fh-6L1" customClass="HomeTapVC" customModule="_9th_assignmnet_YouTube" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" restorationIdentifier="HomeTapVC" id="l58-0I-iFL">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="soptIOS" translatesAutoresizingMaskIntoConstraints="NO" id="8Jo-yG-gVz">
<rect key="frame" x="0.0" y="44" width="414" height="212"/>
<constraints>
<constraint firstAttribute="height" constant="212" id="B2R-rN-riZ"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="soptLogoCircle" translatesAutoresizingMaskIntoConstraints="NO" id="RvL-O4-VHM">
<rect key="frame" x="12" y="267" width="36" height="36"/>
<constraints>
<constraint firstAttribute="width" constant="36" id="Ob6-iK-hHn"/>
<constraint firstAttribute="height" constant="36" id="dY9-ct-fqI"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bFy-RU-Bpj">
<rect key="frame" x="60" y="267" width="320" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DE2-Ji-dvJ">
<rect key="frame" x="388" y="263" width="26" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="3FU-Bc-Qvy"/>
<constraint firstAttribute="height" constant="26" id="Snd-Gn-3bV"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="additional"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i0S-QH-Jgf">
<rect key="frame" x="59" y="289" width="33" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="14f-ey-ZZ1">
<rect key="frame" x="0.0" y="44" width="61" height="31"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="BACK"/>
<connections>
<action selector="touchUpToBack:" destination="MYa-fh-6L1" eventType="touchUpInside" id="yjX-hk-QdI"/>
</connections>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="1n4-oP-a9W"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="RvL-O4-VHM" firstAttribute="leading" secondItem="1n4-oP-a9W" secondAttribute="leading" constant="12" id="2IO-st-95m"/>
<constraint firstItem="14f-ey-ZZ1" firstAttribute="top" secondItem="1n4-oP-a9W" secondAttribute="top" id="BIn-Jz-CIA"/>
<constraint firstItem="DE2-Ji-dvJ" firstAttribute="leading" secondItem="bFy-RU-Bpj" secondAttribute="trailing" constant="8" symbolic="YES" id="IYA-83-6GR"/>
<constraint firstItem="DE2-Ji-dvJ" firstAttribute="top" secondItem="8Jo-yG-gVz" secondAttribute="bottom" constant="7" id="Jhf-nj-KCN"/>
<constraint firstItem="8Jo-yG-gVz" firstAttribute="leading" secondItem="1n4-oP-a9W" secondAttribute="leading" id="Nim-ab-3zv"/>
<constraint firstItem="14f-ey-ZZ1" firstAttribute="leading" secondItem="1n4-oP-a9W" secondAttribute="leading" id="Sd7-li-KiL"/>
<constraint firstItem="bFy-RU-Bpj" firstAttribute="leading" secondItem="RvL-O4-VHM" secondAttribute="trailing" constant="12" id="UjH-Am-mhe"/>
<constraint firstItem="i0S-QH-Jgf" firstAttribute="top" secondItem="bFy-RU-Bpj" secondAttribute="bottom" constant="4" id="WKs-sp-rmp"/>
<constraint firstItem="8Jo-yG-gVz" firstAttribute="trailing" secondItem="1n4-oP-a9W" secondAttribute="trailing" id="Z0d-MQ-Igy"/>
<constraint firstItem="8Jo-yG-gVz" firstAttribute="top" secondItem="1n4-oP-a9W" secondAttribute="top" id="elF-5h-qbb"/>
<constraint firstItem="i0S-QH-Jgf" firstAttribute="leading" secondItem="RvL-O4-VHM" secondAttribute="trailing" constant="11" id="gRR-Xb-7Ky"/>
<constraint firstItem="RvL-O4-VHM" firstAttribute="top" secondItem="8Jo-yG-gVz" secondAttribute="bottom" constant="11" id="gqe-2i-cM3"/>
<constraint firstItem="1n4-oP-a9W" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="i0S-QH-Jgf" secondAttribute="trailing" symbolic="YES" id="iNh-ZG-Fl0"/>
<constraint firstItem="bFy-RU-Bpj" firstAttribute="top" secondItem="8Jo-yG-gVz" secondAttribute="bottom" constant="11" id="nLf-gq-tFD"/>
<constraint firstItem="1n4-oP-a9W" firstAttribute="trailing" secondItem="DE2-Ji-dvJ" secondAttribute="trailing" id="zQk-5G-yig"/>
</constraints>
</view>
<connections>
<outlet property="imgView" destination="8Jo-yG-gVz" id="hiK-op-1hm"/>
<outlet property="subtitleLabel" destination="i0S-QH-Jgf" id="M5O-4a-5Xj"/>
<outlet property="titleLabel" destination="bFy-RU-Bpj" id="DWq-de-q2x"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Uqu-Il-Pli" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="4026.0869565217395" y="-564.50892857142856"/>
</scene>
<!--HomeVC-->
<scene sceneID="p50-DF-CQ9">
<objects>
Expand Down Expand Up @@ -611,12 +692,14 @@
</scene>
</scenes>
<resources>
<image name="additional" width="26" height="26"/>
<image name="alarm" width="32" height="32"/>
<image name="filter-1" width="46" height="32"/>
<image name="finder" width="32" height="32"/>
<image name="ggamju1" width="58" height="58"/>
<image name="googleLogo" width="184" height="62"/>
<image name="share" width="32" height="32"/>
<image name="soptIOS" width="500.5" height="500.5"/>
<image name="soptLogoCircle" width="24" height="24"/>
<image name="square" catalog="system" width="128" height="114"/>
<image name="youtubeLogo" width="96" height="20"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ class HomeTableViewCell: UITableViewCell {
// Configure the view for the selected state
}





}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="221"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="soptIOS" translatesAutoresizingMaskIntoConstraints="NO" id="oxa-Qa-cU3">
<imageView clipsSubviews="YES" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="soptIOS" translatesAutoresizingMaskIntoConstraints="NO" id="oxa-Qa-cU3">
<rect key="frame" x="0.0" y="0.0" width="320" height="127"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="soptLogoCircle" translatesAutoresizingMaskIntoConstraints="NO" id="Adq-8I-Hix">
Expand Down
25 changes: 25 additions & 0 deletions 29th-assignment-YouTube/Sources/HomeVC/HomeTapVC.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// HomeTapVC.swift
// 29th-assignmnet-YouTube
//
// Created by ๋ฐ•์˜ˆ๋นˆ on 2021/12/10.
//

import UIKit

class HomeTapVC: UIViewController {
static let identifier = "HomeTapVC"

@IBOutlet weak var subtitleLabel: UILabel!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var imgView: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
}
@IBAction func touchUpToBack(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
}
42 changes: 30 additions & 12 deletions 29th-assignment-YouTube/Sources/HomeVC/HomeVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class HomeVC: UIViewController {
class HomeVC: UIViewController, UIGestureRecognizerDelegate {

@IBOutlet weak var storyCollectionView: UICollectionView!
@IBOutlet weak var filterCollectionView: UICollectionView!
Expand All @@ -20,14 +20,7 @@ class HomeVC: UIViewController {

initContentList()
registerXib()
storyCollectionView.dataSource = self
filterCollectionView.dataSource = self
storyCollectionView.delegate = self
filterCollectionView.delegate = self
mainTableView.delegate = self
mainTableView.dataSource = self


setDataSourceWithDelegate()
}

@IBAction func touchUpToGoLogin(_ sender: Any) {
Expand All @@ -37,6 +30,15 @@ class HomeVC: UIViewController {

}

func setDataSourceWithDelegate() {
storyCollectionView.dataSource = self
filterCollectionView.dataSource = self
storyCollectionView.delegate = self
filterCollectionView.delegate = self
mainTableView.delegate = self
mainTableView.dataSource = self
}

func registerXib(){
let xibName = UINib(nibName: HomeTableViewCell.identifier, bundle: nil)
mainTableView.register(xibName, forCellReuseIdentifier: HomeTableViewCell.identifier)
Expand All @@ -58,7 +60,6 @@ class HomeVC: UIViewController {
extension HomeVC: UITableViewDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 306

}
}

Expand All @@ -71,8 +72,26 @@ extension HomeVC: UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: HomeTableViewCell.identifier) as? HomeTableViewCell else {return UITableViewCell()}

let tapRecorgnizer = UITapGestureRecognizer(target: self, action: #selector(tapView(gestureRecognizer:)))
cell.mainImageView.addGestureRecognizer(tapRecorgnizer)
tapRecorgnizer.delegate = self

return cell
}

@objc func tapView(gestureRecognizer: UIGestureRecognizer) {
guard let nextVC = self.storyboard?.instantiateViewController(withIdentifier: HomeTapVC.identifier) as? HomeTapVC else { return }

nextVC.modalPresentationStyle = .fullScreen

present(nextVC, animated: true) {
nextVC.imgView.image = UIImage(named: "soptIOS")
nextVC.titleLabel.text = "1์ฐจ ์„ธ๋ฏธ๋‚˜ : iOS ์ปดํฌ๋„ŒํŠธ ์ดํ•ด, XCode ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•, View ํ™”๋ฉด ์ „ํ™˜"
nextVC.subtitleLabel.text = "WE SOPT ใƒป์กฐํšŒ์ˆ˜ 100๋งŒํšŒ ใƒป 3์ฃผ ์ „"

}
}

}

// MARK: CollectionView
Expand All @@ -83,7 +102,6 @@ extension HomeVC: UICollectionViewDataSource {
} else {
return 6
}

}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
Expand All @@ -107,7 +125,7 @@ extension HomeVC: UICollectionViewDelegateFlowLayout {
if collectionView == storyCollectionView {
return CGSize(width: 72, height: 104)
} else {
print(UIImage(named: "filter-" + String(indexPath.row + 1))?.size.width)
// print(UIImage(named: "filter-" + String(indexPath.row + 1))?.size.width)
return CGSize(width:((UIImage(named: "filter-" + String(indexPath.row + 1)))?.size.width)!, height: 32)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class SignInViewController: UIViewController, UITextFieldDelegate {
super.viewDidLoad()

setUI()


}

// MARK: - Custom Method
Expand Down
4 changes: 4 additions & 0 deletions 29th-assignmnet-YouTube.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
1501BB9D276382430084AAE4 /* HomeTapVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1501BB9C276382430084AAE4 /* HomeTapVC.swift */; };
15B2AE83272AF8ED00FFC5B2 /* UINavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15B2AE82272AF8ED00FFC5B2 /* UINavigationController.swift */; };
15B2AE85272AFA2900FFC5B2 /* UITextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15B2AE84272AFA2900FFC5B2 /* UITextField.swift */; };
15B2AE87272AFDD800FFC5B2 /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15B2AE86272AFDD800FFC5B2 /* UIColor.swift */; };
Expand Down Expand Up @@ -39,6 +40,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
1501BB9C276382430084AAE4 /* HomeTapVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeTapVC.swift; sourceTree = "<group>"; };
15B2AE82272AF8ED00FFC5B2 /* UINavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UINavigationController.swift; sourceTree = "<group>"; };
15B2AE84272AFA2900FFC5B2 /* UITextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextField.swift; sourceTree = "<group>"; };
15B2AE86272AFDD800FFC5B2 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -248,6 +250,7 @@
15B2AE92272B24D700FFC5B2 /* HomeTableViewCell.swift */,
15B2AE93272B24D700FFC5B2 /* HomeTableViewCell.xib */,
15FF7ED8272B35E7004BE9D1 /* FilterCollectionViewCell.swift */,
1501BB9C276382430084AAE4 /* HomeTapVC.swift */,
);
path = HomeVC;
sourceTree = "<group>";
Expand Down Expand Up @@ -412,6 +415,7 @@
15B2AE89272B139300FFC5B2 /* StoryCollectionViewCell.swift in Sources */,
15B2AE8B272B17BB00FFC5B2 /* StoryDataModel.swift in Sources */,
15F3BA35271DCD7D00D51D4E /* HomeVC.swift in Sources */,
1501BB9D276382430084AAE4 /* HomeTapVC.swift in Sources */,
15B2AE83272AF8ED00FFC5B2 /* UINavigationController.swift in Sources */,
15F3BA37271DCDD500D51D4E /* ShortsVC.swift in Sources */,
15B2AE94272B24D700FFC5B2 /* HomeTableViewCell.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "C14CA9D3-5C6F-4E58-A011-D2C7A69B0BE7"
type = "0"
version = "2.0">
</Bucket>