Commit 2e247729 by Daniel Dahan

latest changes that remove MateriaLayout translate* property

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