-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
282 changed files
with
4,178 additions
and
1,417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Example/Pods/Target Support Files/RouteComposer/RouteComposer-Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
Example/RouteComposer/Configuration/ExampleDestination.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Created by Eugene Kazaev on 2019-07-22. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
/// `AnyDestination` represents a generic `Destination` that contains the screen configuration for any type | ||
/// of `UIViewController` and the context of any type. | ||
public typealias AnyDestination = Destination<UIViewController, Any?> | ||
|
||
/// `Destination` instance represents both final screen configuration and the data to provide. It is useful when | ||
/// there is a need to wrap both values into a single DTO value. | ||
public struct Destination<VC: UIViewController, C> { | ||
|
||
/// Final configuration. | ||
public let step: DestinationStep<VC, C> | ||
|
||
/// Data to be provided to the configuration. | ||
public let context: C | ||
|
||
/// Constructor | ||
/// | ||
/// - Parameters: | ||
/// - step: `DestinationStep` instance containing the navigation configuration. | ||
/// - context: `Context` instance to be provided to the configuration. | ||
public init(to step: DestinationStep<VC, C>, with context: C) { | ||
self.step = step | ||
self.context = context | ||
} | ||
|
||
/// Transforms into generic representation without information about types. | ||
public func unwrapped() -> AnyDestination { | ||
return AnyDestination(to: step.unsafelyRewrapped(), with: context) | ||
} | ||
|
||
} | ||
|
||
// MARK: Helper Methods | ||
|
||
public extension Destination where C == Any? { | ||
|
||
/// Constructor | ||
/// | ||
/// - Parameters: | ||
/// - step: `DestinationStep` instance containing the navigation configuration. | ||
init(to step: DestinationStep<VC, C>) { | ||
self.step = step | ||
self.context = nil | ||
} | ||
|
||
} | ||
|
||
public extension Destination where C == Void { | ||
|
||
/// Constructor | ||
/// | ||
/// - Parameters: | ||
/// - step: `DestinationStep` instance containing the navigation configuration. | ||
init(to step: DestinationStep<VC, C>) { | ||
self.step = step | ||
self.context = () | ||
} | ||
|
||
} |
Oops, something went wrong.