Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed invalid inspectable properties #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Source/MKButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ public class MKButton : UIButton
mkLayer.enableMask(maskEnabled)
}
}
@IBInspectable public var rippleLocation: MKRippleLocation = .TapLocation {
public var rippleLocation: MKRippleLocation = .TapLocation {
didSet {
mkLayer.rippleLocation = rippleLocation
}
}
@IBInspectable public var rippleLocationAdapter: Int {
get {
return rippleLocation.rawValue
}
set(index) {
rippleLocation = MKRippleLocation(rawValue: index) ?? .TapLocation
}
}
@IBInspectable public var ripplePercent: Float = 0.9 {
didSet {
mkLayer.ripplePercent = ripplePercent
Expand All @@ -44,9 +52,9 @@ public class MKButton : UIButton
@IBInspectable public var backgroundAniDuration: Float = 1.0
@IBInspectable public var shadowAniDuration: Float = 0.65

@IBInspectable public var rippleAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var backgroundAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var shadowAniTimingFunction: MKTimingFunction = .EaseOut
public var rippleAniTimingFunction: MKTimingFunction = .Linear
public var backgroundAniTimingFunction: MKTimingFunction = .Linear
public var shadowAniTimingFunction: MKTimingFunction = .EaseOut

@IBInspectable public var cornerRadius: CGFloat = 2.5 {
didSet {
Expand Down
14 changes: 11 additions & 3 deletions Source/MKImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@ public class MKImageView: UIImageView
mkLayer.enableMask(maskEnabled)
}
}
@IBInspectable public var rippleLocation: MKRippleLocation = .TapLocation {
public var rippleLocation: MKRippleLocation = .TapLocation {
didSet {
mkLayer.rippleLocation = rippleLocation
}
}
@IBInspectable public var rippleLocationAdapter: Int {
get {
return rippleLocation.rawValue
}
set(index) {
rippleLocation = MKRippleLocation(rawValue: index) ?? .TapLocation
}
}
@IBInspectable public var rippleAniDuration: Float = 0.75
@IBInspectable public var backgroundAniDuration: Float = 1.0
@IBInspectable public var rippleAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var backgroundAniTimingFunction: MKTimingFunction = .Linear
public var rippleAniTimingFunction: MKTimingFunction = .Linear
public var backgroundAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var backgroundAniEnabled: Bool = true {
didSet {
if !backgroundAniEnabled {
Expand Down
14 changes: 11 additions & 3 deletions Source/MKLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ public class MKLabel: UILabel {
mkLayer.enableMask(maskEnabled)
}
}
@IBInspectable public var rippleLocation: MKRippleLocation = .TapLocation {
public var rippleLocation: MKRippleLocation = .TapLocation {
didSet {
mkLayer.rippleLocation = rippleLocation
}
}
@IBInspectable public var rippleLocationAdapter: Int {
get {
return rippleLocation.rawValue
}
set(index) {
rippleLocation = MKRippleLocation(rawValue: index) ?? .TapLocation
}
}
@IBInspectable public var rippleAniDuration: Float = 0.75
@IBInspectable public var backgroundAniDuration: Float = 1.0
@IBInspectable public var rippleAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var backgroundAniTimingFunction: MKTimingFunction = .Linear
public var rippleAniTimingFunction: MKTimingFunction = .Linear
public var backgroundAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var backgroundAniEnabled: Bool = true {
didSet {
if !backgroundAniEnabled {
Expand Down
4 changes: 2 additions & 2 deletions Source/MKLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public enum MKTimingFunction {
}
}

public enum MKRippleLocation {
case Center
public enum MKRippleLocation: Int {
case Center = 0
case Left
case Right
case TapLocation
Expand Down
12 changes: 10 additions & 2 deletions Source/MKTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
import UIKit

public class MKTableViewCell : UITableViewCell {
@IBInspectable public var rippleLocation: MKRippleLocation = .TapLocation {
public var rippleLocation: MKRippleLocation = .TapLocation {
didSet {
mkLayer.rippleLocation = rippleLocation
}
}
@IBInspectable public var rippleLocationAdapter: Int {
get {
return rippleLocation.rawValue
}
set(index) {
rippleLocation = MKRippleLocation(rawValue: index) ?? .TapLocation
}
}
@IBInspectable public var rippleAniDuration: Float = 0.75
@IBInspectable public var backgroundAniDuration: Float = 1.0
@IBInspectable public var rippleAniTimingFunction: MKTimingFunction = .Linear
public var rippleAniTimingFunction: MKTimingFunction = .Linear
@IBInspectable public var shadowAniEnabled: Bool = true

// color
Expand Down
14 changes: 11 additions & 3 deletions Source/MKTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@ public class MKTextField : UITextField {
@IBInspectable public var floatingLabelBottomMargin: CGFloat = 2.0
@IBInspectable public var floatingPlaceholderEnabled: Bool = false

@IBInspectable public var rippleLocation: MKRippleLocation = .TapLocation {
public var rippleLocation: MKRippleLocation = .TapLocation {
didSet {
mkLayer.rippleLocation = rippleLocation
}
}
@IBInspectable public var rippleLocationAdapter: Int {
get {
return rippleLocation.rawValue
}
set(index) {
rippleLocation = MKRippleLocation(rawValue: index) ?? .TapLocation
}
}

@IBInspectable public var rippleAniDuration: Float = 0.75
@IBInspectable public var backgroundAniDuration: Float = 1.0
@IBInspectable public var shadowAniEnabled: Bool = true
@IBInspectable public var rippleAniTimingFunction: MKTimingFunction = .Linear
public var rippleAniTimingFunction: MKTimingFunction = .Linear

@IBInspectable public var cornerRadius: CGFloat = 2.5 {
didSet {
Expand All @@ -45,7 +53,7 @@ public class MKTextField : UITextField {
}

// floating label
@IBInspectable public var floatingLabelFont: UIFont = UIFont.boldSystemFontOfSize(10.0) {
public var floatingLabelFont: UIFont = UIFont.boldSystemFontOfSize(10.0) {
didSet {
floatingLabel.font = floatingLabelFont
}
Expand Down