Commit 47b798d8 by Daniel Dahan

updated CG*Zero values to CG*.zero

parent 6d7e43fb
......@@ -33,7 +33,7 @@ import UIKit
public class ControlView : MaterialView {
/// Will render the view.
public var willRenderView: Bool {
return 0 < width
return 0 < width && 0 < height
}
/// A preset wrapper around contentInset.
......
......@@ -52,7 +52,7 @@ public extension UIImage {
var effectImage: UIImage = self
let screenScale: CGFloat = MaterialDevice.scale
let imageRect: CGRect = CGRect(origin: CGPointZero, size: size)
let imageRect: CGRect = CGRect(origin: CGPoint.zero, size: size)
let hasBlur: Bool = blurRadius > CGFloat(FLT_EPSILON)
let hasSaturationChange: Bool = fabs(saturationDeltaFactor - 1.0) > CGFloat(FLT_EPSILON)
......
......@@ -32,10 +32,10 @@ import UIKit
public class MaterialCollectionViewLayout : UICollectionViewLayout {
/// Used to calculate the dimensions of the cells.
internal var offset: CGPoint = CGPointZero
internal var offset: CGPoint = CGPoint.zero
/// The size of items.
public var itemSize: CGSize = CGSizeZero
public var itemSize: CGSize = CGSize.zero
/// A preset wrapper around contentInset.
public var contentInsetPreset: MaterialEdgeInset = .None {
......@@ -48,7 +48,7 @@ public class MaterialCollectionViewLayout : UICollectionViewLayout {
public var contentInset: UIEdgeInsets = UIEdgeInsetsZero
/// Size of the content.
public private(set) var contentSize: CGSize = CGSizeZero
public private(set) var contentSize: CGSize = CGSize.zero
/// Layout attribute items.
public private(set) var layoutItems: Array<(UICollectionViewLayoutAttributes, NSIndexPath)> = Array<(UICollectionViewLayoutAttributes, NSIndexPath)>()
......
......@@ -45,7 +45,7 @@ public enum MaterialDepth {
public func MaterialDepthToValue(depth: MaterialDepth) -> MaterialDepthType {
switch depth {
case .None:
return (offset: CGSizeZero, opacity: 0, radius: 0)
return (offset: CGSize.zero, opacity: 0, radius: 0)
case .Depth1:
return (offset: CGSizeMake(0, 1), opacity: 0.3, radius: 1)
case .Depth2:
......
......@@ -201,7 +201,7 @@ public class MaterialTextLayer : CATextLayer {
return v.stringSize(text!, constrainedToWidth: width)
}
}
return CGSizeZero
return CGSize.zero
}
/**
......
......@@ -97,7 +97,7 @@ public class Menu {
/// Convenience initializer.
public convenience init() {
self.init(origin: CGPointZero)
self.init(origin: CGPoint.zero)
}
/// Reload the view layout.
......
......@@ -290,11 +290,11 @@ public class NavigationBar : UINavigationBar {
public override func intrinsicContentSize() -> CGSize {
switch navigationBarStyle {
case .Tiny:
return CGSizeMake(width ?? MaterialDevice.width, 32)
return CGSize(width: width ?? MaterialDevice.width, height: 32)
case .Default:
return CGSizeMake(width ?? MaterialDevice.width, 44)
return CGSize(width: width ?? MaterialDevice.width, height: 44)
case .Medium:
return CGSizeMake(width ?? MaterialDevice.width, 56)
return CGSize(width: width ?? MaterialDevice.width, height: 56)
}
}
......
......@@ -319,7 +319,7 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
this, and to add a hidden transition viewController for complex
situations, the contentViewController was added.
*/
public private(set) var contentViewController: UIViewController?
public private(set) lazy var contentViewController: UIViewController = UIViewController()
/**
A UIViewController property that references the
......@@ -861,11 +861,9 @@ public class NavigationDrawerController : RootController, UIGestureRecognizerDel
/// Prepares the contentViewController.
private func prepareContentViewController() {
if nil == contentViewController {
contentViewController = UIViewController()
contentViewController!.view.backgroundColor = MaterialColor.black
}
contentViewController.view.backgroundColor = MaterialColor.black
prepareViewControllerWithinContainer(contentViewController, container: view)
view.sendSubviewToBack(contentViewController.view)
}
/// A method that prepares the leftViewController.
......
......@@ -129,6 +129,7 @@ public class RootController : UIViewController {
s.rootViewController = toViewController
s.rootViewController.view.clipsToBounds = true
s.rootViewController.view.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
s.rootViewController.view.contentScaleFactor = MaterialDevice.scale
completion?(result)
}
})
......@@ -171,7 +172,6 @@ public class RootController : UIViewController {
if let v: UIViewController = viewController {
addChildViewController(v)
container.addSubview(v.view)
container.sendSubviewToBack(v.view)
v.didMoveToParentViewController(self)
v.view.clipsToBounds = true
v.view.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
......
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