Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this, I was too lazy to remove the change, sorry!

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>HueBoo.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
11 changes: 3 additions & 8 deletions HueBoo/Models/ColorSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ struct ColorSet: Equatable {
let alpha: CGFloat

init(initialColor: UIColor) {
var hue: CGFloat = 0
var saturation: CGFloat = 0
var brightness: CGFloat = 0
var alpha: CGFloat = 1
var hue, saturation, brightness, alpha: CGFloat
(hue, saturation, brightness, alpha) = (0,0,0,0)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did this in getTextColor() and I thought it was awesome, very "pythonic"! I thought you might be able to use the same pattern here

initialColor.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha)
self.hue = hue
self.saturation = saturation
self.brightness = brightness
self.alpha = alpha
self.init(hue: hue, saturation: saturation, brightness: brightness, alpha: alpha)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does the same thing in 1 line... very minor improvement if any

}

init(hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat = 1) {
Expand Down
8 changes: 4 additions & 4 deletions HueBoo/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RootViewController: UIViewController, RootPresentable, RootCollectionViewL
if Constants.getTextColor(from: color) == .white {
statusBarStyle = .lightContent
} else {
statusBarStyle = .default
statusBarStyle = .default // I'm not 100% sure this is doing what you expect it to do. This seems to hide the status bar content so while I'm swiping through the status bar appears to be flashing on and off.
}

UIView.animate(withDuration: 0.3) {
Expand All @@ -71,13 +71,13 @@ class RootViewController: UIViewController, RootPresentable, RootCollectionViewL
private func setupViews() {

collectionView.listener = self
collectionView.backgroundColor = .red
collectionView.backgroundColor = .red // when I swipe back on the first cell I can see this. Might be better to use black as a default?

view.addSubview(collectionView)

NSLayoutConstraint.activate([
collectionView.topAnchor.constraint(equalTo: view.topAnchor),
collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
collectionView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me like the safeAreaLayoutGuide would be most applicable to the top and bottom anchors because of the notch, but maybe I'm missing something

collectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
collectionView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor),
collectionView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor)
])
Expand Down
2 changes: 1 addition & 1 deletion HueBooTests/RootInteractorTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// RootInteractorTests.swift
// HueBooTests
//
Expand Down