-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* vk-3621-route-refreshing: added routeRefreshSource protocol to allow refreshing route with both RefreshedRoute and another Route instance; CHANGELOG updated
- Loading branch information
Showing
4 changed files
with
51 additions
and
3 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
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,37 @@ | ||
import Foundation | ||
|
||
/** | ||
A skeletal route containing infromation to refresh `Route` object attributes. | ||
*/ | ||
public protocol RouteRefreshSource { | ||
var refreshedLegs: [RouteLegRefreshSource] { get } | ||
} | ||
|
||
/** | ||
A skeletal route leg containing infromation to refresh `RouteLeg` object attributes. | ||
*/ | ||
public protocol RouteLegRefreshSource { | ||
var refreshedAttributes: RouteLeg.Attributes { get } | ||
} | ||
|
||
extension Route: RouteRefreshSource { | ||
public var refreshedLegs: [RouteLegRefreshSource] { | ||
legs | ||
} | ||
} | ||
extension RouteLeg: RouteLegRefreshSource { | ||
public var refreshedAttributes: Attributes { | ||
attributes | ||
} | ||
} | ||
|
||
extension RefreshedRoute: RouteRefreshSource { | ||
public var refreshedLegs: [RouteLegRefreshSource] { | ||
legs | ||
} | ||
} | ||
extension RefreshedRouteLeg: RouteLegRefreshSource { | ||
public var refreshedAttributes: RouteLeg.Attributes { | ||
attributes | ||
} | ||
} |