diff --git a/Spark-iOS/Spark-iOS.xcodeproj/project.pbxproj b/Spark-iOS/Spark-iOS.xcodeproj/project.pbxproj index 7f48bbba..2a8c9a64 100644 --- a/Spark-iOS/Spark-iOS.xcodeproj/project.pbxproj +++ b/Spark-iOS/Spark-iOS.xcodeproj/project.pbxproj @@ -183,6 +183,8 @@ F8B18E0327EF9903001A1A7D /* WithdrawalCellDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B18E0227EF9903001A1A7D /* WithdrawalCellDelegate.swift */; }; F8B18E0527EFA19E001A1A7D /* NotificationVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B18E0427EFA19E001A1A7D /* NotificationVC.swift */; }; F8B18E0727EFA1AA001A1A7D /* Notification.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8B18E0627EFA1AA001A1A7D /* Notification.storyboard */; }; + F8B18E0927EFA43F001A1A7D /* NotificationHeaderTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B18E0827EFA43F001A1A7D /* NotificationHeaderTVC.swift */; }; + F8B18E0B27EFA453001A1A7D /* NotificationTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B18E0A27EFA453001A1A7D /* NotificationTVC.swift */; }; F8C14A9B2795094800498687 /* HomeEmptyCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C14A992795094800498687 /* HomeEmptyCVC.swift */; }; F8C14A9C2795094800498687 /* HomeEmptyCVC.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8C14A9A2795094800498687 /* HomeEmptyCVC.xib */; }; F8C3659527DBB82A000AA9BD /* CompleteFailDialogueVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C3659427DBB82A000AA9BD /* CompleteFailDialogueVC.swift */; }; @@ -417,6 +419,8 @@ F8B18E0227EF9903001A1A7D /* WithdrawalCellDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithdrawalCellDelegate.swift; sourceTree = "<group>"; }; F8B18E0427EFA19E001A1A7D /* NotificationVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationVC.swift; sourceTree = "<group>"; }; F8B18E0627EFA1AA001A1A7D /* Notification.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Notification.storyboard; sourceTree = "<group>"; }; + F8B18E0827EFA43F001A1A7D /* NotificationHeaderTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationHeaderTVC.swift; sourceTree = "<group>"; }; + F8B18E0A27EFA453001A1A7D /* NotificationTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationTVC.swift; sourceTree = "<group>"; }; F8C14A992795094800498687 /* HomeEmptyCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeEmptyCVC.swift; sourceTree = "<group>"; }; F8C14A9A2795094800498687 /* HomeEmptyCVC.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HomeEmptyCVC.xib; sourceTree = "<group>"; }; F8C3659427DBB82A000AA9BD /* CompleteFailDialogueVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompleteFailDialogueVC.swift; sourceTree = "<group>"; }; @@ -1345,6 +1349,8 @@ F8E4DFD527D0918C00128B1F /* MypageProfileTVC.swift */, F8E4DFD727D09F7A00128B1F /* MypageDefaultTVC.swift */, F8E4DFD927D0DE3700128B1F /* MypageTableHeaderView.swift */, + F8B18E0827EFA43F001A1A7D /* NotificationHeaderTVC.swift */, + F8B18E0A27EFA453001A1A7D /* NotificationTVC.swift */, ); path = Mypage; sourceTree = "<group>"; @@ -1671,6 +1677,7 @@ F8E4DFD627D0918C00128B1F /* MypageProfileTVC.swift in Sources */, F821813527DE659E00DDFBF8 /* SparkTabBarController.swift in Sources */, F8B18E0527EFA19E001A1A7D /* NotificationVC.swift in Sources */, + F8B18E0B27EFA453001A1A7D /* NotificationTVC.swift in Sources */, F80A3E57278C1C2700728E07 /* FeedVC.swift in Sources */, EB9C50842792A61D00588155 /* HabitAuthVC.swift in Sources */, 2BC17277278F765C00BA3029 /* WaitingFriendCVC.swift in Sources */, @@ -1701,6 +1708,7 @@ F82F5802279287FD003E4174 /* HabitRoom.swift in Sources */, F82B2E12278F54CD00219628 /* SplashVC.swift in Sources */, F8E4DFDA27D0DE3700128B1F /* MypageTableHeaderView.swift in Sources */, + F8B18E0927EFA43F001A1A7D /* NotificationHeaderTVC.swift in Sources */, F8404E8B27AB835F004AEDC3 /* SendSparkButton.swift in Sources */, F82F580427928975003E4174 /* MoyaLoggerPlugin.swift in Sources */, F8096F2927841F1E00B71D38 /* Const.swift in Sources */, diff --git a/Spark-iOS/Spark-iOS/Resource/Constants/Cell.swift b/Spark-iOS/Spark-iOS/Resource/Constants/Cell.swift index 1dd82ce9..090b171b 100644 --- a/Spark-iOS/Spark-iOS/Resource/Constants/Cell.swift +++ b/Spark-iOS/Spark-iOS/Resource/Constants/Cell.swift @@ -32,6 +32,8 @@ extension Const { static let noticeServiceCVC = "NoticeServiceCVC" static let onboardingCVC = "OnboardingCVC" static let habitRoomGuideCVC = "HabitRoomGuideCVC" + static let notificationHeaderTVC = "NotificationHeaderTVC" + static let notificationTVC = "NotificationTVC" } } } diff --git a/Spark-iOS/Spark-iOS/Resource/Storyboards/Mypage/Notification.storyboard b/Spark-iOS/Spark-iOS/Resource/Storyboards/Mypage/Notification.storyboard index dd79351e..bacc9dcb 100644 --- a/Spark-iOS/Spark-iOS/Resource/Storyboards/Mypage/Notification.storyboard +++ b/Spark-iOS/Spark-iOS/Resource/Storyboards/Mypage/Notification.storyboard @@ -1,16 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17150" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> + <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17122"/> + <deployment identifier="iOS"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> - <!--View Controller--> + <!--NotificationVC--> <scene sceneID="s0d-6b-0kx"> <objects> - <viewController id="Y6W-OH-hqX" sceneMemberID="viewController"> + <viewController storyboardIdentifier="NotificationVC" id="Y6W-OH-hqX" customClass="NotificationVC" customModule="Spark_iOS" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc"> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> @@ -20,6 +22,7 @@ </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/> </objects> + <point key="canvasLocation" x="-23" y="116"/> </scene> </scenes> <resources> diff --git a/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationHeaderTVC.swift b/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationHeaderTVC.swift new file mode 100644 index 00000000..3bfc4585 --- /dev/null +++ b/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationHeaderTVC.swift @@ -0,0 +1,23 @@ +// +// NotificationHeaderTVC.swift +// Spark-iOS +// +// Created by kimhyungyu on 2022/03/27. +// + +import UIKit + +class NotificationHeaderTVC: UITableViewCell { + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationTVC.swift b/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationTVC.swift new file mode 100644 index 00000000..f16b981b --- /dev/null +++ b/Spark-iOS/Spark-iOS/Source/Cells/Mypage/NotificationTVC.swift @@ -0,0 +1,23 @@ +// +// NotificationTVC.swift +// Spark-iOS +// +// Created by kimhyungyu on 2022/03/27. +// + +import UIKit + +class NotificationTVC: UITableViewCell { + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/MypageVC.swift b/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/MypageVC.swift index ba91240c..812ebc42 100644 --- a/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/MypageVC.swift +++ b/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/MypageVC.swift @@ -100,7 +100,6 @@ extension MypageVC { tableView.sectionHeaderTopPadding = 0 } } - } // MARK: - UITableViewDelegate @@ -144,7 +143,9 @@ extension MypageVC: UITableViewDelegate { editProfileVC.modalPresentationStyle = .overFullScreen present(editProfileVC, animated: true, completion: nil) case .setting: - return + guard let notificationVC = UIStoryboard(name: Const.Storyboard.Name.notification, bundle: nil).instantiateViewController(withIdentifier: Const.ViewController.Identifier.notification) as? NotificationVC else { return } + + navigationController?.pushViewController(notificationVC, animated: true) case .center: if MFMailComposeViewController.canSendMail() { guard let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String else { return } diff --git a/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/NotificationVC.swift b/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/NotificationVC.swift index 41c13cb8..9deed2ca 100644 --- a/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/NotificationVC.swift +++ b/Spark-iOS/Spark-iOS/Source/ViewControllers/Mypage/NotificationVC.swift @@ -7,16 +7,22 @@ import UIKit +import SnapKit + class NotificationVC: UIViewController { // MARK: - Properties + private let customNavigationBar = LeftButtonNavigaitonBar() + private let tableView = UITableView() + // MARK: - View Life Cycle override func viewDidLoad() { super.viewDidLoad() setUI() + setTableView() setLayout() } } @@ -25,7 +31,45 @@ class NotificationVC: UIViewController { extension NotificationVC { private func setUI() { + customNavigationBar.title("알림") + .leftButtonImage("icBackWhite") + .leftButtonAction { + self.navigationController?.popViewController(animated: true) + } + } + + private func setTableView() { + tableView.delegate = self + tableView.dataSource = self + + tableView.register(NotificationHeaderTVC.self, forCellReuseIdentifier: Const.Cell.Identifier.notificationHeaderTVC) + tableView.register(NotificationTVC.self, forCellReuseIdentifier: Const.Cell.Identifier.notificationTVC) + tableView.showsVerticalScrollIndicator = false + tableView.separatorStyle = .none + + // iOS 15.0 이상에서 section header 상단에 간격이 생겨서 삭제. + if #available(iOS 15.0, *) { + tableView.sectionHeaderTopPadding = 0 + } + } +} + +// MARK: - UITableViewDelegate + +extension NotificationVC: UITableViewDelegate { + +} + +// MARK: - UITableViewDataSource + +extension NotificationVC: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + <#code#> + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + <#code#> } } @@ -33,6 +77,18 @@ extension NotificationVC { extension NotificationVC { private func setLayout() { + view.addSubviews([customNavigationBar, tableView]) + + customNavigationBar.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide.snp.top) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(60) + } + tableView.snp.makeConstraints { + $0.leading.trailing.equalToSuperview() + $0.top.equalTo(customNavigationBar.snp.bottom) + $0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom) + } } }