Commit 2e247729 by Daniel Dahan

latest changes that remove MateriaLayout translate* property

parent 4dbaa51d
......@@ -98,12 +98,9 @@ class AppLeftViewController: UIViewController {
nameLabel.font = RobotoFont.mediumWithSize(18)
view.addSubview(nameLabel)
profileView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTopLeft(view, child: profileView, top: 30, left: (view.bounds.width - 72) / 2)
MaterialLayout.size(view, child: profileView, width: 72, height: 72)
nameLabel.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: nameLabel, top: 130)
MaterialLayout.alignToParentHorizontally(view, child: nameLabel, left: 20, right: 20)
}
......@@ -118,7 +115,6 @@ class AppLeftViewController: UIViewController {
// Use MaterialLayout to easily align the tableView.
view.addSubview(tableView)
tableView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(view, child: tableView, top: 170)
}
}
......
......@@ -140,7 +140,6 @@ class AppMenuViewController: MenuViewController {
menuView.menu.views = [menuButton, blueButton, greenButton, yellowButton]
view.addSubview(menuView)
menuView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.size(view, child: menuView, width: baseViewSize.width, height: baseViewSize.height)
MaterialLayout.alignFromBottomRight(view, child: menuView, bottom: menuViewInset, right: menuViewInset)
}
......
......@@ -52,7 +52,6 @@ class AppNavigationController: NavigationController {
statusBarView!.backgroundColor = MaterialColor.blue.darken2
view.addSubview(statusBarView!)
statusBarView!.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromTop(view, child: statusBarView!)
MaterialLayout.alignToParentHorizontally(view, child: statusBarView!)
MaterialLayout.height(view, child: statusBarView!, height: 20)
......
......@@ -159,7 +159,6 @@ class ItemViewController: UIViewController {
imageCardView.image = image
scrollView.addSubview(imageCardView)
imageCardView.translatesAutoresizingMaskIntoConstraints = false
}
}
}
......@@ -261,7 +261,6 @@ class RecipesViewController: UIViewController {
// Use MaterialLayout to easily align the tableView.
view.addSubview(tableView)
tableView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(view, child: tableView)
}
}
......@@ -308,7 +307,6 @@ extension RecipesViewController: UITableViewDataSource {
label.text = "Favorites"
header.addSubview(label)
label.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(header, child: label, left: 24)
return header
......
......@@ -71,7 +71,6 @@ class RecommendationViewController: UIViewController {
// Use MaterialLayout to easily align the tableView.
view.addSubview(tableView)
tableView.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(view, child: tableView)
}
}
......@@ -118,7 +117,6 @@ extension RecommendationViewController: UITableViewDataSource {
label.text = "Recommendations"
header.addSubview(label)
label.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParent(header, child: label, left: 24)
return header
......
......@@ -233,7 +233,6 @@ public class BottomTabBar : UITabBar {
super.didMoveToSuperview()
if autoLayoutToSuperview {
if let v: UIView = superview {
translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignFromBottom(v, child: self)
MaterialLayout.alignToParentHorizontally(v, child: self)
}
......
......@@ -113,7 +113,6 @@ public class CardView : MaterialPulseView {
*/
@IBInspectable public var titleLabel: UILabel? {
didSet {
titleLabel?.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
}
......@@ -141,7 +140,6 @@ public class CardView : MaterialPulseView {
*/
@IBInspectable public var contentView: UIView? {
didSet {
contentView?.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
}
......@@ -169,11 +167,6 @@ public class CardView : MaterialPulseView {
*/
public var leftButtons: Array<UIButton>? {
didSet {
if let v = leftButtons {
for b in v {
b.translatesAutoresizingMaskIntoConstraints = false
}
}
reloadView()
}
}
......@@ -201,11 +194,6 @@ public class CardView : MaterialPulseView {
*/
public var rightButtons: Array<UIButton>? {
didSet {
if let v = rightButtons {
for b in v {
b.translatesAutoresizingMaskIntoConstraints = false
}
}
reloadView()
}
}
......
......@@ -206,7 +206,6 @@ public class ImageCardView : MaterialPulseView {
*/
@IBInspectable public var titleLabel: UILabel? {
didSet {
titleLabel?.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
}
......@@ -234,7 +233,6 @@ public class ImageCardView : MaterialPulseView {
*/
@IBInspectable public var contentView: UIView? {
didSet {
contentView?.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
}
......@@ -262,11 +260,6 @@ public class ImageCardView : MaterialPulseView {
*/
public var leftButtons: Array<UIButton>? {
didSet {
if let v = leftButtons {
for b in v {
b.translatesAutoresizingMaskIntoConstraints = false
}
}
reloadView()
}
}
......@@ -294,11 +287,6 @@ public class ImageCardView : MaterialPulseView {
*/
public var rightButtons: Array<UIButton>? {
didSet {
if let v = rightButtons {
for b in v {
b.translatesAutoresizingMaskIntoConstraints = false
}
}
reloadView()
}
}
......
......@@ -32,6 +32,46 @@ import UIKit
@IBDesignable
public class MaterialCollectionView : UICollectionView {
/// A property that accesses the layer.frame.origin.x property.
@IBInspectable public var x: CGFloat {
get {
return layer.frame.origin.x
}
set(value) {
layer.frame.origin.x = value
}
}
/// A property that accesses the layer.frame.origin.y property.
@IBInspectable public var y: CGFloat {
get {
return layer.frame.origin.y
}
set(value) {
layer.frame.origin.y = value
}
}
/// A property that accesses the layer.frame.size.width property.
@IBInspectable public var width: CGFloat {
get {
return layer.frame.size.width
}
set(value) {
layer.frame.size.width = value
}
}
/// A property that accesses the layer.frame.size.height property.
@IBInspectable public var height: CGFloat {
get {
return layer.frame.size.height
}
set(value) {
layer.frame.size.height = value
}
}
/// A preset wrapper around contentInset.
public var contentInsetPreset: MaterialEdgeInset {
get {
......
......@@ -479,7 +479,6 @@ public class TextView: UITextView {
/// prepares the placeholderLabel property.
private func preparePlaceholderLabel() {
if let v: UILabel = placeholderLabel {
v.translatesAutoresizingMaskIntoConstraints = false
v.font = font
v.textAlignment = textAlignment
v.numberOfLines = 0
......
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