diff --git a/idorm.xcodeproj/project.pbxproj b/idorm.xcodeproj/project.pbxproj index ae9aafb0..84fe999c 100644 --- a/idorm.xcodeproj/project.pbxproj +++ b/idorm.xcodeproj/project.pbxproj @@ -35,6 +35,8 @@ E51D1C7A295299FD00A7EE49 /* MyPageEnumerations.swift in Sources */ = {isa = PBXBuildFile; fileRef = E51D1C79295299FD00A7EE49 /* MyPageEnumerations.swift */; }; E51D1C7C2952E5F000A7EE49 /* ManageMyInfoViewReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E51D1C7B2952E5F000A7EE49 /* ManageMyInfoViewReactor.swift */; }; E51D1C7E29531B8300A7EE49 /* MyRoommateViewReactor.swift in Sources */ = {isa = PBXBuildFile; fileRef = E51D1C7D29531B8300A7EE49 /* MyRoommateViewReactor.swift */; }; + E52233B3296CFCAD00C5DD07 /* PostVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E52233B2296CFCAD00C5DD07 /* PostVC.swift */; }; + E52233B6296D04A200C5DD07 /* PostCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E52233B5296D04A200C5DD07 /* PostCell.swift */; }; E5226D582911F3610065C809 /* Dormitory.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5226D572911F3610065C809 /* Dormitory.swift */; }; E5226D5A2911F36B0065C809 /* Gender.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5226D592911F36B0065C809 /* Gender.swift */; }; E5226D5C2911F3760065C809 /* JoinPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5226D5B2911F3760065C809 /* JoinPeriod.swift */; }; @@ -222,6 +224,8 @@ E51D1C79295299FD00A7EE49 /* MyPageEnumerations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageEnumerations.swift; sourceTree = ""; }; E51D1C7B2952E5F000A7EE49 /* ManageMyInfoViewReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageMyInfoViewReactor.swift; sourceTree = ""; }; E51D1C7D29531B8300A7EE49 /* MyRoommateViewReactor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyRoommateViewReactor.swift; sourceTree = ""; }; + E52233B2296CFCAD00C5DD07 /* PostVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostVC.swift; sourceTree = ""; }; + E52233B5296D04A200C5DD07 /* PostCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCell.swift; sourceTree = ""; }; E5226D572911F3610065C809 /* Dormitory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dormitory.swift; sourceTree = ""; }; E5226D592911F36B0065C809 /* Gender.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Gender.swift; sourceTree = ""; }; E5226D5B2911F3760065C809 /* JoinPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinPeriod.swift; sourceTree = ""; }; @@ -461,6 +465,13 @@ path = Popup; sourceTree = ""; }; + E52233B4296CFCB900C5DD07 /* Reactors */ = { + isa = PBXGroup; + children = ( + ); + path = Reactors; + sourceTree = ""; + }; E52791C4291B7CD2009C0ADA /* Storages */ = { isa = PBXGroup; children = ( @@ -518,6 +529,7 @@ E56DF4BD2894041D00E85B10 /* Login */, E5E77EC928D8261E00031010 /* Register */, E5E77ECC28D8293400031010 /* Auth */, + E56DF4B02893CE4F00E85B10 /* Community */, E56DF4B6289403A400E85B10 /* Onboarding */, E56DF4C2289405C000E85B10 /* Home */, E56DF4C3289405CD00E85B10 /* Matching */, @@ -611,8 +623,8 @@ E56DF4B02893CE4F00E85B10 /* Community */ = { isa = PBXGroup; children = ( - E56DF4B32893CE6700E85B10 /* Cells */, E56DF4B22893CE6100E85B10 /* ViewControllers */, + E52233B4296CFCB900C5DD07 /* Reactors */, E56DF4B12893CE5B00E85B10 /* Views */, ); path = Community; @@ -621,6 +633,7 @@ E56DF4B12893CE5B00E85B10 /* Views */ = { isa = PBXGroup; children = ( + E56DF4B32893CE6700E85B10 /* Cells */, E5290F0828881C6E0004B8E6 /* CommunityDetailCollectionHeaderView.swift */, ); path = Views; @@ -629,6 +642,7 @@ E56DF4B22893CE6100E85B10 /* ViewControllers */ = { isa = PBXGroup; children = ( + E52233B2296CFCAD00C5DD07 /* PostVC.swift */, E5F5EC732884025E0026DE21 /* CommunityViewController.swift */, E5290F05288818E70004B8E6 /* CommunityDetailViewController.swift */, E5BF4C5E28840EBF00B4F0B8 /* PostingViewController.swift */, @@ -642,6 +656,7 @@ E56DF4B32893CE6700E85B10 /* Cells */ = { isa = PBXGroup; children = ( + E52233B5296D04A200C5DD07 /* PostCell.swift */, E5290EFC2887BBA30004B8E6 /* CommunityPopularCollectionVIewCell.swift */, E5290F0D288867E50004B8E6 /* CommunityDetailTableViewCell.swift */, E5290F0F288869700004B8E6 /* CommunityDetailHeaderCollectionViewCell.swift */, @@ -913,7 +928,6 @@ E5D070882930CE7800D5DF6E /* Trash */ = { isa = PBXGroup; children = ( - E56DF4B02893CE4F00E85B10 /* Community */, E56DF4A82893C73600E85B10 /* Calendar */, ); path = Trash; @@ -1261,6 +1275,7 @@ E5F56574291908DE0043FCB4 /* MyRoommateCell.swift in Sources */, E57B3E4E2933688500B2C0F0 /* NoMatchingInfoPopup.swift in Sources */, E5D4900B288BFA0200311493 /* MatchingVC.swift in Sources */, + E52233B3296CFCAD00C5DD07 /* PostVC.swift in Sources */, E5FD982428EAF1AE005A29E2 /* NoMatchingInfoPopup_Initial.swift in Sources */, E50F850329582D5E008B7052 /* CompleteSignupViewReactor.swift in Sources */, E5E14984295058FB00A3827C /* MatchingInfoDTO.swift in Sources */, @@ -1290,6 +1305,7 @@ E58F96FB2884E85B00CC3C75 /* ImagePickerCollectionViewCell.swift in Sources */, E513D9FC2955C251002EA592 /* RegisterEnumerations.swift in Sources */, E5226D5A2911F36B0065C809 /* Gender.swift in Sources */, + E52233B6296D04A200C5DD07 /* PostCell.swift in Sources */, E5D31BF3289AB83800510315 /* SetCalendarTabmanController.swift in Sources */, E5226D582911F3610065C809 /* Dormitory.swift in Sources */, E5AC2DCB2882F24000B82AD8 /* OnboardingTextField.swift in Sources */, diff --git a/idorm.xcworkspace/xcuserdata/eungcheol.xcuserdatad/UserInterfaceState.xcuserstate b/idorm.xcworkspace/xcuserdata/eungcheol.xcuserdatad/UserInterfaceState.xcuserstate index 61477eb6..75ffe6a2 100644 Binary files a/idorm.xcworkspace/xcuserdata/eungcheol.xcuserdatad/UserInterfaceState.xcuserstate and b/idorm.xcworkspace/xcuserdata/eungcheol.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Contents.json b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Contents.json new file mode 100644 index 00000000..34a44752 --- /dev/null +++ b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "Group 1604.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "Group 1604@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "Group 1604@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604.png b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604.png new file mode 100644 index 00000000..0fcdfafa Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604.png differ diff --git a/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@2x.png b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@2x.png new file mode 100644 index 00000000..239d3bfa Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@2x.png differ diff --git a/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@3x.png b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@3x.png new file mode 100644 index 00000000..78373d46 Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/circle_xmark_darkgray.imageset/Group 1604@3x.png differ diff --git "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Contents.json" b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Contents.json similarity index 73% rename from "idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Contents.json" rename to idorm/Configuration/Base/Assets.xcassets/picture.imageset/Contents.json index ef6c34b3..a7e67757 100644 --- "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Contents.json" +++ b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "1.png", + "filename" : "Icon.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Frame 11338.png", + "filename" : "Icon@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "3.png", + "filename" : "Icon@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon.png b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon.png new file mode 100644 index 00000000..cee2df41 Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon.png differ diff --git a/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@2x.png b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@2x.png new file mode 100644 index 00000000..e95efec4 Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@2x.png differ diff --git a/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@3x.png b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@3x.png new file mode 100644 index 00000000..f692af35 Binary files /dev/null and b/idorm/Configuration/Base/Assets.xcassets/picture.imageset/Icon@3x.png differ diff --git a/idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/Contents.json "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/Contents.json" similarity index 100% rename from idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/Contents.json rename to "idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/Contents.json" diff --git a/idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-02@2x.png "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-02@2x.png" similarity index 100% rename from idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-02@2x.png rename to "idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-02@2x.png" diff --git a/idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-02@3x.png "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-02@3x.png" similarity index 100% rename from idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-02@3x.png rename to "idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-02@3x.png" diff --git a/idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-2.png "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-2.png" similarity index 100% rename from idorm/Configuration/Base/Assets.xcassets/pencil(Calendar).imageset/pencil-2.png rename to "idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/pencil.imageset/pencil-2.png" diff --git "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/1.png" "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/1.png" deleted file mode 100644 index f6136f8b..00000000 Binary files "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/1.png" and /dev/null differ diff --git "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/3.png" "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/3.png" deleted file mode 100644 index 2edfe4d4..00000000 Binary files "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/3.png" and /dev/null differ diff --git "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Frame 11338.png" "b/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Frame 11338.png" deleted file mode 100644 index 29ccd251..00000000 Binary files "a/idorm/Configuration/Base/Assets.xcassets/\353\257\270\354\240\225/removeImageXmark.imageset/Frame 11338.png" and /dev/null differ diff --git a/idorm/Configuration/Trash/Community/ViewControllers/CommunityAlertViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/CommunityAlertViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/CommunityAlertViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/CommunityAlertViewController.swift diff --git a/idorm/Configuration/Trash/Community/ViewControllers/CommunityDetailViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/CommunityDetailViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/CommunityDetailViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/CommunityDetailViewController.swift diff --git a/idorm/Configuration/Trash/Community/ViewControllers/CommunityPopupViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/CommunityPopupViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/CommunityPopupViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/CommunityPopupViewController.swift diff --git a/idorm/Configuration/Trash/Community/ViewControllers/CommunityViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/CommunityViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/CommunityViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/CommunityViewController.swift diff --git a/idorm/Configuration/Trash/Community/ViewControllers/ImagePickerViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/ImagePickerViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/ImagePickerViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/ImagePickerViewController.swift diff --git a/idorm/Source/Presentation/Community/ViewControllers/PostVC.swift b/idorm/Source/Presentation/Community/ViewControllers/PostVC.swift new file mode 100644 index 00000000..774d1d83 --- /dev/null +++ b/idorm/Source/Presentation/Community/ViewControllers/PostVC.swift @@ -0,0 +1,266 @@ +// +// PostVC.swift +// idorm +// +// Created by 김응철 on 2023/01/10. +// + +import UIKit + +import SnapKit +import RSKPlaceholderTextView + +final class PostViewController: BaseViewController { + + // MARK: - Properties + + private lazy var pictsCollectionView: UICollectionView = { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .horizontal + let cv = UICollectionView(frame: .zero, collectionViewLayout: layout) + cv.showsHorizontalScrollIndicator = false + cv.register(PostCell.self, forCellWithReuseIdentifier: PostCell.identifier) + cv.dataSource = self + cv.delegate = self + + return cv + }() + + private let completeBtn: UIButton = { + let button = UIButton() + var config = UIButton.Configuration.plain() + var container = AttributeContainer() + container.font = .init(name: MyFonts.bold.rawValue, size: 16) + container.strokeColor = .idorm_gray_300 + config.attributedTitle = AttributedString("완료", attributes: container) + button.configuration = config + + return button + }() + + private let titleTf: UITextField = { + let tf = UITextField() + tf.attributedPlaceholder = NSAttributedString( + string: "제목", + attributes: [ + .strokeColor: UIColor.idorm_gray_200, + .font: UIFont.init(name: MyFonts.bold.rawValue, size: 20)! + ] + ) + tf.font = .init(name: MyFonts.bold.rawValue, size: 20) + tf.textColor = .black + + return tf + }() + + private let contentsTv: RSKPlaceholderTextView = { + let tv = RSKPlaceholderTextView() + tv.attributedPlaceholder = NSAttributedString( + string: """ + 기숙사에 있는 학우들에게 질문하거나 + 함께 이야기를 나누어보세요. + """, + attributes: [ + .strokeColor: UIColor.idorm_gray_200, + .font: UIFont(name: MyFonts.medium.rawValue, size: 16)! + ] + ) + tv.font = .init(name: MyFonts.medium.rawValue, size: 16) + tv.textColor = .black + + return tv + }() + + private let separatorLine: UIView = { + let view = UIView() + view.backgroundColor = .idorm_gray_200 + + return view + }() + + private let bottomContainerView: UIView = { + let view = UIView() + view.backgroundColor = .white + view.layer.shadowOpacity = 1 + view.layer.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1).cgColor + view.layer.shadowRadius = 15 + view.layer.shadowOffset = .init(width: 0, height: 3) + + return view + }() + + private let currentPictsCountLb: UILabel = { + let lb = UILabel() + lb.text = "0" + lb.font = .init(name: MyFonts.medium.rawValue, size: 12) + lb.textColor = .black + + return lb + }() + + private let pictsCountLb: UILabel = { + let lb = UILabel() + lb.text = "/10" + lb.textColor = .black + lb.font = .init(name: MyFonts.medium.rawValue, size: 12) + + return lb + }() + + private let anonymousLabel: UILabel = { + let lb = UILabel() + lb.text = "익명" + lb.font = .init(name: MyFonts.medium.rawValue, size: 12) + + return lb + }() + + private let anonymousBtn: UIButton = { + let btn = UIButton() + btn.setImage(UIImage(named: "circle_blue"), for: .selected) + btn.setImage(UIImage(named: "circle"), for: .normal) + btn.isSelected = true + + return btn + }() + + private let pictIv = UIImageView(image: UIImage(named: "picture")) + + // MARK: - Setup + + override func setupStyles() { + navigationItem.title = "글쓰기" + navigationItem.rightBarButtonItem = UIBarButtonItem(customView: completeBtn) + view.backgroundColor = .white + } + + override func setupLayouts() { + [ + titleTf, + separatorLine, + pictsCollectionView, + contentsTv, + bottomContainerView + ].forEach { + view.addSubview($0) + } + + [ + pictIv, + currentPictsCountLb, + pictsCountLb, + anonymousLabel, + anonymousBtn + ].forEach { + bottomContainerView.addSubview($0) + } + } + + override func setupConstraints() { + titleTf.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(24) + make.top.equalToSuperview().inset(30) + } + + separatorLine.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(24) + make.height.equalTo(0.3) + make.top.equalTo(titleTf.snp.bottom).offset(12) + } + + pictsCollectionView.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview() + make.top.equalTo(separatorLine.snp.bottom).offset(22) + make.height.equalTo(85) + } + + contentsTv.snp.makeConstraints { make in + make.leading.trailing.equalToSuperview().inset(24) + make.top.equalTo(pictsCollectionView.snp.bottom).offset(16) + make.bottom.equalToSuperview() + } + + bottomContainerView.snp.makeConstraints { make in + make.bottom.leading.trailing.equalToSuperview() + make.height.equalTo(76) + } + + pictIv.snp.makeConstraints { make in + make.leading.equalToSuperview().inset(24) + make.top.equalToSuperview().inset(12) + } + + currentPictsCountLb.snp.makeConstraints { make in + make.leading.equalTo(pictIv.snp.trailing).offset(10) + make.centerY.equalTo(pictIv) + } + + pictsCountLb.snp.makeConstraints { make in + make.leading.equalTo(currentPictsCountLb.snp.trailing) + make.centerY.equalTo(pictIv) + } + + anonymousLabel.snp.makeConstraints { make in + make.centerY.equalTo(anonymousBtn) + make.trailing.equalTo(anonymousBtn.snp.leading).offset(-6) + } + + anonymousBtn.snp.makeConstraints { make in + make.trailing.equalToSuperview().inset(24) + make.top.equalToSuperview().inset(12) + } + } + + // MARK: - Bind +} + +// MARK: - CollectionView Setup + +extension PostViewController: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { + + func collectionView( + _ collectionView: UICollectionView, + numberOfItemsInSection section: Int + ) -> Int { + return 5 + } + + func collectionView( + _ collectionView: UICollectionView, + cellForItemAt indexPath: IndexPath + ) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell( + withReuseIdentifier: PostCell.identifier, + for: indexPath + ) as? PostCell else { + return UICollectionViewCell() + } + + return cell + } + + func collectionView( + _ collectionView: UICollectionView, + layout collectionViewLayout: UICollectionViewLayout, + insetForSectionAt section: Int + ) -> UIEdgeInsets { + return .init(top: 0, left: 24, bottom: 0, right: 24) + } + + func collectionView( + _ collectionView: UICollectionView, + layout collectionViewLayout: UICollectionViewLayout, + sizeForItemAt indexPath: IndexPath + ) -> CGSize { + return .init(width: 83, height: 83) + } +} + +#if canImport(SwiftUI) && DEBUG +import SwiftUI +struct PostVC_PreView: PreviewProvider { + static var previews: some View { + PostViewController().toPreview() + } +} +#endif diff --git a/idorm/Configuration/Trash/Community/ViewControllers/PostingViewController.swift b/idorm/Source/Presentation/Community/ViewControllers/PostingViewController.swift similarity index 100% rename from idorm/Configuration/Trash/Community/ViewControllers/PostingViewController.swift rename to idorm/Source/Presentation/Community/ViewControllers/PostingViewController.swift diff --git a/idorm/Configuration/Trash/Community/Cells/CommunityDetailHeaderCollectionViewCell.swift b/idorm/Source/Presentation/Community/Views/Cells/CommunityDetailHeaderCollectionViewCell.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Cells/CommunityDetailHeaderCollectionViewCell.swift rename to idorm/Source/Presentation/Community/Views/Cells/CommunityDetailHeaderCollectionViewCell.swift diff --git a/idorm/Configuration/Trash/Community/Cells/CommunityDetailTableViewCell.swift b/idorm/Source/Presentation/Community/Views/Cells/CommunityDetailTableViewCell.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Cells/CommunityDetailTableViewCell.swift rename to idorm/Source/Presentation/Community/Views/Cells/CommunityDetailTableViewCell.swift diff --git a/idorm/Configuration/Trash/Community/Cells/CommunityPopularCollectionVIewCell.swift b/idorm/Source/Presentation/Community/Views/Cells/CommunityPopularCollectionVIewCell.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Cells/CommunityPopularCollectionVIewCell.swift rename to idorm/Source/Presentation/Community/Views/Cells/CommunityPopularCollectionVIewCell.swift diff --git a/idorm/Configuration/Trash/Community/Cells/ImagePickerCollectionViewCell.swift b/idorm/Source/Presentation/Community/Views/Cells/ImagePickerCollectionViewCell.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Cells/ImagePickerCollectionViewCell.swift rename to idorm/Source/Presentation/Community/Views/Cells/ImagePickerCollectionViewCell.swift diff --git a/idorm/Source/Presentation/Community/Views/Cells/PostCell.swift b/idorm/Source/Presentation/Community/Views/Cells/PostCell.swift new file mode 100644 index 00000000..bf533e77 --- /dev/null +++ b/idorm/Source/Presentation/Community/Views/Cells/PostCell.swift @@ -0,0 +1,73 @@ +// +// PostCell.swift +// idorm +// +// Created by 김응철 on 2023/01/10. +// + +import UIKit + +import SnapKit + +final class PostCell: UICollectionViewCell { + + // MARK: - Properties + + static let identifier = "PostCell" + + let deleteBtn: UIButton = { + let btn = UIButton() + btn.setImage(UIImage(named: "circle_xmark_darkgray"), for: .normal) + + return btn + }() + + let imageView: UIImageView = { + let iv = UIImageView() + iv.layer.cornerRadius = 10 + iv.backgroundColor = .blue + + return iv + }() + + // MARK: - LifeCycle + + override init(frame: CGRect) { + super.init(frame: frame) + setupStyles() + setupLayout() + setupConstraints() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Setup + + private func setupStyles() { + contentView.backgroundColor = .white + } + + private func setupLayout() { + [ + imageView, + deleteBtn + ].forEach { + contentView.addSubview($0) + } + } + + private func setupConstraints() { + imageView.snp.makeConstraints { make in + make.bottom.leading.equalToSuperview() + make.width.height.equalTo(80) + } + + deleteBtn.snp.makeConstraints { make in + make.trailing.equalToSuperview().offset(3) + make.top.equalToSuperview().offset(-3) + make.width.height.equalTo(25) + } + } +} diff --git a/idorm/Configuration/Trash/Community/Cells/PostingPictureCollectionViewCell.swift b/idorm/Source/Presentation/Community/Views/Cells/PostingPictureCollectionViewCell.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Cells/PostingPictureCollectionViewCell.swift rename to idorm/Source/Presentation/Community/Views/Cells/PostingPictureCollectionViewCell.swift diff --git a/idorm/Configuration/Trash/Community/Views/CommunityDetailCollectionHeaderView.swift b/idorm/Source/Presentation/Community/Views/CommunityDetailCollectionHeaderView.swift similarity index 100% rename from idorm/Configuration/Trash/Community/Views/CommunityDetailCollectionHeaderView.swift rename to idorm/Source/Presentation/Community/Views/CommunityDetailCollectionHeaderView.swift