Skip to content

Commit

Permalink
cell 생성 영역 단순화 시키기
Browse files Browse the repository at this point in the history
  • Loading branch information
MojitoBar committed Jan 3, 2024
1 parent 60f242d commit 45cc5c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
10 changes: 7 additions & 3 deletions pins.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
B72EDCA22B2B071C00080328 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = B72EDCA12B2B071C00080328 /* GoogleSignIn */; };
B72EDCA42B2B0A4000080328 /* KeyboardAnimationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B72EDCA32B2B0A4000080328 /* KeyboardAnimationManager.swift */; };
B742C5782AEA5EE900E95E96 /* CreateViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B742C5772AEA5EE900E95E96 /* CreateViewModel.swift */; };
B749AED82B3831CB00633BB1 /* AnnotationIdentifying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AED72B3831CB00633BB1 /* AnnotationIdentifying.swift */; };
B749AEDA2B38391E00633BB1 /* SettingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AED92B38391E00633BB1 /* SettingViewModel.swift */; };
B749AEDF2B383EA500633BB1 /* SettingItemHandling.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AEDE2B383EA500633BB1 /* SettingItemHandling.swift */; };
B749AEE12B383ECC00633BB1 /* LogoutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AEE02B383ECC00633BB1 /* LogoutItem.swift */; };
B749AEE32B38509A00633BB1 /* DiskCacheItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AEE22B38509A00633BB1 /* DiskCacheItem.swift */; };
B749AEE52B38527300633BB1 /* ConfirmManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AEE42B38527300633BB1 /* ConfirmManager.swift */; };
B749AEE72B38636000633BB1 /* DiskCacheManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AEE62B38636000633BB1 /* DiskCacheManager.swift */; };
B749AED82B3831CB00633BB1 /* AnnotationIdentifying.swift in Sources */ = {isa = PBXBuildFile; fileRef = B749AED72B3831CB00633BB1 /* AnnotationIdentifying.swift */; };
B74A4FC12AE78BAE00226EA7 /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B74A4FC02AE78BAE00226EA7 /* SearchViewController.swift */; };
B74A4FC32AE78BE700226EA7 /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B74A4FC22AE78BE700226EA7 /* SearchView.swift */; };
B74A4FC52AE7905500226EA7 /* CreateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B74A4FC42AE7905500226EA7 /* CreateViewController.swift */; };
Expand Down Expand Up @@ -105,6 +105,7 @@
B7E1AF472B3466FE008A638D /* UIColor+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */; };
B7E8A4702AEB84420026931D /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = B7E8A46F2AEB84420026931D /* FirebaseAnalytics */; };
B7E8A4722AEB84420026931D /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = B7E8A4712AEB84420026931D /* FirebaseCrashlytics */; };
B7EC21B12B456EC5008F80F7 /* UITableView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7EC21B02B456EC5008F80F7 /* UITableView+Extensions.swift */; };
B7ECD4502B3059E60085C809 /* PinClusterAnnotationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7ECD44F2B3059E60085C809 /* PinClusterAnnotationView.swift */; };
B7F071B72B14855000BB5AB9 /* DetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7F071B62B14855000BB5AB9 /* DetailViewModel.swift */; };
B7F071B92B14876C00BB5AB9 /* PinResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7F071B82B14876C00BB5AB9 /* PinResponse.swift */; };
Expand Down Expand Up @@ -149,13 +150,13 @@
B724F9312AFCBE7A00722CE1 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
B72EDCA32B2B0A4000080328 /* KeyboardAnimationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardAnimationManager.swift; sourceTree = "<group>"; };
B742C5772AEA5EE900E95E96 /* CreateViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateViewModel.swift; sourceTree = "<group>"; };
B749AED72B3831CB00633BB1 /* AnnotationIdentifying.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnotationIdentifying.swift; sourceTree = "<group>"; };
B749AED92B38391E00633BB1 /* SettingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewModel.swift; sourceTree = "<group>"; };
B749AEDE2B383EA500633BB1 /* SettingItemHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingItemHandling.swift; sourceTree = "<group>"; };
B749AEE02B383ECC00633BB1 /* LogoutItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutItem.swift; sourceTree = "<group>"; };
B749AEE22B38509A00633BB1 /* DiskCacheItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiskCacheItem.swift; sourceTree = "<group>"; };
B749AEE42B38527300633BB1 /* ConfirmManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfirmManager.swift; sourceTree = "<group>"; };
B749AEE62B38636000633BB1 /* DiskCacheManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiskCacheManager.swift; sourceTree = "<group>"; };
B749AED72B3831CB00633BB1 /* AnnotationIdentifying.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnotationIdentifying.swift; sourceTree = "<group>"; };
B74A4FC02AE78BAE00226EA7 /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = "<group>"; };
B74A4FC22AE78BE700226EA7 /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = "<group>"; };
B74A4FC42AE7905500226EA7 /* CreateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateViewController.swift; sourceTree = "<group>"; };
Expand All @@ -166,10 +167,10 @@
B7631C732B2DCCBD00B111AA /* DetailViewSnapshotTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewSnapshotTest.swift; sourceTree = "<group>"; };
B76DD4612AFE0DB000DFE7E1 /* FirestorageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirestorageService.swift; sourceTree = "<group>"; };
B76DD4652AFE238F00DFE7E1 /* LoadingIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingIndicator.swift; sourceTree = "<group>"; };
B76EEA9D2B35F06E00D349EA /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
B7704A232B3313A900E310AC /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = "<group>"; };
B7704A252B3313EB00E310AC /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
B7704A272B33193100E310AC /* SettingViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewCell.swift; sourceTree = "<group>"; };
B76EEA9D2B35F06E00D349EA /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
B7781B2F2B0F47C8006372CF /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = "<group>"; };
B7781B322B0F4D4B006372CF /* PinAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinAnnotationView.swift; sourceTree = "<group>"; };
B7781B342B0F4F91006372CF /* PinAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinAnnotation.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -223,6 +224,7 @@
B7E1AF422B346328008A638D /* ColorAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorAssets.swift; sourceTree = "<group>"; };
B7E1AF442B346380008A638D /* ImageAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageAssets.swift; sourceTree = "<group>"; };
B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extensions.swift"; sourceTree = "<group>"; };
B7EC21B02B456EC5008F80F7 /* UITableView+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITableView+Extensions.swift"; sourceTree = "<group>"; };
B7ECD44F2B3059E60085C809 /* PinClusterAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinClusterAnnotationView.swift; sourceTree = "<group>"; };
B7F071B62B14855000BB5AB9 /* DetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewModel.swift; sourceTree = "<group>"; };
B7F071B82B14876C00BB5AB9 /* PinResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinResponse.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -267,6 +269,7 @@
B70BBA522B1703C700F0F9A6 /* UIImage+Extensions.swift */,
B7194A452B1B573800642FDA /* CALayer+Extensions.swift */,
B7E1AF462B3466FE008A638D /* UIColor+Extensions.swift */,
B7EC21B02B456EC5008F80F7 /* UITableView+Extensions.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -787,6 +790,7 @@
B7D051542B10AD2B00D86183 /* DetailCommentView.swift in Sources */,
B7D0514D2B10AC9C00D86183 /* UITextField+Extensions.swift in Sources */,
B74A4FC32AE78BE700226EA7 /* SearchView.swift in Sources */,
B7EC21B12B456EC5008F80F7 /* UITableView+Extensions.swift in Sources */,
B79A28F32AF37F93008FD3CE /* LoginViewController.swift in Sources */,
B78099432B06047400C01059 /* ImageInfo.swift in Sources */,
B71C387C2B0753BB0065A783 /* LoginUseCase.swift in Sources */,
Expand Down
17 changes: 17 additions & 0 deletions pins/Extension/UITableView+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UITableView+Extensions.swift
// pins
//
// Created by 주동석 on 1/3/24.
//

import UIKit

extension UITableView {
func dequeueReusableCell<T: UITableViewCell>(forIndexPath indexPath: IndexPath) -> T where T: ReuseIdentifying {
guard let cell = dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) as? T else {
fatalError("Could not dequeue cell with identifier: \(T.reuseIdentifier)")
}
return cell
}
}
4 changes: 2 additions & 2 deletions pins/Presentation/View/SettingView/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ final class SettingView: UIView {
private func configureDiffableDataSource() {
dataSource = SettingDataSource(tableView: tableView, cellProvider: { [weak self] tableView, indexPath, _ in
guard let self else { fatalError("self is nil") }
let cell = tableView.dequeueReusableCell(withIdentifier: SettingViewCell.reuseIdentifier, for: indexPath) as? SettingViewCell
cell?.setLabelText(self.viewModel.getTableStringData()[indexPath.row])
let cell = tableView.dequeueReusableCell(forIndexPath: indexPath) as SettingViewCell
cell.setLabelText(self.viewModel.getTableStringData()[indexPath.row])
return cell
})
}
Expand Down

0 comments on commit 45cc5c7

Please sign in to comment.