diff --git a/Example/IGColorPicker.xcodeproj/project.pbxproj b/Example/IGColorPicker.xcodeproj/project.pbxproj index ab5d420..0ef15a4 100644 --- a/Example/IGColorPicker.xcodeproj/project.pbxproj +++ b/Example/IGColorPicker.xcodeproj/project.pbxproj @@ -48,7 +48,7 @@ 9FAEF4144B69B4DE10AECF21 /* Pods-IGColorPicker_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IGColorPicker_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-IGColorPicker_Example/Pods-IGColorPicker_Example.release.xcconfig"; sourceTree = ""; }; B249C39F1D8ABCE8C406EED6 /* Pods-IGColorPicker_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IGColorPicker_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-IGColorPicker_Tests/Pods-IGColorPicker_Tests.debug.xcconfig"; sourceTree = ""; }; B5CB5F41429ED1420D267465 /* Pods-IGColorPicker_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IGColorPicker_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-IGColorPicker_Tests/Pods-IGColorPicker_Tests.release.xcconfig"; sourceTree = ""; }; - E6F4F3AABBDCF3FE8E4F59CF /* IGColorPicker.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = IGColorPicker.podspec; path = ../IGColorPicker.podspec; sourceTree = ""; }; + E6F4F3AABBDCF3FE8E4F59CF /* IGColorPicker.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = IGColorPicker.podspec; path = ../IGColorPicker.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -229,6 +229,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -270,7 +271,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-IGColorPicker_Example/Pods-IGColorPicker_Example-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-IGColorPicker_Example/Pods-IGColorPicker_Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/IGColorPicker/IGColorPicker.framework", "${BUILT_PRODUCTS_DIR}/M13Checkbox/M13Checkbox.framework", ); @@ -281,7 +282,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-IGColorPicker_Example/Pods-IGColorPicker_Example-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-IGColorPicker_Example/Pods-IGColorPicker_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 20CE77970D77DC53168988A2 /* [CP] Check Pods Manifest.lock */ = { @@ -410,7 +411,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -450,7 +451,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; diff --git a/Example/Podfile b/Example/Podfile index fe6d01e..dd09c59 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,4 @@ -platform :ios, '8.3' +platform :ios, '11.0' use_frameworks! target 'IGColorPicker_Example' do diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 3baf6b8..0e87ef8 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,7 +1,7 @@ PODS: - - IGColorPicker (0.4.2): - - M13Checkbox (~> 3.2.0) - - M13Checkbox (3.2.2) + - IGColorPicker (0.4.3): + - M13Checkbox + - M13Checkbox (3.4.0) DEPENDENCIES: - IGColorPicker (from `../`) @@ -15,9 +15,9 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - IGColorPicker: 518c7f1ccddd8b28bd6b1e552091240ef48039e5 - M13Checkbox: a8c2491cfbbca10797925fd0b9154a782bf40d89 + IGColorPicker: 5678a791e8ac0c6f1c07d3f58151d34c70bcc565 + M13Checkbox: 6f59404540ac98ba83a3d1afac335895a40c6a5d -PODFILE CHECKSUM: 4ebb9ec0d26d8739b0c18dc9faaa5462d18e8245 +PODFILE CHECKSUM: 37679cb6c192a18d2407f0b8487e4b9ce7d179ac -COCOAPODS: 1.5.3 +COCOAPODS: 1.7.2 diff --git a/IGColorPicker.podspec b/IGColorPicker.podspec index 6b19d3d..68a8dcf 100644 --- a/IGColorPicker.podspec +++ b/IGColorPicker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'IGColorPicker' -s.version = '0.4.2' +s.version = '0.4.3' s.summary = 'A customizable color picker for iOS in Swift' s.description = <<-DESC @@ -12,9 +12,9 @@ s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Andrea Antonioni' => 'andreaantonioni97@gmail.com' } s.source = { :git => 'https://github.com/iGenius-Srl/IGColorPicker.git', :tag => s.version.to_s } -s.ios.deployment_target = '8.3' +s.ios.deployment_target = '11.0' s.source_files = 'IGColorPicker/Classes/**/*' -s.dependency 'M13Checkbox', '~> 3.2.0' +s.dependency 'M13Checkbox' end diff --git a/IGColorPicker/Classes/View/ColorPickerCell.swift b/IGColorPicker/Classes/View/ColorPickerCell.swift index 7ca13d3..cdef7eb 100644 --- a/IGColorPicker/Classes/View/ColorPickerCell.swift +++ b/IGColorPicker/Classes/View/ColorPickerCell.swift @@ -43,6 +43,7 @@ class ColorPickerCell: UICollectionViewCell { // Setup of checkbox checkbox.isUserInteractionEnabled = false checkbox.backgroundColor = .clear + checkbox.secondaryTintColor = .clear checkbox.hideBox = true checkbox.setCheckState(.unchecked, animated: false) diff --git a/IGColorPicker/Classes/View/ColorPickerView.swift b/IGColorPicker/Classes/View/ColorPickerView.swift index 249ae59..25ef429 100644 --- a/IGColorPicker/Classes/View/ColorPickerView.swift +++ b/IGColorPicker/Classes/View/ColorPickerView.swift @@ -75,7 +75,9 @@ open class ColorPickerView: UIView, UICollectionViewDelegate, UICollectionViewDa open var style: ColorPickerViewStyle = .circle /// Style applied when a color is selected open var selectionStyle: ColorPickerViewSelectStyle = .check - + /// Show selected cell's borders + open var showSelectedCellBorders: Bool = true + // MARK: - Private properties fileprivate var _indexOfSelectedColor: Int? @@ -132,6 +134,10 @@ open class ColorPickerView: UIView, UICollectionViewDelegate, UICollectionViewDa } return } + + if let selected = indexOfSelectedColor { + collectionView(self.collectionView, didDeselectItemAt: IndexPath(item: selected, section: 0)) + } _indexOfSelectedColor = indexPath.item @@ -167,6 +173,10 @@ open class ColorPickerView: UIView, UICollectionViewDelegate, UICollectionViewDa if style == .circle { cell.layer.cornerRadius = cell.bounds.width / 2 } + + if showSelectedCellBorders { + cell.checkbox.hideBox = false + } return cell }