Skip to content

Commit

Permalink
✨[FEAT] HomeTapVC dismiss 구현 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
beansbin committed Dec 10, 2021
1 parent 6ddd877 commit 599b14a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,35 +381,44 @@
<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="subTitle" destination="i0S-QH-Jgf" id="Qge-wO-fQV"/>
<outlet property="subtitleLabel" destination="i0S-QH-Jgf" id="M5O-4a-5Xj"/>
<outlet property="title" destination="bFy-RU-Bpj" id="IiW-zV-7Lm"/>
<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="4027" y="-564"/>
<point key="canvasLocation" x="4026.0869565217395" y="-564.50892857142856"/>
</scene>
<!--HomeVC-->
<scene sceneID="p50-DF-CQ9">
Expand Down
11 changes: 3 additions & 8 deletions 29th-assignment-YouTube/Sources/HomeVC/HomeTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ class HomeTableViewCell: UITableViewCell {
// Configure the view for the selected state
}

@objc func tapView(gestureRecognizer: UIGestureRecognizer) {
// guard let nextVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: HomeTapVC.identifier) as? HomeTapVC else { return }
//
// nextVC.imgView = self.mainImageView
// nextVC.titleLabel = self.titleLabel
// nextVC.subtitleLabel = self.subtitleLabel
print("##")
}




}
3 changes: 3 additions & 0 deletions 29th-assignment-YouTube/Sources/HomeVC/HomeTapVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ class HomeTapVC: UIViewController {

// Do any additional setup after loading the view.
}
@IBAction func touchUpToBack(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
}
14 changes: 13 additions & 1 deletion 29th-assignment-YouTube/Sources/HomeVC/HomeVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,25 @@ 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(cell.tapView(gestureRecognizer:)))
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주 전"

}
}

}

Expand Down

0 comments on commit 599b14a

Please sign in to comment.