Commit 1e72fe35 by Daniel Dahan

updated CGRectZero to CGRect.zero

parent 414b7820
...@@ -116,9 +116,7 @@ extension AppLeftViewController: UITableViewDelegate { ...@@ -116,9 +116,7 @@ extension AppLeftViewController: UITableViewDelegate {
if let v: NavigationController = navigationDrawerController?.rootViewController as? NavigationController { if let v: NavigationController = navigationDrawerController?.rootViewController as? NavigationController {
switch item.text { switch item.text {
case "Orange": case "Orange":
// navigationDrawerController?.transitionFromRootViewController(OrangeViewController()) v.pushViewController(OrangeViewController(), animated: true)
// v.pushViewController(OrangeViewController(), animated: true)
navigationDrawerController?.transitionFromRootViewController(NavigationController(rootViewController: OrangeViewController()))
case "Purple": case "Purple":
v.pushViewController(PurpleViewController(), animated: true) v.pushViewController(PurpleViewController(), animated: true)
case "Green": case "Green":
......
...@@ -69,7 +69,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -69,7 +69,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController
*/ */
public required init?(coder aDecoder: NSCoder) { public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder) super.init(coder: aDecoder)
prepareView()
} }
/** /**
...@@ -79,11 +78,14 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -79,11 +78,14 @@ public class BottomNavigationController : UITabBarController, UITabBarController
*/ */
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView()
} }
public init() { public init() {
super.init(nibName: nil, bundle: nil) super.init(nibName: nil, bundle: nil)
}
public override func viewDidLoad() {
super.viewDidLoad()
prepareView() prepareView()
} }
......
...@@ -200,7 +200,7 @@ public class BottomTabBar : UITabBar { ...@@ -200,7 +200,7 @@ public class BottomTabBar : UITabBar {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSubviews() { public override func layoutSubviews() {
......
...@@ -288,7 +288,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate { ...@@ -288,7 +288,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
:name: init :name: init
*/ */
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
/** /**
......
...@@ -216,14 +216,14 @@ public class CardView : MaterialPulseView { ...@@ -216,14 +216,14 @@ public class CardView : MaterialPulseView {
:name: init :name: init
*/ */
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
/** /**
:name: init :name: init
*/ */
public convenience init?(image: UIImage? = nil, titleLabel: UILabel? = nil, contentView: UIView? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) { public convenience init?(image: UIImage? = nil, titleLabel: UILabel? = nil, contentView: UIView? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
prepareProperties(image, titleLabel: titleLabel, contentView: contentView, leftButtons: leftButtons, rightButtons: rightButtons) prepareProperties(image, titleLabel: titleLabel, contentView: contentView, leftButtons: leftButtons, rightButtons: rightButtons)
} }
......
...@@ -140,7 +140,7 @@ public class ControlView : MaterialView { ...@@ -140,7 +140,7 @@ public class ControlView : MaterialView {
/// Basic initializer. /// Basic initializer.
public init() { public init() {
super.init(frame: CGRectZero) super.init(frame: CGRect.zero)
frame.size = intrinsicContentSize() frame.size = intrinsicContentSize()
} }
...@@ -150,7 +150,7 @@ public class ControlView : MaterialView { ...@@ -150,7 +150,7 @@ public class ControlView : MaterialView {
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
public init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) { public init(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
super.init(frame: CGRectZero) super.init(frame: CGRect.zero)
frame.size = intrinsicContentSize() frame.size = intrinsicContentSize()
prepareProperties(leftControls, rightControls: rightControls) prepareProperties(leftControls, rightControls: rightControls)
} }
......
...@@ -97,7 +97,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -97,7 +97,7 @@ public class ImageCardView : MaterialPulseView {
imageLayer?.hidden = false imageLayer?.hidden = false
} else { } else {
imageLayer?.contents = nil imageLayer?.contents = nil
imageLayer?.frame = CGRectZero imageLayer?.frame = CGRect.zero
imageLayer?.hidden = true imageLayer?.hidden = true
imageLayer?.removeFromSuperlayer() imageLayer?.removeFromSuperlayer()
} }
...@@ -309,14 +309,14 @@ public class ImageCardView : MaterialPulseView { ...@@ -309,14 +309,14 @@ public class ImageCardView : MaterialPulseView {
:name: init :name: init
*/ */
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
/** /**
:name: init :name: init
*/ */
public convenience init?(image: UIImage? = nil, titleLabel: UILabel? = nil, contentView: UIView? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) { public convenience init?(image: UIImage? = nil, titleLabel: UILabel? = nil, contentView: UIView? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
prepareProperties(image, titleLabel: titleLabel, contentView: contentView, leftButtons: leftButtons, rightButtons: rightButtons) prepareProperties(image, titleLabel: titleLabel, contentView: contentView, leftButtons: leftButtons, rightButtons: rightButtons)
} }
......
...@@ -335,7 +335,7 @@ public class MaterialButton : UIButton { ...@@ -335,7 +335,7 @@ public class MaterialButton : UIButton {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
......
...@@ -440,7 +440,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView { ...@@ -440,7 +440,7 @@ public class MaterialCollectionReusableView : UICollectionReusableView {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
......
...@@ -148,7 +148,7 @@ public class MaterialCollectionView : UICollectionView { ...@@ -148,7 +148,7 @@ public class MaterialCollectionView : UICollectionView {
/// A convenience initializer that initializes the object. /// A convenience initializer that initializes the object.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
/** /**
......
...@@ -440,7 +440,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -440,7 +440,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
......
...@@ -133,7 +133,7 @@ public class MaterialLabel : UILabel { ...@@ -133,7 +133,7 @@ public class MaterialLabel : UILabel {
:name: init :name: init
*/ */
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
/** /**
......
...@@ -381,7 +381,7 @@ public class MaterialView : UIView { ...@@ -381,7 +381,7 @@ public class MaterialView : UIView {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
......
...@@ -284,7 +284,7 @@ public class NavigationBar : UINavigationBar { ...@@ -284,7 +284,7 @@ public class NavigationBar : UINavigationBar {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
...@@ -304,6 +304,7 @@ public class NavigationBar : UINavigationBar { ...@@ -304,6 +304,7 @@ public class NavigationBar : UINavigationBar {
public override func layoutSubviews() { public override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
if let v: UINavigationItem = topItem { if let v: UINavigationItem = topItem {
layoutNavigationItem(v) layoutNavigationItem(v)
} }
...@@ -456,7 +457,7 @@ public class NavigationBar : UINavigationBar { ...@@ -456,7 +457,7 @@ public class NavigationBar : UINavigationBar {
*/ */
private func prepareTitleView(item: UINavigationItem) -> UIView { private func prepareTitleView(item: UINavigationItem) -> UIView {
if nil == item.titleView { if nil == item.titleView {
item.titleView = UIView(frame: CGRectZero) item.titleView = UIView(frame: CGRect.zero)
} }
return item.titleView! return item.titleView!
} }
...@@ -468,7 +469,7 @@ public class NavigationBar : UINavigationBar { ...@@ -468,7 +469,7 @@ public class NavigationBar : UINavigationBar {
*/ */
private func prepareContentView(item: UINavigationItem) -> UIView { private func prepareContentView(item: UINavigationItem) -> UIView {
if nil == item.contentView { if nil == item.contentView {
item.contentView = UIView(frame: CGRectZero) item.contentView = UIView(frame: CGRect.zero)
} }
item.contentView!.grid.axis.direction = .Vertical item.contentView!.grid.axis.direction = .Vertical
return item.contentView! return item.contentView!
......
...@@ -58,11 +58,6 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -58,11 +58,6 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
setViewControllers([rootViewController], animated: false) setViewControllers([rootViewController], animated: false)
} }
public override func viewDidLoad() {
super.viewDidLoad()
prepareView()
}
public override func viewWillAppear(animated: Bool) { public override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
if let v: UIGestureRecognizer = interactivePopGestureRecognizer { if let v: UIGestureRecognizer = interactivePopGestureRecognizer {
...@@ -77,6 +72,11 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -77,6 +72,11 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
} }
} }
public override func viewDidLoad() {
super.viewDidLoad()
prepareView()
}
public override func viewDidAppear(animated: Bool) { public override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated) super.viewDidAppear(animated)
// Load the initial topItem. // Load the initial topItem.
......
...@@ -176,7 +176,7 @@ public class TextField : UITextField { ...@@ -176,7 +176,7 @@ public class TextField : UITextField {
} }
/// The placeholder UILabel. /// The placeholder UILabel.
@IBInspectable public private(set) lazy var placeholderLabel: UILabel = UILabel(frame: CGRectZero) @IBInspectable public private(set) lazy var placeholderLabel: UILabel = UILabel(frame: CGRect.zero)
/// Placeholder textColor. /// Placeholder textColor.
@IBInspectable public var placeholderColor: UIColor = MaterialColor.darkText.others { @IBInspectable public var placeholderColor: UIColor = MaterialColor.darkText.others {
...@@ -205,7 +205,7 @@ public class TextField : UITextField { ...@@ -205,7 +205,7 @@ public class TextField : UITextField {
public var placeholderVerticalOffset: CGFloat = 0 public var placeholderVerticalOffset: CGFloat = 0
/// The detailLabel UILabel that is displayed. /// The detailLabel UILabel that is displayed.
@IBInspectable public private(set) lazy var detailLabel: UILabel = UILabel(frame: CGRectZero) @IBInspectable public private(set) lazy var detailLabel: UILabel = UILabel(frame: CGRect.zero)
/// The detailLabel text value. /// The detailLabel text value.
...@@ -259,7 +259,7 @@ public class TextField : UITextField { ...@@ -259,7 +259,7 @@ public class TextField : UITextField {
if value { if value {
if nil == clearIconButton { if nil == clearIconButton {
let image: UIImage? = MaterialIcon.cm.clear let image: UIImage? = MaterialIcon.cm.clear
clearIconButton = IconButton(frame: CGRectZero) clearIconButton = IconButton(frame: CGRect.zero)
clearIconButton!.contentEdgeInsets = UIEdgeInsetsZero clearIconButton!.contentEdgeInsets = UIEdgeInsetsZero
clearIconButton!.pulseAnimation = .Center clearIconButton!.pulseAnimation = .Center
clearIconButton!.tintColor = placeholderColor clearIconButton!.tintColor = placeholderColor
...@@ -296,7 +296,7 @@ public class TextField : UITextField { ...@@ -296,7 +296,7 @@ public class TextField : UITextField {
if value { if value {
if nil == visibilityIconButton { if nil == visibilityIconButton {
let image: UIImage? = MaterialIcon.visibility let image: UIImage? = MaterialIcon.visibility
visibilityIconButton = IconButton(frame: CGRectZero) visibilityIconButton = IconButton(frame: CGRect.zero)
visibilityIconButton!.contentEdgeInsets = UIEdgeInsetsZero visibilityIconButton!.contentEdgeInsets = UIEdgeInsetsZero
visibilityIconButton!.pulseAnimation = .Center visibilityIconButton!.pulseAnimation = .Center
visibilityIconButton!.tintColor = placeholderColor visibilityIconButton!.tintColor = placeholderColor
...@@ -354,7 +354,7 @@ public class TextField : UITextField { ...@@ -354,7 +354,7 @@ public class TextField : UITextField {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectZero) self.init(frame: CGRect.zero)
} }
public override func layoutSubviews() { public override func layoutSubviews() {
......
...@@ -325,7 +325,7 @@ public class TextView: UITextView { ...@@ -325,7 +325,7 @@ public class TextView: UITextView {
- Parameter textContainer: A NSTextContainer instance. - Parameter textContainer: A NSTextContainer instance.
*/ */
public convenience init(textContainer: NSTextContainer?) { public convenience init(textContainer: NSTextContainer?) {
self.init(frame: CGRectZero, textContainer: textContainer) self.init(frame: CGRect.zero, textContainer: textContainer)
} }
/** Denitializer. This should never be called unless you know /** Denitializer. This should never be called unless you know
......
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