Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

리팩토링 (밀봉, 개봉, 홈, Capsule) #129

Merged
merged 8 commits into from
Dec 24, 2022
33 changes: 24 additions & 9 deletions SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
0D1331C7293842D300B2CD28 /* Address.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1331C6293842D300B2CD28 /* Address.swift */; };
0D219825294730A600B7401B /* ThemeButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D219824294730A600B7401B /* ThemeButton.swift */; };
0D21982729473A2700B7401B /* CapsuleThumbnailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D21982629473A2700B7401B /* CapsuleThumbnailView.swift */; };
0D46DEFA2923E1180045400A /* UIFont+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D46DEF92923E1180045400A /* UIFont+.swift */; };
0D4C11372927489D00B1C2B6 /* UIViewPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4C11362927489D00B1C2B6 /* UIViewPreview.swift */; };
0D4C11392927495900B1C2B6 /* UIViewControllerPreview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4C11382927495900B1C2B6 /* UIViewControllerPreview.swift */; };
Expand Down Expand Up @@ -45,6 +47,7 @@
0DB746AE292DF8F6005FF249 /* Capsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB746AD292DF8F6005FF249 /* Capsule.swift */; };
0DB746B4292E268A005FF249 /* Date+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB746B3292E268A005FF249 /* Date+.swift */; };
0DB88C712935E83600107DC3 /* AppDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB88C702935E83600107DC3 /* AppDataManager.swift */; };
0DC27FA0294B5F240019FD71 /* LockImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DC27F9F294B5F240019FD71 /* LockImageView.swift */; };
0DBD20A629519E3500C74F4F /* KingReceiver in Frameworks */ = {isa = PBXBuildFile; productRef = 0DBD20A529519E3500C74F4F /* KingReceiver */; };
0DCB22932924CE58002CB095 /* CustomTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCB22922924CE58002CB095 /* CustomTabBarController.swift */; };
0DCEED2D29320B28006EB2B4 /* UILabel+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DCEED2C29320B28006EB2B4 /* UILabel+.swift */; };
Expand Down Expand Up @@ -170,7 +173,7 @@
59D8CFB52935FDAC00FD9CF6 /* CarouselCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8CFB42935FDAC00FD9CF6 /* CarouselCollectionViewFlowLayout.swift */; };
59D8CFB8293609D100FD9CF6 /* HomeCapsuleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8CFB7293609D100FD9CF6 /* HomeCapsuleCell.swift */; };
59D8CFBA293609E000FD9CF6 /* HomeCapsuleCellItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8CFB9293609E000FD9CF6 /* HomeCapsuleCellItem.swift */; };
59D8CFBC29360A8900FD9CF6 /* ThemeThumbnailImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8CFBB29360A8900FD9CF6 /* ThemeThumbnailImageView.swift */; };
59D8CFBC29360A8900FD9CF6 /* ThumbnailImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59D8CFBB29360A8900FD9CF6 /* ThumbnailImageView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -192,6 +195,8 @@

/* Begin PBXFileReference section */
0D1331C6293842D300B2CD28 /* Address.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Address.swift; sourceTree = "<group>"; };
0D219824294730A600B7401B /* ThemeButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeButton.swift; sourceTree = "<group>"; };
0D21982629473A2700B7401B /* CapsuleThumbnailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleThumbnailView.swift; sourceTree = "<group>"; };
0D2B7AB92934594400CE34E3 /* running.gpx */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = running.gpx; sourceTree = "<group>"; };
0D46DEF92923E1180045400A /* UIFont+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+.swift"; sourceTree = "<group>"; };
0D4C11362927489D00B1C2B6 /* UIViewPreview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewPreview.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -231,6 +236,7 @@
0DB746AD292DF8F6005FF249 /* Capsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capsule.swift; sourceTree = "<group>"; };
0DB746B3292E268A005FF249 /* Date+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+.swift"; sourceTree = "<group>"; };
0DB88C702935E83600107DC3 /* AppDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDataManager.swift; sourceTree = "<group>"; };
0DC27F9F294B5F240019FD71 /* LockImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LockImageView.swift; sourceTree = "<group>"; };
0DCB22922924CE58002CB095 /* CustomTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTabBarController.swift; sourceTree = "<group>"; };
0DCEED2C29320B28006EB2B4 /* UILabel+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+.swift"; sourceTree = "<group>"; };
0DCEED2E29320EAB006EB2B4 /* CustomCodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCodable.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -349,7 +355,7 @@
59D8CFB42935FDAC00FD9CF6 /* CarouselCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarouselCollectionViewFlowLayout.swift; sourceTree = "<group>"; };
59D8CFB7293609D100FD9CF6 /* HomeCapsuleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCapsuleCell.swift; sourceTree = "<group>"; };
59D8CFB9293609E000FD9CF6 /* HomeCapsuleCellItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeCapsuleCellItem.swift; sourceTree = "<group>"; };
59D8CFBB29360A8900FD9CF6 /* ThemeThumbnailImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeThumbnailImageView.swift; sourceTree = "<group>"; };
59D8CFBB29360A8900FD9CF6 /* ThumbnailImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThumbnailImageView.swift; sourceTree = "<group>"; };
59F567F72923BE1E00F756B2 /* SpaceCapsule.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SpaceCapsule.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -391,13 +397,14 @@
0D46DEFC2923E4800045400A /* Components */ = {
isa = PBXGroup;
children = (
4A1D1BC52941F3C500F47ACB /* BlurEffectView.swift */,
0D21982629473A2700B7401B /* CapsuleThumbnailView.swift */,
0DA05E1C29308B8400B08FA5 /* CustomNavigationController.swift */,
0DD83D0E292F1BAD0020F15C /* CustomScrollView.swift */,
0DCB22922924CE58002CB095 /* CustomTabBarController.swift */,
0DFF50DE2940587600079FA6 /* RefreshButton.swift */,
0DFF50DC29402E3100079FA6 /* EmptyView.swift */,
0DD83D12292F51960020F15C /* LoadingIndicatorView.swift */,
4A1D1BC52941F3C500F47ACB /* BlurEffectView.swift */,
0DFF50DE2940587600079FA6 /* RefreshButton.swift */,
0D9A834C293788A300D00303 /* Map */,
0DCB22942924CE61002CB095 /* Theme */,
);
Expand Down Expand Up @@ -550,11 +557,12 @@
0DCB22942924CE61002CB095 /* Theme */ = {
isa = PBXGroup;
children = (
59D8CFBB29360A8900FD9CF6 /* ThemeThumbnailImageView.swift */,
2885A9FF293B6466003E5311 /* ProfileButton.swift */,
0D77D7C8292B5D490038D054 /* SelectButton.swift */,
0D219824294730A600B7401B /* ThemeButton.swift */,
0D9D672D292486780038F529 /* ThemeLabel.swift */,
0DA6610C292778BE00CF3563 /* ThemeTextField.swift */,
0D77D7C8292B5D490038D054 /* SelectButton.swift */,
2885A9FF293B6466003E5311 /* ProfileButton.swift */,
59D8CFBB29360A8900FD9CF6 /* ThumbnailImageView.swift */,
);
path = Theme;
sourceTree = "<group>";
Expand Down Expand Up @@ -588,6 +596,7 @@
2807BC0A292C658000288A5D /* ListCapsuleCell.swift */,
2800F979292F1F060069EE7F /* ListCapsuleCellItem.swift */,
28245561293B17B100DE03A1 /* UnOpenable.swift */,
0DC27F9F294B5F240019FD71 /* LockImageView.swift */,
28E68BDF294AB58C009D608E /* SortButton.swift */,
);
path = Components;
Expand Down Expand Up @@ -636,11 +645,11 @@
children = (
288A8E912923244D000229D2 /* Coordinator.swift */,
0DCEED2E29320EAB006EB2B4 /* CustomCodable.swift */,
4AA4C5B429473D8600171D0D /* MovableToCapsuleAccess.swift */,
0DD5C7C42938453300B23B69 /* Refreshable.swift */,
28049CEF292382BB002389BD /* View */,
28049CF0292382C7002389BD /* ViewController */,
28049CEE2923825A002389BD /* ViewModel */,
0DD5C7C42938453300B23B69 /* Refreshable.swift */,
4AA4C5B429473D8600171D0D /* MovableToCapsuleAccess.swift */,
);
path = Base;
sourceTree = "<group>";
Expand Down Expand Up @@ -1148,6 +1157,8 @@
0DF9D2A5293F1CB3001C05DE /* DetailImageView.swift in Sources */,
0DE786E1292BBDEC007EF260 /* DatePickerViewController.swift in Sources */,
4A1D1BC12940292A00F47ACB /* CapsuleSettingsViewModel.swift in Sources */,
599C1A4C292CC99A00517E93 /* ImageCacheFactory.swift in Sources */,
0DC27FA0294B5F240019FD71 /* LockImageView.swift in Sources */,
288A8E9B29235A6E000229D2 /* SignInView.swift in Sources */,
288A8ED529235C6F000229D2 /* CapsuleCreateViewController.swift in Sources */,
4AA4C5B72948729200171D0D /* Calendar+.swift in Sources */,
Expand Down Expand Up @@ -1196,6 +1207,8 @@
0DFF50DD29402E3100079FA6 /* EmptyView.swift in Sources */,
28A700D52938AE100049FAF8 /* AnimationResource.swift in Sources */,
288A8EE229235E3F000229D2 /* CapsuleLocateViewModel.swift in Sources */,
59D8CFBC29360A8900FD9CF6 /* ThumbnailImageView.swift in Sources */,
0D752DB32944A964004A704C /* UIImage+resize.swift in Sources */,
59D8CFBC29360A8900FD9CF6 /* ThemeThumbnailImageView.swift in Sources */,
0D4C11372927489D00B1C2B6 /* UIViewPreview.swift in Sources */,
288A8EB229235B5A000229D2 /* ProfileView.swift in Sources */,
Expand All @@ -1215,6 +1228,8 @@
0DFF50E3294067E600079FA6 /* UIControl+Rx.swift in Sources */,
288A8EA729235AF1000229D2 /* NicknameViewModel.swift in Sources */,
28245562293B17B100DE03A1 /* UnOpenable.swift in Sources */,
0D21982729473A2700B7401B /* CapsuleThumbnailView.swift in Sources */,
0D219825294730A600B7401B /* ThemeButton.swift in Sources */,
4A1D1BC3294033C200F47ACB /* CapsuleSettingsView.swift in Sources */,
288A8ECC29235BE9000229D2 /* HomeViewController.swift in Sources */,
0DA6610D292778BE00CF3563 /* ThemeTextField.swift in Sources */,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension CapsuleCellNeedable {

let capsuleCellItem = ListCapsuleCellItem(
uuid: capsule.uuid,
thumbnailImageURL: capsule.images.first,
thumbnailImageURL: capsule.images.first ?? "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옵셔널을 줄이서 없으시려는 효과가 있나요?
간단히 설명 부탁드려요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

원래 해당 프로퍼티가 optional 이었을때는 url 을 이용해 이미지를 그리는 부분에서 바인딩을 하고, nil 이면 아예 이미지를 그리지 않고 있었더라구요!

이미지를 그리는 경우에 url 을 구성할 string 이 유효하지 않다면 placeholder 이미지를 보여주기 때문에 굳이 바인딩하는 과정을 거칠 필요가 없다고 생각했습니다.

그래서 optional 을 View 로 넘기기보다는 만약 nil 이라면 차라리 빈 문자열을 넘겨서 유효한 url 이 되지 않게 하자! 라는 의도였습니당

address: capsule.simpleAddress,
closedDate: capsule.closedDate,
memoryDate: capsule.memoryDate,
Expand Down
4 changes: 2 additions & 2 deletions SpaceCapsule/SpaceCapsule/Components/BlurEffectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import UIKit

final class CapsuleBlurEffectView: UIVisualEffectView {
init() {
init(width: CGFloat) {
super.init(effect: UIBlurEffect(style: .systemUltraThinMaterialDark))
self.layer.cornerRadius = FrameResource.listCapsuleCellWidth / 2
self.layer.cornerRadius = width / 2
self.clipsToBounds = true
}

Expand Down
Loading