Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add postTransitionBehavior to ContainerViewController #88

Merged
merged 4 commits into from
Jan 20, 2020

Conversation

dmilinski
Copy link
Contributor

No description provided.

tylermilner
tylermilner previously approved these changes Jan 13, 2020
CHANGELOG.md Outdated
@@ -6,6 +6,10 @@
[Will McGinty](https://github.com/willmcginty)
[#87](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/82)

* Add `postTransitionBehavior` to `ContainerViewController`, automating some common child management scenarios
[Dimitar Milinski](https://github.com/dmilinski)
[#88](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/83)
Copy link
Contributor

Choose a reason for hiding this comment

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

The numbers should match.

Suggested change
[#88](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/83)
[#88](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/88)

CHANGELOG.md Outdated
@@ -6,6 +6,10 @@
[Will McGinty](https://github.com/willmcginty)
[#87](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/82)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you correct this too.

Suggested change
[#87](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/82)
[#87](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/87)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, good catch

removeAllNonVisibleChildren(except: [])
case .removeAllNonVisibleChildrenExcept(let identifiers):
removeAllNonVisibleChildren(except: identifiers)
case .none: break
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think UtiliKit is using SwiftLint but I know you could get the following using it:
Switch Case on Newline Violation: Cases inside a switch should always be on a newline (switch_case_on_newline)
Can you move the break to a new line.

Suggested change
case .none: break
case .none:
break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

earlgaspard
earlgaspard previously approved these changes Jan 13, 2020
wmcginty
wmcginty previously approved these changes Jan 14, 2020
@@ -9,6 +9,12 @@ import UIKit

open class ContainerViewController: UIViewController {

// MARK: Subtypes
public enum PostTransitionBehavior {
case removeAllNonVisibleChildren
Copy link
Contributor

Choose a reason for hiding this comment

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

Could .removeAllNonVisibleChildren be a static let that calls .removeAllNonVisibleChildrenExcept([]) so we don't have to handle it in switches and stuff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, good call

// MARK: Subtypes
public enum PostTransitionBehavior {
case removeAllNonVisibleChildren
case removeAllNonVisibleChildrenExcept([AnyHashable])
Copy link
Contributor

@wmcginty wmcginty Jan 14, 2020

Choose a reason for hiding this comment

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

Could also have a default or none case here and then make the property non-optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I was on the fence about this when I originally worked on it. It actually ends up identical when we handle it in a switch, since optionals have a .none case anyway lol

@dmilinski dmilinski dismissed stale reviews from wmcginty and earlgaspard via 9f918f5 January 14, 2020 16:00
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@9f918f5). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             master    #88   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?      5           
  Lines             ?    474           
  Branches          ?      0           
=======================================
  Hits              ?    474           
  Misses            ?      0           
  Partials          ?      0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9f918f5...44d257a. Read the comment docs.

@wmcginty wmcginty merged commit 497bbec into BottleRocketStudios:master Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants