Skip to content

Commit

Permalink
v 1.4.1 fix ColorPicker bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Volodko authored and None committed Jan 31, 2018
1 parent 5ff858b commit 482d080
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 9 additions & 9 deletions Example/Resources/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@
<constraint firstAttribute="width" constant="200" id="uoT-0W-8CS"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="24"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="circleCorner" value="NO"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="circleCorner" value="YES"/>
<userDefinedRuntimeAttribute type="size" keyPath="shadowOffset">
<size key="value" width="0.0" height="6"/>
<size key="value" width="1" height="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="shadowOpacity">
<real key="value" value="0.40000000000000002"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="shadowShouldRasterize" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="shadowRadius">
<real key="value" value="12"/>
<real key="value" value="14"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="shadowColor">
<color key="value" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="uel-BC-dC0">
<rect key="frame" x="0.0" y="258" width="311" height="148"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0tN-R9-wtT" customClass="GradientSlider" customModule="Alerts_Pickers" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="311" height="36"/>
<rect key="frame" x="-2" y="-4" width="315" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="Q8e-SK-Zzo"/>
</constraints>
Expand All @@ -72,7 +72,7 @@
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gc1-Bj-h3h" customClass="GradientSlider" customModule="Alerts_Pickers" customModuleProvider="target">
<rect key="frame" x="0.0" y="56" width="311" height="36"/>
<rect key="frame" x="-2" y="52" width="315" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="5Eh-kD-PEa"/>
</constraints>
Expand All @@ -93,7 +93,7 @@
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ES1-8x-tqc" customClass="GradientSlider" customModule="Alerts_Pickers" customModuleProvider="target">
<rect key="frame" x="0.0" y="112" width="311" height="36"/>
<rect key="frame" x="-2" y="108" width="315" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="36" id="T2U-9b-SvG"/>
</constraints>
Expand Down
3 changes: 1 addition & 2 deletions Source/Pickers/Color/ColorPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ extension UIAlertController {
let buttonSelection = UIAlertAction(title: "Select", style: .default) { action in
selection?(color)
}
buttonSelection.isEnabled = false
buttonSelection.isEnabled = true

let storyboard = UIStoryboard(name: "Main", bundle: nil)
guard let vc = storyboard.instantiateViewController(withIdentifier: "ColorPicker") as? ColorPickerViewController else { return }
set(vc: vc)

set(title: color.hexString, font: .systemFont(ofSize: 17), color: color)
vc.set(color: color) { new in
buttonSelection.isEnabled = color != new
color = new
self.set(title: color.hexString, font: .systemFont(ofSize: 17), color: color)
}
Expand Down

0 comments on commit 482d080

Please sign in to comment.