Skip to content

Commit a51525b

Browse files
committed
Merge pull request #5 from polydice/feature/renaming
Merge branch 'feature/renaming' into develop
2 parents d2d1284 + d6339e4 commit a51525b

18 files changed

+79
-82
lines changed

.codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage:
2+
status:
3+
project: yes
4+
patch: no
5+
changes: no

Dangerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
# Sometimes it's a README fix, or something like that - which isn't relevant for
44
# including in a project's CHANGELOG for example
5-
declared_trivial = (github.pr_title + github.pr_body).include?("#trivial")
5+
declared_trivial = (github.pr_title + github.pr_body).include? "#trivial"
66

77
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
8-
warn("PR is classed as Work in Progress") if pr_title.include? "[WIP]"
8+
warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]"
99

1010
# Warn when there is a big PR
11-
warn("Big PR") if lines_of_code > 500
11+
warn "Big PR" if git.lines_of_code > 500
1212

1313
# Ensure there is a summary for a PR
1414
fail "Please provide a summary in the Pull Request description" if github.pr_body.length < 5
1515

1616
# Add a CHANGELOG entry for app changes
17-
if git.lines_of_code > 50 && !github.modified_files.include?("CHANGELOG.md") && !declared_trivial
18-
fail("Please update [CHANGELOG.md](https://github.com/polydice/iCook-tvOS/blob/develop/CHANGELOG.md).")
17+
if git.lines_of_code > 50 && !git.modified_files.include?("CHANGELOG.md") && !declared_trivial
18+
fail "Please update [CHANGELOG.md](https://github.com/polydice/iCook-tvOS/blob/develop/CHANGELOG.md).", sticky: true
1919
end
2020

2121
# Ensure a clean commits history
2222
if git.commits.any? { |c| c.message =~ /^Merge branch/ }
23-
fail('Please rebase to get rid of the merge commits in this PR')
23+
fail "Please rebase to get rid of the merge commits in this PR", sticky: true
2424
end

Gemfile.lock

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: http://rubygems.org/
33
specs:
4-
CFPropertyList (2.3.3)
4+
CFPropertyList (2.3.4)
55
RubyInline (3.12.4)
66
ZenTest (~> 4.3)
77
ZenTest (4.11.1)
@@ -12,7 +12,6 @@ GEM
1212
thread_safe (~> 0.3, >= 0.3.4)
1313
tzinfo (~> 1.1)
1414
addressable (2.4.0)
15-
babosa (1.0.2)
1615
claide (1.0.1)
1716
claide-plugins (0.9.2)
1817
cork
@@ -64,7 +63,7 @@ GEM
6463
commander (>= 4.3.5)
6564
highline (>= 1.7.1)
6665
security
67-
danger (4.0.0)
66+
danger (4.0.1)
6867
claide (~> 1.0)
6968
claide-plugins (>= 0.9.2)
7069
colored (~> 1.2)
@@ -82,8 +81,7 @@ GEM
8281
multipart-post (>= 1.2, < 3)
8382
faraday-http-cache (1.3.1)
8483
faraday (~> 0.8)
85-
fastlane_core (0.53.0)
86-
babosa
84+
fastlane_core (0.57.2)
8785
colored
8886
commander (>= 4.4.0, <= 5.0.0)
8987
credentials_manager (>= 0.16.2, < 1.0.0)
@@ -102,13 +100,13 @@ GEM
102100
highline (1.7.8)
103101
i18n (0.7.0)
104102
json (1.8.3)
105-
kramdown (1.12.0)
103+
kramdown (1.13.1)
106104
mini_portile2 (2.1.0)
107-
minitest (5.9.1)
108-
molinillo (0.5.2)
105+
minitest (5.10.1)
106+
molinillo (0.5.4)
109107
multi_json (1.12.1)
110108
multipart-post (2.0.0)
111-
nanaimo (0.2.2)
109+
nanaimo (0.2.3)
112110
nap (1.1.0)
113111
netrc (0.7.8)
114112
nokogiri (1.6.8.1)
@@ -124,8 +122,8 @@ GEM
124122
sawyer (0.7.0)
125123
addressable (>= 2.3.5, < 2.5)
126124
faraday (~> 0.8, < 0.10)
127-
scan (0.14.1)
128-
fastlane_core (>= 0.53.0, < 1.0.0)
125+
scan (0.14.2)
126+
fastlane_core (>= 0.57.0, < 1.0.0)
129127
slack-notifier (~> 1.3)
130128
terminal-table (>= 1.4.5, < 2.0.0)
131129
xcpretty (>= 0.2.4, < 1.0.0)

iCookTV/Controllers/CategoriesViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CategoriesViewController: UIViewController,
5656

5757
// MARK: - BlurBackgroundPresentable
5858

59-
let imageAnimationQueue = ImageAnimationQueue(imageView: UIImageView())
59+
let backgroundImageView = UIImageView()
6060

6161
// MARK: - Initialization
6262

iCookTV/Controllers/HistoryViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class HistoryViewController: UIViewController,
3939

4040
// MARK: - BlurBackgroundPresentable
4141

42-
let imageAnimationQueue = ImageAnimationQueue(imageView: UIImageView())
42+
let backgroundImageView = UIImageView()
4343

4444
// MARK: - DropdownMenuPresentable
4545

iCookTV/Controllers/VideosViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class VideosViewController: UIViewController,
5656

5757
// MARK: - BlurBackgroundPresentable
5858

59-
let imageAnimationQueue = ImageAnimationQueue(imageView: UIImageView())
59+
let backgroundImageView = UIImageView()
6060

6161
// MARK: - DataFetching
6262

iCookTV/Extensions/CGRect+Grid.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,26 @@
2626

2727
import UIKit
2828

29-
enum Grid: Int {
29+
enum Grid: Int, Equatable {
3030
case topLeft, topRight, bottomLeft, bottomRight
3131

3232
static let numberOfGrids: Int = {
3333
var count = 0
3434
while let _ = Grid(rawValue: count) { count += 1 }
3535
return count
3636
}()
37-
}
3837

39-
func == (lhs: Grid, rhs: Grid) -> Bool {
40-
return lhs.rawValue == rhs.rawValue
38+
static func == (lhs: Grid, rhs: Grid) -> Bool {
39+
return lhs.rawValue == rhs.rawValue
40+
}
41+
4142
}
4243

4344
extension CGRect {
4445

45-
func rect(bySize size: CGSize, atCorner corner: Grid) -> CGRect {
46+
func rect(with size: CGSize, in grid: Grid) -> CGRect {
4647
let target = CGSize(width: min(width, size.width), height: min(height, size.height))
47-
switch corner {
48+
switch grid {
4849
case .topLeft:
4950
return divided(atDistance: target.height, from: .maxYEdge).remainder.divided(atDistance: target.width, from: .maxXEdge).remainder
5051
case .topRight:

iCookTV/Extensions/UIFont+TV.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,50 @@ extension UIFont {
3535

3636
// MARK: - Private Methods
3737

38-
private class func tvFontOfSize(_ fontSize: CGFloat) -> UIFont {
38+
private class func tvFont(ofSize fontSize: CGFloat) -> UIFont {
3939
return UIFont(name: FontFamily.PingFangTCRegular, size: fontSize) ?? UIFont.systemFont(ofSize: fontSize)
4040
}
4141

42-
private class func tvBoldFontOfSize(_ fontSize: CGFloat) -> UIFont {
42+
private class func tvBoldFont(ofSize fontSize: CGFloat) -> UIFont {
4343
return UIFont(name: FontFamily.PingFangTCMedium, size: fontSize) ?? UIFont.boldSystemFont(ofSize: fontSize)
4444
}
4545

4646
// MARK: - Public Methods
4747

4848
class func tvFontForTagline() -> UIFont {
49-
return UIFont.tvFontOfSize(44)
49+
return UIFont.tvFont(ofSize: 44)
5050
}
5151

5252
class func tvFontForCategoryCell() -> UIFont {
53-
return UIFont.tvFontOfSize(35)
53+
return UIFont.tvFont(ofSize: 35)
5454
}
5555

5656
class func tvFontForFocusedCategoryCell() -> UIFont {
57-
return UIFont.tvFontOfSize(40)
57+
return UIFont.tvFont(ofSize: 40)
5858
}
5959

6060
class func tvFontForVideoCell() -> UIFont {
61-
return UIFont.tvFontOfSize(29)
61+
return UIFont.tvFont(ofSize: 29)
6262
}
6363

6464
class func tvFontForFocusedVideoCell() -> UIFont {
65-
return UIFont.tvBoldFontOfSize(29)
65+
return UIFont.tvBoldFont(ofSize: 29)
6666
}
6767

6868
class func tvFontForVideoLength() -> UIFont {
6969
return UIFont.systemFont(ofSize: 20)
7070
}
7171

7272
class func tvFontForLogo() -> UIFont {
73-
return UIFont.tvFontOfSize(65)
73+
return UIFont.tvFont(ofSize: 65)
7474
}
7575

7676
class func tvFontForMenuButton() -> UIFont {
77-
return UIFont.tvFontOfSize(30)
77+
return UIFont.tvFont(ofSize: 30)
7878
}
7979

8080
class func tvFontForHeaderTitle() -> UIFont {
81-
return UIFont.tvFontOfSize(35)
81+
return UIFont.tvFont(ofSize: 35)
8282
}
8383

8484
}

iCookTV/Extensions/UIImage+Grid.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ import UIKit
2828

2929
extension UIImage {
3030

31-
func image(byReplacingImage image: UIImage, atCorner corner: Grid) -> UIImage? {
31+
func image(byReplacingImage image: UIImage, in grid: Grid) -> UIImage? {
3232
UIGraphicsBeginImageContextWithOptions(size, true, 0)
3333

3434
let canvas = CGRect(origin: CGPoint.zero, size: size)
3535
self.draw(in: canvas)
3636

37-
let rect = canvas.rect(bySize: image.size, atCorner: corner)
37+
let rect = canvas.rect(with: image.size, in: grid)
3838
image.draw(in: rect)
3939

4040
let newImage = UIGraphicsGetImageFromCurrentImageContext()
@@ -43,7 +43,7 @@ extension UIImage {
4343
return newImage
4444
}
4545

46-
class func placeholderImage(withSize size: CGSize) -> UIImage? {
46+
class func placeholderImage(with size: CGSize) -> UIImage? {
4747
let layer = CAGradientLayer()
4848
layer.frame = CGRect(origin: CGPoint.zero, size: size)
4949
layer.colors = [UIColor.white.cgColor, UIColor.Palette.LightGray.cgColor]
@@ -63,7 +63,7 @@ extension UIImage {
6363
return image
6464
}
6565

66-
class func resizableImage(withFillColor color: UIColor) -> UIImage? {
66+
class func resizableImage(filledWith color: UIColor) -> UIImage? {
6767
UIGraphicsBeginImageContextWithOptions(CGSize(width: 1, height: 1), true, 0)
6868

6969
color.setFill()

iCookTV/Helpers/CoverBuilder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ class CoverBuilder {
5757

5858
// MARK: - Public Methods
5959

60-
func addImage(_ image: UIImage, atCorner corner: Grid, categoryID id: String? = nil, completion: @escaping (_ newCover: UIImage?) -> Void) {
60+
func add(image: UIImage, to grid: Grid, categoryID id: String? = nil, completion: @escaping (_ newCover: UIImage?) -> Void) {
6161
operationQueue.addOperation(BlockOperation { [weak self] in
6262
let imageSize = CGSize(width: image.size.width * 2, height: image.size.height * 2)
6363
var canvas: UIImage?
6464

6565
if let currentImage = self?.cover, currentImage.size == imageSize {
6666
canvas = currentImage
6767
} else {
68-
canvas = UIImage.placeholderImage(withSize: imageSize)
68+
canvas = UIImage.placeholderImage(with: imageSize)
6969
}
7070

71-
let cover = canvas?.image(byReplacingImage: image, atCorner: corner)
71+
let cover = canvas?.image(byReplacingImage: image, in: grid)
7272
self?.cover = cover
73-
self?.filledGrids.insert(corner)
73+
self?.filledGrids.insert(grid)
7474

7575
if let key = id, let image = cover, self?.filledGrids.count == Grid.numberOfGrids {
7676
self?.cacheImage(image, forKey: key)

0 commit comments

Comments
 (0)