diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b16dd89..fd074de7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 0.7.5 +- **Add**: `topConfiguration` and `bottomConfiguration` properties, methods to configure top and bottom separators in `CellSeparatorType` extension. +- **Add**: `totalHeight` property in `SeparatorConfiguration` extension. + ### 0.7.4 - **Update**: Exclude UIApplication extensions from iOS-Extension subspec. @@ -16,7 +20,6 @@ - **Fixed**: Change root controller for window - ### 0.7.1 - **Add**: Extension for comparing optional arrays (`[T]?`) with `Equatable` elements. - **Add**: `additionalHttpHeaders` static field in `ConfigurableNetworkService` protocol. diff --git a/LeadKit.podspec b/LeadKit.podspec index c1e458ea..3767a185 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.7.3" + s.version = "0.7.5" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" @@ -16,23 +16,6 @@ Pod::Spec.new do |s| ss.source_files = "Sources/Extensions/UIColor/UIColor+Hex.swift" end - s.subspec 'Drawing' do |ss| - # ss.ios.deployment_target = '8.0' # can't get it work: DrawingOperation.swift:29:17: note: did you mean 'DrawingOperation'? - # ss.tvos.deployment_target = '9.0' # can't get it work: DrawingOperation.swift:29:17: note: did you mean 'DrawingOperation'? - ss.watchos.deployment_target = '2.0' - - ss.source_files = [ - "Sources/Enums/ResizeMode.swift", - "Sources/Extensions/{CGContext,CGImage,CGSize,UIImage}/*", - "Sources/Protocols/{DrawingOperation,SupportProtocol}.swift", - "Sources/Structures/Drawing/*", - ] - ss.watchos.exclude_files = [ - "Sources/Structures/Drawing/CALayerDrawingOperation.swift", - "Sources/Extensions/UIImage/*", - ] - end - s.subspec 'Core' do |ss| ss.ios.deployment_target = '9.0' ss.tvos.deployment_target = '9.0' @@ -59,21 +42,14 @@ Pod::Spec.new do |s| "Sources/Extensions/Support/UIScrollView+Support.swift", "Sources/Extensions/TableDirector/*", "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift", - "Sources/Extensions/UIActivityIndicatorView/*", - "Sources/Extensions/UIAlertcontroller/*", - "Sources/Extensions/UIApplication/*", - "Sources/Extensions/UICollectionView/*", - "Sources/Extensions/UIDevice/*", - "Sources/Extensions/UIImage/*", - "Sources/Extensions/UITableView/*", - "Sources/Extensions/UIView/*", - "Sources/Extensions/UIViewController/*", - "Sources/Extensions/UIWindow/*", - "Sources/Extensions/Views/UILabel/*", + "Sources/Extensions/Drawing/UIImage/*", + "Sources/Extensions/UIKit/**/*.swift", "Sources/Extensions/Views/ViewBackground+Configuration.swift", + "Sources/Extensions/Views/SeparatorCell/*", "Sources/Protocols/LoadingIndicator.swift", "Sources/Protocols/DataLoading/PaginationDataLoading/PaginationWrappable.swift", "Sources/Protocols/DataLoading/GeneralDataLoading/GeneralDataLoadingController.swift", + "Sources/Protocols/Views/SeparatorCell/*", "Sources/Structures/Views/AnyLoadingIndicator.swift", "Sources/Structures/DrawingOperations/CALayerDrawingOperation.swift", "Sources/Structures/DrawingOperations/RoundDrawingOperation.swift", @@ -90,10 +66,12 @@ Pod::Spec.new do |s| "Sources/Extensions/DataLoading/PaginationDataLoading/*", "Sources/Extensions/Support/UIScrollView+Support.swift", "Sources/Extensions/TableDirector/*", - "Sources/Extensions/UIApplication/UIApplication+OpenUrlSupport.swift", - "Sources/Extensions/UIApplication/UIApplication+Cellular.swift", + "Sources/Extensions/UIKit/UIApplication/UIApplication+OpenUrlSupport.swift", + "Sources/Extensions/UIKit/UIApplication/UIApplication+Cellular.swift", "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift", + "Sources/Extensions/Views/SeparatorCell/*", "Sources/Protocols/DataLoading/PaginationDataLoading/PaginationWrappable.swift", + "Sources/Protocols/Views/SeparatorCell/*", "Sources/Structures/DataLoading/PaginationDataLoading/*" ] @@ -123,7 +101,9 @@ Pod::Spec.new do |s| "Sources/Extensions/TableDirector/*", "Sources/Extensions/UIApplication/UIApplication+OpenUrlSupport.swift", "Sources/Extensions/UIApplication/UIApplication+Cellular.swift", - "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift" + "Sources/Extensions/Array/Array+SeparatorRowBoxExtensions.swift", + "Sources/Extensions/Views/SeparatorCell/*", + "Sources/Protocols/Views/SeparatorCell/*" ] ss.dependency "CocoaLumberjack/Swift", '~> 3.4' diff --git a/LeadKit.xcodeproj/project.pbxproj b/LeadKit.xcodeproj/project.pbxproj index f40506fc..7e37890f 100644 --- a/LeadKit.xcodeproj/project.pbxproj +++ b/LeadKit.xcodeproj/project.pbxproj @@ -317,6 +317,9 @@ 673564F72068C68D00F0CBED /* NumberFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 673564F52068C68D00F0CBED /* NumberFormat.swift */; }; 673564F82068C68D00F0CBED /* NumberFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 673564F52068C68D00F0CBED /* NumberFormat.swift */; }; 673564F92068C68D00F0CBED /* NumberFormat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 673564F52068C68D00F0CBED /* NumberFormat.swift */; }; + 6737CFA3207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6737CFA2207220960063E056 /* SeparatorConfiguration+Extensions.swift */; }; + 6737CFA4207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6737CFA2207220960063E056 /* SeparatorConfiguration+Extensions.swift */; }; + 6737CFA5207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6737CFA2207220960063E056 /* SeparatorConfiguration+Extensions.swift */; }; 67386A8C206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67386A8B206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift */; }; 67386A8D206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67386A8B206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift */; }; 67386A8E206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67386A8B206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift */; }; @@ -422,6 +425,12 @@ 678D26A520692BFF00B05B93 /* TextFieldViewModelEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678D269F20692BFF00B05B93 /* TextFieldViewModelEvents.swift */; }; 678D26A620692BFF00B05B93 /* TextFieldViewModelEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678D269F20692BFF00B05B93 /* TextFieldViewModelEvents.swift */; }; 678D26A720692BFF00B05B93 /* TextFieldViewModelEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 678D269F20692BFF00B05B93 /* TextFieldViewModelEvents.swift */; }; + 67926236206EB0AE00308E62 /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67926235206EB0AE00308E62 /* CellSeparatorType.swift */; }; + 67926237206EB0AE00308E62 /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67926235206EB0AE00308E62 /* CellSeparatorType.swift */; }; + 67926239206EB0AE00308E62 /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67926235206EB0AE00308E62 /* CellSeparatorType.swift */; }; + 6792623C206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6792623B206EB0EC00308E62 /* CellSeparatorType+Extensions.swift */; }; + 6792623D206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6792623B206EB0EC00308E62 /* CellSeparatorType+Extensions.swift */; }; + 6792623E206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6792623B206EB0EC00308E62 /* CellSeparatorType+Extensions.swift */; }; 67952C3C1EB3266100B3BA1A /* LeadKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 67186B201EB247A200CFAFFB /* LeadKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 67952C3D1EB3266200B3BA1A /* LeadKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 67186B201EB247A200CFAFFB /* LeadKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 67952DCE1EB327B500B3BA1A /* LeadKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67952DC51EB327B400B3BA1A /* LeadKit.framework */; }; @@ -525,7 +534,6 @@ A676AE571F981130001F9214 /* ObservableMappable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A676AE541F981121001F9214 /* ObservableMappable.swift */; }; A676AE581F981131001F9214 /* ObservableMappable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A676AE541F981121001F9214 /* ObservableMappable.swift */; }; A6C9A4FA1F8BBCF2009311CC /* EmptyCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6AF3B371F8B956F00CDB971 /* EmptyCell.swift */; }; - A6C9A5041F8BC78F009311CC /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0DDEE1F8A6C57002CA74E /* CellSeparatorType.swift */; }; A6C9A5051F8BC78F009311CC /* SeparatorConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0DDF01F8A6C80002CA74E /* SeparatorConfiguration.swift */; }; A6C9A50F1F8BC79D009311CC /* Comparable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D10EAA1F8A9278003E69DD /* Comparable+Extensions.swift */; }; A6C9A5101F8BC79D009311CC /* Comparable+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D10EAA1F8A9278003E69DD /* Comparable+Extensions.swift */; }; @@ -536,7 +544,6 @@ A6E0DDE11F8A696F002CA74E /* SeparatorRowBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66428A81F8A655600C6308D /* SeparatorRowBox.swift */; }; A6E0DDE31F8A696F002CA74E /* SeparatorCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66428A61F8A653600C6308D /* SeparatorCell.swift */; }; A6E0DDE51F8A696F002CA74E /* SeparatorRowBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = A66428A81F8A655600C6308D /* SeparatorRowBox.swift */; }; - A6E0DDEF1F8A6C57002CA74E /* CellSeparatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0DDEE1F8A6C57002CA74E /* CellSeparatorType.swift */; }; A6E0DDF11F8A6C80002CA74E /* SeparatorConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E0DDF01F8A6C80002CA74E /* SeparatorConfiguration.swift */; }; A6F32C081F6EBDAA00AC08EE /* String+LocalizedComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6F32C071F6EBDAA00AC08EE /* String+LocalizedComponent.swift */; }; A6F32C0A1F6EBE5B00AC08EE /* String+LocalizedComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6F32C071F6EBDAA00AC08EE /* String+LocalizedComponent.swift */; }; @@ -690,6 +697,7 @@ 6727478E206CD88600725163 /* DateFormattingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateFormattingService.swift; sourceTree = ""; }; 673564F02068C2AD00F0CBED /* NumberFormattingService+DefaultImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberFormattingService+DefaultImplementation.swift"; sourceTree = ""; }; 673564F52068C68D00F0CBED /* NumberFormat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberFormat.swift; sourceTree = ""; }; + 6737CFA2207220960063E056 /* SeparatorConfiguration+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SeparatorConfiguration+Extensions.swift"; sourceTree = ""; }; 67386A8B206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormattingService+DefaultImplementation.swift"; sourceTree = ""; }; 673CF40A2063AB7C00C329F6 /* GeneralDataLoadingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralDataLoadingViewModel.swift; sourceTree = ""; }; 673CF4102063ABD100C329F6 /* GeneralDataLoadingState+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "GeneralDataLoadingState+Extensions.swift"; sourceTree = ""; }; @@ -722,6 +730,8 @@ 678D267820691D8200B05B93 /* DataModelFieldBinding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataModelFieldBinding.swift; sourceTree = ""; }; 678D269E20692BFF00B05B93 /* TextFieldViewEvents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldViewEvents.swift; sourceTree = ""; }; 678D269F20692BFF00B05B93 /* TextFieldViewModelEvents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldViewModelEvents.swift; sourceTree = ""; }; + 67926235206EB0AE00308E62 /* CellSeparatorType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellSeparatorType.swift; sourceTree = ""; }; + 6792623B206EB0EC00308E62 /* CellSeparatorType+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CellSeparatorType+Extensions.swift"; sourceTree = ""; }; 67952C391EB3203F00B3BA1A /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; }; 67952C3A1EB3205D00B3BA1A /* Info-watchOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-watchOS.plist"; sourceTree = ""; }; 67952C3B1EB3208000B3BA1A /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; @@ -769,7 +779,6 @@ A676AE541F981121001F9214 /* ObservableMappable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObservableMappable.swift; sourceTree = ""; }; A6AF3B371F8B956F00CDB971 /* EmptyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyCell.swift; sourceTree = ""; }; A6D10EAA1F8A9278003E69DD /* Comparable+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Comparable+Extensions.swift"; sourceTree = ""; }; - A6E0DDEE1F8A6C57002CA74E /* CellSeparatorType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellSeparatorType.swift; sourceTree = ""; }; A6E0DDF01F8A6C80002CA74E /* SeparatorConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeparatorConfiguration.swift; sourceTree = ""; }; A6F32C071F6EBDAA00AC08EE /* String+LocalizedComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+LocalizedComponent.swift"; sourceTree = ""; }; A6F32C0E1F6EBE8E00AC08EE /* StringExtensionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringExtensionTests.swift; sourceTree = ""; }; @@ -938,14 +947,12 @@ 671461DB1EB3396E00EAB194 /* Alamofire */, EFBE57CE1EC35ED90040E00A /* Array */, 67A1FF921EBCA64A00D6C89F /* CABasicAnimation */, - 671461DE1EB3396E00EAB194 /* CGContext */, 671461E01EB3396E00EAB194 /* CGFloat */, - 671461E21EB3396E00EAB194 /* CGImage */, - 671461E51EB3396E00EAB194 /* CGSize */, A6D10EA91F8A9269003E69DD /* Comparable */, 67745284206259C20024EEEF /* DataLoading */, 6771DFE81EEA7C8F002DCDAE /* DateFormattingService */, 671461EA1EB3396E00EAB194 /* Double */, + 672947E2206EA59E00AC6B6B /* Drawing */, 6714639C1EB33AC200EAB194 /* NetworkService */, 676B22A0206A6249002E9F8A /* NSAttributedString */, 673564EF2068C29100F0CBED /* NumberFormattingService */, @@ -956,15 +963,8 @@ 671461FE1EB3396E00EAB194 /* Support */, 671462001EB3396E00EAB194 /* TableDirector */, 671462021EB3396E00EAB194 /* TimeInterval */, - 674AF55A1EC45B1600038A8F /* UIActivityIndicatorView */, - 679C77D51F98F7A60094BE10 /* UIAlertController */, - 671AD260206A35C500EAF887 /* UIApplication */, 671462081EB3396E00EAB194 /* UIColor */, - 6714620C1EB3396E00EAB194 /* UIImage */, - 36DAAF4F2007CC330090BE0D /* UITableView */, - 671462111EB3396E00EAB194 /* UIView */, - 671462171EB3396E00EAB194 /* UIViewController */, - 6714621B1EB3396E00EAB194 /* UIWindow */, + 672947E0206EA36B00AC6B6B /* UIKit */, 6727476C206CCD3100725163 /* Views */, ); path = Extensions; @@ -1094,7 +1094,6 @@ isa = PBXGroup; children = ( 6714620D1EB3396E00EAB194 /* UIImage+Extensions.swift */, - 67A1FF8E1EBCA09B00D6C89F /* UIImage+Spinner.swift */, 6714620E1EB3396E00EAB194 /* UIImage+SupportExtensions.swift */, ); path = UIImage; @@ -1146,6 +1145,7 @@ children = ( 67EB7FC5206148C400BDD9FB /* DataLoading */, 67274783206CD7E500725163 /* DateFormatingService */, + 672947E3206EA63200AC6B6B /* Drawing */, 67CAF8AF20651E0F00527085 /* NetworkService */, 67C7B1772068BADA00C9EDA3 /* NumberFormattingService */, 673CF4202063D8EB00C329F6 /* Rx */, @@ -1156,7 +1156,6 @@ 671462231EB3396E00EAB194 /* BaseViewModel.swift */, 671462241EB3396E00EAB194 /* ConfigurableController.swift */, 671462331EB3396E00EAB194 /* ConfigurableView.swift */, - 671462261EB3396E00EAB194 /* DrawingOperation.swift */, 671462281EB3396E00EAB194 /* LoadingIndicator.swift */, 671462291EB3396E00EAB194 /* ModuleConfigurator.swift */, A676AE541F981121001F9214 /* ObservableMappable.swift */, @@ -1304,7 +1303,7 @@ 6727476C206CCD3100725163 /* Views */ = { isa = PBXGroup; children = ( - 67274776206CD07B00725163 /* UILabel */, + 6792623A206EB0D800308E62 /* SeparatorCell */, 6727476D206CCDDB00725163 /* ViewBackground+Configuration.swift */, 6727477E206CD3BD00725163 /* ViewText+Extensions.swift */, ); @@ -1328,6 +1327,49 @@ path = DateFormatingService; sourceTree = ""; }; + 672947E0206EA36B00AC6B6B /* UIKit */ = { + isa = PBXGroup; + children = ( + 674AF55A1EC45B1600038A8F /* UIActivityIndicatorView */, + 679C77D51F98F7A60094BE10 /* UIAlertController */, + 671AD260206A35C500EAF887 /* UIApplication */, + 672947E4206EA67B00AC6B6B /* UIImage */, + 67274776206CD07B00725163 /* UILabel */, + 36DAAF4F2007CC330090BE0D /* UITableView */, + 671462111EB3396E00EAB194 /* UIView */, + 671462171EB3396E00EAB194 /* UIViewController */, + 6714621B1EB3396E00EAB194 /* UIWindow */, + ); + path = UIKit; + sourceTree = ""; + }; + 672947E2206EA59E00AC6B6B /* Drawing */ = { + isa = PBXGroup; + children = ( + 671461DE1EB3396E00EAB194 /* CGContext */, + 671461E21EB3396E00EAB194 /* CGImage */, + 671461E51EB3396E00EAB194 /* CGSize */, + 6714620C1EB3396E00EAB194 /* UIImage */, + ); + path = Drawing; + sourceTree = ""; + }; + 672947E3206EA63200AC6B6B /* Drawing */ = { + isa = PBXGroup; + children = ( + 671462261EB3396E00EAB194 /* DrawingOperation.swift */, + ); + path = Drawing; + sourceTree = ""; + }; + 672947E4206EA67B00AC6B6B /* UIImage */ = { + isa = PBXGroup; + children = ( + 67A1FF8E1EBCA09B00D6C89F /* UIImage+Spinner.swift */, + ); + path = UIImage; + sourceTree = ""; + }; 673564EF2068C29100F0CBED /* NumberFormattingService */ = { isa = PBXGroup; children = ( @@ -1493,6 +1535,7 @@ 678D269C20692BFF00B05B93 /* Views */ = { isa = PBXGroup; children = ( + 67926234206EB08400308E62 /* SeparatorCell */, 678D269D20692BFF00B05B93 /* TextField */, ); path = Views; @@ -1507,6 +1550,23 @@ path = TextField; sourceTree = ""; }; + 67926234206EB08400308E62 /* SeparatorCell */ = { + isa = PBXGroup; + children = ( + 67926235206EB0AE00308E62 /* CellSeparatorType.swift */, + ); + path = SeparatorCell; + sourceTree = ""; + }; + 6792623A206EB0D800308E62 /* SeparatorCell */ = { + isa = PBXGroup; + children = ( + 6792623B206EB0EC00308E62 /* CellSeparatorType+Extensions.swift */, + 6737CFA2207220960063E056 /* SeparatorConfiguration+Extensions.swift */, + ); + path = SeparatorCell; + sourceTree = ""; + }; 679C77D51F98F7A60094BE10 /* UIAlertController */ = { isa = PBXGroup; children = ( @@ -1628,7 +1688,6 @@ isa = PBXGroup; children = ( A66428A61F8A653600C6308D /* SeparatorCell.swift */, - A6E0DDEE1F8A6C57002CA74E /* CellSeparatorType.swift */, A6E0DDF01F8A6C80002CA74E /* SeparatorConfiguration.swift */, ); path = SeparatorCell; @@ -2497,6 +2556,7 @@ files = ( 671463481EB3396E00EAB194 /* ResettableType.swift in Sources */, EFBE57D01EC35EF20040E00A /* Array+Extensions.swift in Sources */, + 6792623C206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */, 671462E41EB3396E00EAB194 /* UIColor+Hex.swift in Sources */, 67EB7FF12061682F00BDD9FB /* TotalCountCursorListingResult+DefaultTotalCountCursorListingResult.swift in Sources */, 67EB8001206177D600BDD9FB /* PaginationWrapperDelegate.swift in Sources */, @@ -2515,7 +2575,6 @@ 67CAF8B120651E1E00527085 /* ConfigurableNetworkService.swift in Sources */, EFBE57DB1EC361620040E00A /* UIView+Layout.swift in Sources */, 6714639E1EB33AEB00EAB194 /* NetworkService+ActivityIndicator-UIApplication.swift in Sources */, - A6E0DDEF1F8A6C57002CA74E /* CellSeparatorType.swift in Sources */, 6714634C1EB3396E00EAB194 /* ReuseIdentifierProtocol.swift in Sources */, 671462F01EB3396E00EAB194 /* UIImage+SupportExtensions.swift in Sources */, 67CAF8C620652E2A00527085 /* TextFieldViewModel.swift in Sources */, @@ -2545,6 +2604,7 @@ 67745268206249360024EEEF /* UITableView+PaginationWrappable.swift in Sources */, 6714624C1EB3396E00EAB194 /* MapCursor.swift in Sources */, A6C9A4FA1F8BBCF2009311CC /* EmptyCell.swift in Sources */, + 6737CFA3207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */, 671463241EB3396E00EAB194 /* Any+TypeName.swift in Sources */, 671463881EB3396E00EAB194 /* RoundDrawingOperation.swift in Sources */, A6D10EAB1F8A9278003E69DD /* Comparable+Extensions.swift in Sources */, @@ -2608,6 +2668,7 @@ 67EB7FDA20615D5B00BDD9FB /* ResettableRxCursorDataSource.swift in Sources */, 671462481EB3396E00EAB194 /* FixedPageCursor.swift in Sources */, 671462C81EB3396E00EAB194 /* String+Localization.swift in Sources */, + 67926236206EB0AE00308E62 /* CellSeparatorType.swift in Sources */, 671462B81EB3396E00EAB194 /* Sequence+ConcurrentMap.swift in Sources */, 67C7B1792068BB1C00C9EDA3 /* NumberFormattingService.swift in Sources */, 671463741EB3396E00EAB194 /* BorderDrawingOperation.swift in Sources */, @@ -2661,7 +2722,6 @@ A6C9A50F1F8BC79D009311CC /* Comparable+Extensions.swift in Sources */, 671463C41EB34B1E00EAB194 /* Post.swift in Sources */, A6E0DDE51F8A696F002CA74E /* SeparatorRowBox.swift in Sources */, - A6C9A5041F8BC78F009311CC /* CellSeparatorType.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2828,6 +2888,7 @@ 671463031EB3396E00EAB194 /* UIView+LoadFromNib.swift in Sources */, 6714627F1EB3396E00EAB194 /* AlamofireManager+Extensions.swift in Sources */, 6714625B1EB3396E00EAB194 /* Log.swift in Sources */, + 6737CFA5207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */, 6714627B1EB3396E00EAB194 /* ResizeMode.swift in Sources */, 67745289206259CF0024EEEF /* Rx+RxDataSourceProtocol.swift in Sources */, 67386A8F206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift in Sources */, @@ -2851,6 +2912,7 @@ 6714625F1EB3396E00EAB194 /* LogFormatter.swift in Sources */, 6714630B1EB3396E00EAB194 /* UIView+Rotation.swift in Sources */, 673CF4192063D50700C329F6 /* GeneralDataLoadingController.swift in Sources */, + 6792623E206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */, 6714626F1EB3396E00EAB194 /* XibView.swift in Sources */, 6714637F1EB3396E00EAB194 /* ImageDrawingOperation.swift in Sources */, 67EB7FD720615D1700BDD9FB /* ResettableCursorType.swift in Sources */, @@ -2862,6 +2924,7 @@ 67EB7FDD20615D5B00BDD9FB /* ResettableRxCursorDataSource.swift in Sources */, 677452A720625FA90024EEEF /* RxDataSource.swift in Sources */, 6774527720624E820024EEEF /* DataLoadingModel.swift in Sources */, + 67926239206EB0AE00308E62 /* CellSeparatorType.swift in Sources */, 678D267C20691D8200B05B93 /* DataModelFieldBinding.swift in Sources */, 6714639B1EB3396E00EAB194 /* AnyLoadingIndicator.swift in Sources */, 671463171EB3396E00EAB194 /* UIViewController+TopVisibleViewController.swift in Sources */, @@ -2929,6 +2992,7 @@ 671463491EB3396E00EAB194 /* ResettableType.swift in Sources */, 67386A8D206CF3F6004EDA6C /* DateFormattingService+DefaultImplementation.swift in Sources */, A676AE491F97D28A001F9214 /* String+Extensions.swift in Sources */, + 6792623D206EB0EC00308E62 /* CellSeparatorType+Extensions.swift in Sources */, 671462E51EB3396E00EAB194 /* UIColor+Hex.swift in Sources */, 67EB7FFE206176C900BDD9FB /* AnyPaginationWrappable.swift in Sources */, 67274773206CCF1200725163 /* ViewText.swift in Sources */, @@ -3036,6 +3100,8 @@ 6714632D1EB3396E00EAB194 /* ConfigurableController.swift in Sources */, 67745287206259CF0024EEEF /* Rx+RxDataSourceProtocol.swift in Sources */, A676AE561F98112F001F9214 /* ObservableMappable.swift in Sources */, + 6737CFA4207220960063E056 /* SeparatorConfiguration+Extensions.swift in Sources */, + 67926237206EB0AE00308E62 /* CellSeparatorType.swift in Sources */, 6774527A206252020024EEEF /* DataLoadingState.swift in Sources */, 6714628D1EB3396E00EAB194 /* CGImage+Alpha.swift in Sources */, 67745269206249360024EEEF /* UITableView+PaginationWrappable.swift in Sources */, diff --git a/Sources/Classes/Views/SeparatorCell/SeparatorCell.swift b/Sources/Classes/Views/SeparatorCell/SeparatorCell.swift index a1a2131c..508da2ab 100644 --- a/Sources/Classes/Views/SeparatorCell/SeparatorCell.swift +++ b/Sources/Classes/Views/SeparatorCell/SeparatorCell.swift @@ -39,23 +39,19 @@ open class SeparatorCell: UITableViewCell { /// Configure separator with viewModel /// - parameter separatorType: type of separators public func configureSeparator(with separatorType: CellSeparatorType) { + topView.isHidden = separatorType.topIsHidden + bottomView.isHidden = separatorType.bottomIsHidden + switch separatorType { case .none: - topView.isHidden = true - bottomView.isHidden = true + break case .bottom(let configuration): - topView.isHidden = true - bottomView.isHidden = false updateBottomSeparator(with: configuration) setNeedsUpdateConstraints() case .top(let configuration): - topView.isHidden = false - bottomView.isHidden = true updateTopSeparator(with: configuration) setNeedsUpdateConstraints() case .full(let topConfiguration, let bottomConfiguration): - topView.isHidden = false - bottomView.isHidden = false updateTopSeparator(with: topConfiguration) updateBottomSeparator(with: bottomConfiguration) setNeedsUpdateConstraints() @@ -146,13 +142,13 @@ open class SeparatorCell: UITableViewCell { private func updateTopSeparator(with configuration: SeparatorConfiguration) { topView.backgroundColor = configuration.color topSeparatorHeight = configuration.height - topSeparatorInsets = configuration.insets ?? .zero + topSeparatorInsets = configuration.insets } private func updateBottomSeparator(with configuration: SeparatorConfiguration) { bottomView.backgroundColor = configuration.color bottomSeparatorHeight = configuration.height - bottomSeparatorInsets = configuration.insets ?? .zero + bottomSeparatorInsets = configuration.insets } private func createConstraints() { diff --git a/Sources/Classes/Views/SeparatorCell/SeparatorConfiguration.swift b/Sources/Classes/Views/SeparatorCell/SeparatorConfiguration.swift index a6ebee80..f0f231e5 100644 --- a/Sources/Classes/Views/SeparatorCell/SeparatorConfiguration.swift +++ b/Sources/Classes/Views/SeparatorCell/SeparatorConfiguration.swift @@ -24,16 +24,17 @@ import UIKit /// Separator configuration. Supports positioning, color and height per each separator public struct SeparatorConfiguration { - let color: UIColor - let insets: UIEdgeInsets? - let height: CGFloat + + public let color: UIColor + public let insets: UIEdgeInsets + public let height: CGFloat /// Initialize configuration with parameters /// - parameter color: Color must be provided /// - parameter insets: Insets for separator. Default is no insets /// - parameter height: Height for separator. Default is 1 pixel /// - returns: Ready to use separator configuration - public init(color: UIColor, insets: UIEdgeInsets? = .zero, height: CGFloat = CGFloat(pixels: 1)) { + public init(color: UIColor, insets: UIEdgeInsets = .zero, height: CGFloat = CGFloat(pixels: 1)) { self.color = color self.insets = insets self.height = height diff --git a/Sources/Extensions/CGContext/CGContext+Initializers.swift b/Sources/Extensions/Drawing/CGContext/CGContext+Initializers.swift similarity index 100% rename from Sources/Extensions/CGContext/CGContext+Initializers.swift rename to Sources/Extensions/Drawing/CGContext/CGContext+Initializers.swift diff --git a/Sources/Extensions/CGImage/CGImage+Alpha.swift b/Sources/Extensions/Drawing/CGImage/CGImage+Alpha.swift similarity index 100% rename from Sources/Extensions/CGImage/CGImage+Alpha.swift rename to Sources/Extensions/Drawing/CGImage/CGImage+Alpha.swift diff --git a/Sources/Extensions/CGImage/CGImage+Crop.swift b/Sources/Extensions/Drawing/CGImage/CGImage+Crop.swift similarity index 100% rename from Sources/Extensions/CGImage/CGImage+Crop.swift rename to Sources/Extensions/Drawing/CGImage/CGImage+Crop.swift diff --git a/Sources/Extensions/CGSize/CGSize+CGContextSize.swift b/Sources/Extensions/Drawing/CGSize/CGSize+CGContextSize.swift similarity index 100% rename from Sources/Extensions/CGSize/CGSize+CGContextSize.swift rename to Sources/Extensions/Drawing/CGSize/CGSize+CGContextSize.swift diff --git a/Sources/Extensions/CGSize/CGSize+Resize.swift b/Sources/Extensions/Drawing/CGSize/CGSize+Resize.swift similarity index 100% rename from Sources/Extensions/CGSize/CGSize+Resize.swift rename to Sources/Extensions/Drawing/CGSize/CGSize+Resize.swift diff --git a/Sources/Extensions/UIImage/UIImage+Extensions.swift b/Sources/Extensions/Drawing/UIImage/UIImage+Extensions.swift similarity index 100% rename from Sources/Extensions/UIImage/UIImage+Extensions.swift rename to Sources/Extensions/Drawing/UIImage/UIImage+Extensions.swift diff --git a/Sources/Extensions/UIImage/UIImage+SupportExtensions.swift b/Sources/Extensions/Drawing/UIImage/UIImage+SupportExtensions.swift similarity index 100% rename from Sources/Extensions/UIImage/UIImage+SupportExtensions.swift rename to Sources/Extensions/Drawing/UIImage/UIImage+SupportExtensions.swift diff --git a/Sources/Extensions/UIActivityIndicatorView/UIActivityIndicatorView+LoadingIndicator.swift b/Sources/Extensions/UIKit/UIActivityIndicatorView/UIActivityIndicatorView+LoadingIndicator.swift similarity index 100% rename from Sources/Extensions/UIActivityIndicatorView/UIActivityIndicatorView+LoadingIndicator.swift rename to Sources/Extensions/UIKit/UIActivityIndicatorView/UIActivityIndicatorView+LoadingIndicator.swift diff --git a/Sources/Extensions/UIAlertController/UIAlertController+Extensions.swift b/Sources/Extensions/UIKit/UIAlertController/UIAlertController+Extensions.swift similarity index 100% rename from Sources/Extensions/UIAlertController/UIAlertController+Extensions.swift rename to Sources/Extensions/UIKit/UIAlertController/UIAlertController+Extensions.swift diff --git a/Sources/Extensions/UIApplication/UIApplication+Cellular.swift b/Sources/Extensions/UIKit/UIApplication/UIApplication+Cellular.swift similarity index 100% rename from Sources/Extensions/UIApplication/UIApplication+Cellular.swift rename to Sources/Extensions/UIKit/UIApplication/UIApplication+Cellular.swift diff --git a/Sources/Extensions/UIApplication/UIApplication+OpenUrlSupport.swift b/Sources/Extensions/UIKit/UIApplication/UIApplication+OpenUrlSupport.swift similarity index 100% rename from Sources/Extensions/UIApplication/UIApplication+OpenUrlSupport.swift rename to Sources/Extensions/UIKit/UIApplication/UIApplication+OpenUrlSupport.swift diff --git a/Sources/Extensions/UIImage/UIImage+Spinner.swift b/Sources/Extensions/UIKit/UIImage/UIImage+Spinner.swift similarity index 100% rename from Sources/Extensions/UIImage/UIImage+Spinner.swift rename to Sources/Extensions/UIKit/UIImage/UIImage+Spinner.swift diff --git a/Sources/Extensions/Views/UILabel/UILabel+ViewTextConfiguration.swift b/Sources/Extensions/UIKit/UILabel/UILabel+ViewTextConfiguration.swift similarity index 100% rename from Sources/Extensions/Views/UILabel/UILabel+ViewTextConfiguration.swift rename to Sources/Extensions/UIKit/UILabel/UILabel+ViewTextConfiguration.swift diff --git a/Sources/Extensions/UITableView/UITableView+Extensions.swift b/Sources/Extensions/UIKit/UITableView/UITableView+Extensions.swift similarity index 100% rename from Sources/Extensions/UITableView/UITableView+Extensions.swift rename to Sources/Extensions/UIKit/UITableView/UITableView+Extensions.swift diff --git a/Sources/Extensions/UIView/UIView+Layout.swift b/Sources/Extensions/UIKit/UIView/UIView+Layout.swift similarity index 100% rename from Sources/Extensions/UIView/UIView+Layout.swift rename to Sources/Extensions/UIKit/UIView/UIView+Layout.swift diff --git a/Sources/Extensions/UIView/UIView+LoadFromNib.swift b/Sources/Extensions/UIKit/UIView/UIView+LoadFromNib.swift similarity index 100% rename from Sources/Extensions/UIView/UIView+LoadFromNib.swift rename to Sources/Extensions/UIKit/UIView/UIView+LoadFromNib.swift diff --git a/Sources/Extensions/UIView/UIView+LoadingIndicator.swift b/Sources/Extensions/UIKit/UIView/UIView+LoadingIndicator.swift similarity index 100% rename from Sources/Extensions/UIView/UIView+LoadingIndicator.swift rename to Sources/Extensions/UIKit/UIView/UIView+LoadingIndicator.swift diff --git a/Sources/Extensions/UIView/UIView+Rotation.swift b/Sources/Extensions/UIKit/UIView/UIView+Rotation.swift similarity index 100% rename from Sources/Extensions/UIView/UIView+Rotation.swift rename to Sources/Extensions/UIKit/UIView/UIView+Rotation.swift diff --git a/Sources/Extensions/UIView/UIView+XibNameProtocol.swift b/Sources/Extensions/UIKit/UIView/UIView+XibNameProtocol.swift similarity index 100% rename from Sources/Extensions/UIView/UIView+XibNameProtocol.swift rename to Sources/Extensions/UIKit/UIView/UIView+XibNameProtocol.swift diff --git a/Sources/Extensions/UIViewController/UIViewController+ConfigurableController.swift b/Sources/Extensions/UIKit/UIViewController/UIViewController+ConfigurableController.swift similarity index 100% rename from Sources/Extensions/UIViewController/UIViewController+ConfigurableController.swift rename to Sources/Extensions/UIKit/UIViewController/UIViewController+ConfigurableController.swift diff --git a/Sources/Extensions/UIViewController/UIViewController+DefaultXibName.swift b/Sources/Extensions/UIKit/UIViewController/UIViewController+DefaultXibName.swift similarity index 100% rename from Sources/Extensions/UIViewController/UIViewController+DefaultXibName.swift rename to Sources/Extensions/UIKit/UIViewController/UIViewController+DefaultXibName.swift diff --git a/Sources/Extensions/UIViewController/UIViewController+TopVisibleViewController.swift b/Sources/Extensions/UIKit/UIViewController/UIViewController+TopVisibleViewController.swift similarity index 100% rename from Sources/Extensions/UIViewController/UIViewController+TopVisibleViewController.swift rename to Sources/Extensions/UIKit/UIViewController/UIViewController+TopVisibleViewController.swift diff --git a/Sources/Extensions/UIWindow/UIWindow+Extensions.swift b/Sources/Extensions/UIKit/UIWindow/UIWindow+Extensions.swift similarity index 100% rename from Sources/Extensions/UIWindow/UIWindow+Extensions.swift rename to Sources/Extensions/UIKit/UIWindow/UIWindow+Extensions.swift diff --git a/Sources/Extensions/Views/SeparatorCell/CellSeparatorType+Extensions.swift b/Sources/Extensions/Views/SeparatorCell/CellSeparatorType+Extensions.swift new file mode 100644 index 00000000..c9582285 --- /dev/null +++ b/Sources/Extensions/Views/SeparatorCell/CellSeparatorType+Extensions.swift @@ -0,0 +1,83 @@ +// +// Copyright (c) 2018 Touch Instinct +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the Software), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +public extension CellSeparatorType { + + /// Determine if bottom separator is hidden. + var bottomIsHidden: Bool { + return bottomConfiguration == nil + } + + /// Determine if top separator is hidden. + var topIsHidden: Bool { + return topConfiguration == nil + } + + /// Returns top configuration if type is top or full. + var topConfiguration: SeparatorConfiguration? { + switch self { + case .top(let configuration), .full(let configuration, _): + return configuration + default: + return nil + } + } + + /// Returns bottom configuration if type is bottom or full. + var bottomConfiguration: SeparatorConfiguration? { + switch self { + case .bottom(let configuration), .full(_, let configuration): + return configuration + default: + return nil + } + } + + /// Configures top separator view with top configuration if type is top or full. + /// + /// - Parameter topSeparatorView: A top separator view to configure. + func configure(topSeparatorView: UIView) { + topSeparatorView.isHidden = topIsHidden + topSeparatorView.backgroundColor = topConfiguration?.color ?? topSeparatorView.backgroundColor + } + + /// Configures bottom separator view with top configuration if type is bottom or full. + /// + /// - Parameter bottomSeparatorView: A bottom separator view to configure. + func configure(bottomSeparatorView: UIView) { + bottomSeparatorView.isHidden = bottomIsHidden + bottomSeparatorView.backgroundColor = bottomConfiguration?.color ?? bottomSeparatorView.backgroundColor + } + + /// Configures both top and bottom separator views. + /// + /// - Parameters: + /// - topSeparatorView: A top separator view to configure. + /// - bottomSeparatorView: A bottom separator view to configure. + func configure(topSeparatorView: UIView, bottomSeparatorView: UIView) { + configure(topSeparatorView: topSeparatorView) + configure(bottomSeparatorView: bottomSeparatorView) + } + +} diff --git a/Sources/Extensions/Views/SeparatorCell/SeparatorConfiguration+Extensions.swift b/Sources/Extensions/Views/SeparatorCell/SeparatorConfiguration+Extensions.swift new file mode 100644 index 00000000..afad95f3 --- /dev/null +++ b/Sources/Extensions/Views/SeparatorCell/SeparatorConfiguration+Extensions.swift @@ -0,0 +1,32 @@ +// +// Copyright (c) 2018 Touch Instinct +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the Software), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import CoreGraphics.CGBase + +public extension SeparatorConfiguration { + + /// Total height of separator top inset + height + bottom inset. + var totalHeight: CGFloat { + return height + insets.top + insets.bottom + } + +} diff --git a/Sources/Protocols/DrawingOperation.swift b/Sources/Protocols/Drawing/DrawingOperation.swift similarity index 100% rename from Sources/Protocols/DrawingOperation.swift rename to Sources/Protocols/Drawing/DrawingOperation.swift diff --git a/Sources/Protocols/SupportProtocol.swift b/Sources/Protocols/SupportProtocol.swift index 8e1b36f3..cf7efa8b 100644 --- a/Sources/Protocols/SupportProtocol.swift +++ b/Sources/Protocols/SupportProtocol.swift @@ -49,7 +49,7 @@ public struct Support { } } -/// A type that has reactive extensions. +/// A type that has support extensions. public protocol SupportCompatible { /// Extended type associatedtype CompatibleType diff --git a/Sources/Classes/Views/SeparatorCell/CellSeparatorType.swift b/Sources/Protocols/Views/SeparatorCell/CellSeparatorType.swift similarity index 73% rename from Sources/Classes/Views/SeparatorCell/CellSeparatorType.swift rename to Sources/Protocols/Views/SeparatorCell/CellSeparatorType.swift index 4b9cf952..357af6e3 100644 --- a/Sources/Classes/Views/SeparatorCell/CellSeparatorType.swift +++ b/Sources/Protocols/Views/SeparatorCell/CellSeparatorType.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Touch Instinct +// Copyright (c) 2018 Touch Instinct // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal @@ -20,8 +20,6 @@ // THE SOFTWARE. // -import UIKit - /// Cell self-descriptive separator type public enum CellSeparatorType { @@ -37,27 +35,3 @@ public enum CellSeparatorType { /// First configuration for top, second for bottom case full(SeparatorConfiguration, SeparatorConfiguration) } - -public extension CellSeparatorType { - - /// Determine if bottom separator is hidden - var bottomIsHidden: Bool { - switch self { - case .top, .none: - return true - case .bottom, .full: - return false - } - } - - /// Determine if top separator is hidden - var topIsHidden: Bool { - switch self { - case .bottom, .none: - return true - case .top, .full: - return false - } - } - -}