Skip to content

Commit

Permalink
Fixes for beta 5
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Aug 4, 2014
1 parent b22cefc commit eec861a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions GradientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ class GradientView: UIView {

// MARK: - Initializers

init(frame: CGRect) {
override init(frame: CGRect) {
super.init(frame: frame)
initialize()
}


init(coder aDecoder: NSCoder!) {
required init(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
initialize()
}
Expand All @@ -155,7 +155,7 @@ class GradientView: UIView {
}
}

let screen = window?.screen ? window.screen : UIScreen.mainScreen()
let screen = window?.screen ?? UIScreen.mainScreen()
let borderWidth: CGFloat = drawsThinBorders ? 1.0 / screen.scale : 1.0

// Top border
Expand All @@ -164,8 +164,8 @@ class GradientView: UIView {
CGContextFillRect(context, CGRect(x: 0, y: 0, width: size.width, height: borderWidth))
}

let sideY: CGFloat = topBorderColor ? borderWidth : 0
let sideHeight: CGFloat = size.height - sideY - (bottomBorderColor ? borderWidth : 0)
let sideY: CGFloat = topBorderColor != nil ? borderWidth : 0
let sideHeight: CGFloat = size.height - sideY - (bottomBorderColor != nil ? borderWidth : 0)

// Right border
if let color = rightBorderColor {
Expand Down
2 changes: 0 additions & 2 deletions GradientView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
21E5C1B4197AD7F100499002 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E5C1AE197AD7F100499002 /* AppDelegate.swift */; };
21E5C1B5197AD7F100499002 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 21E5C1AF197AD7F100499002 /* Main.storyboard */; };
21E5C1B6197AD7F100499002 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 21E5C1B1197AD7F100499002 /* Images.xcassets */; };
21E5C1B7197AD7F100499002 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 21E5C1B2197AD7F100499002 /* Info.plist */; };
21E5C1B8197AD7F100499002 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E5C1B3197AD7F100499002 /* ViewController.swift */; };
21E5C1BF197AD7FA00499002 /* GradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21E5C1BE197AD7FA00499002 /* GradientView.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -124,7 +123,6 @@
files = (
21E5C1B5197AD7F100499002 /* Main.storyboard in Resources */,
21E5C1B6197AD7F100499002 /* Images.xcassets in Resources */,
21E5C1B7197AD7F100499002 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down

0 comments on commit eec861a

Please sign in to comment.