From 827d8a3ca2bed71af0fcc2cd6d50434afbf56292 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 10 Oct 2017 23:56:39 +0300 Subject: [PATCH] Update for review --- LeadKit.podspec | 6 +++--- LeadKit.xcodeproj/project.pbxproj | 12 ++++++------ .../Views/SeparatorCell/SeparatorCellViewModel.swift | 5 +++++ ...s.swift => Array+AnyBaseTableRowExtensions.swift} | 0 .../TableDirector/TableRow+Extensions.swift | 7 ++++++- 5 files changed, 20 insertions(+), 10 deletions(-) rename Sources/Extensions/Array/{Array+AnyBaseTableRow+Extensions.swift => Array+AnyBaseTableRowExtensions.swift} (100%) diff --git a/LeadKit.podspec b/LeadKit.podspec index c3c8e6fa..d282fe81 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -54,7 +54,7 @@ Pod::Spec.new do |s| "Sources/Extensions/StoryboardProtocol/*", "Sources/Extensions/Support/UIScrollView+Support.swift", "Sources/Extensions/TableDirector/*", - "Sources/Extensions/Array/Array+AnyBaseTableRow+Extensions.swift", + "Sources/Extensions/Array/Array+AnyBaseTableRowExtensions.swift", "Sources/Extensions/UIActivityIndicatorView/*", "Sources/Extensions/UIAlertcontroller/*", "Sources/Extensions/UICollectionView/*", @@ -81,7 +81,7 @@ Pod::Spec.new do |s| "Sources/Extensions/PaginationTableViewWrapperDelegate/PaginationTableViewWrapperDelegate+DefaultImplementation.swift", "Sources/Extensions/Support/UIScrollView+Support.swift", "Sources/Extensions/TableDirector/*", - "Sources/Extensions/Array/Array+AnyBaseTableRow+Extensions.swift" + "Sources/Extensions/Array/Array+AnyBaseTableRowExtensions.swift" ] ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' @@ -107,7 +107,7 @@ Pod::Spec.new do |s| "Sources/Extensions/NetworkService/NetworkService+ActivityIndicator.swift", "Sources/Extensions/PaginationTableViewWrapperDelegate/PaginationTableViewWrapperDelegate+DefaultImplementation.swift", "Sources/Extensions/TableDirector/*", - "Sources/Extensions/Array/Array+AnyBaseTableRow+Extensions.swift" + "Sources/Extensions/Array/Array+AnyBaseTableRowExtensions.swift" ] ss.dependency "CocoaLumberjack/Swift", '~> 3.1.0' diff --git a/LeadKit.xcodeproj/project.pbxproj b/LeadKit.xcodeproj/project.pbxproj index fd941c61..ed16ed59 100644 --- a/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit.xcodeproj/project.pbxproj @@ -386,8 +386,8 @@ 82F8BB181F5DDED100C1061B /* Single+DeferredJust.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82F8BB171F5DDED100C1061B /* Single+DeferredJust.swift */; }; A658E54D1F8CD7790093527A /* TableRow+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54C1F8CD7790093527A /* TableRow+Extensions.swift */; }; A658E54E1F8CD7790093527A /* TableRow+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54C1F8CD7790093527A /* TableRow+Extensions.swift */; }; - A658E5501F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54F1F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift */; }; - A658E5511F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54F1F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift */; }; + A658E5501F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54F1F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift */; }; + A658E5511F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A658E54F1F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift */; }; A6C9A4FA1F8BBCF2009311CC /* EmptyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6AF3B371F8B956F00CDB971 /* EmptyCell.swift */; }; A6C9A4FB1F8BBCF2009311CC /* EmptyCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6AF3B361F8B956E00CDB971 /* EmptyCellViewModel.swift */; }; A6C9A5041F8BC78F009311CC /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0DDEE1F8A6C57002CA74E /* CellSeparatorType.swift */; }; @@ -601,7 +601,7 @@ 95E457F1241D136396FC2420 /* Pods_LeadKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LeadKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9966FB938D114F79F71AE037 /* Pods-LeadKit-LeadKit iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LeadKit-LeadKit iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-LeadKit-LeadKit iOS/Pods-LeadKit-LeadKit iOS.release.xcconfig"; sourceTree = ""; }; A658E54C1F8CD7790093527A /* TableRow+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TableRow+Extensions.swift"; sourceTree = ""; }; - A658E54F1F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+AnyBaseTableRow+Extensions.swift"; sourceTree = ""; }; + A658E54F1F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+AnyBaseTableRowExtensions.swift"; sourceTree = ""; }; A66428A51F8A653500C6308D /* SeparatorCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeparatorCellViewModel.swift; sourceTree = ""; }; A66428A61F8A653600C6308D /* SeparatorCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeparatorCell.swift; sourceTree = ""; }; A66428A71F8A654600C6308D /* EmptyCellRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyCellRow.swift; sourceTree = ""; }; @@ -1368,7 +1368,7 @@ isa = PBXGroup; children = ( EFBE57CF1EC35EF20040E00A /* Array+Extensions.swift */, - A658E54F1F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift */, + A658E54F1F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift */, ); path = Array; sourceTree = ""; @@ -2154,7 +2154,7 @@ 671463041EB3396E00EAB194 /* UIView+LoadingIndicator.swift in Sources */, EFBE57D61EC3603E0040E00A /* UIAlertController+Extensions.swift in Sources */, 671463701EB3396E00EAB194 /* ApiRequestParameters.swift in Sources */, - A658E5501F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift in Sources */, + A658E5501F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift in Sources */, 671462EC1EB3396E00EAB194 /* UIImage+Extensions.swift in Sources */, A6E0DDF11F8A6C80002CA74E /* SeparatorConfiguration.swift in Sources */, 6714636C1EB3396E00EAB194 /* XibNameProtocol.swift in Sources */, @@ -2220,7 +2220,7 @@ 671463B81EB34B1E00EAB194 /* StubCursor.swift in Sources */, A658E54E1F8CD7790093527A /* TableRow+Extensions.swift in Sources */, A6E0DDE41F8A696F002CA74E /* SeparatorCellViewModel.swift in Sources */, - A658E5511F8CD9350093527A /* Array+AnyBaseTableRow+Extensions.swift in Sources */, + A658E5511F8CD9350093527A /* Array+AnyBaseTableRowExtensions.swift in Sources */, 671463BB1EB34B1E00EAB194 /* CursorTests.swift in Sources */, A6F32C101F6EBE9600AC08EE /* StringExtensionTests.swift in Sources */, 671463C11EB34B1E00EAB194 /* MappableUserDefaultsTests.swift in Sources */, diff --git a/Sources/Classes/Views/SeparatorCell/SeparatorCellViewModel.swift b/Sources/Classes/Views/SeparatorCell/SeparatorCellViewModel.swift index ded62dcd..a109f002 100644 --- a/Sources/Classes/Views/SeparatorCell/SeparatorCellViewModel.swift +++ b/Sources/Classes/Views/SeparatorCell/SeparatorCellViewModel.swift @@ -41,6 +41,11 @@ open class SeparatorCellViewModel { public extension SeparatorCellViewModel { + func with(separatorType: CellSeparatorType) -> Self { + set(separatorType: separatorType) + return self + } + func set(separatorType: CellSeparatorType) { self.separatorType = separatorType diff --git a/Sources/Extensions/Array/Array+AnyBaseTableRow+Extensions.swift b/Sources/Extensions/Array/Array+AnyBaseTableRowExtensions.swift similarity index 100% rename from Sources/Extensions/Array/Array+AnyBaseTableRow+Extensions.swift rename to Sources/Extensions/Array/Array+AnyBaseTableRowExtensions.swift diff --git a/Sources/Extensions/TableDirector/TableRow+Extensions.swift b/Sources/Extensions/TableDirector/TableRow+Extensions.swift index 35c157d2..3ee4f421 100644 --- a/Sources/Extensions/TableDirector/TableRow+Extensions.swift +++ b/Sources/Extensions/TableDirector/TableRow+Extensions.swift @@ -24,7 +24,12 @@ import TableKit public extension TableRow where CellType.T: SeparatorCellViewModel { - func with(separatorType: CellSeparatorType) { + func with(separatorType: CellSeparatorType) -> Self { + item.set(separatorType: separatorType) + return self + } + + func set(separatorType: CellSeparatorType) { item.set(separatorType: separatorType) }