Commit 47b798d8 by Daniel Dahan

updated CG*Zero values to CG*.zero

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