Commit 20e6c252 by Daniel Dahan

added JSON

parent 4a66e2e2
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
960590421C39E43400691E88 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 960590411C39E43400691E88 /* MaterialKit.framework */; };
960590431C39E43400691E88 /* MaterialKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 960590411C39E43400691E88 /* MaterialKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96D88C831C132C1800B91418 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C821C132C1800B91418 /* AppDelegate.swift */; };
96D88C851C132C1800B91418 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C841C132C1800B91418 /* ViewController.swift */; };
96D88C8A1C132C1800B91418 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D88C891C132C1800B91418 /* Assets.xcassets */; };
......@@ -20,6 +22,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
960590431C39E43400691E88 /* MaterialKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -27,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
960590411C39E43400691E88 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MaterialKit.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/MaterialKit-gdulktuccbcfwbdfadtpxkworhyc/Build/Products/Debug-iphoneos/MaterialKit.framework"; sourceTree = "<absolute>"; };
96D88C7F1C132C1800B91418 /* NavigationBarView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarView.app; sourceTree = BUILT_PRODUCTS_DIR; };
96D88C821C132C1800B91418 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96D88C841C132C1800B91418 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
......@@ -40,6 +44,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
960590421C39E43400691E88 /* MaterialKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -49,6 +54,7 @@
96D88C761C132C1800B91418 = {
isa = PBXGroup;
children = (
960590411C39E43400691E88 /* MaterialKit.framework */,
96D88C811C132C1800B91418 /* NavigationBarView */,
96D88C801C132C1800B91418 /* Products */,
);
......
......@@ -31,8 +31,8 @@ class ViewController: UIViewController {
// prepareOrientationSupportExample()
// prepareDetailLabelExample()
// prepareBackgroundImageExample()
// prepareButtonExample()
prepareAlignTitleAndDetailLabelToLeftExample()
prepareButtonExample()
// prepareAlignTitleAndDetailLabelToLeftExample()
}
/**
......
......@@ -50,8 +50,8 @@ class ViewController: UIViewController, TextFieldDelegate {
nameField.textColor = MaterialColor.black
nameField.titleLabel = UILabel()
nameField.titleLabel!.font = RobotoFont.mediumWithSize(12)
nameField.titleLabelTextColor = MaterialColor.grey.lighten1
nameField.titleLabelActiveTextColor = MaterialColor.blue.accent3
nameField.titleLabelColor = MaterialColor.grey.lighten1
nameField.titleLabelActiveColor = MaterialColor.blue.accent3
nameField.clearButtonMode = .WhileEditing
view.addSubview(nameField)
}
......@@ -68,13 +68,13 @@ class ViewController: UIViewController, TextFieldDelegate {
emailField.textColor = MaterialColor.black
emailField.titleLabel = UILabel()
emailField.titleLabel!.font = RobotoFont.mediumWithSize(12)
emailField.titleLabelTextColor = MaterialColor.grey.lighten1
emailField.titleLabelActiveTextColor = MaterialColor.blue.accent3
emailField.titleLabelColor = MaterialColor.grey.lighten1
emailField.titleLabelActiveColor = MaterialColor.blue.accent3
emailField.clearButtonMode = .WhileEditing
emailField.detailLabel = UILabel()
emailField.detailLabel!.text = "Email is incorrect."
emailField.detailLabel!.font = RobotoFont.mediumWithSize(12)
emailField.detailLabelActiveTextColor = MaterialColor.red.accent3
emailField.detailLabelActiveColor = MaterialColor.red.accent3
view.addSubview(emailField)
}
......
......@@ -53,8 +53,8 @@ class ViewController: UIViewController, TextDelegate, TextViewDelegate {
textView.titleLabel = UILabel()
textView.titleLabel!.font = RobotoFont.mediumWithSize(12)
textView.titleLabelTextColor = MaterialColor.grey.lighten2
textView.titleLabelActiveTextColor = MaterialColor.blue.accent3
textView.titleLabelColor = MaterialColor.grey.lighten2
textView.titleLabelActiveColor = MaterialColor.blue.accent3
view.addSubview(textView)
textView!.translatesAutoresizingMaskIntoConstraints = false
......
......@@ -81,15 +81,16 @@ A TextField is an excellent way to improve UX. Checkout the Examples directory f
![MaterialKitTextField](http://www.materialkit.io/MK/MaterialKitTextField.gif)
```swift
let nameField: TextField = TextField(frame: CGRectMake(57, 100, 300, 24))
nameField.placeholder = "First Name"
nameField.font = RobotoFont.regularWithSize(20)
nameField.textColor = MaterialColor.black
nameField.titleLabel = UILabel()
nameField.titleLabel!.font = RobotoFont.mediumWithSize(12)
nameField.titleLabelNormalColor = MaterialColor.grey.lighten2
nameField.titleLabelHighlightedColor = MaterialColor.blue.accent3
nameField.clearButtonMode = .WhileEditing
let textField: TextField = TextField(frame: CGRectMake(57, 100, 300, 24))
textField.placeholder = "First Name"
textField.font = RobotoFont.regularWithSize(20)
textField.textColor = MaterialColor.black
textField.titleLabel = UILabel()
textField.titleLabel!.font = RobotoFont.mediumWithSize(12)
textField.titleLabelTextColor = MaterialColor.grey.lighten1
textField.titleLabelActiveTextColor = MaterialColor.blue.accent3
textField.clearButtonMode = .WhileEditing
view.addSubview(textField)
// Add nameField to UIViewController.
view.addSubview(nameField)
......
......@@ -235,15 +235,15 @@ public class TextField : UITextField {
}
/// The color of the titleLabel text when the textField is not active.
public var titleLabelTextColor: UIColor? {
public var titleLabelColor: UIColor? {
didSet {
titleLabel?.textColor = titleLabelTextColor
bottomBorderLayer.backgroundColor = titleLabelTextColor?.CGColor
titleLabel?.textColor = titleLabelColor
bottomBorderLayer.backgroundColor = titleLabelColor?.CGColor
}
}
/// The color of the titleLabel text when the textField is active.
public var titleLabelActiveTextColor: UIColor?
public var titleLabelActiveColor: UIColor?
/**
The detail UILabel that is displayed when the detailLabelHidden property
......@@ -259,7 +259,7 @@ public class TextField : UITextField {
The color of the detailLabel text when the detailLabelHidden property
is set to false.
*/
public var detailLabelActiveTextColor: UIColor?
public var detailLabelActiveColor: UIColor?
/**
:name: detailLabelHidden
......@@ -267,11 +267,11 @@ public class TextField : UITextField {
public var detailLabelHidden: Bool = false {
didSet {
if detailLabelHidden {
bottomBorderLayer.backgroundColor = editing ? titleLabelActiveTextColor?.CGColor : titleLabelTextColor?.CGColor
bottomBorderLayer.backgroundColor = editing ? titleLabelActiveColor?.CGColor : titleLabelColor?.CGColor
hideDetailLabel()
} else {
detailLabel?.textColor = detailLabelActiveTextColor
bottomBorderLayer.backgroundColor = detailLabelActiveTextColor?.CGColor
detailLabel?.textColor = detailLabelActiveColor
bottomBorderLayer.backgroundColor = detailLabelActiveColor?.CGColor
showDetailLabel()
}
}
......@@ -398,12 +398,12 @@ public class TextField : UITextField {
}
if 0 == text?.utf16.count {
titleLabel?.textColor = titleLabelTextColor
bottomBorderLayer.backgroundColor = titleLabelTextColor?.CGColor
titleLabel?.textColor = titleLabelColor
bottomBorderLayer.backgroundColor = titleLabelColor?.CGColor
detailLabelHidden = true
} else {
titleLabel?.textColor = titleLabelActiveTextColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelActiveTextColor?.CGColor : detailLabelActiveTextColor?.CGColor
titleLabel?.textColor = titleLabelActiveColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelActiveColor?.CGColor : detailLabelActiveColor?.CGColor
}
}
......@@ -411,8 +411,8 @@ public class TextField : UITextField {
internal func textFieldDidChange(textField: TextField) {
if 0 < text?.utf16.count {
showTitleLabel()
titleLabel?.textColor = titleLabelActiveTextColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelActiveTextColor?.CGColor : detailLabelActiveTextColor?.CGColor
titleLabel?.textColor = titleLabelActiveColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelActiveColor?.CGColor : detailLabelActiveColor?.CGColor
} else if 0 == text?.utf16.count {
hideTitleLabel()
detailLabelHidden = true
......@@ -426,8 +426,8 @@ public class TextField : UITextField {
} else if 0 == text?.utf16.count {
hideTitleLabel()
}
titleLabel?.textColor = titleLabelTextColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelTextColor?.CGColor : detailLabelActiveTextColor?.CGColor
titleLabel?.textColor = titleLabelColor
bottomBorderLayer.backgroundColor = detailLabelHidden ? titleLabelColor?.CGColor : detailLabelActiveColor?.CGColor
}
/// Manages the layout for the shape of the view instance.
......
......@@ -232,14 +232,14 @@ public class TextView: UITextView {
}
/// The color of the titleLabel text when the textView is not active.
public var titleLabelTextColor: UIColor? {
public var titleLabelColor: UIColor? {
didSet {
titleLabel?.textColor = titleLabelTextColor
titleLabel?.textColor = titleLabelColor
}
}
/// The color of the titleLabel text when the textView is active.
public var titleLabelActiveTextColor: UIColor?
public var titleLabelActiveColor: UIColor?
/// Placeholder UILabel view.
public var placeholderLabel: UILabel? {
......@@ -410,9 +410,9 @@ public class TextView: UITextView {
v.frame = CGRectMake(0, -h, bounds.width, h)
v.text = placeholderLabel?.text
if 0 == text?.utf16.count {
v.textColor = titleLabelTextColor
v.textColor = titleLabelColor
} else {
v.textColor = titleLabelActiveTextColor
v.textColor = titleLabelActiveColor
}
}
}
......@@ -426,7 +426,7 @@ public class TextView: UITextView {
if 0 < text?.utf16.count {
showTitleLabel()
titleLabel?.textColor = titleLabelActiveTextColor
titleLabel?.textColor = titleLabelActiveColor
} else if 0 == text?.utf16.count {
hideTitleLabel()
}
......@@ -439,7 +439,7 @@ public class TextView: UITextView {
} else if 0 == text?.utf16.count {
hideTitleLabel()
}
titleLabel?.textColor = titleLabelTextColor
titleLabel?.textColor = titleLabelColor
}
/// Manages the layout for the shape of the view instance.
......
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