Commit 1e72fe35 by Daniel Dahan

updated CGRectZero to CGRect.zero

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