Moved WindowViewControllable and WindowSceneViewControllable to Nodes#318
Conversation
|
Should we put |
…esis file to Nodes
eb8928a to
36a0305
Compare
|
|
||
| /** | ||
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, | ||
| * to avoid the use of UI frameworks within the `Flow` instance and to facilitate testing. |
There was a problem hiding this comment.
Kept the same description as ViewControllable as it seemed appropriate. Let me know if the team has a better suggestion.
|
|
||
| /** | ||
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, | ||
| * to avoid the use of UI frameworks within the `Flow` instance and to facilitate testing. |
There was a problem hiding this comment.
Kept the same description as ViewControllable but I'm not sure whether it is appropriate.
tinder-cfuller
left a comment
There was a problem hiding this comment.
Thank you for doing this 👍
| /// Presents a ``ViewControllable`` instance. | ||
| /// - Parameter viewControllable: The ``ViewControllable`` instance to present. |
There was a problem hiding this comment.
We have been placing an extra line between the various "sections" of our documentation comments for readability.
| /// Presents a ``ViewControllable`` instance. | |
| /// - Parameter viewControllable: The ``ViewControllable`` instance to present. | |
| /// Presents a ``ViewControllable`` instance. | |
| /// | |
| /// - Parameter viewControllable: The ``ViewControllable`` instance to present. |
There was a problem hiding this comment.
Oh, missed that! I just pressed option+command+? and let Xcode generate the skeleton for me. Will update it!
|
|
||
| extension UIWindowScene: WindowSceneViewControllable { | ||
|
|
||
| /// Creates a ``WindowViewControllable`` instance and associates it with the current scene object. |
There was a problem hiding this comment.
| /// Creates a ``WindowViewControllable`` instance and associates it with the current scene object. | |
| /// Creates a ``WindowViewControllable`` instance and associates it with the scene. |
| /// Creates a ``WindowViewControllable`` instance and associates it with the current scene object. | ||
| /// - Returns: The ``WindowViewControllable`` instance created. |
There was a problem hiding this comment.
We have been placing an extra line between the various "sections" of our documentation comments for readability.
| /// Creates a ``WindowViewControllable`` instance and associates it with the current scene object. | |
| /// - Returns: The ``WindowViewControllable`` instance created. | |
| /// Creates a ``WindowViewControllable`` instance and associates it with the scene. | |
| /// | |
| /// - Returns: The ``WindowViewControllable`` instance created. |
| import UIKit | ||
|
|
||
| /** | ||
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, |
There was a problem hiding this comment.
Maybe something like this?
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, | |
| * The interface used for injecting a window scene into a `Flow` instance to limit the available API, |
| /// Creates a ``WindowViewControllable`` instance. | ||
| /// - Returns: The ``WindowViewControllable`` instance created. |
There was a problem hiding this comment.
Please see comments above.
|
|
||
| #else | ||
|
|
||
| public protocol WindowSceneViewControllable: AnyObject {} |
There was a problem hiding this comment.
We do not need the else case here.
| #else | |
| public protocol WindowSceneViewControllable: AnyObject {} |
| import UIKit | ||
|
|
||
| /** | ||
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, |
There was a problem hiding this comment.
Maybe something like this?
| * The interface used for injecting a user interface into a `Flow` instance to limit the available API, | |
| * The interface used for injecting a window into a `Flow` instance to limit the available API, |
| /// Presents a ``ViewControllable`` instance. | ||
| /// - Parameter viewControllable: The ``ViewControllable`` instance to present. |
There was a problem hiding this comment.
Please see comments above.
|
|
||
| #else | ||
|
|
||
| public protocol WindowViewControllable: AnyObject {} |
There was a problem hiding this comment.
We do not need the else case here.
| #else | |
| public protocol WindowViewControllable: AnyObject {} |
| /// Presents a ``ViewControllable`` instance. | ||
| /// | ||
| /// - Parameter viewControllable: The ``ViewControllable`` instance to present. | ||
| func present(_ viewControllable: ViewControllable) |
There was a problem hiding this comment.
Since we ultimately set window.rootViewController and call makeKeyAndVisible, I wonder if there's a better name for this method so that it sets the expectation of what conformers should do. The name sounds more like view controller present. But the implementation is more like contain or...?
There was a problem hiding this comment.
This name is intentional. Callers of this method only care that their view controller is presented. And there is only one conformer that we need to be concerned with and it knows what to do.
There was a problem hiding this comment.
Would it be silly for a Nodes developer to think - because the name is present - that setting certain presentation properties¹ on the presented view controller would cause a change in the presentation?
¹For example, transitioningDelegate or modalPresentationStyle.
There was a problem hiding this comment.
I cannot say whether that would be silly or not, but I do not see that as any different than calling a custom present method that overrides those properties to different values - in either case, the internal implementation of the present method has the final say on presentation.
tinder-garricnahapetian
left a comment
There was a problem hiding this comment.
Great! Perhaps we could improve the docs, but I dont have any clear suggestions yet. Also, did you test that the quick start project still works as expected after this change?
Yeah, I did test the quick project pointing to Nodes locally. |
4820072
|
@tinder-caiofonseca @tinder-cfuller Our QuickStart workflow uses our local copy of genesis.yml but points to a released version of Nodes. This means that our QuickStart projects are brittle. This PR actually breaks our QuickStart since those types are removed from the genesis file but not available in 0.0.14. The workaround is to checkout 0.0.14 or modified the project to point to our local copy of Nodes. I'm not sure what the long term solution is, if any to make this more robust. Mentioning so that we can discuss. |
This is expected behavior. Local development requires using development versions of Nodes instead of the release version. |
Current versions of
WindowViewControllableandWindowSceneViewControllableare in theNodes/genesis.ymlfile.Moved these two protocols to
/Nodes/Sources/Nodes/WindowViewControllableand/Nodes/Sources/Nodes/WindowSceneViewControllable, and the respective conformances ofUIWindowandUIWindowSceneto/Nodes/Sources/Nodes/UIKit/UIWindow+WindowViewControllableand/Nodes/Sources/Nodes/UIKit/UIWindowScene+WindowSceneViewControllable.