1 Commits

Author SHA1 Message Date
Ryan Ackermann aea70afcce minor update for carthage support 2018-08-04 11:30:54 -05:00
8 changed files with 296 additions and 10 deletions
File diff suppressed because one or more lines are too long
@@ -163,6 +163,8 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
@import UIKit;
@import CoreGraphics;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
@@ -180,6 +182,15 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# pragma pop_macro("any")
#endif
@class NSCoder;
SWIFT_CLASS("_TtC22RAScrollablePickerView22RAScrollablePickerView")
@interface RAScrollablePickerView : UIView
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
- (void)drawRect:(CGRect)rect;
@end
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
@@ -17,23 +17,23 @@
import UIKit
enum PickerType: Int {
public enum PickerType: Int {
case hue
case saturation
case brightness
}
protocol RAScrollablePickerViewDelegate: class {
public protocol RAScrollablePickerViewDelegate: class {
func valueChanged(_ value: CGFloat, type: PickerType)
}
class RAScrollablePickerView: UIView {
public class RAScrollablePickerView: UIView {
var type: PickerType = .hue
var shouldDecelerate = true
weak var delegate: RAScrollablePickerViewDelegate?
public var type: PickerType = .hue
public var shouldDecelerate = true
public weak var delegate: RAScrollablePickerViewDelegate?
var hueValueForPreview: CGFloat = 1.0 {
public var hueValueForPreview: CGFloat = 1.0 {
didSet {
setNeedsDisplay()
}
@@ -171,17 +171,17 @@ class RAScrollablePickerView: UIView {
clipsToBounds = true
}
override init(frame: CGRect) {
public override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
required init?(coder aDecoder: NSCoder) {
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
}
override func draw(_ rect: CGRect) {
public override func draw(_ rect: CGRect) {
let ctx = UIGraphicsGetCurrentContext()
if let gradient = CGGradient(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors: colors(for: value) as CFArray, locations: [0, 0.25, 0.5, 0.75, 1]) {