Commit d8bec523 by Daniel Dahan

master: merged development

parents 13a5c521 50d58ec9
Pod::Spec.new do |s|
s.name = 'MK'
s.version = '1.5.0'
s.version = '1.6.0'
s.license = { :type => "AGPLv3+", :file => "LICENSE" }
s.summary = 'A Material Design Framework In Swift'
s.homepage = 'http://materialkit.io'
......
......@@ -35,8 +35,6 @@
963832881B8908180015F710 /* Layout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963832871B8908180015F710 /* Layout.swift */; };
963832891B89097D0015F710 /* Layout.swift in Headers */ = {isa = PBXBuildFile; fileRef = 963832871B8908180015F710 /* Layout.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96B57D4E1B90AF7D00DE7BBB /* MaterialTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96B57D4D1B90AF7D00DE7BBB /* MaterialTheme.swift */; };
9A3A3B6A1B8E992F005F16BC /* ImageTextCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3A3B691B8E992F005F16BC /* ImageTextCard.swift */; };
9A3A3B6E1B8EA7A5005F16BC /* ImageTextButtonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3A3B6D1B8EA7A5005F16BC /* ImageTextButtonCard.swift */; };
9A3A3B701B8EB582005F16BC /* ImageRevealCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */; };
9A94D0F91B895C8C00F586A5 /* Roboto.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9AAC38531B89559900FE6B2D /* Roboto.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9A94D0FA1B895EA500F586A5 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 963832631B88E5BF0015F710 /* LICENSE */; };
......@@ -79,8 +77,6 @@
963832681B88E5BF0015F710 /* TextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = "<group>"; };
963832871B8908180015F710 /* Layout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Layout.swift; sourceTree = "<group>"; };
96B57D4D1B90AF7D00DE7BBB /* MaterialTheme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTheme.swift; sourceTree = "<group>"; };
9A3A3B691B8E992F005F16BC /* ImageTextCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageTextCard.swift; sourceTree = "<group>"; };
9A3A3B6D1B8EA7A5005F16BC /* ImageTextButtonCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageTextButtonCard.swift; sourceTree = "<group>"; };
9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageRevealCard.swift; sourceTree = "<group>"; };
9A94D1081B8A3F5100F586A5 /* MaterialCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialCard.swift; sourceTree = "<group>"; };
9A94D10A1B8A485C00F586A5 /* ImageCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCard.swift; sourceTree = "<group>"; };
......@@ -238,8 +234,6 @@
9A94D1081B8A3F5100F586A5 /* MaterialCard.swift */,
9AAC384C1B89528900FE6B2D /* BasicCard.swift */,
9A94D10A1B8A485C00F586A5 /* ImageCard.swift */,
9A3A3B691B8E992F005F16BC /* ImageTextCard.swift */,
9A3A3B6D1B8EA7A5005F16BC /* ImageTextButtonCard.swift */,
9A3A3B6F1B8EB582005F16BC /* ImageRevealCard.swift */,
);
name = Card;
......@@ -388,12 +382,10 @@
9638326B1B88E5BF0015F710 /* FabButton.swift in Sources */,
9A94D1091B8A3F5100F586A5 /* MaterialCard.swift in Sources */,
9A3A3B701B8EB582005F16BC /* ImageRevealCard.swift in Sources */,
9A3A3B6A1B8E992F005F16BC /* ImageTextCard.swift in Sources */,
65B965871B8BEEC60055B139 /* SideNavController.swift in Sources */,
9638326C1B88E5BF0015F710 /* FlatButton.swift in Sources */,
963832711B88E5BF0015F710 /* Text.swift in Sources */,
9638326A1B88E5BF0015F710 /* CapturePreview.swift in Sources */,
9A3A3B6E1B8EA7A5005F16BC /* ImageTextButtonCard.swift in Sources */,
9AAC38541B89559900FE6B2D /* Roboto.swift in Sources */,
65B9657E1B8A7C330055B139 /* MaterialButton.swift in Sources */,
963832881B8908180015F710 /* Layout.swift in Sources */,
......
......@@ -11,8 +11,10 @@ MaterialKit is now on CocoaPods under the name [MK](https://cocoapods.org/?q=MK)
Make a call to action with a Floating Action Button.
![MaterialKitPreview](http://www.materialkit.io/fabbuttonpreview.gif)
```swift
var button: FabButton = FabButton()
button.setTitle("+", forState: .Normal)
......@@ -26,8 +28,10 @@ Layout.size(view, child: button, width: 60, height: 60)
Use a Raised Button to capture attention.
![MaterialKitPreview](http://www.materialkit.io/raisedbuttonpreview.gif)
```swift
var button: RaisedButton = RaisedButton()
button.setTitle("Raised", forState: .Normal)
......@@ -40,8 +44,10 @@ Layout.size(view, child: button, width: 200, height: 60)
Keep it simple and elegant with a Flat Button.
![MaterialKitPreview](http://www.materialkit.io/flatbuttonpreview.gif)
```swift
var button: RaisedButton = RaisedButton()
button.setTitle("Flat", forState: .Normal)
......@@ -54,8 +60,10 @@ Layout.size(view, child: button, width: 200, height: 60)
Easily make cards with fully customizable components.
![MaterialKitPreview](http://www.materialkit.io/basiccardpreview.gif)
```swift
var card: BasicCard = BasicCard()
......@@ -84,14 +92,77 @@ okButton.setTitleColor(MaterialTheme.yellow.darken3, forState: .Normal)
card.buttons = [cancelButton, okButton]
view.addSubview(card)
view.addConstraints(Layout.constraint("H:|-(pad)-[child]-(pad)-|", options: nil, metrics: ["pad": 20], views: ["child": card]))
view.addConstraints(Layout.constraint("V:|-(pad)-[child]", options: nil, metrics: ["pad": 100], views: ["child": card]))
```
### Image Card
Add photos with an Image Card.
![MaterialKitPreview](http://www.materialkit.io/imagecardpreview.gif)
```swift
var card: ImageCard = ImageCard()
card.imageView = UIImageView(image: UIImage(named: "photo.jpg"))
view.addSubview(card)
Layout.size(view, child: card, width: 300, height: 175)
```
### Full Image Card
Allow the Image Card to really shine by adding a title, some details, and buttons.
![MaterialKitPreview](http://www.materialkit.io/imagecardfullpreview.gif)
```swift
var card: ImageCard = ImageCard()
card.imageView = UIImageView(image: UIImage(named: "photo.jpg"))
// add a title
card.titleLabel = UILabel()
card.titleLabel!.text = "Card Title"
// add a body of text
card.detailTextLabel = UILabel()
card.detailTextLabel!.text = "I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively."
// add a divider for buttons
card.divider = UIView()
// add a couple buttons
var cancelButton: FlatButton = FlatButton()
cancelButton.pulseColor = MaterialTheme.blueGrey.darken3
cancelButton.setTitle("Cancel", forState: .Normal)
cancelButton.setTitleColor(MaterialTheme.yellow.darken3, forState: .Normal)
var okButton: FlatButton = FlatButton()
okButton.pulseColor = MaterialTheme.blueGrey.darken3
okButton.setTitle("Okay", forState: .Normal)
okButton.setTitleColor(MaterialTheme.yellow.darken3, forState: .Normal)
card.buttons = [cancelButton, okButton]
view.addSubview(card)
view.addConstraints(Layout.constraint("H:|-(pad)-[child]-(pad)-|", options: nil, metrics: ["pad": 20], views: ["child": card]))
view.addConstraints(Layout.constraint("V:|-(pad)-[child]", options: nil, metrics: ["pad": 100], views: ["child": card]))
```
### Side Navigation
Add a sleek Side Navigation to give your users a wonderful experience.
![MaterialKitPreview](http://www.materialkit.io/sidenavpreview.gif)
```swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
sideNav = SideNavController(mainViewController: MainViewController(), leftViewController: LeftViewController(), rightViewController: RightViewController())
......
//
// Copyright (C) 2015 GraphKit, Inc. <http://graphkit.io> and other GraphKit contributors.
// Copyright (C) 1615 GraphKit, Inc. <http://graphkit.io> and other GraphKit contributors.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
......@@ -30,18 +30,6 @@ public class BasicCard : MaterialCard {
//
internal lazy var views: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
//
// :name: divider
//
public var divider: UIView? {
didSet {
divider!.setTranslatesAutoresizingMaskIntoConstraints(false)
divider!.backgroundColor = MaterialTheme.blueGrey.color
addSubview(divider!)
prepareCard()
}
}
/**
:name: titleLabel
*/
......@@ -71,6 +59,18 @@ public class BasicCard : MaterialCard {
}
/**
:name: divider
*/
public var divider: UIView? {
didSet {
divider!.setTranslatesAutoresizingMaskIntoConstraints(false)
divider!.backgroundColor = MaterialTheme.blueGrey.darken2
addSubview(divider!)
prepareCard()
}
}
/**
:name: buttons
*/
public var buttons: Array<MaterialButton>? {
......@@ -84,6 +84,7 @@ public class BasicCard : MaterialCard {
//
internal override func prepareView() {
super.prepareView()
prepareShadow()
backgroundColor = MaterialTheme.blueGrey.darken1
}
......@@ -92,8 +93,6 @@ public class BasicCard : MaterialCard {
//
internal override func prepareCard() {
super.prepareCard()
prepareShadow()
// deactivate and clear all constraints
NSLayoutConstraint.deactivateConstraints(layoutConstraints)
layoutConstraints.removeAll(keepCapacity: false)
......@@ -103,15 +102,15 @@ public class BasicCard : MaterialCard {
// title
if nil != titleLabel {
layoutConstraints += Layout.constraint("H:|-(20)-[titleLabel]-(20)-|", options: nil, metrics: nil, views: ["titleLabel": titleLabel!])
verticalFormat += "-(20)-[titleLabel(22)]"
layoutConstraints += Layout.constraint("H:|-(16)-[titleLabel]-(16)-|", options: nil, metrics: nil, views: ["titleLabel": titleLabel!])
verticalFormat += "-(16)-[titleLabel(22)]"
views["titleLabel"] = titleLabel!
}
// details
if nil != detailTextLabel {
layoutConstraints += Layout.constraint("H:|-(20)-[detailTextLabel]-(20)-|", options: nil, metrics: nil, views: ["detailTextLabel": detailTextLabel!])
verticalFormat += "-(20)-[detailTextLabel]"
layoutConstraints += Layout.constraint("H:|-(16)-[detailTextLabel]-(16)-|", options: nil, metrics: nil, views: ["detailTextLabel": detailTextLabel!])
verticalFormat += "-(16)-[detailTextLabel]"
views["detailTextLabel"] = detailTextLabel!
}
......@@ -120,7 +119,7 @@ public class BasicCard : MaterialCard {
if nil != divider {
layoutConstraints += Layout.constraint("H:|[divider]|", options: nil, metrics: nil, views: ["divider": divider!])
views["divider"] = divider!
verticalFormat += "-(20)-[divider(1)]"
verticalFormat += "-(16)-[divider(1)]"
}
// buttons
......@@ -131,14 +130,13 @@ public class BasicCard : MaterialCard {
addSubview(button)
buttonViews["button\(i)"] = button
views["button\(i)"] = button as AnyObject
horizontalFormat += "-(10)-[button\(i)]"
layoutConstraints += Layout.constraint(verticalFormat + "-(10)-[button\(i)]-(10)-|", options: nil, metrics: nil, views: views)
horizontalFormat += "-(8)-[button\(i)]"
layoutConstraints += Layout.constraint(verticalFormat + "-(8)-[button\(i)]-(8)-|", options: nil, metrics: nil, views: views)
}
layoutConstraints += Layout.constraint(horizontalFormat, options: nil, metrics: nil, views: buttonViews)
} else {
verticalFormat += "-(20)-|"
verticalFormat += "-(16)-|"
}
// combine constraints
......
////
//// Copyright (C) 2015 GraphKit, Inc. <http://graphkit.io> and other GraphKit contributors.
////
//// This program is free software: you can redistribute it and/or modify
//// it under the terms of the GNU Affero General Public License as published
//// by the Free Software Foundation, either version 3 of the License, or
//// (at your option) any later version.
////
//// This program is distributed in the hope that it will be useful,
//// but WITHOUT ANY WARRANTY; without even the implied warranty of
//// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//// GNU Affero General Public License for more details.
////
//// You should have received a copy of the GNU Affero General Public License
//// along with this program located at the root of the software package
//// in a file called LICENSE. If not, see <http://www.gnu.org/licenses/>.
////
//
//import UIKit
// Copyright (C) 1615 GraphKit, Inc. <http://graphkit.io> and other GraphKit contributors.
//
//public class ImageCard : MaterialPulseView {
// public lazy var imageView: UIImageView = UIImageView()
//
// public required init(coder aDecoder: NSCoder) {
// super.init(coder: aDecoder)
// }
//
// public required init(frame: CGRect) {
// super.init(frame: frame)
// }
//
// internal override func initialize() {
// prepareImageView()
// super.initialize()
// }
//
// internal override func constrainSubviews() {
// super.constrainSubviews()
// addConstraints(Layout.constraint("H:|[imageView]|", options: nil, metrics: nil, views: views))
// addConstraints(Layout.constraint("V:|[imageView]|", options: nil, metrics: nil, views: views))
// }
//
// private func prepareImageView() {
// imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
// imageView.contentMode = .ScaleAspectFill
// imageView.userInteractionEnabled = false
// imageView.clipsToBounds = true
// addSubview(imageView)
// views["imageView"] = imageView
// }
//}
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program located at the root of the software package
// in a file called LICENSE. If not, see <http://www.gnu.org/licenses/>.
//
import UIKit
public class ImageCard : MaterialCard {
//
// :name: layoutConstraints
//
internal lazy var layoutConstraints: Array<NSLayoutConstraint> = Array<NSLayoutConstraint>()
//
// :name: views
//
internal lazy var views: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
//
// :name: detailTextContainer
//
internal var detailTextContainer: UIView?
//
// :name: buttonsContainer
//
internal var buttonsContainer: UIView?
/**
:name: imageView
*/
public var imageView: UIImageView? {
didSet {
imageView!.setTranslatesAutoresizingMaskIntoConstraints(false)
imageView!.contentMode = .ScaleAspectFill
imageView!.userInteractionEnabled = false
imageView!.clipsToBounds = true
insertSubview(imageView!, belowSubview: backgroundColorView)
if nil != titleLabel {
titleLabel!.removeFromSuperview()
imageView!.addSubview(titleLabel!)
}
prepareCard()
}
}
/**
:name: titleLabel
*/
public var titleLabel: UILabel? {
didSet {
titleLabel!.setTranslatesAutoresizingMaskIntoConstraints(false)
titleLabel!.textColor = MaterialTheme.white.color
titleLabel!.font = Roboto.regularWithSize(22.0)
if nil == imageView {
addSubview(titleLabel!)
} else {
imageView!.addSubview(titleLabel!)
}
prepareCard()
}
}
/**
:name: detailTextLabel
*/
public var detailTextLabel: UILabel? {
didSet {
// container
if nil == detailTextContainer {
detailTextContainer = UIView()
detailTextContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
detailTextContainer!.backgroundColor = MaterialTheme.white.color
addSubview(detailTextContainer!)
}
// text
detailTextContainer!.addSubview(detailTextLabel!)
detailTextLabel!.setTranslatesAutoresizingMaskIntoConstraints(false)
detailTextLabel!.textColor = MaterialTheme.black.color
detailTextLabel!.font = Roboto.lightWithSize(16.0)
detailTextLabel!.numberOfLines = 0
detailTextLabel!.lineBreakMode = .ByWordWrapping
prepareCard()
}
}
/**
:name: divider
*/
public var divider: UIView? {
didSet {
divider!.setTranslatesAutoresizingMaskIntoConstraints(false)
divider!.backgroundColor = MaterialTheme.blueGrey.lighten4
addSubview(divider!)
prepareCard()
}
}
/**
:name: buttons
*/
public var buttons: Array<MaterialButton>? {
didSet {
if nil == buttonsContainer {
buttonsContainer = UIView()
buttonsContainer!.setTranslatesAutoresizingMaskIntoConstraints(false)
buttonsContainer!.backgroundColor = MaterialTheme.white.color
addSubview(buttonsContainer!)
}
prepareCard()
}
}
//
// :name: prepareView
//
internal override func prepareView() {
super.prepareView()
prepareShadow()
backgroundColor = MaterialTheme.clear.color
}
//
// :name: prepareCard
//
internal override func prepareCard() {
super.prepareCard()
// deactivate and clear all constraints
NSLayoutConstraint.deactivateConstraints(layoutConstraints)
layoutConstraints.removeAll(keepCapacity: false)
// detect all components and create constraints
var verticalFormat: String = "V:|"
if nil != imageView {
layoutConstraints += Layout.constraint("H:|[imageView]|", options: nil, metrics: nil, views: ["imageView": imageView!])
verticalFormat += "[imageView(200)]"
views["imageView"] = imageView!
}
// title
if nil != titleLabel {
if nil == imageView {
layoutConstraints += Layout.constraint("H:|-(16)-[titleLabel]-(16)-|", options: nil, metrics: nil, views: ["titleLabel": titleLabel!])
verticalFormat += "-(16)-[titleLabel(22)]"
} else {
layoutConstraints += Layout.constraint("H:[titleLabel]-(16)-|", options: nil, metrics: nil, views: ["titleLabel": titleLabel!])
Layout.alignFromBottomLeft(imageView!, child: titleLabel!, bottom: 16, left: 16)
}
views["titleLabel"] = titleLabel!
}
// details
if nil != detailTextContainer && nil != detailTextLabel {
// container
layoutConstraints += Layout.constraint("H:|[detailTextContainer]|", options: nil, metrics: nil, views: ["detailTextContainer": detailTextContainer!])
verticalFormat += "-(0)-[detailTextContainer]"
views["detailTextContainer"] = detailTextContainer!
// text
layoutConstraints += Layout.constraint("H:|-(16)-[detailTextLabel]-(16)-|", options: nil, metrics: nil, views: ["detailTextLabel": detailTextLabel!])
layoutConstraints += Layout.constraint("V:|-(16)-[detailTextLabel(<=128)]-(16)-|", options: nil, metrics: nil, views: ["detailTextLabel": detailTextLabel!])
views["detailTextLabel"] = detailTextLabel!
}
if nil != buttons && nil != buttonsContainer {
// divider
if nil != divider {
layoutConstraints += Layout.constraint("H:|[divider]|", options: nil, metrics: nil, views: ["divider": divider!])
views["divider"] = divider!
verticalFormat += "-(0)-[divider(1)]"
}
//container
layoutConstraints += Layout.constraint("H:|[buttonsContainer]|", options: nil, metrics: nil, views: ["buttonsContainer": buttonsContainer!])
verticalFormat += "-(0)-[buttonsContainer]|"
views["buttonsContainer"] = buttonsContainer!
// buttons
var horizontalFormat: String = "H:|"
var buttonViews: Dictionary<String, AnyObject> = Dictionary<String, AnyObject>()
for var i: Int = 0, l: Int = buttons!.count; i < l; ++i {
let button: MaterialButton = buttons![i]
buttonsContainer!.addSubview(button)
buttonViews["button\(i)"] = button
views["button\(i)"] = button as AnyObject
horizontalFormat += "-(8)-[button\(i)]"
layoutConstraints += Layout.constraint("V:|-(8)-[button\(i)]-(8)-|", options: nil, metrics: nil, views: views)
}
layoutConstraints += Layout.constraint(horizontalFormat, options: nil, metrics: nil, views: buttonViews)
} else {
verticalFormat += "|"
}
// combine constraints
if 0 < layoutConstraints.count {
layoutConstraints += Layout.constraint(verticalFormat, options: nil, metrics: nil, views: views)
NSLayoutConstraint.activateConstraints(layoutConstraints)
}
}
}
////
//// ImageTextButtonCard.swift
//// MaterialKit
////
//// Created by Adam Dahan on 2015-08-26.
//// Copyright (c) 2015 GraphKit Inc. All rights reserved.
////
//
//import UIKit
//
//public class ImageTextButtonCard : MaterialPulseView {
// public lazy var imageView: UIImageView = UIImageView()
// public lazy var titleLabel: UILabel = UILabel()
// public lazy var descriptionContainerView: UIView = UIView()
// public lazy var descriptionLabel: UILabel = UILabel()
// public lazy var horizontalSeparator: UIView = UIView()
// public lazy var button: FlatButton = FlatButton()
//
// public required init(coder aDecoder: NSCoder) {
// super.init(coder: aDecoder)
// }
//
// public required init(frame: CGRect) {
// super.init(frame: frame)
// }
//
// internal override func initialize() {
// prepareImageView()
// prepareTitleLabel()
// prepareDescriptionContainerView()
// prepareDescriptionLabel()
// prepareHorizontalSeparator()
// prepareButton()
// super.initialize()
// }
//
// internal override func constrainSubviews() {
// super.constrainSubviews()
// addConstraints(Layout.constraint("H:|[imageView]|", options: nil, metrics: nil, views: views))
// imageView.addConstraints(Layout.constraint("H:|-20-[titleLabel]-(20)-|", options: nil, metrics: nil, views: views))
// imageView.addConstraints(Layout.constraint("V:[titleLabel(45)]|", options: nil, metrics: nil, views: views))
// addConstraints(Layout.constraint("H:|[descriptionContainerView]|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("H:|-20-[descriptionLabel]-(20)-|", options: nil, metrics: nil, views: views))
// addConstraints(Layout.constraint("V:|[imageView][descriptionContainerView(160)]|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("H:|[horizontalSeparator]|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("H:|-(10)-[button(70)]", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("V:|-(20)-[descriptionLabel]-(20)-[horizontalSeparator(1)]-(10)-[button(30)]-(10)-|", options: nil, metrics: nil, views: views))
// }
//
// private func prepareImageView() {
// imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
// imageView.contentMode = .ScaleAspectFill
// imageView.userInteractionEnabled = false
// imageView.clipsToBounds = true
// addSubview(imageView)
// views["imageView"] = imageView
// }
//
// private func prepareTitleLabel() {
// titleLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
// titleLabel.font = Roboto.mediumWithSize(18)
// titleLabel.textColor = .whiteColor()
// titleLabel.text = "Card Title"
// titleLabel.layer.shadowOffset = CGSizeMake(1, 1)
// titleLabel.layer.shadowOpacity = 0.4
// titleLabel.layer.shadowRadius = 5.0
// imageView.addSubview(titleLabel)
// views["titleLabel"] = titleLabel
// }
//
// private func prepareDescriptionContainerView() {
// descriptionContainerView.setTranslatesAutoresizingMaskIntoConstraints(false)
// descriptionContainerView.backgroundColor = UIColor.whiteColor()
// addSubview(descriptionContainerView)
// views["descriptionContainerView"] = descriptionContainerView
// }
//
// private func prepareDescriptionLabel() {
// descriptionLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
// descriptionLabel.font = Roboto.lightWithSize(14)
// descriptionLabel.textColor = .darkTextColor()
// descriptionLabel.numberOfLines = 0
// descriptionLabel.lineBreakMode = NSLineBreakMode.ByWordWrapping
// descriptionLabel.text = "I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively."
// descriptionContainerView.addSubview(descriptionLabel)
// views["descriptionLabel"] = descriptionLabel
// }
//
// private func prepareHorizontalSeparator() {
// horizontalSeparator.setTranslatesAutoresizingMaskIntoConstraints(false)
// horizontalSeparator.backgroundColor = UIColor.darkGrayColor()
// horizontalSeparator.alpha = 0.2
// descriptionContainerView.addSubview(horizontalSeparator)
// views["horizontalSeparator"] = horizontalSeparator
// }
//
// private func prepareButton() {
// button.setTranslatesAutoresizingMaskIntoConstraints(false)
// button.setTitle("Cancel", forState: .Normal)
// button.setTitleColor(UIColor(red: 255.0/255.0, green: 156.0/255.0, blue: 38.0/255.0, alpha: 1.0), forState: .Normal)
// button.layer.shadowOpacity = 0
// button.titleLabel!.font = Roboto.lightWithSize(16.0)
// button.pulseColor = UIColor(red: 255.0/255.0, green: 156.0/255.0, blue: 38.0/255.0, alpha: 1.0)
// descriptionContainerView.addSubview(button)
// views["button"] = button
// }
//}
////
//// ImageTextCard.swift
//// MaterialKit
////
//// Created by Adam Dahan on 2015-08-26.
//// Copyright (c) 2015 GraphKit Inc. All rights reserved.
////
//
//import UIKit
//
//public class ImageTextCard : MaterialPulseView {
// public lazy var imageView: UIImageView = UIImageView()
// public lazy var titleLabel: UILabel = UILabel()
// public lazy var descriptionContainerView: UIView = UIView()
// public lazy var descriptionLabel: UILabel = UILabel()
// public lazy var horizontalSeparator: UIView = UIView()
// public lazy var ctaButton: FlatButton = FlatButton()
// public lazy var showsCTA: Bool = false
//
// public required init(coder aDecoder: NSCoder) {
// super.init(coder: aDecoder)
// }
//
// public required init(frame: CGRect) {
// super.init(frame: frame)
// }
//
// internal override func initialize() {
// prepareImageView()
// prepareTitleLabel()
// prepareDescriptionContainerView()
// prepareDescriptionLabel()
// if showsCTA {
// prepareHorizontalSeparator()
// prepareCTAButton()
// }
// super.initialize()
// }
//
// internal override func constrainSubviews() {
// super.constrainSubviews()
// addConstraints(Layout.constraint("H:|[imageView]|", options: nil, metrics: nil, views: views))
// imageView.addConstraints(Layout.constraint("H:|-20-[titleLabel]-(20)-|", options: nil, metrics: nil, views: views))
// imageView.addConstraints(Layout.constraint("V:[titleLabel(45)]|", options: nil, metrics: nil, views: views))
// addConstraints(Layout.constraint("H:|[descriptionContainerView]|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("H:|-20-[descriptionLabel]-(20)-|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("V:|-(20)-[descriptionLabel]-(20)-|", options: nil, metrics: nil, views: views))
// addConstraints(Layout.constraint("V:|[imageView][descriptionContainerView(120)]|", options: nil, metrics: nil, views: views))
// if showsCTA {
// descriptionContainerView.addConstraints(Layout.constraint("H:|[horizontalSeparator]|", options: nil, metrics: nil, views: views))
// descriptionContainerView.addConstraints(Layout.constraint("V:|-(20)-[descriptionLabel]-(20)-[horizontalSeparator(1)]-(20)-|", options: nil, metrics: nil, views: views))
// }
// }
//
// private func prepareImageView() {
// imageView.setTranslatesAutoresizingMaskIntoConstraints(false)
// imageView.contentMode = .ScaleAspectFill
// imageView.userInteractionEnabled = false
// imageView.clipsToBounds = true
// addSubview(imageView)
// views["imageView"] = imageView
// }
//
// private func prepareTitleLabel() {
// titleLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
// titleLabel.font = Roboto.mediumWithSize(18)
// titleLabel.textColor = .whiteColor()
// titleLabel.text = "Card Title"
// titleLabel.layer.shadowOffset = CGSizeMake(1, 1)
// titleLabel.layer.shadowOpacity = 0.4
// titleLabel.layer.shadowRadius = 5.0
// imageView.addSubview(titleLabel)
// views["titleLabel"] = titleLabel
// }
//
// private func prepareDescriptionContainerView() {
// descriptionContainerView.setTranslatesAutoresizingMaskIntoConstraints(false)
// descriptionContainerView.backgroundColor = UIColor.whiteColor()
// addSubview(descriptionContainerView)
// views["descriptionContainerView"] = descriptionContainerView
// }
//
// private func prepareDescriptionLabel() {
// descriptionLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
// descriptionLabel.font = Roboto.lightWithSize(14)
// descriptionLabel.textColor = .darkTextColor()
// descriptionLabel.numberOfLines = 0
// descriptionLabel.lineBreakMode = NSLineBreakMode.ByWordWrapping
// descriptionLabel.text = "I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively."
// descriptionContainerView.addSubview(descriptionLabel)
// views["descriptionLabel"] = descriptionLabel
// }
//
// private func prepareHorizontalSeparator() {
// horizontalSeparator.setTranslatesAutoresizingMaskIntoConstraints(false)
// horizontalSeparator.backgroundColor = UIColor.whiteColor()
// horizontalSeparator.alpha = 0.2
// descriptionContainerView.addSubview(horizontalSeparator)
// views["horizontalSeparator"] = horizontalSeparator
// }
//
// private func prepareCTAButton() {
//
// }
//}
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.6.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
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