diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index fa1cae4f..531149f4 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -87,7 +87,7 @@ CE40BB2D296808B00030ABCA /* DepartureSearchingRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE40BB2C296808B00030ABCA /* DepartureSearchingRouter.swift */; }; CE4545C9295D7AF4003201E1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE4545C8295D7AF4003201E1 /* AppDelegate.swift */; }; CE4545CB295D7AF4003201E1 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE4545CA295D7AF4003201E1 /* SceneDelegate.swift */; }; - CE4545CD295D7AF4003201E1 /* TaBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE4545CC295D7AF4003201E1 /* TaBarController.swift */; }; + CE4545CD295D7AF4003201E1 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE4545CC295D7AF4003201E1 /* TabBarController.swift */; }; CE4545D2295D7AF5003201E1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CE4545D1295D7AF5003201E1 /* Assets.xcassets */; }; CE4545D5295D7AF5003201E1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CE4545D3295D7AF5003201E1 /* LaunchScreen.storyboard */; }; CE4942AD296FCD2300736701 /* UploadedCourseDetailResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE4942AC296FCD2300736701 /* UploadedCourseDetailResponseDto.swift */; }; @@ -266,7 +266,7 @@ CE4545C5295D7AF4003201E1 /* Runnect-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Runnect-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; CE4545C8295D7AF4003201E1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; CE4545CA295D7AF4003201E1 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; - CE4545CC295D7AF4003201E1 /* TaBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaBarController.swift; sourceTree = ""; }; + CE4545CC295D7AF4003201E1 /* TabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarController.swift; sourceTree = ""; }; CE4545D1295D7AF5003201E1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; CE4545D4295D7AF5003201E1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; CE4545D6295D7AF5003201E1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -966,7 +966,7 @@ CE6655AB295D7FBC00C64E12 /* TabBar */ = { isa = PBXGroup; children = ( - CE4545CC295D7AF4003201E1 /* TaBarController.swift */, + CE4545CC295D7AF4003201E1 /* TabBarController.swift */, ); path = TabBar; sourceTree = ""; @@ -1415,7 +1415,7 @@ CE665602295D918000C64E12 /* JsonCoder.swift in Sources */, DA97A033296E65D80086760E /* CourseUploadingRequestDto.swift in Sources */, 711E18212B38516D00C651CD /* GAManager.swift in Sources */, - CE4545CD295D7AF4003201E1 /* TaBarController.swift in Sources */, + CE4545CD295D7AF4003201E1 /* TabBarController.swift in Sources */, A3305A97296EF58C000B1A10 /* GoalRewardInfoDto.swift in Sources */, CE21C024299E5FE500F62AF5 /* UserRouter.swift in Sources */, 71F780502B0893D700B53253 /* MarathonMapCollectionViewCell.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift index db5b6315..547d088a 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift +++ b/Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIViewController+.swift @@ -7,6 +7,8 @@ import UIKit +import SnapKit + extension UIViewController { /** @@ -74,9 +76,9 @@ extension UIViewController { self.view.addSubview(emptyView) - emptyView.snp.makeConstraints { make in - make.center.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(80) + emptyView.snp.makeConstraints { + $0.center.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(80) } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CourseDetailInfoView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CourseDetailInfoView.swift index 0390cc0b..6ff86d0f 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CourseDetailInfoView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CourseDetailInfoView.swift @@ -7,6 +7,9 @@ import UIKit +import SnapKit +import Then + final class CourseDetailInfoView: UIView { // MARK: - UI Components @@ -60,20 +63,20 @@ extension CourseDetailInfoView { private func setLayout() { self.addSubviews(leftImageView, titleLabel, descriptionLabel) - leftImageView.snp.makeConstraints { make in - make.top.leading.bottom.equalToSuperview() - make.width.equalTo(leftImageView.snp.height) + leftImageView.snp.makeConstraints { + $0.top.leading.bottom.equalToSuperview() + $0.width.equalTo(leftImageView.snp.height) } - titleLabel.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalTo(leftImageView.snp.trailing).offset(9) + titleLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalTo(leftImageView.snp.trailing).offset(9) } - descriptionLabel.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalTo(titleLabel.snp.leading).offset(57) - make.trailing.greaterThanOrEqualToSuperview() + descriptionLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalTo(titleLabel.snp.leading).offset(57) + $0.trailing.greaterThanOrEqualToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift index 2084fced..b658ab2e 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomAlertVC.swift @@ -8,6 +8,9 @@ import UIKit import Combine +import SnapKit +import Then + final class CustomAlertVC: UIViewController { // MARK: - Properties @@ -69,9 +72,9 @@ extension CustomAlertVC { /// 이미지 변경 public func setImage(_ image: UIImage, size: CGSize) { self.alertImageView.image = image - self.alertImageView.snp.updateConstraints { make in - make.width.equalTo(size.width) - make.height.equalTo(size.height) + self.alertImageView.snp.updateConstraints { + $0.width.equalTo(size.width) + $0.height.equalTo(size.height) } } @@ -121,28 +124,29 @@ extension CustomAlertVC { alertView.addSubviews(alertImageView, contentsLabel, buttonStackView) - alertView.snp.makeConstraints { make in - make.center.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) + alertView.snp.makeConstraints { + $0.center.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(31) } - alertImageView.snp.makeConstraints { make in - make.top.equalToSuperview().inset(38) - make.centerX.equalToSuperview() - make.width.equalTo(189) - make.height.equalTo(169) + alertImageView.snp.makeConstraints { + $0.top.equalToSuperview().inset(38) + $0.centerX.equalToSuperview() + $0.width.equalTo(189) + $0.height.equalTo(169) } - contentsLabel.snp.makeConstraints { make in - make.top.equalTo(alertImageView.snp.bottom).offset(24) - make.leading.trailing.equalToSuperview().inset(10) - make.centerX.equalToSuperview() + contentsLabel.snp.makeConstraints { + $0.top.equalTo(alertImageView.snp.bottom).offset(24) + $0.leading.trailing.equalToSuperview().inset(10) + $0.centerX.equalToSuperview() } - buttonStackView.snp.makeConstraints { make in - make.top.equalTo(contentsLabel.snp.bottom).offset(26) - make.leading.trailing.equalToSuperview().inset(14) - make.height.equalTo(44) - make.bottom.equalToSuperview().inset(25) + + buttonStackView.snp.makeConstraints { + $0.top.equalTo(contentsLabel.snp.bottom).offset(26) + $0.leading.trailing.equalToSuperview().inset(14) + $0.height.equalTo(44) + $0.bottom.equalToSuperview().inset(25) } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift index 18be608e..413ab729 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift @@ -9,6 +9,9 @@ import UIKit import Combine import CombineCocoa +import SnapKit +import Then + @frozen enum SheetType { case image // 가운에 이미지가 있는 시트 @@ -135,8 +138,9 @@ final class CustomBottomSheetVC: UIViewController { extension CustomBottomSheetVC { private func setUI() { view.addSubview(backgroundView) - backgroundView.snp.makeConstraints { make in - make.edges.equalToSuperview() + + backgroundView.snp.makeConstraints { + $0.edges.equalToSuperview() } } @@ -153,27 +157,27 @@ extension CustomBottomSheetVC { view.addSubviews(bottomSheetView) bottomSheetView.addSubviews(contentsLabel, mainImageView, completeButton) - bottomSheetView.snp.makeConstraints { make in - make.leading.bottom.trailing.equalToSuperview() - make.height.equalTo(330) + bottomSheetView.snp.makeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.height.equalTo(330) } - contentsLabel.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.top.equalToSuperview().inset(30) + contentsLabel.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.top.equalToSuperview().inset(30) } - mainImageView.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.top.equalTo(contentsLabel.snp.bottom).offset(24) - make.width.equalTo(267) - make.height.equalTo(158) + mainImageView.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.top.equalTo(contentsLabel.snp.bottom).offset(24) + $0.width.equalTo(267) + $0.height.equalTo(158) } - completeButton.snp.makeConstraints { make in - make.top.equalTo(mainImageView.snp.bottom).offset(20) - make.height.equalTo(44) - make.leading.trailing.equalToSuperview().inset(16) + completeButton.snp.makeConstraints { + $0.top.equalTo(mainImageView.snp.bottom).offset(20) + $0.height.equalTo(44) + $0.leading.trailing.equalToSuperview().inset(16) } } @@ -184,33 +188,33 @@ extension CustomBottomSheetVC { bottomSheetView.addSubviews(contentsLabel, bottomSheetTextField, dismissIndicatorView, completeButton) - bottomSheetView.snp.makeConstraints { make in - make.leading.bottom.trailing.equalToSuperview() - make.top.equalTo(view.snp.top).offset(topConst) + bottomSheetView.snp.makeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.top.equalTo(view.snp.top).offset(topConst) } - dismissIndicatorView.snp.makeConstraints { make in - make.width.equalTo(42) - make.height.equalTo(4) - make.top.equalTo(bottomSheetView.snp.top).inset(16) - make.centerX.equalToSuperview() + dismissIndicatorView.snp.makeConstraints { + $0.width.equalTo(42) + $0.height.equalTo(4) + $0.top.equalTo(bottomSheetView.snp.top).inset(16) + $0.centerX.equalToSuperview() } - contentsLabel.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.top.equalToSuperview().inset(34) + contentsLabel.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.top.equalToSuperview().inset(34) } - bottomSheetTextField.snp.makeConstraints { make in - make.top.equalTo(contentsLabel.snp.bottom).offset(19) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(44) + bottomSheetTextField.snp.makeConstraints { + $0.top.equalTo(contentsLabel.snp.bottom).offset(19) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(44) } - completeButton.snp.makeConstraints { make in - make.top.equalTo(bottomSheetTextField.snp.bottom).offset(10) - make.height.equalTo(44) - make.leading.trailing.equalToSuperview().inset(16) + completeButton.snp.makeConstraints { + $0.top.equalTo(bottomSheetTextField.snp.bottom).offset(10) + $0.height.equalTo(44) + $0.leading.trailing.equalToSuperview().inset(16) } } @@ -228,9 +232,9 @@ extension CustomBottomSheetVC { let topConst = (safeAreaHeight + bottomPadding) - bottomHeight - bottomSheetView.snp.remakeConstraints { make in - make.leading.bottom.trailing.equalToSuperview() - make.top.equalTo(view.snp.top).offset(topConst) + bottomSheetView.snp.remakeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.top.equalTo(view.snp.top).offset(topConst) } UIView.animate(withDuration: 0.25, delay: 0, options: .curveEaseIn, animations: { @@ -287,9 +291,9 @@ extension CustomBottomSheetVC { let topConst = (safeAreaHeight + bottomPadding) - bottomSheetView.snp.remakeConstraints { make in - make.leading.bottom.trailing.equalToSuperview() - make.top.equalTo(view.snp.top).offset(topConst) + bottomSheetView.snp.remakeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.top.equalTo(view.snp.top).offset(topConst) } UIView.animate(withDuration: 0.25, delay: 0, options: .curveEaseIn, animations: { diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomButton.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomButton.swift index c6a49a72..98ca0fe4 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomButton.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomButton.swift @@ -10,7 +10,7 @@ import UIKit public class CustomButton: UIButton { // MARK: - Initialize - + public init(title: String) { super.init(frame: .zero) self.setUI(title) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomNavigationBar.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomNavigationBar.swift index 88fcf77c..54b32b42 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomNavigationBar.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomNavigationBar.swift @@ -8,7 +8,6 @@ import UIKit import SnapKit -import Then protocol CustomNavigationBarDelegate: AnyObject { func searchButtonDidTap(text: String) @@ -177,7 +176,6 @@ extension CustomNavigationBar { self.vc?.navigationController?.popViewController(animated: true) if vc.presentingViewController != nil { self.vc?.dismiss(animated: true) - } } @@ -256,61 +254,62 @@ extension CustomNavigationBar { private func setTitleLayout() { self.addSubviews(leftTitleLabel) - leftTitleLabel.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalToSuperview().inset(16) + leftTitleLabel.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview().inset(16) } } private func setTitleWithLeftButtonLayout() { self.addSubviews(leftButton, centerTitleLabel) - leftButton.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalToSuperview() - make.width.height.equalTo(48) + leftButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview() + $0.width.height.equalTo(48) } - centerTitleLabel.snp.makeConstraints { make in - make.center.equalToSuperview() + centerTitleLabel.snp.makeConstraints { + $0.center.equalToSuperview() } } private func setSearchLayout() { self.addSubviews(leftButton, textField, rightButton) - leftButton.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalToSuperview() - make.width.height.equalTo(48) + leftButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview() + $0.width.height.equalTo(48) } - rightButton.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.trailing.equalToSuperview() - make.width.height.equalTo(48) + rightButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.trailing.equalToSuperview() + $0.width.height.equalTo(48) } - textField.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalTo(leftButton.snp.trailing) - make.trailing.equalTo(rightButton.snp.leading) + textField.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalTo(leftButton.snp.trailing) + $0.trailing.equalTo(rightButton.snp.leading) } } private func setReportButtonLayout() { self.addSubviews(leftButton, reportButton) - leftButton.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.leading.equalToSuperview() - make.width.height.equalTo(48) - } - reportButton.snp.makeConstraints { make in - make.centerY.equalToSuperview() - make.trailing.equalToSuperview() - make.width.height.equalTo(48) + + leftButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.equalToSuperview() + $0.width.height.equalTo(48) } + reportButton.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.trailing.equalToSuperview() + $0.width.height.equalTo(48) + } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/GuideView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/GuideView.swift index 519b87d1..59787baf 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/GuideView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/GuideView.swift @@ -61,22 +61,22 @@ extension GuideView { self.addSubviews(logoImageView, titleContainerView) titleContainerView.addSubviews(titleLabel) - self.snp.makeConstraints { make in - make.width.greaterThanOrEqualTo(200) + self.snp.makeConstraints { + $0.width.greaterThanOrEqualTo(200) } - logoImageView.snp.makeConstraints { make in - make.leading.top.bottom.equalToSuperview() - make.width.height.equalTo(44) + logoImageView.snp.makeConstraints { + $0.leading.top.bottom.equalToSuperview() + $0.width.height.equalTo(44) } - titleContainerView.snp.makeConstraints { make in - make.leading.equalTo(logoImageView.snp.centerX) - make.top.bottom.trailing.equalToSuperview() + titleContainerView.snp.makeConstraints { + $0.leading.equalTo(logoImageView.snp.centerX) + $0.top.bottom.trailing.equalToSuperview() } - titleLabel.snp.makeConstraints { make in - make.center.equalToSuperview() + titleLabel.snp.makeConstraints { + $0.center.equalToSuperview() } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ListEmptyView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ListEmptyView.swift index 82347cad..9c6ecefe 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ListEmptyView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ListEmptyView.swift @@ -12,7 +12,7 @@ protocol ListEmptyViewDelegate: AnyObject { } final class ListEmptyView: UIView { - + // MARK: - Properties weak var delegate: ListEmptyViewDelegate? @@ -42,7 +42,7 @@ final class ListEmptyView: UIView { $0.alignment = .center $0.spacing = 24 } - + // MARK: - initialization init(description: String, buttonTitle: String) { @@ -66,9 +66,9 @@ extension ListEmptyView { public func setImage(_ image: UIImage, size: CGSize) { self.mainImageView.image = image - self.mainImageView.snp.updateConstraints { make in - make.width.equalTo(size.width) - make.height.equalTo(size.height) + self.mainImageView.snp.updateConstraints { + $0.width.equalTo(size.width) + $0.height.equalTo(size.height) } } } @@ -95,17 +95,17 @@ extension ListEmptyView { private func setLayout() { self.addSubviews(containerStackView) - bottomButton.snp.makeConstraints { make in - make.height.equalTo(40) - make.leading.trailing.equalToSuperview() + bottomButton.snp.makeConstraints { + $0.height.equalTo(40) + $0.leading.trailing.equalToSuperview() } - mainImageView.snp.makeConstraints { make in - make.width.height.equalTo(148) + mainImageView.snp.makeConstraints { + $0.width.height.equalTo(148) } - containerStackView.snp.makeConstraints { make in - make.edges.equalToSuperview() + containerStackView.snp.makeConstraints { + $0.edges.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMapView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMapView.swift index 67ae4351..5c836b75 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMapView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/MapView/RNMapView.swift @@ -356,20 +356,20 @@ extension RNMapView { private func setLayout() { addSubviews(map, locationButton) - map.snp.makeConstraints { make in - make.edges.equalToSuperview() + map.snp.makeConstraints { + $0.edges.equalToSuperview() } - locationButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().inset(88+bottomPadding) - make.trailing.equalToSuperview().inset(12) + locationButton.snp.makeConstraints { + $0.bottom.equalToSuperview().inset(88+bottomPadding) + $0.trailing.equalToSuperview().inset(12) } } private func updateSubviewsConstraints() { [locationButton].forEach { view in - view.snp.updateConstraints { make in - make.bottom.equalToSuperview().inset(98+bottomPadding) + view.snp.updateConstraints { + $0.bottom.equalToSuperview().inset(98+bottomPadding) } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift index 4a6ded3a..2a82a714 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift @@ -118,36 +118,35 @@ extension RNAlertVC { private func setLayout() { view.addSubviews(containerView) - containerView.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.centerY.equalToSuperview() - make.leading.trailing.equalToSuperview().inset(30) - // make.height.equalTo(126) + containerView.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.centerY.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(30) } containerView.addSubviews(descriptionLabel, yesButton, noButton) - descriptionLabel.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.top.equalToSuperview().offset(26) + descriptionLabel.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.top.equalToSuperview().offset(26) } - noButton.snp.makeConstraints { make in - make.top.equalTo(descriptionLabel.snp.bottom).offset(20) - make.leading.equalToSuperview().offset(16) - make.trailing.equalTo(containerView.snp.centerX).offset(-4) - make.height.equalTo(44) - make.width.equalTo(145) - make.bottom.equalToSuperview().inset(16) + noButton.snp.makeConstraints { + $0.top.equalTo(descriptionLabel.snp.bottom).offset(20) + $0.leading.equalToSuperview().offset(16) + $0.trailing.equalTo(containerView.snp.centerX).offset(-4) + $0.height.equalTo(44) + $0.width.equalTo(145) + $0.bottom.equalToSuperview().inset(16) } - yesButton.snp.makeConstraints { make in - make.top.equalTo(noButton.snp.top) - make.trailing.equalToSuperview().inset(16) - make.leading.equalTo(containerView.snp.centerX).offset(4) - make.height.equalTo(44) - make.width.equalTo(145) - make.bottom.equalToSuperview().inset(16) + yesButton.snp.makeConstraints { + $0.top.equalTo(noButton.snp.top) + $0.trailing.equalToSuperview().inset(16) + $0.leading.equalTo(containerView.snp.centerX).offset(4) + $0.height.equalTo(44) + $0.width.equalTo(145) + $0.bottom.equalToSuperview().inset(16) } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/StatsInfoView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/StatsInfoView.swift index 69295e3a..b4f6f80d 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/StatsInfoView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/StatsInfoView.swift @@ -7,6 +7,9 @@ import UIKit +import SnapKit +import Then + final class StatsInfoView: UIView { // MARK: - UI Components @@ -83,8 +86,8 @@ extension StatsInfoView { private func setLayout() { self.addSubviews(statsContainerStackView) - statsContainerStackView.snp.makeConstraints { make in - make.edges.equalToSuperview() + statsContainerStackView.snp.makeConstraints { + $0.edges.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/CVC/PageCVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/CVC/PageCVC.swift index be961b81..c8f20d73 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/CVC/PageCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/CVC/PageCVC.swift @@ -7,6 +7,8 @@ import UIKit +import SnapKit + final class PageCVC: UICollectionViewCell { // MARK: - UI Components @@ -35,8 +37,8 @@ final class PageCVC: UICollectionViewCell { self.contentView.addSubview(view) - view.snp.makeConstraints { make in - make.edges.equalTo(contentView) + view.snp.makeConstraints { + $0.edges.equalTo(contentView) } } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/PagedView.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/PagedView.swift index 8a6f46a6..22c12656 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/PagedView.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/PagedView/PagedView.swift @@ -60,8 +60,8 @@ final class PagedView: UIView { private func setLayout() { self.addSubview(collectionView) - collectionView.snp.makeConstraints { make in - make.edges.equalToSuperview() + collectionView.snp.makeConstraints { + $0.edges.equalToSuperview() } } diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/ViewPager.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/ViewPager.swift index 1d1a0beb..7a40dd9a 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/ViewPager.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/ViewPager/ViewPager.swift @@ -8,6 +8,9 @@ import UIKit import Combine +import SnapKit +import Then + class ViewPager: UIView { // MARK: - Properties @@ -81,8 +84,8 @@ extension ViewPager { leadingConstant += (buttonWidth * CGFloat(index)) UIView.animate(withDuration: 0.4, delay: 0, options: [.curveLinear]) { - self.barView.snp.updateConstraints { make in - make.leading.equalToSuperview().offset(leadingConstant) + self.barView.snp.updateConstraints { + $0.leading.equalToSuperview().offset(leadingConstant) } self.barBackgroundView.layoutIfNeeded() } @@ -118,8 +121,8 @@ extension ViewPager { pagedView.percent.sink { [weak self] percent in guard let self = self, !self.tappedButton else { return } let leadingContraints = self.barBackgroundView.frame.width * percent - self.barView.snp.updateConstraints { make in - make.leading.equalToSuperview().offset(leadingContraints) + self.barView.snp.updateConstraints { + $0.leading.equalToSuperview().offset(leadingContraints) } }.store(in: cancelBag) @@ -143,35 +146,35 @@ extension ViewPager { self.addSubviews(buttonStackView, barBackgroundView, pagedView) barBackgroundView.addSubviews(bottomBorderView, barView) - buttonStackView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(38) + buttonStackView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(38) } - - barBackgroundView.snp.makeConstraints { make in - make.height.equalTo(2) - make.bottom.equalTo(buttonStackView.snp.bottom) - make.leading.trailing.equalToSuperview().inset(16) + + barBackgroundView.snp.makeConstraints { + $0.height.equalTo(2) + $0.bottom.equalTo(buttonStackView.snp.bottom) + $0.leading.trailing.equalToSuperview().inset(16) } - - bottomBorderView.snp.makeConstraints { make in - make.top.equalTo(barBackgroundView.snp.bottom).inset(1) - make.leading.trailing.equalToSuperview() - make.height.equalTo(1) + + bottomBorderView.snp.makeConstraints { + $0.top.equalTo(barBackgroundView.snp.bottom).inset(1) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) } - + guard let button = buttonStackView.arrangedSubviews.first as? UIButton else { return } - - barView.snp.makeConstraints { make in - make.leading.top.bottom.equalToSuperview() - make.width.equalTo(button.snp.width) + + barView.snp.makeConstraints { + $0.leading.top.bottom.equalToSuperview() + $0.width.equalTo(button.snp.width) } - - pagedView.snp.makeConstraints { make in - make.top.equalTo(barBackgroundView.snp.bottom) - make.leading.trailing.equalToSuperview() - make.bottom.equalToSuperview() + + pagedView.snp.makeConstraints { + $0.top.equalTo(barBackgroundView.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.bottom.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Network/Router/RecordRouter.swift b/Runnect-iOS/Runnect-iOS/Network/Router/RecordRouter.swift index 5c7f062b..683fd297 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Router/RecordRouter.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Router/RecordRouter.swift @@ -64,8 +64,7 @@ extension RecordRouter: TargetType { case .updateRecordTitle(_, let recordTitle): do { return .requestParameters(parameters: ["title": recordTitle], encoding: JSONEncoding.default) - } catch { - fatalError("Encoding 실패")} + } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift index 51669f23..a829a2b4 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseDetailVC.swift @@ -391,7 +391,7 @@ extension CourseDetailVC { navibar.snp.makeConstraints { $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - $0.height.equalTo(48) + $0.height.equalTo(56) } moreButton.snp.makeConstraints { @@ -479,9 +479,9 @@ extension CourseDetailVC { $0.width.height.equalTo(37) } - profileNameLabel.snp.makeConstraints { - $0.leading.equalTo(profileImageView.snp.trailing).offset(12) - } +// profileNameLabel.snp.makeConstraints { +// $0.leading.equalTo(profileImageView.snp.trailing).offset(12) +// } firstHorizontalDivideLine.snp.makeConstraints { $0.top.equalTo(mapImageView.snp.bottom).offset(62) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift index c175793f..cf5b969f 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDetail/VC/CourseEditVC.swift @@ -16,7 +16,7 @@ class CourseEditVC: UIViewController { // MARK: - Properties private let PublicCourseProvider = Providers.publicCourseProvider - + private let courseTitleMaxLength = 20 private let activityTextMaxLength = 150 var publicCourseId: Int? @@ -54,7 +54,7 @@ class CourseEditVC: UIViewController { $0.tintColor = .m1 $0.textContainerInset = UIEdgeInsets(top: 14, left: 12, bottom: 14, right: 12) } - + // MARK: - Life Cycle override func viewDidLoad() { @@ -204,7 +204,7 @@ extension CourseEditVC { self?.navigationController?.popViewController(animated: true) }, .titleWithLeftButton) } - + @objc func presentToQuitEditAlertVC() { let quitEditAlertVC = RNAlertVC(description: "게시글 수정을 종료할까요?\n종료 시 수정 내용이 반영되지 않아요.") @@ -224,9 +224,9 @@ extension CourseEditVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } @@ -242,15 +242,15 @@ extension CourseEditVC { view.bringSubviewToFront(editButton) buttonContainerView.addSubview(editButton) - buttonContainerView.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(86) - make.bottom.equalToSuperview() + buttonContainerView.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(86) + $0.bottom.equalToSuperview() } - editButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(44) - make.bottom.equalToSuperview().inset(34) + editButton.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(44) + $0.bottom.equalToSuperview().inset(34) } setScrollViewLayout() @@ -273,39 +273,41 @@ extension CourseEditVC { $0.bottom.equalTo(editButton.snp.top).inset(-25) } - mapImageView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) - make.height.equalTo(mapImageView.snp.width).multipliedBy(0.75) + mapImageView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) + $0.height.equalTo(mapImageView.snp.width).multipliedBy(0.75) } - courseTitleTextField.snp.makeConstraints { make in - make.top.equalTo(mapImageView.snp.bottom).offset(28) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(35) + courseTitleTextField.snp.makeConstraints { + $0.top.equalTo(mapImageView.snp.bottom).offset(28) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(35) } - - dividerView.snp.makeConstraints { make in - make.top.equalTo(courseTitleTextField.snp.bottom).offset(0) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(2) + + dividerView.snp.makeConstraints { + $0.top.equalTo(courseTitleTextField.snp.bottom).offset(0) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(2) } - distanceInfoView.snp.makeConstraints { make in - make.top.equalTo(courseTitleTextField.snp.bottom).offset(22) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(16) + distanceInfoView.snp.makeConstraints { + $0.top.equalTo(courseTitleTextField.snp.bottom).offset(22) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(16) } - departureInfoView.snp.makeConstraints { make in - make.top.equalTo(distanceInfoView.snp.bottom).offset(6) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(16) + + departureInfoView.snp.makeConstraints { + $0.top.equalTo(distanceInfoView.snp.bottom).offset(6) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(16) } - activityTextView.snp.makeConstraints { make in - make.top.equalTo(departureInfoView.snp.bottom).offset(34) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.bottom.equalToSuperview() - make.height.equalTo(187) + + activityTextView.snp.makeConstraints { + $0.top.equalTo(departureInfoView.snp.bottom).offset(34) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.bottom.equalToSuperview() + $0.height.equalTo(187) } } } @@ -351,14 +353,14 @@ extension CourseEditVC: UITextViewDelegate { let attributedString = NSMutableAttributedString(string: textView.text) attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attributedString.length)) - + textView.attributedText = attributedString textView.font = .b3 textView.textColor = .g1 // 커서 위치 다시 설정 textView.selectedRange = selectedRange - + guard let courseTitleTextFieldText = self.courseTitleTextField.text else { return } textDidChanged(courseTitleTextFieldText, text) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/AdImageCollectionViewCell.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/AdImageCollectionViewCell.swift index 9993e4bc..a112c374 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/AdImageCollectionViewCell.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/AdImageCollectionViewCell.swift @@ -2,12 +2,12 @@ // AdImageCollectionViewCell.swift // Runnect-iOS // -// Created by YEONOO on 2023/01/10. +// Created by 이명진 on 2023/11/18. // import UIKit -import SnapKit +import SnapKit import Then final class AdImageCollectionViewCell: UICollectionViewCell, UIScrollViewDelegate { @@ -89,12 +89,13 @@ extension AdImageCollectionViewCell { contentView.addSubview(bannerCollectionView) contentView.addSubview(pageControl) - bannerCollectionView.snp.makeConstraints { make in - make.edges.equalToSuperview() + bannerCollectionView.snp.makeConstraints { + $0.edges.equalToSuperview() } - pageControl.snp.makeConstraints { make in - make.centerX.equalTo(self) - make.bottom.equalTo(bannerCollectionView.snp.bottom) + + pageControl.snp.makeConstraints { + $0.centerX.equalTo(self) + $0.bottom.equalTo(bannerCollectionView.snp.bottom) } } } @@ -128,20 +129,8 @@ extension AdImageCollectionViewCell: UICollectionViewDelegate, UICollectionViewD imageView.isUserInteractionEnabled = true cell.contentView.addSubviews(imageView) - // 터치 이벤트 임시 제거 - // if indexPath.item == 0 { - // let tapGesture = UITapGestureRecognizer(target: self, action: #selector(firstCellTapped(_:))) - // imageView.addGestureRecognizer(tapGesture) - // } return cell } - // 첫 번째 셀 클릭 이벤트 핸들러 - // @objc func firstCellTapped(_ gesture: UITapGestureRecognizer) { - // // Safari 링크로 연결 - // if let url = URL(string: "https://docs.google.com/forms/d/1cpgZHNNi1kIvi2ZCwCIcMJcI1PkHBz9a5vWJb7FfIbg/edit") { - // UIApplication.shared.open(url) - // } - // } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonMapCollectionViewCell.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonMapCollectionViewCell.swift index 40f9f1b3..ccb0568c 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonMapCollectionViewCell.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonMapCollectionViewCell.swift @@ -8,6 +8,8 @@ import UIKit import Combine +import SnapKit + protocol MarathonScrapStateDelegate: AnyObject { func didUpdateMarathonScrapState(publicCourseId: Int, isScrapped: Bool) } @@ -151,7 +153,7 @@ extension MarathonMapCollectionViewCell: UICollectionViewDelegateFlowLayout { // MARK: - CourseListCVCDelegate -extension MarathonMapCollectionViewCell: CourseListCVCDeleagte { +extension MarathonMapCollectionViewCell: CourseListCVCDelegate { func likeButtonTapped(wantsTolike: Bool, index: Int) { guard UserManager.shared.userType != .visitor else { return diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonTitleCollectionViewCell.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonTitleCollectionViewCell.swift index 789bdd75..9ebca221 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonTitleCollectionViewCell.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/MarathonTitleCollectionViewCell.swift @@ -7,11 +7,19 @@ import UIKit +import SnapKit +import Then + final class MarathonTitleCollectionViewCell: UICollectionViewCell { // MARK: - UI Components - private lazy var titleStackView = UIStackView(arrangedSubviews: [mainLabel, subLabel]).then { + private lazy var titleStackView = UIStackView( + arrangedSubviews: [ + mainLabel, + subLabel + ] + ).then { $0.axis = .vertical $0.spacing = 6 $0.alignment = .leading diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/TitleCollectionViewCell.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/TitleCollectionViewCell.swift index 64efdf24..67e5252a 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/TitleCollectionViewCell.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/TitleCollectionViewCell.swift @@ -8,6 +8,9 @@ import UIKit import Combine +import SnapKit +import Then + protocol TitleCollectionViewCellDelegate: AnyObject { func didTapSortButton(ordering: String) } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift index 5e4d635f..165d6365 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift @@ -189,13 +189,13 @@ extension CourseDiscoveryVC { view.addSubview(naviBar) view.addSubview(searchButton) - naviBar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(56) + naviBar.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(56) } - searchButton.snp.makeConstraints { make in - make.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(16) - make.centerY.equalTo(naviBar) + searchButton.snp.makeConstraints { + $0.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(16) + $0.centerY.equalTo(naviBar) } } @@ -210,21 +210,21 @@ extension CourseDiscoveryVC { $0.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) } - uploadButton.snp.makeConstraints { make in - make.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(21) - make.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(20) - make.height.equalTo(40) - make.width.equalTo(92) + uploadButton.snp.makeConstraints { + $0.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(21) + $0.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(20) + $0.height.equalTo(40) + $0.width.equalTo(92) } - miniUploadButton.snp.makeConstraints { make in - make.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(22) - make.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(20) + miniUploadButton.snp.makeConstraints { + $0.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(22) + $0.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(20) } - emptyView.snp.makeConstraints { make in - make.top.equalTo(naviBar.snp.bottom).offset(300) - make.centerX.equalTo(naviBar) + emptyView.snp.makeConstraints { + $0.top.equalTo(naviBar.snp.bottom).offset(300) + $0.centerX.equalTo(naviBar) } self.view.bringSubviewToFront(uploadButton) @@ -429,7 +429,7 @@ extension CourseDiscoveryVC: UIScrollViewDelegate { // MARK: - CourseListCVCDelegate -extension CourseDiscoveryVC: CourseListCVCDeleagte { +extension CourseDiscoveryVC: CourseListCVCDelegate { func likeButtonTapped(wantsTolike: Bool, index: Int) { guard UserManager.shared.userType != .visitor else { showToastOnWindow(text: "러넥트에 가입하면 코스를 스크랩할 수 있어요") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift index d340141d..3d47190e 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseSearchVC.swift @@ -107,36 +107,40 @@ extension CourseSearchVC { } // MARK: - UI & Layout + extension CourseSearchVC { private func setNavigationBar() { view.addSubview(naviBar) - naviBar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + naviBar.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } + private func layout() { view.backgroundColor = .w1 emptyDataView.isHidden = true // 데이터가 없으면 false로 설정 view.addSubviews(dividerView, mapCollectionView) - dividerView.snp.makeConstraints { make in - make.top.equalTo(naviBar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(6) + dividerView.snp.makeConstraints { + $0.top.equalTo(naviBar.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(6) } - mapCollectionView.snp.makeConstraints { make in - make.top.equalTo(self.dividerView.snp.bottom) - make.leading.trailing.bottom.equalTo(self.view.safeAreaLayoutGuide) + + mapCollectionView.snp.makeConstraints { + $0.top.equalTo(dividerView.snp.bottom) + $0.leading.trailing.bottom.equalTo(view.safeAreaLayoutGuide) } mapCollectionView.addSubview(emptyDataView) - emptyDataView.snp.makeConstraints { make in - make.center.equalToSuperview() + emptyDataView.snp.makeConstraints { + $0.center.equalToSuperview() } } } + // MARK: - UICollectionViewDelegate, UICollectionViewDataSource extension CourseSearchVC: UICollectionViewDelegate, UICollectionViewDataSource { @@ -201,9 +205,9 @@ extension CourseSearchVC: CustomNavigationBarDelegate { } } -// MARK: - CourseListCVCDeleagte +// MARK: - CourseListCVCDelegate -extension CourseSearchVC: CourseListCVCDeleagte { +extension CourseSearchVC: CourseListCVCDelegate { func likeButtonTapped(wantsTolike: Bool, index: Int) { guard UserManager.shared.userType != .visitor else { showToastOnWindow(text: "러넥트에 가입하면 코스를 스크랩할 수 있어요") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseUploadVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseUploadVC.swift index b69a82da..773814b4 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseUploadVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseUploadVC.swift @@ -203,9 +203,9 @@ extension CourseUploadVC { extension CourseUploadVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } // MARK: - setUI @@ -225,15 +225,15 @@ extension CourseUploadVC { view.bringSubviewToFront(uploadButton) buttonContainerView.addSubview(uploadButton) - buttonContainerView.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(86) - make.bottom.equalToSuperview() + buttonContainerView.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(86) + $0.bottom.equalToSuperview() } - uploadButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(44) - make.bottom.equalToSuperview().inset(34) + uploadButton.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(44) + $0.bottom.equalToSuperview().inset(34) } setScrollViewLayout() @@ -256,39 +256,41 @@ extension CourseUploadVC { $0.bottom.equalTo(uploadButton.snp.top).inset(-25) } - mapImageView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) - make.height.equalTo(mapImageView.snp.width).multipliedBy(0.75) + mapImageView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) + $0.height.equalTo(mapImageView.snp.width).multipliedBy(0.75) } - courseTitleTextField.snp.makeConstraints { make in - make.top.equalTo(mapImageView.snp.bottom).offset(28) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(35) + courseTitleTextField.snp.makeConstraints { + $0.top.equalTo(mapImageView.snp.bottom).offset(28) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(35) } - dividerView.snp.makeConstraints { make in - make.top.equalTo(courseTitleTextField.snp.bottom).offset(0) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(2) + dividerView.snp.makeConstraints { + $0.top.equalTo(courseTitleTextField.snp.bottom).offset(0) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(2) } - distanceInfoView.snp.makeConstraints { make in - make.top.equalTo(courseTitleTextField.snp.bottom).offset(22) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(16) + distanceInfoView.snp.makeConstraints { + $0.top.equalTo(courseTitleTextField.snp.bottom).offset(22) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(16) } - departureInfoView.snp.makeConstraints { make in - make.top.equalTo(distanceInfoView.snp.bottom).offset(6) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(16) + + departureInfoView.snp.makeConstraints { + $0.top.equalTo(distanceInfoView.snp.bottom).offset(6) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(16) } - activityTextView.snp.makeConstraints { make in - make.top.equalTo(departureInfoView.snp.bottom).offset(34) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.bottom.equalToSuperview() - make.height.equalTo(187) + + activityTextView.snp.makeConstraints { + $0.top.equalTo(departureInfoView.snp.bottom).offset(34) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.bottom.equalToSuperview() + $0.height.equalTo(187) } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift index 0e4b97c9..a2000a2b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/MyCourseSelectVC.swift @@ -7,8 +7,9 @@ import UIKit -import Then import Moya +import SnapKit +import Then protocol UploadStateDelegate: AnyObject { func didUploadCourse() @@ -45,7 +46,7 @@ class MyCourseSelectVC: UIViewController { private lazy var selectButton = CustomButton(title: "선택하기").setEnabled(false).then { $0.isHidden = true } - + private lazy var mapCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical @@ -62,7 +63,7 @@ class MyCourseSelectVC: UIViewController { buttonTitle: "코스 그리기").then { $0.setImage(ImageLiterals.imgPaper, size: CGSize(width: 189, height: 169)) } - + // MARK: - Constants final let collectionViewInset = UIEdgeInsets(top: 28, left: 16, bottom: 28, right: 16) @@ -99,7 +100,7 @@ extension MyCourseSelectVC { self.guidelineLabel.isHidden = courseList.isEmpty self.selectButton.isHidden = courseList.isEmpty } - + private func setDelegate() { mapCollectionView.delegate = self mapCollectionView.dataSource = self @@ -140,9 +141,9 @@ extension MyCourseSelectVC: UploadStateDelegate { extension MyCourseSelectVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } @@ -152,47 +153,47 @@ extension MyCourseSelectVC { self.emptyView.isHidden = true firstDivideView.backgroundColor = .g4 } - + private func setLayout() { view.addSubviews(firstDivideView, guidelineView, guidelineLabel, selectButton, mapCollectionView) self.view.bringSubviewToFront(selectButton) mapCollectionView.addSubview(emptyView) - selectButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(44) - make.bottom.equalToSuperview().inset(34) + selectButton.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(44) + $0.bottom.equalToSuperview().inset(34) } - firstDivideView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalToSuperview() - make.height.equalTo(1) + firstDivideView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) } - guidelineView.snp.makeConstraints { make in - make.top.equalTo(firstDivideView.snp.bottom) - make.leading.trailing.equalToSuperview() - make.height.equalTo(36) + guidelineView.snp.makeConstraints { + $0.top.equalTo(firstDivideView.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(36) } - guidelineLabel.snp.makeConstraints { make in - make.centerX.equalTo(guidelineView) - make.top.equalTo(guidelineView.snp.top).offset(8) + guidelineLabel.snp.makeConstraints { + $0.centerX.equalTo(guidelineView) + $0.top.equalTo(guidelineView.snp.top).offset(8) } - mapCollectionView.snp.makeConstraints { make in - make.top.equalTo(guidelineView.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalTo(selectButton.snp.top).inset(-25) + mapCollectionView.snp.makeConstraints { + $0.top.equalTo(guidelineView.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalTo(selectButton.snp.top).inset(-25) } - emptyView.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.centerY.equalTo(view.safeAreaLayoutGuide) + emptyView.snp.makeConstraints { + $0.centerX.centerY.equalToSuperview() } } } + // MARK: - UICollectionViewDelegate, UICollectionViewDataSource extension MyCourseSelectVC: UICollectionViewDelegate, UICollectionViewDataSource { @@ -231,7 +232,7 @@ extension MyCourseSelectVC: UICollectionViewDelegate, UICollectionViewDataSource if let town = model.departure.town { title += " \(town)" } - + cell.setData(imageURL: model.image, title: title, location: nil, didLike: nil) return cell diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift index 61f5e5cb..e69c6bd7 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingHomeVC.swift @@ -7,10 +7,12 @@ import UIKit +import SnapKit + final class CourseDrawingHomeVC: UIViewController { // MARK: - Properties - + private lazy var tabBarHeight = self.tabBarController?.tabBar.frame.size.height ?? 49 // MARK: - UI Components @@ -75,20 +77,20 @@ extension CourseDrawingHomeVC { private func setLayout() { view.addSubviews(mapView, drawCourseButton, guideView) - mapView.snp.makeConstraints { make in - make.top.bottom.equalToSuperview() - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) + mapView.snp.makeConstraints { + $0.top.bottom.equalToSuperview() + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) } - drawCourseButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(75) - make.bottom.equalTo(view.safeAreaLayoutGuide).inset(24) - make.height.equalTo(44) + drawCourseButton.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(75) + $0.bottom.equalTo(view.safeAreaLayoutGuide).inset(24) + $0.height.equalTo(44) } - guideView.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide).inset(7) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(23) + guideView.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide).inset(7) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(23) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift index bc073fb2..8b3e93ba 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/CourseDrawingVC.swift @@ -9,6 +9,8 @@ import UIKit import Combine import Moya +import SnapKit +import Then final class CourseDrawingVC: UIViewController { @@ -301,45 +303,45 @@ extension CourseDrawingVC { view.addSubviews(naviBarForEditing, guideView, distanceContainerView, completeButton, undoButton) view.sendSubviewToBack(naviBarForEditing) - naviBarForEditing.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + naviBarForEditing.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } - guideView.snp.makeConstraints { make in - make.centerY.equalTo(naviBarForEditing.snp.centerY) - make.leading.equalTo(view.safeAreaLayoutGuide).inset(55) - make.trailing.equalTo(view.safeAreaLayoutGuide).inset(27) + guideView.snp.makeConstraints { + $0.centerY.equalTo(naviBarForEditing.snp.centerY) + $0.leading.equalTo(view.safeAreaLayoutGuide).inset(55) + $0.trailing.equalTo(view.safeAreaLayoutGuide).inset(27) } - distanceContainerView.snp.makeConstraints { make in - make.width.equalTo(96) - make.height.equalTo(44) - make.leading.equalTo(view.safeAreaLayoutGuide).inset(16) - make.top.equalTo(view.snp.bottom) + distanceContainerView.snp.makeConstraints { + $0.width.equalTo(96) + $0.height.equalTo(44) + $0.leading.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.top.equalTo(view.snp.bottom) } distanceContainerView.addSubviews(distanceStackView) - distanceStackView.snp.makeConstraints { make in - make.center.equalToSuperview() + distanceStackView.snp.makeConstraints { + $0.center.equalToSuperview() } - undoButton.snp.makeConstraints { make in - make.trailing.equalTo(view.safeAreaLayoutGuide) - make.top.equalTo(view.snp.bottom) + undoButton.snp.makeConstraints { + $0.trailing.equalTo(view.safeAreaLayoutGuide) + $0.top.equalTo(view.snp.bottom) } - completeButton.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(44) - make.top.equalTo(view.snp.bottom).offset(34) + completeButton.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(44) + $0.top.equalTo(view.snp.bottom).offset(34) } } private func showHiddenViews(withDuration: TimeInterval = 0) { - [naviBarForEditing, guideView, distanceContainerView, completeButton, undoButton].forEach { subView in - view.bringSubviewToFront(subView) + [naviBarForEditing, guideView, distanceContainerView, completeButton, undoButton].forEach { + view.bringSubviewToFront($0) } UIView.animate(withDuration: withDuration) { @@ -360,70 +362,70 @@ extension CourseDrawingVC { } private func setNotchCoverViewLayout() { - notchCoverView.snp.makeConstraints { make in + notchCoverView.snp.makeConstraints { var notchHeight = calculateTopInset() if notchHeight == -44 { let statusBarHeight = UIApplication.shared.statusBarHeight notchHeight = -statusBarHeight } - make.height.equalTo(-notchHeight) + $0.height.equalTo(-notchHeight) } } private func setNaviBarLayout() { - naviBar.snp.makeConstraints { make in - make.height.equalTo(56) + naviBar.snp.makeConstraints { + $0.height.equalTo(56) } - naviBarContainerStackView.snp.makeConstraints { make in - make.leading.top.trailing.equalToSuperview() + naviBarContainerStackView.snp.makeConstraints { + $0.leading.top.trailing.equalToSuperview() } } private func setMapViewLayout() { - mapView.snp.makeConstraints { make in - make.edges.equalToSuperview() + mapView.snp.makeConstraints { + $0.edges.equalToSuperview() } } private func setStartMarkStackViewLayout() { - startLabelUIImage.snp.makeConstraints { make in - make.height.equalTo(34) - make.width.equalTo(58) + startLabelUIImage.snp.makeConstraints { + $0.height.equalTo(34) + $0.width.equalTo(58) } - startMarkUIImage.snp.makeConstraints { make in - make.height.width.equalTo(65) + startMarkUIImage.snp.makeConstraints { + $0.height.width.equalTo(65) } - startMarkStackView.snp.makeConstraints { make in - make.height.equalTo(100) - make.width.equalTo(65) - make.centerX.equalToSuperview() - make.centerY.equalToSuperview().offset(-17) + startMarkStackView.snp.makeConstraints { + $0.height.equalTo(100) + $0.width.equalTo(65) + $0.centerX.equalToSuperview() + $0.centerY.equalToSuperview().offset(-17) } } private func setDepartureInfoContainerViewLayout() { - departureInfoContainerView.snp.makeConstraints { make in - make.leading.bottom.trailing.equalToSuperview() - make.height.equalTo(172) + departureInfoContainerView.snp.makeConstraints { + $0.leading.bottom.trailing.equalToSuperview() + $0.height.equalTo(172) } - departureLocationLabel.snp.makeConstraints { make in - make.top.equalToSuperview().inset(28) - make.leading.trailing.equalToSuperview().inset(16) + departureLocationLabel.snp.makeConstraints { + $0.top.equalToSuperview().inset(28) + $0.leading.trailing.equalToSuperview().inset(16) } - departureDetailLocationLabel.snp.makeConstraints { make in - make.top.equalTo(departureLocationLabel.snp.bottom).offset(6) - make.leading.trailing.equalToSuperview().inset(16) + departureDetailLocationLabel.snp.makeConstraints { + $0.top.equalTo(departureLocationLabel.snp.bottom).offset(6) + $0.leading.trailing.equalToSuperview().inset(16) } - decideDepartureButton.snp.makeConstraints { make in - make.top.equalTo(departureDetailLocationLabel.snp.bottom).offset(24) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(44) + decideDepartureButton.snp.makeConstraints { + $0.top.equalTo(departureDetailLocationLabel.snp.bottom).offset(24) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(44) } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift index 08d8643e..7b3a808c 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/VC/DepartureSearchVC.swift @@ -8,8 +8,10 @@ import UIKit import Combine -import Moya import CoreLocation +import Moya +import SnapKit +import Then final class DepartureSearchVC: UIViewController, CLLocationManagerDelegate { @@ -217,47 +219,47 @@ extension DepartureSearchVC { private func setLayout() { view.addSubviews(naviBar, dividerView, locationSelectStackView, thinDividerView, locationTableView) - naviBar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + naviBar.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } - dividerView.snp.makeConstraints { make in - make.top.equalTo(naviBar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(6) + dividerView.snp.makeConstraints { + $0.top.equalTo(naviBar.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(6) } - locationSelectStackView.snp.makeConstraints { make in - make.top.equalTo(dividerView.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(8) - make.height.equalTo(50) + locationSelectStackView.snp.makeConstraints { + $0.top.equalTo(dividerView.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(8) + $0.height.equalTo(50) } - selectDirectionView.snp.makeConstraints { make in - make.height.equalTo(locationSelectStackView.snp.height) - make.centerY.equalTo(locationSelectStackView) + selectDirectionView.snp.makeConstraints { + $0.height.equalTo(locationSelectStackView.snp.height) + $0.centerY.equalTo(locationSelectStackView) } - selectMapView.snp.makeConstraints { make in - make.height.equalTo(locationSelectStackView.snp.height) - make.centerY.equalTo(locationSelectStackView) + selectMapView.snp.makeConstraints { + $0.height.equalTo(locationSelectStackView.snp.height) + $0.centerY.equalTo(locationSelectStackView) } - thinDividerView.snp.makeConstraints { make in - make.top.equalTo(locationSelectStackView.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(1) + thinDividerView.snp.makeConstraints { + $0.top.equalTo(locationSelectStackView.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(1) } - locationTableView.snp.makeConstraints { make in - make.top.equalTo(thinDividerView.snp.bottom) - make.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) + locationTableView.snp.makeConstraints { + $0.top.equalTo(thinDividerView.snp.bottom) + $0.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) } locationTableView.addSubview(emptyDataView) - emptyDataView.snp.makeConstraints { make in - make.center.equalToSuperview() + emptyDataView.snp.makeConstraints { + $0.center.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSearchResultTVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSearchResultTVC.swift index f81130c0..7cc21cf2 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSearchResultTVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSearchResultTVC.swift @@ -7,10 +7,13 @@ import UIKit +import SnapKit +import Then + final class LocationSearchResultTVC: UITableViewCell { // MARK: - UI Components - + private let locationPointImageView = UIImageView().then { $0.image = ImageLiterals.icLocationPoint $0.tintColor = .g3 @@ -71,21 +74,21 @@ extension LocationSearchResultTVC { private func setLayout() { self.addSubviews(locationPointImageView, locationStackView, dividerView) - locationPointImageView.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(24) - make.centerY.equalToSuperview() + locationPointImageView.snp.makeConstraints { + $0.leading.equalToSuperview().inset(24) + $0.centerY.equalToSuperview() } - locationStackView.snp.makeConstraints { make in - make.leading.equalTo(locationPointImageView.snp.trailing).offset(14) - make.centerY.equalToSuperview() - make.trailing.equalToSuperview().inset(24) + locationStackView.snp.makeConstraints { + $0.leading.equalTo(locationPointImageView.snp.trailing).offset(14) + $0.centerY.equalToSuperview() + $0.trailing.equalToSuperview().inset(24) } - dividerView.snp.makeConstraints { make in - make.bottom.equalToSuperview() - make.leading.trailing.equalToSuperview() - make.height.equalTo(1) + dividerView.snp.makeConstraints { + $0.bottom.equalToSuperview() + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(1) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSelectView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSelectView.swift index 3a44a77f..3d326a96 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSelectView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDrawing/Views/LocationSelectView.swift @@ -6,8 +6,9 @@ // import UIKit -import Then + import SnapKit +import Then enum locationType { case current @@ -41,7 +42,8 @@ enum locationType { } } -class LocationSelectView: BaseView { +final class LocationSelectView: BaseView { + let type: locationType private lazy var view = UIView() diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index 748c7baf..f39f141b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -9,6 +9,8 @@ import UIKit import Combine import Moya +import SnapKit +import Then final class CourseStorageVC: UIViewController { @@ -209,9 +211,9 @@ extension CourseStorageVC { private func setLayout() { view.addSubviews(naviBar) - naviBar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(56) + naviBar.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(56) } guard UserManager.shared.userType != .visitor else { @@ -222,15 +224,15 @@ extension CourseStorageVC { view.addSubviews(viewPager, deleteCourseButton) - viewPager.snp.makeConstraints { make in - make.top.equalTo(naviBar.snp.bottom) - make.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) + viewPager.snp.makeConstraints { + $0.top.equalTo(naviBar.snp.bottom) + $0.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) } - deleteCourseButton.snp.makeConstraints { make in - make.top.equalTo(view.safeAreaLayoutGuide.snp.bottom) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(44) + deleteCourseButton.snp.makeConstraints { + $0.top.equalTo(view.safeAreaLayoutGuide.snp.bottom) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(44) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift index dace27f1..53562a6e 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CVC/CourseListCVC.swift @@ -7,7 +7,10 @@ import UIKit -protocol CourseListCVCDeleagte: AnyObject { +import SnapKit +import Then + +protocol CourseListCVCDelegate: AnyObject { func likeButtonTapped(wantsTolike: Bool, index: Int) } @@ -29,10 +32,10 @@ enum CourseListCVCType { } final class CourseListCVC: UICollectionViewCell { - + // MARK: - Properties - weak var delegate: CourseListCVCDeleagte? + weak var delegate: CourseListCVCDelegate? private var indexPath: Int? @@ -64,7 +67,10 @@ final class CourseListCVC: UICollectionViewCell { } private lazy var labelStackView = UIStackView( - arrangedSubviews: [titleLabel, locationLabel] + arrangedSubviews: [ + titleLabel, + locationLabel + ] ).then { $0.axis = .vertical $0.alignment = .leading @@ -156,35 +162,33 @@ extension CourseListCVC { private func setLayout() { self.contentView.addSubviews(courseImageView, imageCoverView, labelStackView, likeButton, selectIndicatorButton) - - courseImageView.snp.makeConstraints { make in - make.leading.top.trailing.equalToSuperview() + + courseImageView.snp.makeConstraints { + $0.leading.top.trailing.equalToSuperview() let imageHeight = contentView.frame.width * (124/174) - make.height.equalTo(imageHeight) + $0.height.equalTo(imageHeight) } - imageCoverView.snp.makeConstraints { make in - make.edges.equalTo(courseImageView) + imageCoverView.snp.makeConstraints { + $0.edges.equalTo(courseImageView) } - likeButton.snp.makeConstraints { make in - make.top.equalTo(courseImageView.snp.bottom).offset(4) - make.trailing.equalToSuperview() - make.width.equalTo(22) - make.height.equalTo(20) + likeButton.snp.makeConstraints { + $0.top.equalTo(courseImageView.snp.bottom).offset(4) + $0.trailing.equalToSuperview() + $0.width.equalTo(22) + $0.height.equalTo(20) } - selectIndicatorButton.snp.makeConstraints { make in - make.top.leading.equalToSuperview().inset(8) - make.leading.equalToSuperview().offset(8) - make.width.equalTo(20) - make.height.equalTo(20) + selectIndicatorButton.snp.makeConstraints { + $0.top.leading.equalToSuperview().inset(8) + $0.width.height.equalTo(20) } - labelStackView.snp.makeConstraints { make in - make.top.equalTo(courseImageView.snp.bottom).offset(4) - make.leading.equalToSuperview() - make.width.equalTo(courseImageView.snp.width).multipliedBy(0.7) + labelStackView.snp.makeConstraints { + $0.top.equalTo(courseImageView.snp.bottom).offset(4) + $0.leading.equalToSuperview() + $0.width.equalTo(courseImageView.snp.width).multipliedBy(0.7) } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index 45e362f1..a3bfeee6 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -8,6 +8,9 @@ import UIKit import Combine +import SnapKit +import Then + protocol PrivateCourseListViewDelegate: AnyObject { func courseListEditButtonTapped() func selectCellDidTapped() @@ -32,7 +35,7 @@ final class PrivateCourseListView: UIView { isEditMode ? startEditMode() : finishEditMode() } } - + final let collectionViewInset = UIEdgeInsets(top: 28, left: 16, bottom: 28, right: 16) final let itemSpacing: CGFloat = 10 final let lineSpacing: CGFloat = 20 @@ -59,8 +62,8 @@ final class PrivateCourseListView: UIView { $0.titleLabel?.font = .b5 $0.layer.backgroundColor = UIColor.m3.cgColor $0.layer.cornerRadius = 11 -// $0.layer.borderColor = UIColor.m1.cgColor -// $0.layer.borderWidth = 1 + // $0.layer.borderColor = UIColor.m1.cgColor + // $0.layer.borderWidth = 1 } lazy var courseListCollectionView = UICollectionView( @@ -155,31 +158,32 @@ extension PrivateCourseListView { self.addSubviews(beforeEditTopView, courseListCollectionView) courseListCollectionView.addSubviews(emptyView) beforeEditTopView.addSubviews(totalNumOfRecordlabel, editButton) - beforeEditTopView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalToSuperview() - make.height.equalTo(38) + beforeEditTopView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(38) } - totalNumOfRecordlabel.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(16) - make.top.equalToSuperview().offset(10) + totalNumOfRecordlabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(16) + $0.top.equalToSuperview().offset(10) } - editButton.snp.makeConstraints { make in - make.trailing.equalToSuperview().inset(16) - make.width.equalTo(47) - make.height.equalTo(22) - make.top.equalToSuperview().offset(8) + editButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(16) + $0.width.equalTo(47) + $0.height.equalTo(22) + $0.top.equalToSuperview().offset(8) } - courseListCollectionView.snp.makeConstraints { make in - make.top.equalTo(editButton.snp.bottom) - make.leading.bottom.trailing.equalToSuperview() + courseListCollectionView.snp.makeConstraints { + $0.top.equalTo(editButton.snp.bottom) + $0.leading.bottom.trailing.equalToSuperview() } - emptyView.snp.makeConstraints { make in - make.center.equalToSuperview() - make.leading.trailing.equalToSuperview().inset(80) + + emptyView.snp.makeConstraints { + $0.center.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(80) } } } @@ -191,19 +195,19 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return courseList.count } - + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, for: indexPath) as? CourseListCVC else { return UICollectionViewCell() } - + let model = courseList[indexPath.item] let cellTitle = model.title cell.setCellType(type: .title) cell.selectCell(didSelect: collectionView.indexPathsForSelectedItems?.contains(indexPath) ?? false) cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, isEditMode: isEditMode) - + return cell } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift index d8e27823..e909a924 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/ScrapCourseListView.swift @@ -8,6 +8,9 @@ import UIKit import Combine +import SnapKit +import Then + protocol ScrapCourseListViewDelegate: AnyObject { func likeButtonTapped(wantsTolike: Bool, publicCourseId: Int) } @@ -91,14 +94,14 @@ extension ScrapCourseListView { self.addSubviews(courseListCollectionView) courseListCollectionView.addSubviews(emptyView) - courseListCollectionView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.bottom.trailing.equalToSuperview() + courseListCollectionView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.bottom.trailing.equalToSuperview() } - emptyView.snp.makeConstraints { make in - make.center.equalToSuperview() - make.leading.trailing.equalToSuperview().inset(80) + emptyView.snp.makeConstraints { + $0.center.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(80) } } } @@ -162,7 +165,7 @@ extension ScrapCourseListView: ListEmptyViewDelegate { } } -extension ScrapCourseListView: CourseListCVCDeleagte { +extension ScrapCourseListView: CourseListCVCDelegate { func likeButtonTapped(wantsTolike: Bool, index: Int) { let publicCourseId = courseList[index].publicCourseId delegate?.likeButtonTapped(wantsTolike: wantsTolike, publicCourseId: publicCourseId) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift index 53c9057b..107c8aad 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift @@ -207,10 +207,10 @@ extension ActivityRecordDetailVC { self.navibar.isHidden = false - middleScorollView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalTo(view.safeAreaLayoutGuide) + middleScorollView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalTo(view.safeAreaLayoutGuide) } } @@ -344,61 +344,61 @@ extension ActivityRecordDetailVC { view.addSubview(navibar) view.addSubview(moreButton) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } - moreButton.snp.makeConstraints { make in - make.trailing.equalTo(self.view.safeAreaLayoutGuide) - make.centerY.equalTo(navibar) + moreButton.snp.makeConstraints { + $0.trailing.equalTo(self.view.safeAreaLayoutGuide) + $0.centerY.equalTo(navibar) } } private func setLayout() { view.addSubviews(middleScorollView) - middleScorollView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalTo(view.safeAreaLayoutGuide) + middleScorollView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalTo(view.safeAreaLayoutGuide) } middleScorollView.addSubviews(mapImageView, courseTitleLabel, firstHorizontalDivideLine, recordInfoStackView, secondHorizontalDivideLine) - mapImageView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(middleScorollView.snp.width).multipliedBy(1.13) + mapImageView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(middleScorollView.snp.width).multipliedBy(1.13) } - courseTitleLabel.snp.makeConstraints { make in - make.top.equalTo(mapImageView.snp.bottom).offset(31) - make.leading.equalTo(view.safeAreaLayoutGuide).offset(16) + courseTitleLabel.snp.makeConstraints { + $0.top.equalTo(mapImageView.snp.bottom).offset(31) + $0.leading.equalTo(view.safeAreaLayoutGuide).offset(16) } - firstHorizontalDivideLine.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(2) - make.top.equalTo(courseTitleLabel.snp.bottom).offset(7) + firstHorizontalDivideLine.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(2) + $0.top.equalTo(courseTitleLabel.snp.bottom).offset(7) } - recordInfoStackView.snp.makeConstraints { make in - make.top.equalTo(firstHorizontalDivideLine.snp.bottom).offset(20) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + recordInfoStackView.snp.makeConstraints { + $0.top.equalTo(firstHorizontalDivideLine.snp.bottom).offset(20) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) } - firstVerticalDivideLine.snp.makeConstraints { make in - make.width.equalTo(1) + firstVerticalDivideLine.snp.makeConstraints { + $0.width.equalTo(1) } - secondVerticalDivideLine.snp.makeConstraints { make in - make.width.equalTo(1) + secondVerticalDivideLine.snp.makeConstraints { + $0.width.equalTo(1) } - secondHorizontalDivideLine.snp.makeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(7) - make.top.equalTo(recordInfoStackView.snp.bottom).offset(36) + secondHorizontalDivideLine.snp.makeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(7) + $0.top.equalTo(recordInfoStackView.snp.bottom).offset(36) } setRecordSubInfoStackView() @@ -411,32 +411,32 @@ extension ActivityRecordDetailVC { let containerViewWidth = screenWidth - 32 let stackViewWidth = Int(containerViewWidth - 2) / 3 - recordDistanceStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + recordDistanceStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - recordRunningTimeStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + recordRunningTimeStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - recordAveragePaceStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + recordAveragePaceStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - recordSubInfoStackView.snp.makeConstraints { make in - make.top.equalTo(secondHorizontalDivideLine.snp.bottom).offset(23) - make.centerX.equalToSuperview() - make.bottom.equalToSuperview().inset(30) + recordSubInfoStackView.snp.makeConstraints { + $0.top.equalTo(secondHorizontalDivideLine.snp.bottom).offset(23) + $0.centerX.equalToSuperview() + $0.bottom.equalToSuperview().inset(30) } } private func setEditMode() { self.navibar.isHidden = false // true - mapImageView.snp.remakeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(middleScorollView.snp.width) + mapImageView.snp.remakeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(middleScorollView.snp.width) } self.courseTitleLabel.isHidden = true @@ -445,43 +445,43 @@ extension ActivityRecordDetailVC { middleScorollView.addSubview(courseTitleTextField) - courseTitleTextField.snp.makeConstraints { make in - make.top.equalTo(mapImageView.snp.bottom).offset(27) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(35) + courseTitleTextField.snp.makeConstraints { + $0.top.equalTo(mapImageView.snp.bottom).offset(27) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(35) } self.finishEditButton.isHidden = false - firstHorizontalDivideLine.snp.remakeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.height.equalTo(2) - make.top.equalTo(courseTitleTextField.snp.bottom).offset(5) + firstHorizontalDivideLine.snp.remakeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.height.equalTo(2) + $0.top.equalTo(courseTitleTextField.snp.bottom).offset(5) } - recordInfoStackView.snp.makeConstraints { make in - make.top.equalTo(firstHorizontalDivideLine.snp.bottom).offset(20) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + recordInfoStackView.snp.makeConstraints { + $0.top.equalTo(firstHorizontalDivideLine.snp.bottom).offset(20) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) } - secondHorizontalDivideLine.snp.remakeConstraints { make in - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(7) - make.top.equalTo(recordInfoStackView.snp.bottom).offset(24) + secondHorizontalDivideLine.snp.remakeConstraints { + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(7) + $0.top.equalTo(recordInfoStackView.snp.bottom).offset(24) } - recordSubInfoStackView.snp.remakeConstraints { make in - make.top.equalTo(secondHorizontalDivideLine.snp.bottom).offset(22) - make.centerX.equalToSuperview() + recordSubInfoStackView.snp.remakeConstraints { + $0.top.equalTo(secondHorizontalDivideLine.snp.bottom).offset(22) + $0.centerX.equalToSuperview() } middleScorollView.addSubview(finishEditButton) - finishEditButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().inset(30) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) - make.top.equalTo(recordSubInfoStackView.snp.bottom).offset(50) - make.height.equalTo(44) + finishEditButton.snp.makeConstraints { + $0.bottom.equalToSuperview().inset(30) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + $0.top.equalTo(recordSubInfoStackView.snp.bottom).offset(50) + $0.height.equalTo(44) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift index a642dd24..d68f13f2 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift @@ -59,7 +59,7 @@ final class ActivityRecordInfoTVC: UITableViewCell { private lazy var activityRecordTotalDistanceLabel = SetInfoLayout.makeGreySmailTitleLabel().then { $0.text = "총 거리" } - + private lazy var activityRecordRunningTimeLabel = SetInfoLayout.makeGreySmailTitleLabel().then { $0.text = "이동 시간" } @@ -189,10 +189,10 @@ extension ActivityRecordInfoTVC { func setLayout() { addSubview(activityRecordContainerView) - activityRecordContainerView.snp.makeConstraints { make in - make.top.equalToSuperview() - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(177) + activityRecordContainerView.snp.makeConstraints { + $0.top.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(177) } activityRecordContainerView.addSubviews( @@ -202,30 +202,30 @@ extension ActivityRecordInfoTVC { activityRecordSubInfoStackView ) - activityRecordMapImage.snp.makeConstraints { make in - make.top.equalToSuperview().offset(13) - make.leading.equalToSuperview().offset(20) - make.width.equalTo(86) - make.height.equalTo(85) + activityRecordMapImage.snp.makeConstraints { + $0.top.equalToSuperview().offset(13) + $0.leading.equalToSuperview().offset(20) + $0.width.equalTo(86) + $0.height.equalTo(85) } - activityRecordMainInfoStackView.snp.makeConstraints { make in - make.centerY.equalTo(activityRecordMapImage.snp.centerY) - make.leading.equalTo(activityRecordMapImage.snp.trailing).offset(14) + activityRecordMainInfoStackView.snp.makeConstraints { + $0.centerY.equalTo(activityRecordMapImage.snp.centerY) + $0.leading.equalTo(activityRecordMapImage.snp.trailing).offset(14) } - horizontalDivideLine.snp.makeConstraints { make in - make.top.equalTo(activityRecordMapImage.snp.bottom).offset(8) - make.leading.trailing.equalToSuperview().inset(20) - make.height.equalTo(1) + horizontalDivideLine.snp.makeConstraints { + $0.top.equalTo(activityRecordMapImage.snp.bottom).offset(8) + $0.leading.trailing.equalToSuperview().inset(20) + $0.height.equalTo(1) } - firstVerticalDivideLine.snp.makeConstraints { make in - make.width.equalTo(1) + firstVerticalDivideLine.snp.makeConstraints { + $0.width.equalTo(1) } - secondVerticalDivideLine.snp.makeConstraints { make in - make.width.equalTo(1) + secondVerticalDivideLine.snp.makeConstraints { + $0.width.equalTo(1) } setActivityRecordSubInfoStackView() @@ -236,21 +236,21 @@ extension ActivityRecordInfoTVC { let containerViewWidth = screenWidth - 32 let stackViewWidth = Int(containerViewWidth - 2) / 3 - activityRecordTotalDistanceStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + activityRecordTotalDistanceStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - - activityRecordRunningTimeStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + + activityRecordRunningTimeStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - - activityRecordAveragePaceStackView.snp.makeConstraints { make in - make.width.equalTo(stackViewWidth) + + activityRecordAveragePaceStackView.snp.makeConstraints { + $0.width.equalTo(stackViewWidth) } - - activityRecordSubInfoStackView.snp.makeConstraints { make in - make.top.equalTo(horizontalDivideLine.snp.bottom).offset(15) - make.centerX.equalToSuperview() + + activityRecordSubInfoStackView.snp.makeConstraints { + $0.top.equalTo(horizontalDivideLine.snp.bottom).offset(15) + $0.centerX.equalToSuperview() } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift index 90afa4ea..cb9488f4 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift @@ -20,7 +20,7 @@ final class ActivityRecordInfoVC: UIViewController { private var activityRecordList = [ActivityRecord]() private var deleteRecordList = [Int]() - + private var isEditMode: Bool = false // MARK: - UI Components @@ -50,8 +50,8 @@ final class ActivityRecordInfoVC: UIViewController { $0.titleLabel?.font = .b5 $0.layer.backgroundColor = UIColor.m3.cgColor $0.layer.cornerRadius = 11 -// $0.layer.borderColor = UIColor.m1.cgColor -// $0.layer.borderWidth = 1 + // $0.layer.borderColor = UIColor.m1.cgColor + // $0.layer.borderWidth = 1 } private lazy var deleteRecordButton = CustomButton(title: "삭제하기").then { @@ -173,9 +173,9 @@ extension ActivityRecordInfoVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } @@ -189,42 +189,42 @@ extension ActivityRecordInfoVC { view.addSubviews(editRecordContainerView, activityRecordTableView, deleteRecordButton) activityRecordTableView.addSubviews(emptyView) - editRecordContainerView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalToSuperview() - make.height.equalTo(38) + editRecordContainerView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(38) } editRecordContainerView.addSubviews(totalNumOfRecordlabel, editButton) - totalNumOfRecordlabel.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(16) - make.top.equalToSuperview().offset(10) + totalNumOfRecordlabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(16) + $0.top.equalToSuperview().offset(10) } - editButton.snp.makeConstraints { make in - make.trailing.equalToSuperview().inset(16) - make.width.equalTo(47) - make.height.equalTo(22) - make.top.equalToSuperview().offset(5) + editButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(16) + $0.width.equalTo(47) + $0.height.equalTo(22) + $0.top.equalToSuperview().offset(5) } - activityRecordTableView.snp.makeConstraints { make in - make.top.equalTo(editRecordContainerView.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalToSuperview() + activityRecordTableView.snp.makeConstraints { + $0.top.equalTo(editRecordContainerView.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalToSuperview() } - deleteRecordButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().inset(32) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(44) + deleteRecordButton.snp.makeConstraints { + $0.bottom.equalToSuperview().inset(32) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(44) } - emptyView.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.centerY.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalToSuperview().inset(80) + emptyView.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.centerY.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview().inset(80) } } } @@ -239,7 +239,7 @@ extension ActivityRecordInfoVC: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { guard let cell = tableView.cellForRow(at: indexPath) as? ActivityRecordInfoTVC else { return } guard let selectedRecords = tableView.indexPathsForSelectedRows else { return } - + if isEditMode { self.deleteRecordButton.isEnabled = true let countSelectedRows = selectedRecords.count diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift index 0e6180d8..06421799 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift @@ -55,14 +55,14 @@ extension GoalRewardInfoCVC { private func setLayout() { contentView.addSubviews(stampImageView, stampStandardLabel) - stampImageView.snp.makeConstraints { make in - make.top.leading.trailing.equalToSuperview() - make.height.equalTo(contentView.snp.width) + stampImageView.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + $0.height.equalTo(contentView.snp.width) } - stampStandardLabel.snp.makeConstraints { make in - make.top.equalTo(stampImageView.snp.bottom).offset(8) - make.centerX.equalToSuperview() + stampStandardLabel.snp.makeConstraints { + $0.top.equalTo(stampImageView.snp.bottom).offset(8) + $0.centerX.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift index 686d50fe..1229ac9a 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift @@ -51,17 +51,17 @@ extension GoalRewardTitleCVC { private func setLayout() { contentView.addSubviews(stampImage, stampExcourageLabel) - stampImage.snp.makeConstraints { make in - make.top.equalToSuperview().inset(18) - make.centerX.equalToSuperview() - make.width.equalTo(139) - make.height.equalTo(126) + stampImage.snp.makeConstraints { + $0.top.equalToSuperview().inset(18) + $0.centerX.equalToSuperview() + $0.width.equalTo(139) + $0.height.equalTo(126) } - stampExcourageLabel.snp.makeConstraints { make in - make.top.equalTo(stampImage.snp.bottom).offset(32) - make.centerX.equalToSuperview() - make.bottom.equalToSuperview().inset(37) + stampExcourageLabel.snp.makeConstraints { + $0.top.equalTo(stampImage.snp.bottom).offset(32) + $0.centerX.equalToSuperview() + $0.bottom.equalToSuperview().inset(37) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift index 91136998..28c72b41 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift @@ -35,7 +35,7 @@ final class GoalRewardInfoVC: UIViewController { // MARK: - UI Components private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("목표 보상") - + private lazy var stampCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical @@ -68,7 +68,7 @@ extension GoalRewardInfoVC { stampCollectionView.delegate = self stampCollectionView.dataSource = self } - + private func register() { stampCollectionView.register(GoalRewardInfoCVC.self, forCellWithReuseIdentifier: GoalRewardInfoCVC.className) @@ -94,9 +94,9 @@ extension GoalRewardInfoVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } @@ -108,10 +108,10 @@ extension GoalRewardInfoVC { private func setLayout() { view.addSubview(stampCollectionView) - stampCollectionView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.bottom.equalToSuperview() + stampCollectionView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.bottom.equalToSuperview() } } } @@ -140,7 +140,7 @@ extension GoalRewardInfoVC: UICollectionViewDelegateFlowLayout { if section == 0 { return 0 } return stampLineSpacing } - + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { if section == 0 { return .zero } return stampInset @@ -156,7 +156,7 @@ extension GoalRewardInfoVC: UICollectionViewDataSource { } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - + if indexPath.section == 0 { guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: GoalRewardTitleCVC.className, for: indexPath) as? GoalRewardTitleCVC else { return UICollectionViewCell()} return cell diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoCollectionView/UploadedCourseInfoCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoCollectionView/UploadedCourseInfoCVC.swift index 4e83bc61..027a43e2 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoCollectionView/UploadedCourseInfoCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoCollectionView/UploadedCourseInfoCVC.swift @@ -68,19 +68,19 @@ extension UploadedCourseInfoCVC { private func setLayout() { contentView.addSubviews(uploadedCourseMapImage, uploadedCourseTitleLabel, uploadedCoursePlaceLabel) - uploadedCourseMapImage.snp.makeConstraints { make in - make.top.leading.trailing.equalToSuperview() - make.height.equalTo(contentView.snp.width).multipliedBy(0.7) + uploadedCourseMapImage.snp.makeConstraints { + $0.top.leading.trailing.equalToSuperview() + $0.height.equalTo(contentView.snp.width).multipliedBy(0.7) } - uploadedCourseTitleLabel.snp.makeConstraints { make in - make.top.equalTo(uploadedCourseMapImage.snp.bottom).offset(7) - make.leading.equalToSuperview() + uploadedCourseTitleLabel.snp.makeConstraints { + $0.top.equalTo(uploadedCourseMapImage.snp.bottom).offset(7) + $0.leading.equalToSuperview() } - uploadedCoursePlaceLabel.snp.makeConstraints { make in - make.top.equalTo(uploadedCourseTitleLabel.snp.bottom).offset(5) - make.leading.equalToSuperview() + uploadedCoursePlaceLabel.snp.makeConstraints { + $0.top.equalTo(uploadedCourseTitleLabel.snp.bottom).offset(5) + $0.leading.equalToSuperview() } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index 80ded91c..d02ee430 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -193,9 +193,9 @@ extension UploadedCourseInfoVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(48) } } @@ -212,38 +212,40 @@ extension UploadedCourseInfoVC { UploadedCourseInfoCollectionView.addSubview(emptyView) beforeEditTopView.addSubviews(totalNumOfRecordlabel, editButton) - beforeEditTopView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalToSuperview() - make.height.equalTo(38) + + beforeEditTopView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(38) } - totalNumOfRecordlabel.snp.makeConstraints { make in - make.leading.equalToSuperview().inset(16) - make.top.equalToSuperview().offset(10) + totalNumOfRecordlabel.snp.makeConstraints { + $0.leading.equalToSuperview().inset(16) + $0.top.equalToSuperview().offset(10) } - editButton.snp.makeConstraints { make in - make.trailing.equalToSuperview().inset(16) - make.width.equalTo(47) - make.height.equalTo(22) - make.top.equalToSuperview().offset(5) + editButton.snp.makeConstraints { + $0.trailing.equalToSuperview().inset(16) + $0.width.equalTo(47) + $0.height.equalTo(22) + $0.top.equalToSuperview().offset(5) } - deleteCourseButton.snp.makeConstraints { make in - make.bottom.equalToSuperview().inset(32) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(44) + deleteCourseButton.snp.makeConstraints { + $0.bottom.equalToSuperview().inset(32) + $0.leading.trailing.equalToSuperview().inset(16) + $0.height.equalTo(44) } - UploadedCourseInfoCollectionView.snp.makeConstraints { make in - make.top.equalTo(editButton.snp.bottom) - make.leading.bottom.trailing.equalToSuperview() + UploadedCourseInfoCollectionView.snp.makeConstraints { + $0.top.equalTo(editButton.snp.bottom) + $0.leading.bottom.trailing.equalToSuperview() } - emptyView.snp.makeConstraints { make in - make.centerX.equalToSuperview() - make.centerY.equalTo(view.safeAreaLayoutGuide) - make.leading.trailing.equalToSuperview().inset(80) + + emptyView.snp.makeConstraints { + $0.centerX.equalToSuperview() + $0.centerY.equalTo(view.safeAreaLayoutGuide) + $0.leading.trailing.equalToSuperview().inset(80) } } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift index 76e3b305..41d99a07 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift @@ -150,21 +150,21 @@ extension MyPageVC { containerView.addSubviews(icStar, label, icArrowRight) - icStar.snp.makeConstraints { make in - make.top.equalToSuperview().offset(22) - make.leading.equalToSuperview().offset(17) - make.width.equalTo(14) - make.height.equalTo(14) + icStar.snp.makeConstraints { + $0.top.equalToSuperview().offset(22) + $0.leading.equalToSuperview().offset(17) + $0.width.equalTo(14) + $0.height.equalTo(14) } - label.snp.makeConstraints { make in - make.top.equalToSuperview().offset(21) - make.leading.equalTo(icStar.snp.trailing).offset(8) + label.snp.makeConstraints { + $0.top.equalToSuperview().offset(21) + $0.leading.equalTo(icStar.snp.trailing).offset(8) } - icArrowRight.snp.makeConstraints { make in - make.top.equalToSuperview().offset(18) - make.trailing.equalToSuperview().inset(10) + icArrowRight.snp.makeConstraints { + $0.top.equalToSuperview().offset(18) + $0.trailing.equalToSuperview().inset(10) } return containerView @@ -272,9 +272,9 @@ extension MyPageVC { private func setNavigationBar() { view.addSubview(navibar) - navibar.snp.makeConstraints { make in - make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) - make.height.equalTo(48) + navibar.snp.makeConstraints { + $0.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + $0.height.equalTo(56) } } @@ -301,10 +301,10 @@ extension MyPageVC { activityRecordInfoView, secondDivideView, goalRewardInfoView, thirdDivideView, uploadedCourseInfoView, fourthDivideView, settingView, fifthDivideView, kakaoChannelAsk) - myProfileView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom).offset(6) - make.leading.trailing.equalToSuperview() - make.height.equalTo(84) + myProfileView.snp.makeConstraints { + $0.top.equalTo(navibar.snp.bottom).offset(6) + $0.leading.trailing.equalToSuperview() + $0.height.equalTo(84) } setMyProfileLayout() diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift index b166da60..0c7e7784 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift @@ -30,7 +30,7 @@ final class NicknameEditorVC: UIViewController { // MARK: - UI Components private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("닉네임 수정") - + private lazy var nickNameTextField = UITextField().then { $0.resignFirstResponder() $0.text = self.currentNickname @@ -64,7 +64,7 @@ final class NicknameEditorVC: UIViewController { } // MARK: - View Life Cycle - + override func viewDidLoad() { super.viewDidLoad() nickNameTextField.delegate = self @@ -114,7 +114,7 @@ extension NicknameEditorVC { @objc private func textFieldTextDidChange() { guard let text = nickNameTextField.text else { return } - + if text.count > nicknameMaxLength { let index = text.index(text.startIndex, offsetBy: nicknameMaxLength) let newString = text[text.startIndex..