Commit 20e6c252 by Daniel Dahan

added JSON

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