Commit cf9d270f by Daniel Dahan

added @IBInspectable where appropriate

parent 7eb6d70c
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
963236121C96512C00282A94 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963236111C96512C00282A94 /* Material.framework */; };
963236131C96512C00282A94 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 963236111C96512C00282A94 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9663F9321C7A744600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9311C7A744600AF0965 /* AppDelegate.swift */; };
9663F9341C7A744600AF0965 /* RecommendationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* RecommendationViewController.swift */; };
9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; };
......@@ -17,8 +19,6 @@
9663F94E1C7A74EA00AF0965 /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */; };
9663F9501C7A74FC00AF0965 /* AppRightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94F1C7A74FC00AF0965 /* AppRightViewController.swift */; };
9663F9521C7A751D00AF0965 /* ItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9511C7A751D00AF0965 /* ItemViewController.swift */; };
968F171F1C9273ED008CA3F6 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 968F171E1C9273ED008CA3F6 /* Material.framework */; };
968F17201C9273ED008CA3F6 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 968F171E1C9273ED008CA3F6 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96CC08881C7FEBD60034FF84 /* RecipesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */; };
/* End PBXBuildFile section */
......@@ -29,7 +29,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
968F17201C9273ED008CA3F6 /* Material.framework in Embed Frameworks */,
963236131C96512C00282A94 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -37,6 +37,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
963236111C96512C00282A94 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
9663F92E1C7A744600AF0965 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
9663F9311C7A744600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9663F9331C7A744600AF0965 /* RecommendationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendationViewController.swift; sourceTree = "<group>"; };
......@@ -49,7 +50,6 @@
9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.swift; sourceTree = "<group>"; };
9663F94F1C7A74FC00AF0965 /* AppRightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppRightViewController.swift; sourceTree = "<group>"; };
9663F9511C7A751D00AF0965 /* ItemViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemViewController.swift; sourceTree = "<group>"; };
968F171E1C9273ED008CA3F6 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecipesViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -58,7 +58,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
968F171F1C9273ED008CA3F6 /* Material.framework in Frameworks */,
963236121C96512C00282A94 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -68,7 +68,7 @@
9663F9251C7A744500AF0965 = {
isa = PBXGroup;
children = (
968F171E1C9273ED008CA3F6 /* Material.framework */,
963236111C96512C00282A94 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */,
);
......
......@@ -12,6 +12,8 @@
96212DCB1C1696D000F31053 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC31C1696D000F31053 /* LaunchScreen.storyboard */; };
96212DCC1C1696D000F31053 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC51C1696D000F31053 /* Main.storyboard */; };
96212DCE1C1696D000F31053 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96212DC81C1696D000F31053 /* ViewController.swift */; };
963236151C96578E00282A94 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963236141C96578E00282A94 /* Material.framework */; };
963236161C96578E00282A94 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 963236141C96578E00282A94 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -21,6 +23,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
963236161C96578E00282A94 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -34,6 +37,7 @@
96212DC61C1696D000F31053 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
96212DC71C1696D000F31053 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96212DC81C1696D000F31053 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
963236141C96578E00282A94 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
9ABEC4EF1C14F08200F6895E /* MaterialPulseView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MaterialPulseView.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
......@@ -42,6 +46,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
963236151C96578E00282A94 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -64,6 +69,7 @@
9ABEC4E61C14F08200F6895E = {
isa = PBXGroup;
children = (
963236141C96578E00282A94 /* Material.framework */,
96212DC01C1696D000F31053 /* MaterialPulseView */,
9ABEC4F01C14F08200F6895E /* Products */,
);
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<scenes>
<!--View Controller-->
......@@ -19,15 +19,16 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zN4-ul-wPl" customClass="MaterialPulseView" customModule="Material">
<rect key="frame" x="200" y="200" width="200" height="200"/>
<animations/>
<color key="backgroundColor" red="0.39222975830000001" green="0.2440954615" blue="0.68699765469999996" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="Dz1-jZ-jhl"/>
<constraint firstAttribute="height" constant="200" id="HWq-yF-e3p"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="image" keyPath="image" value="ContentAppIcon"/>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="zN4-ul-wPl" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="2rl-2s-lQp"/>
......@@ -43,4 +44,7 @@
<point key="canvasLocation" x="286" y="363"/>
</scene>
</scenes>
<resources>
<image name="ContentAppIcon" width="1024" height="1024"/>
</resources>
</document>
......@@ -37,25 +37,16 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Examples of using MaterialPulseView.
prepareGeneralMaterialPulseViewExample()
prepareMaterialPulseView()
}
/**
:name: prepareView
:description: General preparation statements.
*/
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareGeneralMaterialPulseViewExample
:description: General usage example.
*/
private func prepareGeneralMaterialPulseViewExample() {
pulseView.image = UIImage(named: "ContentAppIcon")
/// Prepares the pulseView.
private func prepareMaterialPulseView() {
pulseView.shape = .Circle
pulseView.depth = .Depth2
}
......
......@@ -489,9 +489,9 @@
96D88C4D1C1329BB00B91418 /* Animation */ = {
isa = PBXGroup;
children = (
96D88C131C1328D800B91418 /* MaterialTransitionAnimation.swift */,
96D88BFF1C1328D800B91418 /* MaterialAnimation.swift */,
96D88C001C1328D800B91418 /* MaterialBasicAnimation.swift */,
96D88C131C1328D800B91418 /* MaterialTransitionAnimation.swift */,
96D88C081C1328D800B91418 /* MaterialKeyframeAnimation.swift */,
968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */,
);
......
......@@ -123,7 +123,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
/**
:name: tapToFocusEnabled
*/
public var tapToFocusEnabled: Bool = false {
@IBInspectable public var tapToFocusEnabled: Bool = false {
didSet {
if tapToFocusEnabled {
tapToResetEnabled = true
......@@ -143,7 +143,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
/**
:name: tapToExposeEnabled
*/
public var tapToExposeEnabled: Bool = false {
@IBInspectable public var tapToExposeEnabled: Bool = false {
didSet {
if tapToExposeEnabled {
tapToResetEnabled = true
......@@ -163,7 +163,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
/**
:name: tapToResetEnabled
*/
public var tapToResetEnabled: Bool = false {
@IBInspectable public var tapToResetEnabled: Bool = false {
didSet {
if tapToResetEnabled {
prepareResetLayer()
......
......@@ -39,7 +39,7 @@ public class CardView : MaterialPulseView {
/**
:name: dividerColor
*/
public var dividerColor: UIColor? {
@IBInspectable public var dividerColor: UIColor? {
didSet {
dividerLayer?.backgroundColor = dividerColor?.CGColor
}
......@@ -48,7 +48,7 @@ public class CardView : MaterialPulseView {
/**
:name: divider
*/
public var divider: Bool = true {
@IBInspectable public var divider: Bool = true {
didSet {
reloadView()
}
......
......@@ -64,7 +64,7 @@ public class ControlView : MaterialView {
}
/// A wrapper around grid.spacing.
public var spacing: CGFloat {
@IBInspectable public var spacing: CGFloat {
get {
return grid.spacing
}
......
......@@ -39,7 +39,7 @@ public class ImageCardView : MaterialPulseView {
/**
:name: dividerColor
*/
public var dividerColor: UIColor? {
@IBInspectable public var dividerColor: UIColor? {
didSet {
dividerLayer?.backgroundColor = dividerColor?.CGColor
}
......@@ -48,7 +48,7 @@ public class ImageCardView : MaterialPulseView {
/**
:name: divider
*/
public var divider: Bool = true {
@IBInspectable public var divider: Bool = true {
didSet {
reloadView()
}
......@@ -80,7 +80,7 @@ public class ImageCardView : MaterialPulseView {
/**
:name: image
*/
public override var image: UIImage? {
@IBInspectable public override var image: UIImage? {
get {
return nil == imageLayer?.contents ? nil : UIImage(CGImage: imageLayer?.contents as! CGImage)
}
......@@ -108,7 +108,7 @@ public class ImageCardView : MaterialPulseView {
/**
:name: maxImageHeight
*/
public var maxImageHeight: CGFloat = 0 {
@IBInspectable public var maxImageHeight: CGFloat = 0 {
didSet {
if let v: UIImage = image {
if 0 < maxImageHeight {
......@@ -147,7 +147,7 @@ public class ImageCardView : MaterialPulseView {
/**
:name: contentsScale
*/
public override var contentsScale: CGFloat {
@IBInspectable public override var contentsScale: CGFloat {
didSet {
prepareImageLayer()
imageLayer?.contentsScale = contentsScale
......@@ -155,7 +155,7 @@ public class ImageCardView : MaterialPulseView {
}
/// Determines how content should be aligned within the visualLayer's bounds.
public override var contentsGravity: String {
@IBInspectable public override var contentsGravity: String {
get {
return nil == imageLayer ? "" : imageLayer!.contentsGravity
}
......
......@@ -68,7 +68,7 @@ public class MaterialCollectionView : UICollectionView {
}
/// Spacing between items.
public var spacing: CGFloat {
@IBInspectable public var spacing: CGFloat {
get {
return (collectionViewLayout as? MaterialCollectionViewLayout)!.spacing
}
......
......@@ -48,7 +48,7 @@ public class MaterialLabel : UILabel {
/**
:name: text
*/
public override var text: String? {
@IBInspectable public override var text: String? {
didSet {
textLayer.text = text
}
......@@ -57,7 +57,7 @@ public class MaterialLabel : UILabel {
/**
:name: textColor
*/
public override var textColor: UIColor? {
@IBInspectable public override var textColor: UIColor? {
didSet {
textLayer.textColor = textColor
}
......@@ -84,7 +84,7 @@ public class MaterialLabel : UILabel {
/**
:name: wrapped
*/
public var wrapped: Bool {
@IBInspectable public var wrapped: Bool {
didSet {
textLayer.wrapped = wrapped
}
......@@ -93,7 +93,7 @@ public class MaterialLabel : UILabel {
/**
:name: contentsScale
*/
public var contentsScale: CGFloat {
@IBInspectable public var contentsScale: CGFloat {
didSet {
textLayer.contentsScale = contentsScale
}
......
......@@ -44,7 +44,7 @@ public class MaterialLayer : CAShapeLayer {
public private(set) lazy var visualLayer: CAShapeLayer = CAShapeLayer()
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return frame.origin.x
}
......@@ -54,7 +54,7 @@ public class MaterialLayer : CAShapeLayer {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return frame.origin.y
}
......@@ -69,7 +69,7 @@ public class MaterialLayer : CAShapeLayer {
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return frame.size.width
}
......@@ -87,7 +87,7 @@ public class MaterialLayer : CAShapeLayer {
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return frame.size.height
}
......@@ -104,7 +104,7 @@ public class MaterialLayer : CAShapeLayer {
property. Images should not be set to the backing layer's contents
property to avoid conflicts when using clipsToBounds.
*/
public var image: UIImage? {
@IBInspectable public var image: UIImage? {
didSet {
visualLayer.contents = image?.CGImage
}
......@@ -137,7 +137,7 @@ public class MaterialLayer : CAShapeLayer {
dimensions of the visualLayer's contents property and the size
of the layer. By default, this value is set to the MaterialDevice.scale.
*/
public override var contentsScale: CGFloat {
@IBInspectable public override var contentsScale: CGFloat {
didSet {
visualLayer.contentsScale = contentsScale
}
......@@ -151,7 +151,7 @@ public class MaterialLayer : CAShapeLayer {
}
/// Determines how content should be aligned within the visualLayer's bounds.
public override var contentsGravity: String {
@IBInspectable public override var contentsGravity: String {
get {
return visualLayer.contentsGravity
}
......@@ -161,7 +161,7 @@ public class MaterialLayer : CAShapeLayer {
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = true {
@IBInspectable public var shadowPathAutoSizeEnabled: Bool = true {
didSet {
if shadowPathAutoSizeEnabled {
layoutShadowPath()
......@@ -204,7 +204,7 @@ public class MaterialLayer : CAShapeLayer {
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public override var cornerRadius: CGFloat {
@IBInspectable public override var cornerRadius: CGFloat {
didSet {
layoutShadowPath()
if .Circle == shape {
......
......@@ -32,19 +32,19 @@ import UIKit
public class MaterialPulseView : MaterialView {
/// To use a single pulse and have it focused when held.
public var pulseFocus: Bool = false
@IBInspectable public var pulseFocus: Bool = false
/// A pulse layer for focus handling.
public private(set) var pulseLayer: CAShapeLayer?
/// Sets whether the scaling animation should be used.
public lazy var pulseScale: Bool = true
@IBInspectable public lazy var pulseScale: Bool = true
/// The opcaity value for the pulse animation.
public var pulseColorOpacity: CGFloat = 0.25
@IBInspectable public var pulseOpacity: CGFloat = 0.25
/// The color of the pulse effect.
public var pulseColor: UIColor?
@IBInspectable public var pulseColor: UIColor?
/**
Triggers the pulse animation.
......@@ -59,7 +59,7 @@ public class MaterialPulseView : MaterialView {
let duration: NSTimeInterval = MaterialAnimation.pulseDuration(width)
if let v: UIColor = pulseColor {
MaterialAnimation.pulseAnimation(layer, visualLayer: visualLayer, color: v.colorWithAlphaComponent(pulseColorOpacity), point: point!, width: width, height: height, duration: duration)
MaterialAnimation.pulseAnimation(layer, visualLayer: visualLayer, color: v.colorWithAlphaComponent(pulseOpacity), point: point!, width: width, height: height, duration: duration)
}
if pulseScale {
......@@ -89,9 +89,7 @@ public class MaterialPulseView : MaterialView {
}
if let v: UIColor = pulseColor {
let point: CGPoint = layer.convertPoint(touches.first!.locationInView(self), fromLayer: layer)
MaterialAnimation.pulseAnimation(layer, visualLayer: visualLayer, color: v.colorWithAlphaComponent(pulseColorOpacity), point: point, width: width, height: height, duration: duration, pulseLayer: pulseLayer)
MaterialAnimation.pulseAnimation(layer, visualLayer: visualLayer, color: v.colorWithAlphaComponent(pulseOpacity), point: layer.convertPoint(touches.first!.locationInView(self), fromLayer: layer), width: width, height: height, duration: duration, pulseLayer: pulseLayer)
}
if pulseScale {
......
......@@ -74,7 +74,7 @@ public class MaterialSwitch: UIControl {
private var bounceOffset: CGFloat = 3
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
......@@ -84,7 +84,7 @@ public class MaterialSwitch: UIControl {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
......@@ -94,7 +94,7 @@ public class MaterialSwitch: UIControl {
}
/// A property that accesses the layer.frame.origin.width property.
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
......@@ -104,7 +104,7 @@ public class MaterialSwitch: UIControl {
}
/// A property that accesses the layer.frame.origin.height property.
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
......@@ -117,35 +117,35 @@ public class MaterialSwitch: UIControl {
public var delegate: MaterialSwitchDelegate?
/// Indicates if the animation should bounce.
public var bounceable: Bool = true {
@IBInspectable public var bounceable: Bool = true {
didSet {
bounceOffset = bounceable ? 3 : 0
}
}
/// Button on color.
public var buttonOnColor: UIColor = MaterialColor.clear
@IBInspectable public var buttonOnColor: UIColor = MaterialColor.clear
/// Button off color.
public var buttonOffColor: UIColor = MaterialColor.clear
@IBInspectable public var buttonOffColor: UIColor = MaterialColor.clear
/// Track on color.
public var trackOnColor: UIColor = MaterialColor.clear
@IBInspectable public var trackOnColor: UIColor = MaterialColor.clear
/// Track off color.
public var trackOffColor: UIColor = MaterialColor.clear
@IBInspectable public var trackOffColor: UIColor = MaterialColor.clear
/// Button on disabled color.
public var buttonOnDisabledColor: UIColor = MaterialColor.clear
@IBInspectable public var buttonOnDisabledColor: UIColor = MaterialColor.clear
/// Track on disabled color.
public var trackOnDisabledColor: UIColor = MaterialColor.clear
@IBInspectable public var trackOnDisabledColor: UIColor = MaterialColor.clear
/// Button off disabled color.
public var buttonOffDisabledColor: UIColor = MaterialColor.clear
@IBInspectable public var buttonOffDisabledColor: UIColor = MaterialColor.clear
/// Track off disabled color.
public var trackOffDisabledColor: UIColor = MaterialColor.clear
@IBInspectable public var trackOffDisabledColor: UIColor = MaterialColor.clear
/// Track view reference.
public private(set) var trackLayer: MaterialLayer {
......@@ -161,14 +161,14 @@ public class MaterialSwitch: UIControl {
}
}
public override var enabled: Bool {
@IBInspectable public override var enabled: Bool {
didSet {
styleForState(internalSwitchState)
}
}
/// A boolean indicating if the switch is on or not.
public var on: Bool {
@IBInspectable public var on: Bool {
get {
return .On == internalSwitchState
}
......
......@@ -46,7 +46,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: text
*/
public var text: String? {
@IBInspectable public var text: String? {
didSet {
string = text as? AnyObject
}
......@@ -55,7 +55,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: pointSize
*/
public var pointSize: CGFloat = 10 {
@IBInspectable public var pointSize: CGFloat = 10 {
didSet {
fontSize = pointSize
}
......@@ -64,7 +64,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: textColor
*/
public var textColor: UIColor? {
@IBInspectable public var textColor: UIColor? {
didSet {
foregroundColor = textColor?.CGColor
}
......@@ -115,7 +115,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: x
*/
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return frame.origin.x
}
......@@ -127,7 +127,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: y
*/
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return frame.origin.y
}
......@@ -139,7 +139,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: width
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return frame.size.width
}
......@@ -151,7 +151,7 @@ public class MaterialTextLayer : CATextLayer {
/**
:name: height
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return frame.size.height
}
......
......@@ -50,7 +50,7 @@ public class MaterialView : UIView {
property. Images should not be set to the backing layer's contents
property to avoid conflicts when using clipsToBounds.
*/
public var image: UIImage? {
@IBInspectable public var image: UIImage? {
didSet {
visualLayer.contents = image?.CGImage
}
......@@ -89,7 +89,7 @@ public class MaterialView : UIView {
dimensions of the visualLayer's contents property and the size
of the view. By default, this value is set to the MaterialDevice.scale.
*/
public var contentsScale: CGFloat {
@IBInspectable public var contentsScale: CGFloat {
get {
return visualLayer.contentsScale
}
......@@ -99,14 +99,14 @@ public class MaterialView : UIView {
}
/// A Preset for the contentsGravity property.
public var contentsGravityPreset: MaterialGravity {
@IBInspectable public var contentsGravityPreset: MaterialGravity {
didSet {
contentsGravity = MaterialGravityToString(contentsGravityPreset)
}
}
/// Determines how content should be aligned within the visualLayer's bounds.
public var contentsGravity: String {
@IBInspectable public var contentsGravity: String {
get {
return visualLayer.contentsGravity
}
......@@ -121,7 +121,7 @@ public class MaterialView : UIView {
the image property, then this value does not need to be set, since the
visualLayer's maskToBounds is set to true by default.
*/
public var masksToBounds: Bool {
@IBInspectable public var masksToBounds: Bool {
get {
return layer.masksToBounds
}
......@@ -131,14 +131,14 @@ public class MaterialView : UIView {
}
/// A property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
@IBInspectable public override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.CGColor
}
}
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
......@@ -148,7 +148,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
......@@ -163,7 +163,7 @@ public class MaterialView : UIView {
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
......@@ -181,7 +181,7 @@ public class MaterialView : UIView {
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
......@@ -194,7 +194,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the backing layer's shadowColor.
public var shadowColor: UIColor? {
@IBInspectable public var shadowColor: UIColor? {
didSet {
layer.shadowColor = shadowColor?.CGColor
}
......@@ -211,7 +211,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the backing layer's shadowOpacity.
public var shadowOpacity: Float {
@IBInspectable public var shadowOpacity: Float {
get {
return layer.shadowOpacity
}
......@@ -221,7 +221,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the backing layer's shadowRadius.
public var shadowRadius: CGFloat {
@IBInspectable public var shadowRadius: CGFloat {
get {
return layer.shadowRadius
}
......@@ -241,7 +241,7 @@ public class MaterialView : UIView {
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = true {
@IBInspectable public var shadowPathAutoSizeEnabled: Bool = true {
didSet {
if shadowPathAutoSizeEnabled {
layoutShadowPath()
......@@ -280,7 +280,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat {
@IBInspectable public var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
......@@ -319,7 +319,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
@IBInspectable public var borderWidth: CGFloat {
get {
return layer.borderWidth
}
......@@ -329,7 +329,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.borderColor property.
public var borderColor: UIColor? {
@IBInspectable public var borderColor: UIColor? {
get {
return nil == layer.borderColor ? nil : UIColor(CGColor: layer.borderColor!)
}
......@@ -339,7 +339,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.position property.
public var position: CGPoint {
@IBInspectable public var position: CGPoint {
get {
return layer.position
}
......@@ -349,7 +349,7 @@ public class MaterialView : UIView {
}
/// A property that accesses the layer.zPosition property.
public var zPosition: CGFloat {
@IBInspectable public var zPosition: CGFloat {
get {
return layer.zPosition
}
......
......@@ -56,7 +56,7 @@ public class MenuViewController: UIViewController {
A Boolean property used to enable and disable interactivity
with the mainViewController.
*/
public var userInteractionEnabled: Bool {
@IBInspectable public var userInteractionEnabled: Bool {
get {
return mainViewController.view.userInteractionEnabled
}
......
......@@ -50,11 +50,15 @@ public class NavigationBar : UINavigationBar {
The back button image writes to the backIndicatorImage property and
backIndicatorTransitionMaskImage property.
*/
public var backButtonImage: UIImage? {
@IBInspectable public var backButtonImage: UIImage? {
didSet {
if nil == backButtonImage {
backButtonImage = MaterialIcon.arrowBack
}
backIndicatorImage = backButtonImage
backIndicatorTransitionMaskImage = backButtonImage
backButton.setImage(backButtonImage, forState: .Normal)
backButton.setImage(backButtonImage, forState: .Highlighted)
}
}
......@@ -78,7 +82,7 @@ public class NavigationBar : UINavigationBar {
the image property, then this value does not need to be set, since the
visualLayer's maskToBounds is set to true by default.
*/
public var masksToBounds: Bool {
@IBInspectable public var masksToBounds: Bool {
get {
return layer.masksToBounds
}
......@@ -88,14 +92,14 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
@IBInspectable public override var backgroundColor: UIColor? {
didSet {
barTintColor = backgroundColor
}
}
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
......@@ -105,7 +109,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
......@@ -120,7 +124,7 @@ public class NavigationBar : UINavigationBar {
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
......@@ -135,7 +139,7 @@ public class NavigationBar : UINavigationBar {
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
......@@ -145,7 +149,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the backing layer's shadowColor.
public var shadowColor: UIColor? {
@IBInspectable public var shadowColor: UIColor? {
didSet {
layer.shadowColor = shadowColor?.CGColor
}
......@@ -162,7 +166,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the backing layer's shadowOpacity.
public var shadowOpacity: Float {
@IBInspectable public var shadowOpacity: Float {
get {
return layer.shadowOpacity
}
......@@ -172,7 +176,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the backing layer's shadowRadius.
public var shadowRadius: CGFloat {
@IBInspectable public var shadowRadius: CGFloat {
get {
return layer.shadowRadius
}
......@@ -203,7 +207,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
@IBInspectable public var borderWidth: CGFloat {
get {
return layer.borderWidth
}
......@@ -213,7 +217,7 @@ public class NavigationBar : UINavigationBar {
}
/// A property that accesses the layer.borderColor property.
public var borderColor: UIColor? {
@IBInspectable public var borderColor: UIColor? {
get {
return nil == layer.borderColor ? nil : UIColor(CGColor: layer.borderColor!)
}
......
......@@ -66,7 +66,7 @@ public protocol NavigationBarViewControllerDelegate : MaterialDelegate {
@objc(NavigationBarViewController)
public class NavigationBarViewController: StatusBarViewController {
/// The height of the StatusBar.
public override var heightForStatusBar: CGFloat {
@IBInspectable public override var heightForStatusBar: CGFloat {
get {
return navigationBarView.heightForStatusBar
}
......@@ -76,7 +76,7 @@ public class NavigationBarViewController: StatusBarViewController {
}
/// The height when in Portrait orientation mode.
public override var heightForPortraitOrientation: CGFloat {
@IBInspectable public override var heightForPortraitOrientation: CGFloat {
get {
return navigationBarView.heightForPortraitOrientation
}
......@@ -86,7 +86,7 @@ public class NavigationBarViewController: StatusBarViewController {
}
/// The height when in Landscape orientation mode.
public override var heightForLandscapeOrientation: CGFloat {
@IBInspectable public override var heightForLandscapeOrientation: CGFloat {
get {
return navigationBarView.heightForLandscapeOrientation
}
......
......@@ -45,28 +45,28 @@ public class SearchBarView : StatusBarView {
}
/// TintColor for searchBar.
public override var tintColor: UIColor? {
@IBInspectable public override var tintColor: UIColor? {
didSet {
textField.tintColor = tintColor
}
}
/// TextColor for searchBar.
public var textColor: UIColor? {
@IBInspectable public var textColor: UIColor? {
didSet {
textField.textColor = textColor
}
}
/// A wrapper for searchBar.placeholder.
public var placeholder: String? {
@IBInspectable public var placeholder: String? {
didSet {
textField.placeholder = placeholder
}
}
/// Placeholder textColor.
public var placeholderTextColor: UIColor {
@IBInspectable public var placeholderTextColor: UIColor {
get {
return textField.placeholderTextColor
}
......
......@@ -50,7 +50,7 @@ public extension UIViewController {
public class SearchBarViewController: StatusBarViewController {
/// The height of the StatusBar.
public override var heightForStatusBar: CGFloat {
@IBInspectable public override var heightForStatusBar: CGFloat {
get {
return searchBarView.heightForStatusBar
}
......@@ -60,7 +60,7 @@ public class SearchBarViewController: StatusBarViewController {
}
/// The height when in Portrait orientation mode.
public override var heightForPortraitOrientation: CGFloat {
@IBInspectable public override var heightForPortraitOrientation: CGFloat {
get {
return searchBarView.heightForPortraitOrientation
}
......@@ -70,7 +70,7 @@ public class SearchBarViewController: StatusBarViewController {
}
/// The height when in Landscape orientation mode.
public override var heightForLandscapeOrientation: CGFloat {
@IBInspectable public override var heightForLandscapeOrientation: CGFloat {
get {
return searchBarView.heightForLandscapeOrientation
}
......
......@@ -139,7 +139,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
leftView is closed. The leftViewThreshold is always at half
the width of the leftView.
*/
public private(set) var leftViewThreshold: CGFloat = 0
@IBInspectable public var leftViewThreshold: CGFloat = 0
/**
A CGFloat property that accesses the rightView threshold of
......@@ -149,7 +149,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
rightView is opened. The rightViewThreshold is always at half
the width of the rightView.
*/
public private(set) var rightViewThreshold: CGFloat = 0
@IBInspectable public var rightViewThreshold: CGFloat = 0
/**
A SideNavigationViewControllerDelegate property used to bind
......@@ -161,7 +161,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A Boolean property used to enable and disable interactivity
with the mainViewController.
*/
public var userInteractionEnabled: Bool {
@IBInspectable public var userInteractionEnabled: Bool {
get {
return mainViewController.view.userInteractionEnabled
}
......@@ -174,13 +174,13 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A CGFloat property that sets the animation duration of the
leftView when closing and opening. Defaults to 0.25.
*/
public var animationDuration: CGFloat = 0.25
@IBInspectable public var animationDuration: CGFloat = 0.25
/**
A Boolean property that enables and disables the leftView from
opening and closing. Defaults to true.
*/
public var enabled: Bool {
@IBInspectable public var enabled: Bool {
get {
return enabledLeftView || enabledRightView
}
......@@ -198,19 +198,19 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A Boolean property that enables and disables the leftView from
opening and closing. Defaults to true.
*/
public var enabledLeftView: Bool = true
@IBInspectable public var enabledLeftView: Bool = true
/**
A Boolean property that enables and disables the rightView from
opening and closing. Defaults to true.
*/
public var enabledRightView: Bool = true
@IBInspectable public var enabledRightView: Bool = true
/**
A Boolean property that triggers the status bar to be hidden
when the leftView is opened. Defaults to true.
*/
public var hideStatusBar: Bool = true
@IBInspectable public var hideStatusBar: Bool = true
/**
A MaterialDepth property that is used to set the depth of the
......@@ -277,13 +277,13 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
A CGFloat property to access the width that the leftView
opens up to.
*/
public private(set) var leftViewWidth: CGFloat = 240
@IBInspectable public private(set) var leftViewWidth: CGFloat = 240
/**
A CGFloat property to access the width that the rightView
opens up to.
*/
public private(set) var rightViewWidth: CGFloat = 240
@IBInspectable public private(set) var rightViewWidth: CGFloat = 240
/**
An initializer for the SideNavigationViewController.
......
......@@ -32,13 +32,13 @@ import UIKit
public class StatusBarView : ControlView {
/// The height of the StatusBar.
public var heightForStatusBar: CGFloat = 20
@IBInspectable public var heightForStatusBar: CGFloat = 20
/// The height when in Portrait orientation mode.
public var heightForPortraitOrientation: CGFloat = 64
@IBInspectable public var heightForPortraitOrientation: CGFloat = 64
/// The height when in Landscape orientation mode.
public var heightForLandscapeOrientation: CGFloat = 44
@IBInspectable public var heightForLandscapeOrientation: CGFloat = 44
/// Device status bar style.
public var statusBarStyle: UIStatusBarStyle {
......
......@@ -32,19 +32,19 @@ import UIKit
public class StatusBarViewController: UIViewController {
/// The height of the StatusBar.
public var heightForStatusBar: CGFloat = 20
@IBInspectable public var heightForStatusBar: CGFloat = 20
/// The height when in Portrait orientation mode.
public var heightForPortraitOrientation: CGFloat = 64
@IBInspectable public var heightForPortraitOrientation: CGFloat = 64
/// The height when in Landscape orientation mode.
public var heightForLandscapeOrientation: CGFloat = 44
@IBInspectable public var heightForLandscapeOrientation: CGFloat = 44
/**
A Boolean property used to enable and disable interactivity
with the mainViewController.
*/
public var userInteractionEnabled: Bool {
@IBInspectable public var userInteractionEnabled: Bool {
get {
return mainViewController.view.userInteractionEnabled
}
......
......@@ -37,7 +37,7 @@ public class TextField : UITextField {
This property is the same as clipsToBounds. It crops any of the view's
contents from bleeding past the view's frame.
*/
public var masksToBounds: Bool {
@IBInspectable public var masksToBounds: Bool {
get {
return layer.masksToBounds
}
......@@ -47,14 +47,14 @@ public class TextField : UITextField {
}
/// A property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
@IBInspectable public override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.CGColor
}
}
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
......@@ -64,7 +64,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
......@@ -79,7 +79,7 @@ public class TextField : UITextField {
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
......@@ -97,7 +97,7 @@ public class TextField : UITextField {
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
......@@ -110,7 +110,7 @@ public class TextField : UITextField {
}
/// A property that accesses the backing layer's shadowColor.
public var shadowColor: UIColor? {
@IBInspectable public var shadowColor: UIColor? {
didSet {
layer.shadowColor = shadowColor?.CGColor
}
......@@ -127,7 +127,7 @@ public class TextField : UITextField {
}
/// A property that accesses the backing layer's shadowOpacity.
public var shadowOpacity: Float {
@IBInspectable public var shadowOpacity: Float {
get {
return layer.shadowOpacity
}
......@@ -137,7 +137,7 @@ public class TextField : UITextField {
}
/// A property that accesses the backing layer's shadowRadius.
public var shadowRadius: CGFloat {
@IBInspectable public var shadowRadius: CGFloat {
get {
return layer.shadowRadius
}
......@@ -157,7 +157,7 @@ public class TextField : UITextField {
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = true {
@IBInspectable public var shadowPathAutoSizeEnabled: Bool = true {
didSet {
if shadowPathAutoSizeEnabled {
layoutShadowPath()
......@@ -196,7 +196,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat {
@IBInspectable public var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
......@@ -235,7 +235,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
@IBInspectable public var borderWidth: CGFloat {
get {
return layer.borderWidth
}
......@@ -245,7 +245,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.borderColor property.
public var borderColor: UIColor? {
@IBInspectable public var borderColor: UIColor? {
get {
return nil == layer.borderColor ? nil : UIColor(CGColor: layer.borderColor!)
}
......@@ -255,7 +255,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.position property.
public var position: CGPoint {
@IBInspectable public var position: CGPoint {
get {
return layer.position
}
......@@ -265,7 +265,7 @@ public class TextField : UITextField {
}
/// A property that accesses the layer.zPosition property.
public var zPosition: CGFloat {
@IBInspectable public var zPosition: CGFloat {
get {
return layer.zPosition
}
......@@ -298,7 +298,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
bottomBorderLayer.
*/
public var bottomBorderLayerDistance: CGFloat = 4
@IBInspectable public var bottomBorderLayerDistance: CGFloat = 4
/**
The title UILabel that is displayed when there is text. The
......@@ -312,7 +312,7 @@ public class TextField : UITextField {
}
/// The color of the titleLabel text when the textField is not active.
public var titleLabelColor: UIColor? {
@IBInspectable public var titleLabelColor: UIColor? {
didSet {
titleLabel?.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in
......@@ -322,16 +322,16 @@ public class TextField : UITextField {
}
/// The color of the titleLabel text when the textField is active.
public var titleLabelActiveColor: UIColor?
@IBInspectable public var titleLabelActiveColor: UIColor?
/**
A property that sets the distance between the textField and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 8
@IBInspectable public var titleLabelAnimationDistance: CGFloat = 8
/// An override to the text property.
public override var text: String? {
@IBInspectable public override var text: String? {
didSet {
textFieldDidChange()
}
......@@ -351,7 +351,7 @@ public class TextField : UITextField {
The color of the detailLabel text when the detailLabelHidden property
is set to false.
*/
public var detailLabelActiveColor: UIColor? {
@IBInspectable public var detailLabelActiveColor: UIColor? {
didSet {
if !detailLabelHidden {
detailLabel?.textColor = detailLabelActiveColor
......@@ -366,18 +366,18 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
detailLabel.
*/
public var detailLabelAnimationDistance: CGFloat = 8
@IBInspectable public var detailLabelAnimationDistance: CGFloat = 8
/**
A Boolean that indicates the detailLabel should hide
automatically when text changes.
*/
public var detailLabelAutoHideEnabled: Bool = true
@IBInspectable public var detailLabelAutoHideEnabled: Bool = true
/**
:name: detailLabelHidden
*/
public var detailLabelHidden: Bool = true {
@IBInspectable public var detailLabelHidden: Bool = true {
didSet {
if detailLabelHidden {
detailLabel?.textColor = titleLabelColor
......@@ -396,7 +396,7 @@ public class TextField : UITextField {
}
/// A wrapper for searchBar.placeholder.
public override var placeholder: String? {
@IBInspectable public override var placeholder: String? {
didSet {
if let v: String = placeholder {
attributedPlaceholder = NSAttributedString(string: v, attributes: [NSForegroundColorAttributeName: placeholderTextColor])
......@@ -405,7 +405,7 @@ public class TextField : UITextField {
}
/// Placeholder textColor.
public var placeholderTextColor: UIColor = MaterialColor.black {
@IBInspectable public var placeholderTextColor: UIColor = MaterialColor.black {
didSet {
if let v: String = placeholder {
attributedPlaceholder = NSAttributedString(string: v, attributes: [NSForegroundColorAttributeName: placeholderTextColor])
......
......@@ -39,7 +39,7 @@ public class TextView: UITextView {
This property is the same as clipsToBounds. It crops any of the view's
contents from bleeding past the view's frame.
*/
public var masksToBounds: Bool {
@IBInspectable public var masksToBounds: Bool {
get {
return layer.masksToBounds
}
......@@ -49,14 +49,14 @@ public class TextView: UITextView {
}
/// A property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
@IBInspectable public override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.CGColor
}
}
/// A property that accesses the layer.frame.origin.x property.
public var x: CGFloat {
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
......@@ -66,7 +66,7 @@ public class TextView: UITextView {
}
/// A property that accesses the layer.frame.origin.y property.
public var y: CGFloat {
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
......@@ -81,7 +81,7 @@ public class TextView: UITextView {
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
public var width: CGFloat {
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
......@@ -99,7 +99,7 @@ public class TextView: UITextView {
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
public var height: CGFloat {
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
......@@ -112,7 +112,7 @@ public class TextView: UITextView {
}
/// A property that accesses the backing layer's shadowColor.
public var shadowColor: UIColor? {
@IBInspectable public var shadowColor: UIColor? {
didSet {
layer.shadowColor = shadowColor?.CGColor
}
......@@ -129,7 +129,7 @@ public class TextView: UITextView {
}
/// A property that accesses the backing layer's shadowOpacity.
public var shadowOpacity: Float {
@IBInspectable public var shadowOpacity: Float {
get {
return layer.shadowOpacity
}
......@@ -139,7 +139,7 @@ public class TextView: UITextView {
}
/// A property that accesses the backing layer's shadowRadius.
public var shadowRadius: CGFloat {
@IBInspectable public var shadowRadius: CGFloat {
get {
return layer.shadowRadius
}
......@@ -159,7 +159,7 @@ public class TextView: UITextView {
}
/// Enables automatic shadowPath sizing.
public var shadowPathAutoSizeEnabled: Bool = true {
@IBInspectable public var shadowPathAutoSizeEnabled: Bool = true {
didSet {
if shadowPathAutoSizeEnabled {
layoutShadowPath()
......@@ -198,7 +198,7 @@ public class TextView: UITextView {
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat {
@IBInspectable public var cornerRadius: CGFloat {
get {
return layer.cornerRadius
}
......@@ -237,7 +237,7 @@ public class TextView: UITextView {
}
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
@IBInspectable public var borderWidth: CGFloat {
get {
return layer.borderWidth
}
......@@ -247,7 +247,7 @@ public class TextView: UITextView {
}
/// A property that accesses the layer.borderColor property.
public var borderColor: UIColor? {
@IBInspectable public var borderColor: UIColor? {
get {
return nil == layer.borderColor ? nil : UIColor(CGColor: layer.borderColor!)
}
......@@ -267,7 +267,7 @@ public class TextView: UITextView {
}
/// A property that accesses the layer.zPosition property.
public var zPosition: CGFloat {
@IBInspectable public var zPosition: CGFloat {
get {
return layer.zPosition
}
......@@ -288,20 +288,20 @@ public class TextView: UITextView {
}
/// The color of the titleLabel text when the textView is not active.
public var titleLabelColor: UIColor? {
@IBInspectable public var titleLabelColor: UIColor? {
didSet {
titleLabel?.textColor = titleLabelColor
}
}
/// The color of the titleLabel text when the textView is active.
public var titleLabelActiveColor: UIColor?
@IBInspectable public var titleLabelActiveColor: UIColor?
/**
A property that sets the distance between the textView and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 8
@IBInspectable public var titleLabelAnimationDistance: CGFloat = 8
/// Placeholder UILabel view.
public var placeholderLabel: UILabel? {
......@@ -311,7 +311,7 @@ public class TextView: UITextView {
}
/// An override to the text property.
public override var text: String! {
@IBInspectable public override var text: String! {
didSet {
handleTextViewTextDidChange()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment